25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

50554 lines
1.7 MiB

  1. // Package dfareporting provides access to the DCM/DFA Reporting And Trafficking API.
  2. //
  3. // See https://developers.google.com/doubleclick-advertisers/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/dfareporting/v3.1"
  8. // ...
  9. // dfareportingService, err := dfareporting.New(oauthHttpClient)
  10. package dfareporting // import "google.golang.org/api/dfareporting/v3.1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "dfareporting:v3.1"
  41. const apiName = "dfareporting"
  42. const apiVersion = "v3.1"
  43. const basePath = "https://www.googleapis.com/dfareporting/v3.1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage DoubleClick Digital Marketing conversions
  47. DdmconversionsScope = "https://www.googleapis.com/auth/ddmconversions"
  48. // View and manage DoubleClick for Advertisers reports
  49. DfareportingScope = "https://www.googleapis.com/auth/dfareporting"
  50. // View and manage your DoubleClick Campaign Manager's (DCM) display ad
  51. // campaigns
  52. DfatraffickingScope = "https://www.googleapis.com/auth/dfatrafficking"
  53. )
  54. func New(client *http.Client) (*Service, error) {
  55. if client == nil {
  56. return nil, errors.New("client is nil")
  57. }
  58. s := &Service{client: client, BasePath: basePath}
  59. s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s)
  60. s.AccountPermissionGroups = NewAccountPermissionGroupsService(s)
  61. s.AccountPermissions = NewAccountPermissionsService(s)
  62. s.AccountUserProfiles = NewAccountUserProfilesService(s)
  63. s.Accounts = NewAccountsService(s)
  64. s.Ads = NewAdsService(s)
  65. s.AdvertiserGroups = NewAdvertiserGroupsService(s)
  66. s.AdvertiserLandingPages = NewAdvertiserLandingPagesService(s)
  67. s.Advertisers = NewAdvertisersService(s)
  68. s.Browsers = NewBrowsersService(s)
  69. s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s)
  70. s.Campaigns = NewCampaignsService(s)
  71. s.ChangeLogs = NewChangeLogsService(s)
  72. s.Cities = NewCitiesService(s)
  73. s.ConnectionTypes = NewConnectionTypesService(s)
  74. s.ContentCategories = NewContentCategoriesService(s)
  75. s.Conversions = NewConversionsService(s)
  76. s.Countries = NewCountriesService(s)
  77. s.CreativeAssets = NewCreativeAssetsService(s)
  78. s.CreativeFieldValues = NewCreativeFieldValuesService(s)
  79. s.CreativeFields = NewCreativeFieldsService(s)
  80. s.CreativeGroups = NewCreativeGroupsService(s)
  81. s.Creatives = NewCreativesService(s)
  82. s.DimensionValues = NewDimensionValuesService(s)
  83. s.DirectorySiteContacts = NewDirectorySiteContactsService(s)
  84. s.DirectorySites = NewDirectorySitesService(s)
  85. s.DynamicTargetingKeys = NewDynamicTargetingKeysService(s)
  86. s.EventTags = NewEventTagsService(s)
  87. s.Files = NewFilesService(s)
  88. s.FloodlightActivities = NewFloodlightActivitiesService(s)
  89. s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s)
  90. s.FloodlightConfigurations = NewFloodlightConfigurationsService(s)
  91. s.InventoryItems = NewInventoryItemsService(s)
  92. s.Languages = NewLanguagesService(s)
  93. s.Metros = NewMetrosService(s)
  94. s.MobileApps = NewMobileAppsService(s)
  95. s.MobileCarriers = NewMobileCarriersService(s)
  96. s.OperatingSystemVersions = NewOperatingSystemVersionsService(s)
  97. s.OperatingSystems = NewOperatingSystemsService(s)
  98. s.OrderDocuments = NewOrderDocumentsService(s)
  99. s.Orders = NewOrdersService(s)
  100. s.PlacementGroups = NewPlacementGroupsService(s)
  101. s.PlacementStrategies = NewPlacementStrategiesService(s)
  102. s.Placements = NewPlacementsService(s)
  103. s.PlatformTypes = NewPlatformTypesService(s)
  104. s.PostalCodes = NewPostalCodesService(s)
  105. s.Projects = NewProjectsService(s)
  106. s.Regions = NewRegionsService(s)
  107. s.RemarketingListShares = NewRemarketingListSharesService(s)
  108. s.RemarketingLists = NewRemarketingListsService(s)
  109. s.Reports = NewReportsService(s)
  110. s.Sites = NewSitesService(s)
  111. s.Sizes = NewSizesService(s)
  112. s.Subaccounts = NewSubaccountsService(s)
  113. s.TargetableRemarketingLists = NewTargetableRemarketingListsService(s)
  114. s.TargetingTemplates = NewTargetingTemplatesService(s)
  115. s.UserProfiles = NewUserProfilesService(s)
  116. s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s)
  117. s.UserRolePermissions = NewUserRolePermissionsService(s)
  118. s.UserRoles = NewUserRolesService(s)
  119. s.VideoFormats = NewVideoFormatsService(s)
  120. return s, nil
  121. }
  122. type Service struct {
  123. client *http.Client
  124. BasePath string // API endpoint base URL
  125. UserAgent string // optional additional User-Agent fragment
  126. AccountActiveAdSummaries *AccountActiveAdSummariesService
  127. AccountPermissionGroups *AccountPermissionGroupsService
  128. AccountPermissions *AccountPermissionsService
  129. AccountUserProfiles *AccountUserProfilesService
  130. Accounts *AccountsService
  131. Ads *AdsService
  132. AdvertiserGroups *AdvertiserGroupsService
  133. AdvertiserLandingPages *AdvertiserLandingPagesService
  134. Advertisers *AdvertisersService
  135. Browsers *BrowsersService
  136. CampaignCreativeAssociations *CampaignCreativeAssociationsService
  137. Campaigns *CampaignsService
  138. ChangeLogs *ChangeLogsService
  139. Cities *CitiesService
  140. ConnectionTypes *ConnectionTypesService
  141. ContentCategories *ContentCategoriesService
  142. Conversions *ConversionsService
  143. Countries *CountriesService
  144. CreativeAssets *CreativeAssetsService
  145. CreativeFieldValues *CreativeFieldValuesService
  146. CreativeFields *CreativeFieldsService
  147. CreativeGroups *CreativeGroupsService
  148. Creatives *CreativesService
  149. DimensionValues *DimensionValuesService
  150. DirectorySiteContacts *DirectorySiteContactsService
  151. DirectorySites *DirectorySitesService
  152. DynamicTargetingKeys *DynamicTargetingKeysService
  153. EventTags *EventTagsService
  154. Files *FilesService
  155. FloodlightActivities *FloodlightActivitiesService
  156. FloodlightActivityGroups *FloodlightActivityGroupsService
  157. FloodlightConfigurations *FloodlightConfigurationsService
  158. InventoryItems *InventoryItemsService
  159. Languages *LanguagesService
  160. Metros *MetrosService
  161. MobileApps *MobileAppsService
  162. MobileCarriers *MobileCarriersService
  163. OperatingSystemVersions *OperatingSystemVersionsService
  164. OperatingSystems *OperatingSystemsService
  165. OrderDocuments *OrderDocumentsService
  166. Orders *OrdersService
  167. PlacementGroups *PlacementGroupsService
  168. PlacementStrategies *PlacementStrategiesService
  169. Placements *PlacementsService
  170. PlatformTypes *PlatformTypesService
  171. PostalCodes *PostalCodesService
  172. Projects *ProjectsService
  173. Regions *RegionsService
  174. RemarketingListShares *RemarketingListSharesService
  175. RemarketingLists *RemarketingListsService
  176. Reports *ReportsService
  177. Sites *SitesService
  178. Sizes *SizesService
  179. Subaccounts *SubaccountsService
  180. TargetableRemarketingLists *TargetableRemarketingListsService
  181. TargetingTemplates *TargetingTemplatesService
  182. UserProfiles *UserProfilesService
  183. UserRolePermissionGroups *UserRolePermissionGroupsService
  184. UserRolePermissions *UserRolePermissionsService
  185. UserRoles *UserRolesService
  186. VideoFormats *VideoFormatsService
  187. }
  188. func (s *Service) userAgent() string {
  189. if s.UserAgent == "" {
  190. return googleapi.UserAgent
  191. }
  192. return googleapi.UserAgent + " " + s.UserAgent
  193. }
  194. func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService {
  195. rs := &AccountActiveAdSummariesService{s: s}
  196. return rs
  197. }
  198. type AccountActiveAdSummariesService struct {
  199. s *Service
  200. }
  201. func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService {
  202. rs := &AccountPermissionGroupsService{s: s}
  203. return rs
  204. }
  205. type AccountPermissionGroupsService struct {
  206. s *Service
  207. }
  208. func NewAccountPermissionsService(s *Service) *AccountPermissionsService {
  209. rs := &AccountPermissionsService{s: s}
  210. return rs
  211. }
  212. type AccountPermissionsService struct {
  213. s *Service
  214. }
  215. func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService {
  216. rs := &AccountUserProfilesService{s: s}
  217. return rs
  218. }
  219. type AccountUserProfilesService struct {
  220. s *Service
  221. }
  222. func NewAccountsService(s *Service) *AccountsService {
  223. rs := &AccountsService{s: s}
  224. return rs
  225. }
  226. type AccountsService struct {
  227. s *Service
  228. }
  229. func NewAdsService(s *Service) *AdsService {
  230. rs := &AdsService{s: s}
  231. return rs
  232. }
  233. type AdsService struct {
  234. s *Service
  235. }
  236. func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService {
  237. rs := &AdvertiserGroupsService{s: s}
  238. return rs
  239. }
  240. type AdvertiserGroupsService struct {
  241. s *Service
  242. }
  243. func NewAdvertiserLandingPagesService(s *Service) *AdvertiserLandingPagesService {
  244. rs := &AdvertiserLandingPagesService{s: s}
  245. return rs
  246. }
  247. type AdvertiserLandingPagesService struct {
  248. s *Service
  249. }
  250. func NewAdvertisersService(s *Service) *AdvertisersService {
  251. rs := &AdvertisersService{s: s}
  252. return rs
  253. }
  254. type AdvertisersService struct {
  255. s *Service
  256. }
  257. func NewBrowsersService(s *Service) *BrowsersService {
  258. rs := &BrowsersService{s: s}
  259. return rs
  260. }
  261. type BrowsersService struct {
  262. s *Service
  263. }
  264. func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService {
  265. rs := &CampaignCreativeAssociationsService{s: s}
  266. return rs
  267. }
  268. type CampaignCreativeAssociationsService struct {
  269. s *Service
  270. }
  271. func NewCampaignsService(s *Service) *CampaignsService {
  272. rs := &CampaignsService{s: s}
  273. return rs
  274. }
  275. type CampaignsService struct {
  276. s *Service
  277. }
  278. func NewChangeLogsService(s *Service) *ChangeLogsService {
  279. rs := &ChangeLogsService{s: s}
  280. return rs
  281. }
  282. type ChangeLogsService struct {
  283. s *Service
  284. }
  285. func NewCitiesService(s *Service) *CitiesService {
  286. rs := &CitiesService{s: s}
  287. return rs
  288. }
  289. type CitiesService struct {
  290. s *Service
  291. }
  292. func NewConnectionTypesService(s *Service) *ConnectionTypesService {
  293. rs := &ConnectionTypesService{s: s}
  294. return rs
  295. }
  296. type ConnectionTypesService struct {
  297. s *Service
  298. }
  299. func NewContentCategoriesService(s *Service) *ContentCategoriesService {
  300. rs := &ContentCategoriesService{s: s}
  301. return rs
  302. }
  303. type ContentCategoriesService struct {
  304. s *Service
  305. }
  306. func NewConversionsService(s *Service) *ConversionsService {
  307. rs := &ConversionsService{s: s}
  308. return rs
  309. }
  310. type ConversionsService struct {
  311. s *Service
  312. }
  313. func NewCountriesService(s *Service) *CountriesService {
  314. rs := &CountriesService{s: s}
  315. return rs
  316. }
  317. type CountriesService struct {
  318. s *Service
  319. }
  320. func NewCreativeAssetsService(s *Service) *CreativeAssetsService {
  321. rs := &CreativeAssetsService{s: s}
  322. return rs
  323. }
  324. type CreativeAssetsService struct {
  325. s *Service
  326. }
  327. func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService {
  328. rs := &CreativeFieldValuesService{s: s}
  329. return rs
  330. }
  331. type CreativeFieldValuesService struct {
  332. s *Service
  333. }
  334. func NewCreativeFieldsService(s *Service) *CreativeFieldsService {
  335. rs := &CreativeFieldsService{s: s}
  336. return rs
  337. }
  338. type CreativeFieldsService struct {
  339. s *Service
  340. }
  341. func NewCreativeGroupsService(s *Service) *CreativeGroupsService {
  342. rs := &CreativeGroupsService{s: s}
  343. return rs
  344. }
  345. type CreativeGroupsService struct {
  346. s *Service
  347. }
  348. func NewCreativesService(s *Service) *CreativesService {
  349. rs := &CreativesService{s: s}
  350. return rs
  351. }
  352. type CreativesService struct {
  353. s *Service
  354. }
  355. func NewDimensionValuesService(s *Service) *DimensionValuesService {
  356. rs := &DimensionValuesService{s: s}
  357. return rs
  358. }
  359. type DimensionValuesService struct {
  360. s *Service
  361. }
  362. func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService {
  363. rs := &DirectorySiteContactsService{s: s}
  364. return rs
  365. }
  366. type DirectorySiteContactsService struct {
  367. s *Service
  368. }
  369. func NewDirectorySitesService(s *Service) *DirectorySitesService {
  370. rs := &DirectorySitesService{s: s}
  371. return rs
  372. }
  373. type DirectorySitesService struct {
  374. s *Service
  375. }
  376. func NewDynamicTargetingKeysService(s *Service) *DynamicTargetingKeysService {
  377. rs := &DynamicTargetingKeysService{s: s}
  378. return rs
  379. }
  380. type DynamicTargetingKeysService struct {
  381. s *Service
  382. }
  383. func NewEventTagsService(s *Service) *EventTagsService {
  384. rs := &EventTagsService{s: s}
  385. return rs
  386. }
  387. type EventTagsService struct {
  388. s *Service
  389. }
  390. func NewFilesService(s *Service) *FilesService {
  391. rs := &FilesService{s: s}
  392. return rs
  393. }
  394. type FilesService struct {
  395. s *Service
  396. }
  397. func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService {
  398. rs := &FloodlightActivitiesService{s: s}
  399. return rs
  400. }
  401. type FloodlightActivitiesService struct {
  402. s *Service
  403. }
  404. func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService {
  405. rs := &FloodlightActivityGroupsService{s: s}
  406. return rs
  407. }
  408. type FloodlightActivityGroupsService struct {
  409. s *Service
  410. }
  411. func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService {
  412. rs := &FloodlightConfigurationsService{s: s}
  413. return rs
  414. }
  415. type FloodlightConfigurationsService struct {
  416. s *Service
  417. }
  418. func NewInventoryItemsService(s *Service) *InventoryItemsService {
  419. rs := &InventoryItemsService{s: s}
  420. return rs
  421. }
  422. type InventoryItemsService struct {
  423. s *Service
  424. }
  425. func NewLanguagesService(s *Service) *LanguagesService {
  426. rs := &LanguagesService{s: s}
  427. return rs
  428. }
  429. type LanguagesService struct {
  430. s *Service
  431. }
  432. func NewMetrosService(s *Service) *MetrosService {
  433. rs := &MetrosService{s: s}
  434. return rs
  435. }
  436. type MetrosService struct {
  437. s *Service
  438. }
  439. func NewMobileAppsService(s *Service) *MobileAppsService {
  440. rs := &MobileAppsService{s: s}
  441. return rs
  442. }
  443. type MobileAppsService struct {
  444. s *Service
  445. }
  446. func NewMobileCarriersService(s *Service) *MobileCarriersService {
  447. rs := &MobileCarriersService{s: s}
  448. return rs
  449. }
  450. type MobileCarriersService struct {
  451. s *Service
  452. }
  453. func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService {
  454. rs := &OperatingSystemVersionsService{s: s}
  455. return rs
  456. }
  457. type OperatingSystemVersionsService struct {
  458. s *Service
  459. }
  460. func NewOperatingSystemsService(s *Service) *OperatingSystemsService {
  461. rs := &OperatingSystemsService{s: s}
  462. return rs
  463. }
  464. type OperatingSystemsService struct {
  465. s *Service
  466. }
  467. func NewOrderDocumentsService(s *Service) *OrderDocumentsService {
  468. rs := &OrderDocumentsService{s: s}
  469. return rs
  470. }
  471. type OrderDocumentsService struct {
  472. s *Service
  473. }
  474. func NewOrdersService(s *Service) *OrdersService {
  475. rs := &OrdersService{s: s}
  476. return rs
  477. }
  478. type OrdersService struct {
  479. s *Service
  480. }
  481. func NewPlacementGroupsService(s *Service) *PlacementGroupsService {
  482. rs := &PlacementGroupsService{s: s}
  483. return rs
  484. }
  485. type PlacementGroupsService struct {
  486. s *Service
  487. }
  488. func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService {
  489. rs := &PlacementStrategiesService{s: s}
  490. return rs
  491. }
  492. type PlacementStrategiesService struct {
  493. s *Service
  494. }
  495. func NewPlacementsService(s *Service) *PlacementsService {
  496. rs := &PlacementsService{s: s}
  497. return rs
  498. }
  499. type PlacementsService struct {
  500. s *Service
  501. }
  502. func NewPlatformTypesService(s *Service) *PlatformTypesService {
  503. rs := &PlatformTypesService{s: s}
  504. return rs
  505. }
  506. type PlatformTypesService struct {
  507. s *Service
  508. }
  509. func NewPostalCodesService(s *Service) *PostalCodesService {
  510. rs := &PostalCodesService{s: s}
  511. return rs
  512. }
  513. type PostalCodesService struct {
  514. s *Service
  515. }
  516. func NewProjectsService(s *Service) *ProjectsService {
  517. rs := &ProjectsService{s: s}
  518. return rs
  519. }
  520. type ProjectsService struct {
  521. s *Service
  522. }
  523. func NewRegionsService(s *Service) *RegionsService {
  524. rs := &RegionsService{s: s}
  525. return rs
  526. }
  527. type RegionsService struct {
  528. s *Service
  529. }
  530. func NewRemarketingListSharesService(s *Service) *RemarketingListSharesService {
  531. rs := &RemarketingListSharesService{s: s}
  532. return rs
  533. }
  534. type RemarketingListSharesService struct {
  535. s *Service
  536. }
  537. func NewRemarketingListsService(s *Service) *RemarketingListsService {
  538. rs := &RemarketingListsService{s: s}
  539. return rs
  540. }
  541. type RemarketingListsService struct {
  542. s *Service
  543. }
  544. func NewReportsService(s *Service) *ReportsService {
  545. rs := &ReportsService{s: s}
  546. rs.CompatibleFields = NewReportsCompatibleFieldsService(s)
  547. rs.Files = NewReportsFilesService(s)
  548. return rs
  549. }
  550. type ReportsService struct {
  551. s *Service
  552. CompatibleFields *ReportsCompatibleFieldsService
  553. Files *ReportsFilesService
  554. }
  555. func NewReportsCompatibleFieldsService(s *Service) *ReportsCompatibleFieldsService {
  556. rs := &ReportsCompatibleFieldsService{s: s}
  557. return rs
  558. }
  559. type ReportsCompatibleFieldsService struct {
  560. s *Service
  561. }
  562. func NewReportsFilesService(s *Service) *ReportsFilesService {
  563. rs := &ReportsFilesService{s: s}
  564. return rs
  565. }
  566. type ReportsFilesService struct {
  567. s *Service
  568. }
  569. func NewSitesService(s *Service) *SitesService {
  570. rs := &SitesService{s: s}
  571. return rs
  572. }
  573. type SitesService struct {
  574. s *Service
  575. }
  576. func NewSizesService(s *Service) *SizesService {
  577. rs := &SizesService{s: s}
  578. return rs
  579. }
  580. type SizesService struct {
  581. s *Service
  582. }
  583. func NewSubaccountsService(s *Service) *SubaccountsService {
  584. rs := &SubaccountsService{s: s}
  585. return rs
  586. }
  587. type SubaccountsService struct {
  588. s *Service
  589. }
  590. func NewTargetableRemarketingListsService(s *Service) *TargetableRemarketingListsService {
  591. rs := &TargetableRemarketingListsService{s: s}
  592. return rs
  593. }
  594. type TargetableRemarketingListsService struct {
  595. s *Service
  596. }
  597. func NewTargetingTemplatesService(s *Service) *TargetingTemplatesService {
  598. rs := &TargetingTemplatesService{s: s}
  599. return rs
  600. }
  601. type TargetingTemplatesService struct {
  602. s *Service
  603. }
  604. func NewUserProfilesService(s *Service) *UserProfilesService {
  605. rs := &UserProfilesService{s: s}
  606. return rs
  607. }
  608. type UserProfilesService struct {
  609. s *Service
  610. }
  611. func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService {
  612. rs := &UserRolePermissionGroupsService{s: s}
  613. return rs
  614. }
  615. type UserRolePermissionGroupsService struct {
  616. s *Service
  617. }
  618. func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService {
  619. rs := &UserRolePermissionsService{s: s}
  620. return rs
  621. }
  622. type UserRolePermissionsService struct {
  623. s *Service
  624. }
  625. func NewUserRolesService(s *Service) *UserRolesService {
  626. rs := &UserRolesService{s: s}
  627. return rs
  628. }
  629. type UserRolesService struct {
  630. s *Service
  631. }
  632. func NewVideoFormatsService(s *Service) *VideoFormatsService {
  633. rs := &VideoFormatsService{s: s}
  634. return rs
  635. }
  636. type VideoFormatsService struct {
  637. s *Service
  638. }
  639. // Account: Contains properties of a DCM account.
  640. type Account struct {
  641. // AccountPermissionIds: Account permissions assigned to this account.
  642. AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"`
  643. // AccountProfile: Profile for this account. This is a read-only field
  644. // that can be left blank.
  645. //
  646. // Possible values:
  647. // "ACCOUNT_PROFILE_BASIC"
  648. // "ACCOUNT_PROFILE_STANDARD"
  649. AccountProfile string `json:"accountProfile,omitempty"`
  650. // Active: Whether this account is active.
  651. Active bool `json:"active,omitempty"`
  652. // ActiveAdsLimitTier: Maximum number of active ads allowed for this
  653. // account.
  654. //
  655. // Possible values:
  656. // "ACTIVE_ADS_TIER_100K"
  657. // "ACTIVE_ADS_TIER_1M"
  658. // "ACTIVE_ADS_TIER_200K"
  659. // "ACTIVE_ADS_TIER_300K"
  660. // "ACTIVE_ADS_TIER_40K"
  661. // "ACTIVE_ADS_TIER_500K"
  662. // "ACTIVE_ADS_TIER_750K"
  663. // "ACTIVE_ADS_TIER_75K"
  664. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  665. // ActiveViewOptOut: Whether to serve creatives with Active View tags.
  666. // If disabled, viewability data will not be available for any
  667. // impressions.
  668. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  669. // AvailablePermissionIds: User role permissions available to the user
  670. // roles of this account.
  671. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  672. // CountryId: ID of the country associated with this account.
  673. CountryId int64 `json:"countryId,omitempty,string"`
  674. // CurrencyId: ID of currency associated with this account. This is a
  675. // required field.
  676. // Acceptable values are:
  677. // - "1" for USD
  678. // - "2" for GBP
  679. // - "3" for ESP
  680. // - "4" for SEK
  681. // - "5" for CAD
  682. // - "6" for JPY
  683. // - "7" for DEM
  684. // - "8" for AUD
  685. // - "9" for FRF
  686. // - "10" for ITL
  687. // - "11" for DKK
  688. // - "12" for NOK
  689. // - "13" for FIM
  690. // - "14" for ZAR
  691. // - "15" for IEP
  692. // - "16" for NLG
  693. // - "17" for EUR
  694. // - "18" for KRW
  695. // - "19" for TWD
  696. // - "20" for SGD
  697. // - "21" for CNY
  698. // - "22" for HKD
  699. // - "23" for NZD
  700. // - "24" for MYR
  701. // - "25" for BRL
  702. // - "26" for PTE
  703. // - "27" for MXP
  704. // - "28" for CLP
  705. // - "29" for TRY
  706. // - "30" for ARS
  707. // - "31" for PEN
  708. // - "32" for ILS
  709. // - "33" for CHF
  710. // - "34" for VEF
  711. // - "35" for COP
  712. // - "36" for GTQ
  713. // - "37" for PLN
  714. // - "39" for INR
  715. // - "40" for THB
  716. // - "41" for IDR
  717. // - "42" for CZK
  718. // - "43" for RON
  719. // - "44" for HUF
  720. // - "45" for RUB
  721. // - "46" for AED
  722. // - "47" for BGN
  723. // - "48" for HRK
  724. // - "49" for MXN
  725. // - "50" for NGN
  726. CurrencyId int64 `json:"currencyId,omitempty,string"`
  727. // DefaultCreativeSizeId: Default placement dimensions for this account.
  728. DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"`
  729. // Description: Description of this account.
  730. Description string `json:"description,omitempty"`
  731. // Id: ID of this account. This is a read-only, auto-generated field.
  732. Id int64 `json:"id,omitempty,string"`
  733. // Kind: Identifies what kind of resource this is. Value: the fixed
  734. // string "dfareporting#account".
  735. Kind string `json:"kind,omitempty"`
  736. // Locale: Locale of this account.
  737. // Acceptable values are:
  738. // - "cs" (Czech)
  739. // - "de" (German)
  740. // - "en" (English)
  741. // - "en-GB" (English United Kingdom)
  742. // - "es" (Spanish)
  743. // - "fr" (French)
  744. // - "it" (Italian)
  745. // - "ja" (Japanese)
  746. // - "ko" (Korean)
  747. // - "pl" (Polish)
  748. // - "pt-BR" (Portuguese Brazil)
  749. // - "ru" (Russian)
  750. // - "sv" (Swedish)
  751. // - "tr" (Turkish)
  752. // - "zh-CN" (Chinese Simplified)
  753. // - "zh-TW" (Chinese Traditional)
  754. Locale string `json:"locale,omitempty"`
  755. // MaximumImageSize: Maximum image size allowed for this account, in
  756. // kilobytes. Value must be greater than or equal to 1.
  757. MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"`
  758. // Name: Name of this account. This is a required field, and must be
  759. // less than 128 characters long and be globally unique.
  760. Name string `json:"name,omitempty"`
  761. // NielsenOcrEnabled: Whether campaigns created in this account will be
  762. // enabled for Nielsen OCR reach ratings by default.
  763. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  764. // ReportsConfiguration: Reporting configuration of this account.
  765. ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"`
  766. // ShareReportsWithTwitter: Share Path to Conversion reports with
  767. // Twitter.
  768. ShareReportsWithTwitter bool `json:"shareReportsWithTwitter,omitempty"`
  769. // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser
  770. // creatives. Acceptable values are 1 to 10240, inclusive.
  771. TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"`
  772. // ServerResponse contains the HTTP response code and headers from the
  773. // server.
  774. googleapi.ServerResponse `json:"-"`
  775. // ForceSendFields is a list of field names (e.g.
  776. // "AccountPermissionIds") to unconditionally include in API requests.
  777. // By default, fields with empty values are omitted from API requests.
  778. // However, any non-pointer, non-interface field appearing in
  779. // ForceSendFields will be sent to the server regardless of whether the
  780. // field is empty or not. This may be used to include empty fields in
  781. // Patch requests.
  782. ForceSendFields []string `json:"-"`
  783. // NullFields is a list of field names (e.g. "AccountPermissionIds") to
  784. // include in API requests with the JSON null value. By default, fields
  785. // with empty values are omitted from API requests. However, any field
  786. // with an empty value appearing in NullFields will be sent to the
  787. // server as null. It is an error if a field in this list has a
  788. // non-empty value. This may be used to include null fields in Patch
  789. // requests.
  790. NullFields []string `json:"-"`
  791. }
  792. func (s *Account) MarshalJSON() ([]byte, error) {
  793. type NoMethod Account
  794. raw := NoMethod(*s)
  795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  796. }
  797. // AccountActiveAdSummary: Gets a summary of active ads in an account.
  798. type AccountActiveAdSummary struct {
  799. // AccountId: ID of the account.
  800. AccountId int64 `json:"accountId,omitempty,string"`
  801. // ActiveAds: Ads that have been activated for the account
  802. ActiveAds int64 `json:"activeAds,omitempty,string"`
  803. // ActiveAdsLimitTier: Maximum number of active ads allowed for the
  804. // account.
  805. //
  806. // Possible values:
  807. // "ACTIVE_ADS_TIER_100K"
  808. // "ACTIVE_ADS_TIER_1M"
  809. // "ACTIVE_ADS_TIER_200K"
  810. // "ACTIVE_ADS_TIER_300K"
  811. // "ACTIVE_ADS_TIER_40K"
  812. // "ACTIVE_ADS_TIER_500K"
  813. // "ACTIVE_ADS_TIER_750K"
  814. // "ACTIVE_ADS_TIER_75K"
  815. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  816. // AvailableAds: Ads that can be activated for the account.
  817. AvailableAds int64 `json:"availableAds,omitempty,string"`
  818. // Kind: Identifies what kind of resource this is. Value: the fixed
  819. // string "dfareporting#accountActiveAdSummary".
  820. Kind string `json:"kind,omitempty"`
  821. // ServerResponse contains the HTTP response code and headers from the
  822. // server.
  823. googleapi.ServerResponse `json:"-"`
  824. // ForceSendFields is a list of field names (e.g. "AccountId") to
  825. // unconditionally include in API requests. By default, fields with
  826. // empty values are omitted from API requests. However, any non-pointer,
  827. // non-interface field appearing in ForceSendFields will be sent to the
  828. // server regardless of whether the field is empty or not. This may be
  829. // used to include empty fields in Patch requests.
  830. ForceSendFields []string `json:"-"`
  831. // NullFields is a list of field names (e.g. "AccountId") to include in
  832. // API requests with the JSON null value. By default, fields with empty
  833. // values are omitted from API requests. However, any field with an
  834. // empty value appearing in NullFields will be sent to the server as
  835. // null. It is an error if a field in this list has a non-empty value.
  836. // This may be used to include null fields in Patch requests.
  837. NullFields []string `json:"-"`
  838. }
  839. func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) {
  840. type NoMethod AccountActiveAdSummary
  841. raw := NoMethod(*s)
  842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  843. }
  844. // AccountPermission: AccountPermissions contains information about a
  845. // particular account permission. Some features of DCM require an
  846. // account permission to be present in the account.
  847. type AccountPermission struct {
  848. // AccountProfiles: Account profiles associated with this account
  849. // permission.
  850. //
  851. // Possible values are:
  852. // - "ACCOUNT_PROFILE_BASIC"
  853. // - "ACCOUNT_PROFILE_STANDARD"
  854. //
  855. // Possible values:
  856. // "ACCOUNT_PROFILE_BASIC"
  857. // "ACCOUNT_PROFILE_STANDARD"
  858. AccountProfiles []string `json:"accountProfiles,omitempty"`
  859. // Id: ID of this account permission.
  860. Id int64 `json:"id,omitempty,string"`
  861. // Kind: Identifies what kind of resource this is. Value: the fixed
  862. // string "dfareporting#accountPermission".
  863. Kind string `json:"kind,omitempty"`
  864. // Level: Administrative level required to enable this account
  865. // permission.
  866. //
  867. // Possible values:
  868. // "ADMINISTRATOR"
  869. // "USER"
  870. Level string `json:"level,omitempty"`
  871. // Name: Name of this account permission.
  872. Name string `json:"name,omitempty"`
  873. // PermissionGroupId: Permission group of this account permission.
  874. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  875. // ServerResponse contains the HTTP response code and headers from the
  876. // server.
  877. googleapi.ServerResponse `json:"-"`
  878. // ForceSendFields is a list of field names (e.g. "AccountProfiles") to
  879. // unconditionally include in API requests. By default, fields with
  880. // empty values are omitted from API requests. However, any non-pointer,
  881. // non-interface field appearing in ForceSendFields will be sent to the
  882. // server regardless of whether the field is empty or not. This may be
  883. // used to include empty fields in Patch requests.
  884. ForceSendFields []string `json:"-"`
  885. // NullFields is a list of field names (e.g. "AccountProfiles") to
  886. // include in API requests with the JSON null value. By default, fields
  887. // with empty values are omitted from API requests. However, any field
  888. // with an empty value appearing in NullFields will be sent to the
  889. // server as null. It is an error if a field in this list has a
  890. // non-empty value. This may be used to include null fields in Patch
  891. // requests.
  892. NullFields []string `json:"-"`
  893. }
  894. func (s *AccountPermission) MarshalJSON() ([]byte, error) {
  895. type NoMethod AccountPermission
  896. raw := NoMethod(*s)
  897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  898. }
  899. // AccountPermissionGroup: AccountPermissionGroups contains a mapping of
  900. // permission group IDs to names. A permission group is a grouping of
  901. // account permissions.
  902. type AccountPermissionGroup struct {
  903. // Id: ID of this account permission group.
  904. Id int64 `json:"id,omitempty,string"`
  905. // Kind: Identifies what kind of resource this is. Value: the fixed
  906. // string "dfareporting#accountPermissionGroup".
  907. Kind string `json:"kind,omitempty"`
  908. // Name: Name of this account permission group.
  909. Name string `json:"name,omitempty"`
  910. // ServerResponse contains the HTTP response code and headers from the
  911. // server.
  912. googleapi.ServerResponse `json:"-"`
  913. // ForceSendFields is a list of field names (e.g. "Id") to
  914. // unconditionally include in API requests. By default, fields with
  915. // empty values are omitted from API requests. However, any non-pointer,
  916. // non-interface field appearing in ForceSendFields will be sent to the
  917. // server regardless of whether the field is empty or not. This may be
  918. // used to include empty fields in Patch requests.
  919. ForceSendFields []string `json:"-"`
  920. // NullFields is a list of field names (e.g. "Id") to include in API
  921. // requests with the JSON null value. By default, fields with empty
  922. // values are omitted from API requests. However, any field with an
  923. // empty value appearing in NullFields will be sent to the server as
  924. // null. It is an error if a field in this list has a non-empty value.
  925. // This may be used to include null fields in Patch requests.
  926. NullFields []string `json:"-"`
  927. }
  928. func (s *AccountPermissionGroup) MarshalJSON() ([]byte, error) {
  929. type NoMethod AccountPermissionGroup
  930. raw := NoMethod(*s)
  931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  932. }
  933. // AccountPermissionGroupsListResponse: Account Permission Group List
  934. // Response
  935. type AccountPermissionGroupsListResponse struct {
  936. // AccountPermissionGroups: Account permission group collection.
  937. AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"`
  938. // Kind: Identifies what kind of resource this is. Value: the fixed
  939. // string "dfareporting#accountPermissionGroupsListResponse".
  940. Kind string `json:"kind,omitempty"`
  941. // ServerResponse contains the HTTP response code and headers from the
  942. // server.
  943. googleapi.ServerResponse `json:"-"`
  944. // ForceSendFields is a list of field names (e.g.
  945. // "AccountPermissionGroups") to unconditionally include in API
  946. // requests. By default, fields with empty values are omitted from API
  947. // requests. However, any non-pointer, non-interface field appearing in
  948. // ForceSendFields will be sent to the server regardless of whether the
  949. // field is empty or not. This may be used to include empty fields in
  950. // Patch requests.
  951. ForceSendFields []string `json:"-"`
  952. // NullFields is a list of field names (e.g. "AccountPermissionGroups")
  953. // to include in API requests with the JSON null value. By default,
  954. // fields with empty values are omitted from API requests. However, any
  955. // field with an empty value appearing in NullFields will be sent to the
  956. // server as null. It is an error if a field in this list has a
  957. // non-empty value. This may be used to include null fields in Patch
  958. // requests.
  959. NullFields []string `json:"-"`
  960. }
  961. func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  962. type NoMethod AccountPermissionGroupsListResponse
  963. raw := NoMethod(*s)
  964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  965. }
  966. // AccountPermissionsListResponse: Account Permission List Response
  967. type AccountPermissionsListResponse struct {
  968. // AccountPermissions: Account permission collection.
  969. AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"`
  970. // Kind: Identifies what kind of resource this is. Value: the fixed
  971. // string "dfareporting#accountPermissionsListResponse".
  972. Kind string `json:"kind,omitempty"`
  973. // ServerResponse contains the HTTP response code and headers from the
  974. // server.
  975. googleapi.ServerResponse `json:"-"`
  976. // ForceSendFields is a list of field names (e.g. "AccountPermissions")
  977. // to unconditionally include in API requests. By default, fields with
  978. // empty values are omitted from API requests. However, any non-pointer,
  979. // non-interface field appearing in ForceSendFields will be sent to the
  980. // server regardless of whether the field is empty or not. This may be
  981. // used to include empty fields in Patch requests.
  982. ForceSendFields []string `json:"-"`
  983. // NullFields is a list of field names (e.g. "AccountPermissions") to
  984. // include in API requests with the JSON null value. By default, fields
  985. // with empty values are omitted from API requests. However, any field
  986. // with an empty value appearing in NullFields will be sent to the
  987. // server as null. It is an error if a field in this list has a
  988. // non-empty value. This may be used to include null fields in Patch
  989. // requests.
  990. NullFields []string `json:"-"`
  991. }
  992. func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) {
  993. type NoMethod AccountPermissionsListResponse
  994. raw := NoMethod(*s)
  995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  996. }
  997. // AccountUserProfile: AccountUserProfiles contains properties of a DCM
  998. // user profile. This resource is specifically for managing user
  999. // profiles, whereas UserProfiles is for accessing the API.
  1000. type AccountUserProfile struct {
  1001. // AccountId: Account ID of the user profile. This is a read-only field
  1002. // that can be left blank.
  1003. AccountId int64 `json:"accountId,omitempty,string"`
  1004. // Active: Whether this user profile is active. This defaults to false,
  1005. // and must be set true on insert for the user profile to be usable.
  1006. Active bool `json:"active,omitempty"`
  1007. // AdvertiserFilter: Filter that describes which advertisers are visible
  1008. // to the user profile.
  1009. AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"`
  1010. // CampaignFilter: Filter that describes which campaigns are visible to
  1011. // the user profile.
  1012. CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"`
  1013. // Comments: Comments for this user profile.
  1014. Comments string `json:"comments,omitempty"`
  1015. // Email: Email of the user profile. The email addresss must be linked
  1016. // to a Google Account. This field is required on insertion and is
  1017. // read-only after insertion.
  1018. Email string `json:"email,omitempty"`
  1019. // Id: ID of the user profile. This is a read-only, auto-generated
  1020. // field.
  1021. Id int64 `json:"id,omitempty,string"`
  1022. // Kind: Identifies what kind of resource this is. Value: the fixed
  1023. // string "dfareporting#accountUserProfile".
  1024. Kind string `json:"kind,omitempty"`
  1025. // Locale: Locale of the user profile. This is a required
  1026. // field.
  1027. // Acceptable values are:
  1028. // - "cs" (Czech)
  1029. // - "de" (German)
  1030. // - "en" (English)
  1031. // - "en-GB" (English United Kingdom)
  1032. // - "es" (Spanish)
  1033. // - "fr" (French)
  1034. // - "it" (Italian)
  1035. // - "ja" (Japanese)
  1036. // - "ko" (Korean)
  1037. // - "pl" (Polish)
  1038. // - "pt-BR" (Portuguese Brazil)
  1039. // - "ru" (Russian)
  1040. // - "sv" (Swedish)
  1041. // - "tr" (Turkish)
  1042. // - "zh-CN" (Chinese Simplified)
  1043. // - "zh-TW" (Chinese Traditional)
  1044. Locale string `json:"locale,omitempty"`
  1045. // Name: Name of the user profile. This is a required field. Must be
  1046. // less than 64 characters long, must be globally unique, and cannot
  1047. // contain whitespace or any of the following characters: "&;"#%,".
  1048. Name string `json:"name,omitempty"`
  1049. // SiteFilter: Filter that describes which sites are visible to the user
  1050. // profile.
  1051. SiteFilter *ObjectFilter `json:"siteFilter,omitempty"`
  1052. // SubaccountId: Subaccount ID of the user profile. This is a read-only
  1053. // field that can be left blank.
  1054. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1055. // TraffickerType: Trafficker type of this user profile. This is a
  1056. // read-only field.
  1057. //
  1058. // Possible values:
  1059. // "EXTERNAL_TRAFFICKER"
  1060. // "INTERNAL_NON_TRAFFICKER"
  1061. // "INTERNAL_TRAFFICKER"
  1062. TraffickerType string `json:"traffickerType,omitempty"`
  1063. // UserAccessType: User type of the user profile. This is a read-only
  1064. // field that can be left blank.
  1065. //
  1066. // Possible values:
  1067. // "INTERNAL_ADMINISTRATOR"
  1068. // "NORMAL_USER"
  1069. // "READ_ONLY_SUPER_USER"
  1070. // "SUPER_USER"
  1071. UserAccessType string `json:"userAccessType,omitempty"`
  1072. // UserRoleFilter: Filter that describes which user roles are visible to
  1073. // the user profile.
  1074. UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"`
  1075. // UserRoleId: User role ID of the user profile. This is a required
  1076. // field.
  1077. UserRoleId int64 `json:"userRoleId,omitempty,string"`
  1078. // ServerResponse contains the HTTP response code and headers from the
  1079. // server.
  1080. googleapi.ServerResponse `json:"-"`
  1081. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1082. // unconditionally include in API requests. By default, fields with
  1083. // empty values are omitted from API requests. However, any non-pointer,
  1084. // non-interface field appearing in ForceSendFields will be sent to the
  1085. // server regardless of whether the field is empty or not. This may be
  1086. // used to include empty fields in Patch requests.
  1087. ForceSendFields []string `json:"-"`
  1088. // NullFields is a list of field names (e.g. "AccountId") to include in
  1089. // API requests with the JSON null value. By default, fields with empty
  1090. // values are omitted from API requests. However, any field with an
  1091. // empty value appearing in NullFields will be sent to the server as
  1092. // null. It is an error if a field in this list has a non-empty value.
  1093. // This may be used to include null fields in Patch requests.
  1094. NullFields []string `json:"-"`
  1095. }
  1096. func (s *AccountUserProfile) MarshalJSON() ([]byte, error) {
  1097. type NoMethod AccountUserProfile
  1098. raw := NoMethod(*s)
  1099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1100. }
  1101. // AccountUserProfilesListResponse: Account User Profile List Response
  1102. type AccountUserProfilesListResponse struct {
  1103. // AccountUserProfiles: Account user profile collection.
  1104. AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"`
  1105. // Kind: Identifies what kind of resource this is. Value: the fixed
  1106. // string "dfareporting#accountUserProfilesListResponse".
  1107. Kind string `json:"kind,omitempty"`
  1108. // NextPageToken: Pagination token to be used for the next list
  1109. // operation.
  1110. NextPageToken string `json:"nextPageToken,omitempty"`
  1111. // ServerResponse contains the HTTP response code and headers from the
  1112. // server.
  1113. googleapi.ServerResponse `json:"-"`
  1114. // ForceSendFields is a list of field names (e.g. "AccountUserProfiles")
  1115. // to unconditionally include in API requests. By default, fields with
  1116. // empty values are omitted from API requests. However, any non-pointer,
  1117. // non-interface field appearing in ForceSendFields will be sent to the
  1118. // server regardless of whether the field is empty or not. This may be
  1119. // used to include empty fields in Patch requests.
  1120. ForceSendFields []string `json:"-"`
  1121. // NullFields is a list of field names (e.g. "AccountUserProfiles") to
  1122. // include in API requests with the JSON null value. By default, fields
  1123. // with empty values are omitted from API requests. However, any field
  1124. // with an empty value appearing in NullFields will be sent to the
  1125. // server as null. It is an error if a field in this list has a
  1126. // non-empty value. This may be used to include null fields in Patch
  1127. // requests.
  1128. NullFields []string `json:"-"`
  1129. }
  1130. func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) {
  1131. type NoMethod AccountUserProfilesListResponse
  1132. raw := NoMethod(*s)
  1133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1134. }
  1135. // AccountsListResponse: Account List Response
  1136. type AccountsListResponse struct {
  1137. // Accounts: Account collection.
  1138. Accounts []*Account `json:"accounts,omitempty"`
  1139. // Kind: Identifies what kind of resource this is. Value: the fixed
  1140. // string "dfareporting#accountsListResponse".
  1141. Kind string `json:"kind,omitempty"`
  1142. // NextPageToken: Pagination token to be used for the next list
  1143. // operation.
  1144. NextPageToken string `json:"nextPageToken,omitempty"`
  1145. // ServerResponse contains the HTTP response code and headers from the
  1146. // server.
  1147. googleapi.ServerResponse `json:"-"`
  1148. // ForceSendFields is a list of field names (e.g. "Accounts") to
  1149. // unconditionally include in API requests. By default, fields with
  1150. // empty values are omitted from API requests. However, any non-pointer,
  1151. // non-interface field appearing in ForceSendFields will be sent to the
  1152. // server regardless of whether the field is empty or not. This may be
  1153. // used to include empty fields in Patch requests.
  1154. ForceSendFields []string `json:"-"`
  1155. // NullFields is a list of field names (e.g. "Accounts") to include in
  1156. // API requests with the JSON null value. By default, fields with empty
  1157. // values are omitted from API requests. However, any field with an
  1158. // empty value appearing in NullFields will be sent to the server as
  1159. // null. It is an error if a field in this list has a non-empty value.
  1160. // This may be used to include null fields in Patch requests.
  1161. NullFields []string `json:"-"`
  1162. }
  1163. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1164. type NoMethod AccountsListResponse
  1165. raw := NoMethod(*s)
  1166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1167. }
  1168. // Activities: Represents an activity group.
  1169. type Activities struct {
  1170. // Filters: List of activity filters. The dimension values need to be
  1171. // all either of type "dfa:activity" or "dfa:activityGroup".
  1172. Filters []*DimensionValue `json:"filters,omitempty"`
  1173. // Kind: The kind of resource this is, in this case
  1174. // dfareporting#activities.
  1175. Kind string `json:"kind,omitempty"`
  1176. // MetricNames: List of names of floodlight activity metrics.
  1177. MetricNames []string `json:"metricNames,omitempty"`
  1178. // ForceSendFields is a list of field names (e.g. "Filters") to
  1179. // unconditionally include in API requests. By default, fields with
  1180. // empty values are omitted from API requests. However, any non-pointer,
  1181. // non-interface field appearing in ForceSendFields will be sent to the
  1182. // server regardless of whether the field is empty or not. This may be
  1183. // used to include empty fields in Patch requests.
  1184. ForceSendFields []string `json:"-"`
  1185. // NullFields is a list of field names (e.g. "Filters") to include in
  1186. // API requests with the JSON null value. By default, fields with empty
  1187. // values are omitted from API requests. However, any field with an
  1188. // empty value appearing in NullFields will be sent to the server as
  1189. // null. It is an error if a field in this list has a non-empty value.
  1190. // This may be used to include null fields in Patch requests.
  1191. NullFields []string `json:"-"`
  1192. }
  1193. func (s *Activities) MarshalJSON() ([]byte, error) {
  1194. type NoMethod Activities
  1195. raw := NoMethod(*s)
  1196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1197. }
  1198. // Ad: Contains properties of a DCM ad.
  1199. type Ad struct {
  1200. // AccountId: Account ID of this ad. This is a read-only field that can
  1201. // be left blank.
  1202. AccountId int64 `json:"accountId,omitempty,string"`
  1203. // Active: Whether this ad is active. When true, archived must be false.
  1204. Active bool `json:"active,omitempty"`
  1205. // AdvertiserId: Advertiser ID of this ad. This is a required field on
  1206. // insertion.
  1207. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1208. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  1209. // advertiser. This is a read-only, auto-generated field.
  1210. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1211. // Archived: Whether this ad is archived. When true, active must be
  1212. // false.
  1213. Archived bool `json:"archived,omitempty"`
  1214. // AudienceSegmentId: Audience segment ID that is being targeted for
  1215. // this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  1216. AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"`
  1217. // CampaignId: Campaign ID of this ad. This is a required field on
  1218. // insertion.
  1219. CampaignId int64 `json:"campaignId,omitempty,string"`
  1220. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  1221. // This is a read-only, auto-generated field.
  1222. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  1223. // ClickThroughUrl: Click-through URL for this ad. This is a required
  1224. // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  1225. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  1226. // ClickThroughUrlSuffixProperties: Click-through URL suffix properties
  1227. // for this ad. Applies to the URL in the ad or (if overriding ad
  1228. // properties) the URL in the creative.
  1229. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1230. // Comments: Comments for this ad.
  1231. Comments string `json:"comments,omitempty"`
  1232. // Compatibility: Compatibility of this ad. Applicable when type is
  1233. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  1234. // either rendering on desktop or on mobile devices or in mobile apps
  1235. // for regular or interstitial ads, respectively. APP and
  1236. // APP_INTERSTITIAL are only used for existing default ads. New mobile
  1237. // placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and
  1238. // default ads created for those placements will be limited to those
  1239. // compatibility types. IN_STREAM_VIDEO refers to rendering in-stream
  1240. // video ads developed with the VAST standard.
  1241. //
  1242. // Possible values:
  1243. // "APP"
  1244. // "APP_INTERSTITIAL"
  1245. // "DISPLAY"
  1246. // "DISPLAY_INTERSTITIAL"
  1247. // "IN_STREAM_AUDIO"
  1248. // "IN_STREAM_VIDEO"
  1249. Compatibility string `json:"compatibility,omitempty"`
  1250. // CreateInfo: Information about the creation of this ad. This is a
  1251. // read-only field.
  1252. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1253. // CreativeGroupAssignments: Creative group assignments for this ad.
  1254. // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment
  1255. // per creative group number is allowed for a maximum of two
  1256. // assignments.
  1257. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  1258. // CreativeRotation: Creative rotation for this ad. Applicable when type
  1259. // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or
  1260. // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field
  1261. // should have exactly one creativeAssignment.
  1262. CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"`
  1263. // DayPartTargeting: Time and day targeting information for this ad.
  1264. // This field must be left blank if the ad is using a targeting
  1265. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1266. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  1267. // DefaultClickThroughEventTagProperties: Default click-through event
  1268. // tag properties for this ad.
  1269. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1270. // DeliverySchedule: Delivery schedule information for this ad.
  1271. // Applicable when type is AD_SERVING_STANDARD_AD or
  1272. // AD_SERVING_TRACKING. This field along with subfields priority and
  1273. // impressionRatio are required on insertion when type is
  1274. // AD_SERVING_STANDARD_AD.
  1275. DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"`
  1276. // DynamicClickTracker: Whether this ad is a dynamic click tracker.
  1277. // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required
  1278. // field on insert, and is read-only after insert.
  1279. DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"`
  1280. // EndTime: Date and time that this ad should stop serving. Must be
  1281. // later than the start time. This is a required field on insertion.
  1282. EndTime string `json:"endTime,omitempty"`
  1283. // EventTagOverrides: Event tag overrides for this ad.
  1284. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1285. // GeoTargeting: Geographical targeting information for this ad. This
  1286. // field must be left blank if the ad is using a targeting template.
  1287. // Applicable when type is AD_SERVING_STANDARD_AD.
  1288. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  1289. // Id: ID of this ad. This is a read-only, auto-generated field.
  1290. Id int64 `json:"id,omitempty,string"`
  1291. // IdDimensionValue: Dimension value for the ID of this ad. This is a
  1292. // read-only, auto-generated field.
  1293. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1294. // KeyValueTargetingExpression: Key-value targeting information for this
  1295. // ad. This field must be left blank if the ad is using a targeting
  1296. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1297. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  1298. // Kind: Identifies what kind of resource this is. Value: the fixed
  1299. // string "dfareporting#ad".
  1300. Kind string `json:"kind,omitempty"`
  1301. // LanguageTargeting: Language targeting information for this ad. This
  1302. // field must be left blank if the ad is using a targeting template.
  1303. // Applicable when type is AD_SERVING_STANDARD_AD.
  1304. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  1305. // LastModifiedInfo: Information about the most recent modification of
  1306. // this ad. This is a read-only field.
  1307. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1308. // Name: Name of this ad. This is a required field and must be less than
  1309. // 256 characters long.
  1310. Name string `json:"name,omitempty"`
  1311. // PlacementAssignments: Placement assignments for this ad.
  1312. PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"`
  1313. // RemarketingListExpression: Remarketing list targeting expression for
  1314. // this ad. This field must be left blank if the ad is using a targeting
  1315. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1316. RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"`
  1317. // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  1318. Size *Size `json:"size,omitempty"`
  1319. // SslCompliant: Whether this ad is ssl compliant. This is a read-only
  1320. // field that is auto-generated when the ad is inserted or updated.
  1321. SslCompliant bool `json:"sslCompliant,omitempty"`
  1322. // SslRequired: Whether this ad requires ssl. This is a read-only field
  1323. // that is auto-generated when the ad is inserted or updated.
  1324. SslRequired bool `json:"sslRequired,omitempty"`
  1325. // StartTime: Date and time that this ad should start serving. If
  1326. // creating an ad, this field must be a time in the future. This is a
  1327. // required field on insertion.
  1328. StartTime string `json:"startTime,omitempty"`
  1329. // SubaccountId: Subaccount ID of this ad. This is a read-only field
  1330. // that can be left blank.
  1331. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1332. // TargetingTemplateId: Targeting template ID, used to apply
  1333. // preconfigured targeting information to this ad. This cannot be set
  1334. // while any of dayPartTargeting, geoTargeting,
  1335. // keyValueTargetingExpression, languageTargeting,
  1336. // remarketingListExpression, or technologyTargeting are set. Applicable
  1337. // when type is AD_SERVING_STANDARD_AD.
  1338. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  1339. // TechnologyTargeting: Technology platform targeting information for
  1340. // this ad. This field must be left blank if the ad is using a targeting
  1341. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1342. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  1343. // Type: Type of ad. This is a required field on insertion. Note that
  1344. // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see
  1345. // Creative resource).
  1346. //
  1347. // Possible values:
  1348. // "AD_SERVING_CLICK_TRACKER"
  1349. // "AD_SERVING_DEFAULT_AD"
  1350. // "AD_SERVING_STANDARD_AD"
  1351. // "AD_SERVING_TRACKING"
  1352. Type string `json:"type,omitempty"`
  1353. // ServerResponse contains the HTTP response code and headers from the
  1354. // server.
  1355. googleapi.ServerResponse `json:"-"`
  1356. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1357. // unconditionally include in API requests. By default, fields with
  1358. // empty values are omitted from API requests. However, any non-pointer,
  1359. // non-interface field appearing in ForceSendFields will be sent to the
  1360. // server regardless of whether the field is empty or not. This may be
  1361. // used to include empty fields in Patch requests.
  1362. ForceSendFields []string `json:"-"`
  1363. // NullFields is a list of field names (e.g. "AccountId") to include in
  1364. // API requests with the JSON null value. By default, fields with empty
  1365. // values are omitted from API requests. However, any field with an
  1366. // empty value appearing in NullFields will be sent to the server as
  1367. // null. It is an error if a field in this list has a non-empty value.
  1368. // This may be used to include null fields in Patch requests.
  1369. NullFields []string `json:"-"`
  1370. }
  1371. func (s *Ad) MarshalJSON() ([]byte, error) {
  1372. type NoMethod Ad
  1373. raw := NoMethod(*s)
  1374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1375. }
  1376. // AdBlockingConfiguration: Campaign ad blocking settings.
  1377. type AdBlockingConfiguration struct {
  1378. // ClickThroughUrl: Click-through URL used by brand-neutral ads. This is
  1379. // a required field when overrideClickThroughUrl is set to true.
  1380. ClickThroughUrl string `json:"clickThroughUrl,omitempty"`
  1381. // CreativeBundleId: ID of a creative bundle to use for this campaign.
  1382. // If set, brand-neutral ads will select creatives from this bundle.
  1383. // Otherwise, a default transparent pixel will be used.
  1384. CreativeBundleId int64 `json:"creativeBundleId,omitempty,string"`
  1385. // Enabled: Whether this campaign has enabled ad blocking. When true, ad
  1386. // blocking is enabled for placements in the campaign, but this may be
  1387. // overridden by site and placement settings. When false, ad blocking is
  1388. // disabled for all placements under the campaign, regardless of site
  1389. // and placement settings.
  1390. Enabled bool `json:"enabled,omitempty"`
  1391. // OverrideClickThroughUrl: Whether the brand-neutral ad's click-through
  1392. // URL comes from the campaign's creative bundle or the override URL.
  1393. // Must be set to true if ad blocking is enabled and no creative bundle
  1394. // is configured.
  1395. OverrideClickThroughUrl bool `json:"overrideClickThroughUrl,omitempty"`
  1396. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  1397. // unconditionally include in API requests. By default, fields with
  1398. // empty values are omitted from API requests. However, any non-pointer,
  1399. // non-interface field appearing in ForceSendFields will be sent to the
  1400. // server regardless of whether the field is empty or not. This may be
  1401. // used to include empty fields in Patch requests.
  1402. ForceSendFields []string `json:"-"`
  1403. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  1404. // include in API requests with the JSON null value. By default, fields
  1405. // with empty values are omitted from API requests. However, any field
  1406. // with an empty value appearing in NullFields will be sent to the
  1407. // server as null. It is an error if a field in this list has a
  1408. // non-empty value. This may be used to include null fields in Patch
  1409. // requests.
  1410. NullFields []string `json:"-"`
  1411. }
  1412. func (s *AdBlockingConfiguration) MarshalJSON() ([]byte, error) {
  1413. type NoMethod AdBlockingConfiguration
  1414. raw := NoMethod(*s)
  1415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1416. }
  1417. // AdSlot: Ad Slot
  1418. type AdSlot struct {
  1419. // Comment: Comment for this ad slot.
  1420. Comment string `json:"comment,omitempty"`
  1421. // Compatibility: Ad slot compatibility. DISPLAY and
  1422. // DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile
  1423. // devices or in mobile apps for regular or interstitial ads
  1424. // respectively. APP and APP_INTERSTITIAL are for rendering in mobile
  1425. // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads
  1426. // developed with the VAST standard.
  1427. //
  1428. // Possible values:
  1429. // "APP"
  1430. // "APP_INTERSTITIAL"
  1431. // "DISPLAY"
  1432. // "DISPLAY_INTERSTITIAL"
  1433. // "IN_STREAM_AUDIO"
  1434. // "IN_STREAM_VIDEO"
  1435. Compatibility string `json:"compatibility,omitempty"`
  1436. // Height: Height of this ad slot.
  1437. Height int64 `json:"height,omitempty,string"`
  1438. // LinkedPlacementId: ID of the placement from an external platform that
  1439. // is linked to this ad slot.
  1440. LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"`
  1441. // Name: Name of this ad slot.
  1442. Name string `json:"name,omitempty"`
  1443. // PaymentSourceType: Payment source type of this ad slot.
  1444. //
  1445. // Possible values:
  1446. // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID"
  1447. // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID"
  1448. PaymentSourceType string `json:"paymentSourceType,omitempty"`
  1449. // Primary: Primary ad slot of a roadblock inventory item.
  1450. Primary bool `json:"primary,omitempty"`
  1451. // Width: Width of this ad slot.
  1452. Width int64 `json:"width,omitempty,string"`
  1453. // ForceSendFields is a list of field names (e.g. "Comment") to
  1454. // unconditionally include in API requests. By default, fields with
  1455. // empty values are omitted from API requests. However, any non-pointer,
  1456. // non-interface field appearing in ForceSendFields will be sent to the
  1457. // server regardless of whether the field is empty or not. This may be
  1458. // used to include empty fields in Patch requests.
  1459. ForceSendFields []string `json:"-"`
  1460. // NullFields is a list of field names (e.g. "Comment") to include in
  1461. // API requests with the JSON null value. By default, fields with empty
  1462. // values are omitted from API requests. However, any field with an
  1463. // empty value appearing in NullFields will be sent to the server as
  1464. // null. It is an error if a field in this list has a non-empty value.
  1465. // This may be used to include null fields in Patch requests.
  1466. NullFields []string `json:"-"`
  1467. }
  1468. func (s *AdSlot) MarshalJSON() ([]byte, error) {
  1469. type NoMethod AdSlot
  1470. raw := NoMethod(*s)
  1471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1472. }
  1473. // AdsListResponse: Ad List Response
  1474. type AdsListResponse struct {
  1475. // Ads: Ad collection.
  1476. Ads []*Ad `json:"ads,omitempty"`
  1477. // Kind: Identifies what kind of resource this is. Value: the fixed
  1478. // string "dfareporting#adsListResponse".
  1479. Kind string `json:"kind,omitempty"`
  1480. // NextPageToken: Pagination token to be used for the next list
  1481. // operation.
  1482. NextPageToken string `json:"nextPageToken,omitempty"`
  1483. // ServerResponse contains the HTTP response code and headers from the
  1484. // server.
  1485. googleapi.ServerResponse `json:"-"`
  1486. // ForceSendFields is a list of field names (e.g. "Ads") to
  1487. // unconditionally include in API requests. By default, fields with
  1488. // empty values are omitted from API requests. However, any non-pointer,
  1489. // non-interface field appearing in ForceSendFields will be sent to the
  1490. // server regardless of whether the field is empty or not. This may be
  1491. // used to include empty fields in Patch requests.
  1492. ForceSendFields []string `json:"-"`
  1493. // NullFields is a list of field names (e.g. "Ads") to include in API
  1494. // requests with the JSON null value. By default, fields with empty
  1495. // values are omitted from API requests. However, any field with an
  1496. // empty value appearing in NullFields will be sent to the server as
  1497. // null. It is an error if a field in this list has a non-empty value.
  1498. // This may be used to include null fields in Patch requests.
  1499. NullFields []string `json:"-"`
  1500. }
  1501. func (s *AdsListResponse) MarshalJSON() ([]byte, error) {
  1502. type NoMethod AdsListResponse
  1503. raw := NoMethod(*s)
  1504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1505. }
  1506. // Advertiser: Contains properties of a DCM advertiser.
  1507. type Advertiser struct {
  1508. // AccountId: Account ID of this advertiser.This is a read-only field
  1509. // that can be left blank.
  1510. AccountId int64 `json:"accountId,omitempty,string"`
  1511. // AdvertiserGroupId: ID of the advertiser group this advertiser belongs
  1512. // to. You can group advertisers for reporting purposes, allowing you to
  1513. // see aggregated information for all advertisers in each group.
  1514. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1515. // ClickThroughUrlSuffix: Suffix added to click-through URL of ad
  1516. // creative associations under this advertiser. Must be less than 129
  1517. // characters long.
  1518. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  1519. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  1520. // apply by default to the landing pages of this advertiser's campaigns.
  1521. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  1522. // DefaultEmail: Default email address used in sender field for tag
  1523. // emails.
  1524. DefaultEmail string `json:"defaultEmail,omitempty"`
  1525. // FloodlightConfigurationId: Floodlight configuration ID of this
  1526. // advertiser. The floodlight configuration ID will be created
  1527. // automatically, so on insert this field should be left blank. This
  1528. // field can be set to another advertiser's floodlight configuration ID
  1529. // in order to share that advertiser's floodlight configuration with
  1530. // this advertiser, so long as:
  1531. // - This advertiser's original floodlight configuration is not already
  1532. // associated with floodlight activities or floodlight activity groups.
  1533. //
  1534. // - This advertiser's original floodlight configuration is not already
  1535. // shared with another advertiser.
  1536. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  1537. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  1538. // of the floodlight configuration. This is a read-only, auto-generated
  1539. // field.
  1540. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  1541. // Id: ID of this advertiser. This is a read-only, auto-generated field.
  1542. Id int64 `json:"id,omitempty,string"`
  1543. // IdDimensionValue: Dimension value for the ID of this advertiser. This
  1544. // is a read-only, auto-generated field.
  1545. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1546. // Kind: Identifies what kind of resource this is. Value: the fixed
  1547. // string "dfareporting#advertiser".
  1548. Kind string `json:"kind,omitempty"`
  1549. // Name: Name of this advertiser. This is a required field and must be
  1550. // less than 256 characters long and unique among advertisers of the
  1551. // same account.
  1552. Name string `json:"name,omitempty"`
  1553. // OriginalFloodlightConfigurationId: Original floodlight configuration
  1554. // before any sharing occurred. Set the floodlightConfigurationId of
  1555. // this advertiser to originalFloodlightConfigurationId to unshare the
  1556. // advertiser's current floodlight configuration. You cannot unshare an
  1557. // advertiser's floodlight configuration if the shared configuration has
  1558. // activities associated with any campaign or placement.
  1559. OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"`
  1560. // Status: Status of this advertiser.
  1561. //
  1562. // Possible values:
  1563. // "APPROVED"
  1564. // "ON_HOLD"
  1565. Status string `json:"status,omitempty"`
  1566. // SubaccountId: Subaccount ID of this advertiser.This is a read-only
  1567. // field that can be left blank.
  1568. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1569. // Suspended: Suspension status of this advertiser.
  1570. Suspended bool `json:"suspended,omitempty"`
  1571. // ServerResponse contains the HTTP response code and headers from the
  1572. // server.
  1573. googleapi.ServerResponse `json:"-"`
  1574. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1575. // unconditionally include in API requests. By default, fields with
  1576. // empty values are omitted from API requests. However, any non-pointer,
  1577. // non-interface field appearing in ForceSendFields will be sent to the
  1578. // server regardless of whether the field is empty or not. This may be
  1579. // used to include empty fields in Patch requests.
  1580. ForceSendFields []string `json:"-"`
  1581. // NullFields is a list of field names (e.g. "AccountId") to include in
  1582. // API requests with the JSON null value. By default, fields with empty
  1583. // values are omitted from API requests. However, any field with an
  1584. // empty value appearing in NullFields will be sent to the server as
  1585. // null. It is an error if a field in this list has a non-empty value.
  1586. // This may be used to include null fields in Patch requests.
  1587. NullFields []string `json:"-"`
  1588. }
  1589. func (s *Advertiser) MarshalJSON() ([]byte, error) {
  1590. type NoMethod Advertiser
  1591. raw := NoMethod(*s)
  1592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1593. }
  1594. // AdvertiserGroup: Groups advertisers together so that reports can be
  1595. // generated for the entire group at once.
  1596. type AdvertiserGroup struct {
  1597. // AccountId: Account ID of this advertiser group. This is a read-only
  1598. // field that can be left blank.
  1599. AccountId int64 `json:"accountId,omitempty,string"`
  1600. // Id: ID of this advertiser group. This is a read-only, auto-generated
  1601. // field.
  1602. Id int64 `json:"id,omitempty,string"`
  1603. // Kind: Identifies what kind of resource this is. Value: the fixed
  1604. // string "dfareporting#advertiserGroup".
  1605. Kind string `json:"kind,omitempty"`
  1606. // Name: Name of this advertiser group. This is a required field and
  1607. // must be less than 256 characters long and unique among advertiser
  1608. // groups of the same account.
  1609. Name string `json:"name,omitempty"`
  1610. // ServerResponse contains the HTTP response code and headers from the
  1611. // server.
  1612. googleapi.ServerResponse `json:"-"`
  1613. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1614. // unconditionally include in API requests. By default, fields with
  1615. // empty values are omitted from API requests. However, any non-pointer,
  1616. // non-interface field appearing in ForceSendFields will be sent to the
  1617. // server regardless of whether the field is empty or not. This may be
  1618. // used to include empty fields in Patch requests.
  1619. ForceSendFields []string `json:"-"`
  1620. // NullFields is a list of field names (e.g. "AccountId") to include in
  1621. // API requests with the JSON null value. By default, fields with empty
  1622. // values are omitted from API requests. However, any field with an
  1623. // empty value appearing in NullFields will be sent to the server as
  1624. // null. It is an error if a field in this list has a non-empty value.
  1625. // This may be used to include null fields in Patch requests.
  1626. NullFields []string `json:"-"`
  1627. }
  1628. func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) {
  1629. type NoMethod AdvertiserGroup
  1630. raw := NoMethod(*s)
  1631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1632. }
  1633. // AdvertiserGroupsListResponse: Advertiser Group List Response
  1634. type AdvertiserGroupsListResponse struct {
  1635. // AdvertiserGroups: Advertiser group collection.
  1636. AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"`
  1637. // Kind: Identifies what kind of resource this is. Value: the fixed
  1638. // string "dfareporting#advertiserGroupsListResponse".
  1639. Kind string `json:"kind,omitempty"`
  1640. // NextPageToken: Pagination token to be used for the next list
  1641. // operation.
  1642. NextPageToken string `json:"nextPageToken,omitempty"`
  1643. // ServerResponse contains the HTTP response code and headers from the
  1644. // server.
  1645. googleapi.ServerResponse `json:"-"`
  1646. // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to
  1647. // unconditionally include in API requests. By default, fields with
  1648. // empty values are omitted from API requests. However, any non-pointer,
  1649. // non-interface field appearing in ForceSendFields will be sent to the
  1650. // server regardless of whether the field is empty or not. This may be
  1651. // used to include empty fields in Patch requests.
  1652. ForceSendFields []string `json:"-"`
  1653. // NullFields is a list of field names (e.g. "AdvertiserGroups") to
  1654. // include in API requests with the JSON null value. By default, fields
  1655. // with empty values are omitted from API requests. However, any field
  1656. // with an empty value appearing in NullFields will be sent to the
  1657. // server as null. It is an error if a field in this list has a
  1658. // non-empty value. This may be used to include null fields in Patch
  1659. // requests.
  1660. NullFields []string `json:"-"`
  1661. }
  1662. func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) {
  1663. type NoMethod AdvertiserGroupsListResponse
  1664. raw := NoMethod(*s)
  1665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1666. }
  1667. // AdvertiserLandingPagesListResponse: Landing Page List Response
  1668. type AdvertiserLandingPagesListResponse struct {
  1669. // Kind: Identifies what kind of resource this is. Value: the fixed
  1670. // string "dfareporting#advertiserLandingPagesListResponse".
  1671. Kind string `json:"kind,omitempty"`
  1672. // LandingPages: Landing page collection
  1673. LandingPages []*LandingPage `json:"landingPages,omitempty"`
  1674. // NextPageToken: Pagination token to be used for the next list
  1675. // operation.
  1676. NextPageToken string `json:"nextPageToken,omitempty"`
  1677. // ServerResponse contains the HTTP response code and headers from the
  1678. // server.
  1679. googleapi.ServerResponse `json:"-"`
  1680. // ForceSendFields is a list of field names (e.g. "Kind") to
  1681. // unconditionally include in API requests. By default, fields with
  1682. // empty values are omitted from API requests. However, any non-pointer,
  1683. // non-interface field appearing in ForceSendFields will be sent to the
  1684. // server regardless of whether the field is empty or not. This may be
  1685. // used to include empty fields in Patch requests.
  1686. ForceSendFields []string `json:"-"`
  1687. // NullFields is a list of field names (e.g. "Kind") to include in API
  1688. // requests with the JSON null value. By default, fields with empty
  1689. // values are omitted from API requests. However, any field with an
  1690. // empty value appearing in NullFields will be sent to the server as
  1691. // null. It is an error if a field in this list has a non-empty value.
  1692. // This may be used to include null fields in Patch requests.
  1693. NullFields []string `json:"-"`
  1694. }
  1695. func (s *AdvertiserLandingPagesListResponse) MarshalJSON() ([]byte, error) {
  1696. type NoMethod AdvertiserLandingPagesListResponse
  1697. raw := NoMethod(*s)
  1698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1699. }
  1700. // AdvertisersListResponse: Advertiser List Response
  1701. type AdvertisersListResponse struct {
  1702. // Advertisers: Advertiser collection.
  1703. Advertisers []*Advertiser `json:"advertisers,omitempty"`
  1704. // Kind: Identifies what kind of resource this is. Value: the fixed
  1705. // string "dfareporting#advertisersListResponse".
  1706. Kind string `json:"kind,omitempty"`
  1707. // NextPageToken: Pagination token to be used for the next list
  1708. // operation.
  1709. NextPageToken string `json:"nextPageToken,omitempty"`
  1710. // ServerResponse contains the HTTP response code and headers from the
  1711. // server.
  1712. googleapi.ServerResponse `json:"-"`
  1713. // ForceSendFields is a list of field names (e.g. "Advertisers") to
  1714. // unconditionally include in API requests. By default, fields with
  1715. // empty values are omitted from API requests. However, any non-pointer,
  1716. // non-interface field appearing in ForceSendFields will be sent to the
  1717. // server regardless of whether the field is empty or not. This may be
  1718. // used to include empty fields in Patch requests.
  1719. ForceSendFields []string `json:"-"`
  1720. // NullFields is a list of field names (e.g. "Advertisers") to include
  1721. // in API requests with the JSON null value. By default, fields with
  1722. // empty values are omitted from API requests. However, any field with
  1723. // an empty value appearing in NullFields will be sent to the server as
  1724. // null. It is an error if a field in this list has a non-empty value.
  1725. // This may be used to include null fields in Patch requests.
  1726. NullFields []string `json:"-"`
  1727. }
  1728. func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) {
  1729. type NoMethod AdvertisersListResponse
  1730. raw := NoMethod(*s)
  1731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1732. }
  1733. // AudienceSegment: Audience Segment.
  1734. type AudienceSegment struct {
  1735. // Allocation: Weight allocated to this segment. The weight assigned
  1736. // will be understood in proportion to the weights assigned to other
  1737. // segments in the same segment group. Acceptable values are 1 to 1000,
  1738. // inclusive.
  1739. Allocation int64 `json:"allocation,omitempty"`
  1740. // Id: ID of this audience segment. This is a read-only, auto-generated
  1741. // field.
  1742. Id int64 `json:"id,omitempty,string"`
  1743. // Name: Name of this audience segment. This is a required field and
  1744. // must be less than 65 characters long.
  1745. Name string `json:"name,omitempty"`
  1746. // ForceSendFields is a list of field names (e.g. "Allocation") 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. "Allocation") to include in
  1754. // API requests with the JSON null value. By default, fields with empty
  1755. // values are omitted from API requests. However, any field with an
  1756. // empty value appearing in NullFields will be sent to the server as
  1757. // null. It is an error if a field in this list has a non-empty value.
  1758. // This may be used to include null fields in Patch requests.
  1759. NullFields []string `json:"-"`
  1760. }
  1761. func (s *AudienceSegment) MarshalJSON() ([]byte, error) {
  1762. type NoMethod AudienceSegment
  1763. raw := NoMethod(*s)
  1764. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1765. }
  1766. // AudienceSegmentGroup: Audience Segment Group.
  1767. type AudienceSegmentGroup struct {
  1768. // AudienceSegments: Audience segments assigned to this group. The
  1769. // number of segments must be between 2 and 100.
  1770. AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"`
  1771. // Id: ID of this audience segment group. This is a read-only,
  1772. // auto-generated field.
  1773. Id int64 `json:"id,omitempty,string"`
  1774. // Name: Name of this audience segment group. This is a required field
  1775. // and must be less than 65 characters long.
  1776. Name string `json:"name,omitempty"`
  1777. // ForceSendFields is a list of field names (e.g. "AudienceSegments") 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. "AudienceSegments") to
  1785. // include in API requests with the JSON null value. By default, fields
  1786. // with empty values are omitted from API requests. However, any field
  1787. // with an empty value appearing in NullFields will be sent to the
  1788. // server as null. It is an error if a field in this list has a
  1789. // non-empty value. This may be used to include null fields in Patch
  1790. // requests.
  1791. NullFields []string `json:"-"`
  1792. }
  1793. func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) {
  1794. type NoMethod AudienceSegmentGroup
  1795. raw := NoMethod(*s)
  1796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1797. }
  1798. // Browser: Contains information about a browser that can be targeted by
  1799. // ads.
  1800. type Browser struct {
  1801. // BrowserVersionId: ID referring to this grouping of browser and
  1802. // version numbers. This is the ID used for targeting.
  1803. BrowserVersionId int64 `json:"browserVersionId,omitempty,string"`
  1804. // DartId: DART ID of this browser. This is the ID used when generating
  1805. // reports.
  1806. DartId int64 `json:"dartId,omitempty,string"`
  1807. // Kind: Identifies what kind of resource this is. Value: the fixed
  1808. // string "dfareporting#browser".
  1809. Kind string `json:"kind,omitempty"`
  1810. // MajorVersion: Major version number (leftmost number) of this browser.
  1811. // For example, for Chrome 5.0.376.86 beta, this field should be set to
  1812. // 5. An asterisk (*) may be used to target any version number, and a
  1813. // question mark (?) may be used to target cases where the version
  1814. // number cannot be identified. For example, Chrome *.* targets any
  1815. // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1816. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1817. // server knows the browser is Firefox but can't tell which version it
  1818. // is.
  1819. MajorVersion string `json:"majorVersion,omitempty"`
  1820. // MinorVersion: Minor version number (number after first dot on left)
  1821. // of this browser. For example, for Chrome 5.0.375.86 beta, this field
  1822. // should be set to 0. An asterisk (*) may be used to target any version
  1823. // number, and a question mark (?) may be used to target cases where the
  1824. // version number cannot be identified. For example, Chrome *.* targets
  1825. // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1826. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1827. // server knows the browser is Firefox but can't tell which version it
  1828. // is.
  1829. MinorVersion string `json:"minorVersion,omitempty"`
  1830. // Name: Name of this browser.
  1831. Name string `json:"name,omitempty"`
  1832. // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to
  1833. // unconditionally include in API requests. By default, fields with
  1834. // empty values are omitted from API requests. However, any non-pointer,
  1835. // non-interface field appearing in ForceSendFields will be sent to the
  1836. // server regardless of whether the field is empty or not. This may be
  1837. // used to include empty fields in Patch requests.
  1838. ForceSendFields []string `json:"-"`
  1839. // NullFields is a list of field names (e.g. "BrowserVersionId") to
  1840. // include in API requests with the JSON null value. By default, fields
  1841. // with empty values are omitted from API requests. However, any field
  1842. // with an empty value appearing in NullFields will be sent to the
  1843. // server as null. It is an error if a field in this list has a
  1844. // non-empty value. This may be used to include null fields in Patch
  1845. // requests.
  1846. NullFields []string `json:"-"`
  1847. }
  1848. func (s *Browser) MarshalJSON() ([]byte, error) {
  1849. type NoMethod Browser
  1850. raw := NoMethod(*s)
  1851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1852. }
  1853. // BrowsersListResponse: Browser List Response
  1854. type BrowsersListResponse struct {
  1855. // Browsers: Browser collection.
  1856. Browsers []*Browser `json:"browsers,omitempty"`
  1857. // Kind: Identifies what kind of resource this is. Value: the fixed
  1858. // string "dfareporting#browsersListResponse".
  1859. Kind string `json:"kind,omitempty"`
  1860. // ServerResponse contains the HTTP response code and headers from the
  1861. // server.
  1862. googleapi.ServerResponse `json:"-"`
  1863. // ForceSendFields is a list of field names (e.g. "Browsers") to
  1864. // unconditionally include in API requests. By default, fields with
  1865. // empty values are omitted from API requests. However, any non-pointer,
  1866. // non-interface field appearing in ForceSendFields will be sent to the
  1867. // server regardless of whether the field is empty or not. This may be
  1868. // used to include empty fields in Patch requests.
  1869. ForceSendFields []string `json:"-"`
  1870. // NullFields is a list of field names (e.g. "Browsers") to include in
  1871. // API requests with the JSON null value. By default, fields with empty
  1872. // values are omitted from API requests. However, any field with an
  1873. // empty value appearing in NullFields will be sent to the server as
  1874. // null. It is an error if a field in this list has a non-empty value.
  1875. // This may be used to include null fields in Patch requests.
  1876. NullFields []string `json:"-"`
  1877. }
  1878. func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) {
  1879. type NoMethod BrowsersListResponse
  1880. raw := NoMethod(*s)
  1881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1882. }
  1883. // Campaign: Contains properties of a DCM campaign.
  1884. type Campaign struct {
  1885. // AccountId: Account ID of this campaign. This is a read-only field
  1886. // that can be left blank.
  1887. AccountId int64 `json:"accountId,omitempty,string"`
  1888. // AdBlockingConfiguration: Ad blocking settings for this campaign.
  1889. AdBlockingConfiguration *AdBlockingConfiguration `json:"adBlockingConfiguration,omitempty"`
  1890. // AdditionalCreativeOptimizationConfigurations: Additional creative
  1891. // optimization configurations for the campaign.
  1892. AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"`
  1893. // AdvertiserGroupId: Advertiser group ID of the associated advertiser.
  1894. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1895. // AdvertiserId: Advertiser ID of this campaign. This is a required
  1896. // field.
  1897. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1898. // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of
  1899. // this campaign. This is a read-only, auto-generated field.
  1900. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1901. // Archived: Whether this campaign has been archived.
  1902. Archived bool `json:"archived,omitempty"`
  1903. // AudienceSegmentGroups: Audience segment groups assigned to this
  1904. // campaign. Cannot have more than 300 segment groups.
  1905. AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"`
  1906. // BillingInvoiceCode: Billing invoice code included in the DCM client
  1907. // billing invoices associated with the campaign.
  1908. BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"`
  1909. // ClickThroughUrlSuffixProperties: Click-through URL suffix override
  1910. // properties for this campaign.
  1911. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1912. // Comment: Arbitrary comments about this campaign. Must be less than
  1913. // 256 characters long.
  1914. Comment string `json:"comment,omitempty"`
  1915. // CreateInfo: Information about the creation of this campaign. This is
  1916. // a read-only field.
  1917. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1918. // CreativeGroupIds: List of creative group IDs that are assigned to the
  1919. // campaign.
  1920. CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"`
  1921. // CreativeOptimizationConfiguration: Creative optimization
  1922. // configuration for the campaign.
  1923. CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"`
  1924. // DefaultClickThroughEventTagProperties: Click-through event tag ID
  1925. // override properties for this campaign.
  1926. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1927. // DefaultLandingPageId: The default landing page ID for this campaign.
  1928. DefaultLandingPageId int64 `json:"defaultLandingPageId,omitempty,string"`
  1929. // EndDate: Date on which the campaign will stop running. On insert, the
  1930. // end date must be today or a future date. The end date must be later
  1931. // than or be the same as the start date. If, for example, you set
  1932. // 6/25/2015 as both the start and end dates, the effective campaign run
  1933. // date is just that day only, 6/25/2015. The hours, minutes, and
  1934. // seconds of the end date should not be set, as doing so will result in
  1935. // an error. This is a required field.
  1936. EndDate string `json:"endDate,omitempty"`
  1937. // EventTagOverrides: Overrides that can be used to activate or
  1938. // deactivate advertiser event tags.
  1939. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1940. // ExternalId: External ID for this campaign.
  1941. ExternalId string `json:"externalId,omitempty"`
  1942. // Id: ID of this campaign. This is a read-only auto-generated field.
  1943. Id int64 `json:"id,omitempty,string"`
  1944. // IdDimensionValue: Dimension value for the ID of this campaign. This
  1945. // is a read-only, auto-generated field.
  1946. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1947. // Kind: Identifies what kind of resource this is. Value: the fixed
  1948. // string "dfareporting#campaign".
  1949. Kind string `json:"kind,omitempty"`
  1950. // LastModifiedInfo: Information about the most recent modification of
  1951. // this campaign. This is a read-only field.
  1952. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1953. // LookbackConfiguration: Lookback window settings for the campaign.
  1954. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  1955. // Name: Name of this campaign. This is a required field and must be
  1956. // less than 256 characters long and unique among campaigns of the same
  1957. // advertiser.
  1958. Name string `json:"name,omitempty"`
  1959. // NielsenOcrEnabled: Whether Nielsen reports are enabled for this
  1960. // campaign.
  1961. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  1962. // StartDate: Date on which the campaign starts running. The start date
  1963. // can be any date. The hours, minutes, and seconds of the start date
  1964. // should not be set, as doing so will result in an error. This is a
  1965. // required field.
  1966. StartDate string `json:"startDate,omitempty"`
  1967. // SubaccountId: Subaccount ID of this campaign. This is a read-only
  1968. // field that can be left blank.
  1969. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1970. // TraffickerEmails: Campaign trafficker contact emails.
  1971. TraffickerEmails []string `json:"traffickerEmails,omitempty"`
  1972. // ServerResponse contains the HTTP response code and headers from the
  1973. // server.
  1974. googleapi.ServerResponse `json:"-"`
  1975. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1976. // unconditionally include in API requests. By default, fields with
  1977. // empty values are omitted from API requests. However, any non-pointer,
  1978. // non-interface field appearing in ForceSendFields will be sent to the
  1979. // server regardless of whether the field is empty or not. This may be
  1980. // used to include empty fields in Patch requests.
  1981. ForceSendFields []string `json:"-"`
  1982. // NullFields is a list of field names (e.g. "AccountId") to include in
  1983. // API requests with the JSON null value. By default, fields with empty
  1984. // values are omitted from API requests. However, any field with an
  1985. // empty value appearing in NullFields will be sent to the server as
  1986. // null. It is an error if a field in this list has a non-empty value.
  1987. // This may be used to include null fields in Patch requests.
  1988. NullFields []string `json:"-"`
  1989. }
  1990. func (s *Campaign) MarshalJSON() ([]byte, error) {
  1991. type NoMethod Campaign
  1992. raw := NoMethod(*s)
  1993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1994. }
  1995. // CampaignCreativeAssociation: Identifies a creative which has been
  1996. // associated with a given campaign.
  1997. type CampaignCreativeAssociation struct {
  1998. // CreativeId: ID of the creative associated with the campaign. This is
  1999. // a required field.
  2000. CreativeId int64 `json:"creativeId,omitempty,string"`
  2001. // Kind: Identifies what kind of resource this is. Value: the fixed
  2002. // string "dfareporting#campaignCreativeAssociation".
  2003. Kind string `json:"kind,omitempty"`
  2004. // ServerResponse contains the HTTP response code and headers from the
  2005. // server.
  2006. googleapi.ServerResponse `json:"-"`
  2007. // ForceSendFields is a list of field names (e.g. "CreativeId") to
  2008. // unconditionally include in API requests. By default, fields with
  2009. // empty values are omitted from API requests. However, any non-pointer,
  2010. // non-interface field appearing in ForceSendFields will be sent to the
  2011. // server regardless of whether the field is empty or not. This may be
  2012. // used to include empty fields in Patch requests.
  2013. ForceSendFields []string `json:"-"`
  2014. // NullFields is a list of field names (e.g. "CreativeId") to include in
  2015. // API requests with the JSON null value. By default, fields with empty
  2016. // values are omitted from API requests. However, any field with an
  2017. // empty value appearing in NullFields will be sent to the server as
  2018. // null. It is an error if a field in this list has a non-empty value.
  2019. // This may be used to include null fields in Patch requests.
  2020. NullFields []string `json:"-"`
  2021. }
  2022. func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) {
  2023. type NoMethod CampaignCreativeAssociation
  2024. raw := NoMethod(*s)
  2025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2026. }
  2027. // CampaignCreativeAssociationsListResponse: Campaign Creative
  2028. // Association List Response
  2029. type CampaignCreativeAssociationsListResponse struct {
  2030. // CampaignCreativeAssociations: Campaign creative association
  2031. // collection
  2032. CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"`
  2033. // Kind: Identifies what kind of resource this is. Value: the fixed
  2034. // string "dfareporting#campaignCreativeAssociationsListResponse".
  2035. Kind string `json:"kind,omitempty"`
  2036. // NextPageToken: Pagination token to be used for the next list
  2037. // operation.
  2038. NextPageToken string `json:"nextPageToken,omitempty"`
  2039. // ServerResponse contains the HTTP response code and headers from the
  2040. // server.
  2041. googleapi.ServerResponse `json:"-"`
  2042. // ForceSendFields is a list of field names (e.g.
  2043. // "CampaignCreativeAssociations") to unconditionally include in API
  2044. // requests. By default, fields with empty values are omitted from API
  2045. // requests. However, any non-pointer, non-interface field appearing in
  2046. // ForceSendFields will be sent to the server regardless of whether the
  2047. // field is empty or not. This may be used to include empty fields in
  2048. // Patch requests.
  2049. ForceSendFields []string `json:"-"`
  2050. // NullFields is a list of field names (e.g.
  2051. // "CampaignCreativeAssociations") to include in API requests with the
  2052. // JSON null value. By default, fields with empty values are omitted
  2053. // from API requests. However, any field with an empty value appearing
  2054. // in NullFields will be sent to the server as null. It is an error if a
  2055. // field in this list has a non-empty value. This may be used to include
  2056. // null fields in Patch requests.
  2057. NullFields []string `json:"-"`
  2058. }
  2059. func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) {
  2060. type NoMethod CampaignCreativeAssociationsListResponse
  2061. raw := NoMethod(*s)
  2062. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2063. }
  2064. // CampaignsListResponse: Campaign List Response
  2065. type CampaignsListResponse struct {
  2066. // Campaigns: Campaign collection.
  2067. Campaigns []*Campaign `json:"campaigns,omitempty"`
  2068. // Kind: Identifies what kind of resource this is. Value: the fixed
  2069. // string "dfareporting#campaignsListResponse".
  2070. Kind string `json:"kind,omitempty"`
  2071. // NextPageToken: Pagination token to be used for the next list
  2072. // operation.
  2073. NextPageToken string `json:"nextPageToken,omitempty"`
  2074. // ServerResponse contains the HTTP response code and headers from the
  2075. // server.
  2076. googleapi.ServerResponse `json:"-"`
  2077. // ForceSendFields is a list of field names (e.g. "Campaigns") to
  2078. // unconditionally include in API requests. By default, fields with
  2079. // empty values are omitted from API requests. However, any non-pointer,
  2080. // non-interface field appearing in ForceSendFields will be sent to the
  2081. // server regardless of whether the field is empty or not. This may be
  2082. // used to include empty fields in Patch requests.
  2083. ForceSendFields []string `json:"-"`
  2084. // NullFields is a list of field names (e.g. "Campaigns") to include in
  2085. // API requests with the JSON null value. By default, fields with empty
  2086. // values are omitted from API requests. However, any field with an
  2087. // empty value appearing in NullFields will be sent to the server as
  2088. // null. It is an error if a field in this list has a non-empty value.
  2089. // This may be used to include null fields in Patch requests.
  2090. NullFields []string `json:"-"`
  2091. }
  2092. func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) {
  2093. type NoMethod CampaignsListResponse
  2094. raw := NoMethod(*s)
  2095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2096. }
  2097. // ChangeLog: Describes a change that a user has made to a resource.
  2098. type ChangeLog struct {
  2099. // AccountId: Account ID of the modified object.
  2100. AccountId int64 `json:"accountId,omitempty,string"`
  2101. // Action: Action which caused the change.
  2102. Action string `json:"action,omitempty"`
  2103. // ChangeTime: Time when the object was modified.
  2104. ChangeTime string `json:"changeTime,omitempty"`
  2105. // FieldName: Field name of the object which changed.
  2106. FieldName string `json:"fieldName,omitempty"`
  2107. // Id: ID of this change log.
  2108. Id int64 `json:"id,omitempty,string"`
  2109. // Kind: Identifies what kind of resource this is. Value: the fixed
  2110. // string "dfareporting#changeLog".
  2111. Kind string `json:"kind,omitempty"`
  2112. // NewValue: New value of the object field.
  2113. NewValue string `json:"newValue,omitempty"`
  2114. // ObjectId: ID of the object of this change log. The object could be a
  2115. // campaign, placement, ad, or other type.
  2116. ObjectId int64 `json:"objectId,omitempty,string"`
  2117. // ObjectType: Object type of the change log.
  2118. ObjectType string `json:"objectType,omitempty"`
  2119. // OldValue: Old value of the object field.
  2120. OldValue string `json:"oldValue,omitempty"`
  2121. // SubaccountId: Subaccount ID of the modified object.
  2122. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2123. // TransactionId: Transaction ID of this change log. When a single API
  2124. // call results in many changes, each change will have a separate ID in
  2125. // the change log but will share the same transactionId.
  2126. TransactionId int64 `json:"transactionId,omitempty,string"`
  2127. // UserProfileId: ID of the user who modified the object.
  2128. UserProfileId int64 `json:"userProfileId,omitempty,string"`
  2129. // UserProfileName: User profile name of the user who modified the
  2130. // object.
  2131. UserProfileName string `json:"userProfileName,omitempty"`
  2132. // ServerResponse contains the HTTP response code and headers from the
  2133. // server.
  2134. googleapi.ServerResponse `json:"-"`
  2135. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2136. // unconditionally include in API requests. By default, fields with
  2137. // empty values are omitted from API requests. However, any non-pointer,
  2138. // non-interface field appearing in ForceSendFields will be sent to the
  2139. // server regardless of whether the field is empty or not. This may be
  2140. // used to include empty fields in Patch requests.
  2141. ForceSendFields []string `json:"-"`
  2142. // NullFields is a list of field names (e.g. "AccountId") to include in
  2143. // API requests with the JSON null value. By default, fields with empty
  2144. // values are omitted from API requests. However, any field with an
  2145. // empty value appearing in NullFields will be sent to the server as
  2146. // null. It is an error if a field in this list has a non-empty value.
  2147. // This may be used to include null fields in Patch requests.
  2148. NullFields []string `json:"-"`
  2149. }
  2150. func (s *ChangeLog) MarshalJSON() ([]byte, error) {
  2151. type NoMethod ChangeLog
  2152. raw := NoMethod(*s)
  2153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2154. }
  2155. // ChangeLogsListResponse: Change Log List Response
  2156. type ChangeLogsListResponse struct {
  2157. // ChangeLogs: Change log collection.
  2158. ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"`
  2159. // Kind: Identifies what kind of resource this is. Value: the fixed
  2160. // string "dfareporting#changeLogsListResponse".
  2161. Kind string `json:"kind,omitempty"`
  2162. // NextPageToken: Pagination token to be used for the next list
  2163. // operation.
  2164. NextPageToken string `json:"nextPageToken,omitempty"`
  2165. // ServerResponse contains the HTTP response code and headers from the
  2166. // server.
  2167. googleapi.ServerResponse `json:"-"`
  2168. // ForceSendFields is a list of field names (e.g. "ChangeLogs") to
  2169. // unconditionally include in API requests. By default, fields with
  2170. // empty values are omitted from API requests. However, any non-pointer,
  2171. // non-interface field appearing in ForceSendFields will be sent to the
  2172. // server regardless of whether the field is empty or not. This may be
  2173. // used to include empty fields in Patch requests.
  2174. ForceSendFields []string `json:"-"`
  2175. // NullFields is a list of field names (e.g. "ChangeLogs") to include in
  2176. // API requests with the JSON null value. By default, fields with empty
  2177. // values are omitted from API requests. However, any field with an
  2178. // empty value appearing in NullFields will be sent to the server as
  2179. // null. It is an error if a field in this list has a non-empty value.
  2180. // This may be used to include null fields in Patch requests.
  2181. NullFields []string `json:"-"`
  2182. }
  2183. func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) {
  2184. type NoMethod ChangeLogsListResponse
  2185. raw := NoMethod(*s)
  2186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2187. }
  2188. // CitiesListResponse: City List Response
  2189. type CitiesListResponse struct {
  2190. // Cities: City collection.
  2191. Cities []*City `json:"cities,omitempty"`
  2192. // Kind: Identifies what kind of resource this is. Value: the fixed
  2193. // string "dfareporting#citiesListResponse".
  2194. Kind string `json:"kind,omitempty"`
  2195. // ServerResponse contains the HTTP response code and headers from the
  2196. // server.
  2197. googleapi.ServerResponse `json:"-"`
  2198. // ForceSendFields is a list of field names (e.g. "Cities") to
  2199. // unconditionally include in API requests. By default, fields with
  2200. // empty values are omitted from API requests. However, any non-pointer,
  2201. // non-interface field appearing in ForceSendFields will be sent to the
  2202. // server regardless of whether the field is empty or not. This may be
  2203. // used to include empty fields in Patch requests.
  2204. ForceSendFields []string `json:"-"`
  2205. // NullFields is a list of field names (e.g. "Cities") to include in API
  2206. // requests with the JSON null value. By default, fields with empty
  2207. // values are omitted from API requests. However, any field with an
  2208. // empty value appearing in NullFields will be sent to the server as
  2209. // null. It is an error if a field in this list has a non-empty value.
  2210. // This may be used to include null fields in Patch requests.
  2211. NullFields []string `json:"-"`
  2212. }
  2213. func (s *CitiesListResponse) MarshalJSON() ([]byte, error) {
  2214. type NoMethod CitiesListResponse
  2215. raw := NoMethod(*s)
  2216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2217. }
  2218. // City: Contains information about a city that can be targeted by ads.
  2219. type City struct {
  2220. // CountryCode: Country code of the country to which this city belongs.
  2221. CountryCode string `json:"countryCode,omitempty"`
  2222. // CountryDartId: DART ID of the country to which this city belongs.
  2223. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  2224. // DartId: DART ID of this city. This is the ID used for targeting and
  2225. // generating reports.
  2226. DartId int64 `json:"dartId,omitempty,string"`
  2227. // Kind: Identifies what kind of resource this is. Value: the fixed
  2228. // string "dfareporting#city".
  2229. Kind string `json:"kind,omitempty"`
  2230. // MetroCode: Metro region code of the metro region (DMA) to which this
  2231. // city belongs.
  2232. MetroCode string `json:"metroCode,omitempty"`
  2233. // MetroDmaId: ID of the metro region (DMA) to which this city belongs.
  2234. MetroDmaId int64 `json:"metroDmaId,omitempty,string"`
  2235. // Name: Name of this city.
  2236. Name string `json:"name,omitempty"`
  2237. // RegionCode: Region code of the region to which this city belongs.
  2238. RegionCode string `json:"regionCode,omitempty"`
  2239. // RegionDartId: DART ID of the region to which this city belongs.
  2240. RegionDartId int64 `json:"regionDartId,omitempty,string"`
  2241. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2242. // unconditionally include in API requests. By default, fields with
  2243. // empty values are omitted from API requests. However, any non-pointer,
  2244. // non-interface field appearing in ForceSendFields will be sent to the
  2245. // server regardless of whether the field is empty or not. This may be
  2246. // used to include empty fields in Patch requests.
  2247. ForceSendFields []string `json:"-"`
  2248. // NullFields is a list of field names (e.g. "CountryCode") to include
  2249. // in API requests with the JSON null value. By default, fields with
  2250. // empty values are omitted from API requests. However, any field with
  2251. // an empty value appearing in NullFields will be sent to the server as
  2252. // null. It is an error if a field in this list has a non-empty value.
  2253. // This may be used to include null fields in Patch requests.
  2254. NullFields []string `json:"-"`
  2255. }
  2256. func (s *City) MarshalJSON() ([]byte, error) {
  2257. type NoMethod City
  2258. raw := NoMethod(*s)
  2259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2260. }
  2261. // ClickTag: Creative Click Tag.
  2262. type ClickTag struct {
  2263. // ClickThroughUrl: Parameter value for the specified click tag. This
  2264. // field contains a click-through url.
  2265. ClickThroughUrl *CreativeClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2266. // EventName: Advertiser event name associated with the click tag. This
  2267. // field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives.
  2268. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2269. EventName string `json:"eventName,omitempty"`
  2270. // Name: Parameter name for the specified click tag. For
  2271. // DISPLAY_IMAGE_GALLERY creative assets, this field must match the
  2272. // value of the creative asset's creativeAssetId.name field.
  2273. Name string `json:"name,omitempty"`
  2274. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2275. // unconditionally include in API requests. By default, fields with
  2276. // empty values are omitted from API requests. However, any non-pointer,
  2277. // non-interface field appearing in ForceSendFields will be sent to the
  2278. // server regardless of whether the field is empty or not. This may be
  2279. // used to include empty fields in Patch requests.
  2280. ForceSendFields []string `json:"-"`
  2281. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2282. // include in API requests with the JSON null value. By default, fields
  2283. // with empty values are omitted from API requests. However, any field
  2284. // with an empty value appearing in NullFields will be sent to the
  2285. // server as null. It is an error if a field in this list has a
  2286. // non-empty value. This may be used to include null fields in Patch
  2287. // requests.
  2288. NullFields []string `json:"-"`
  2289. }
  2290. func (s *ClickTag) MarshalJSON() ([]byte, error) {
  2291. type NoMethod ClickTag
  2292. raw := NoMethod(*s)
  2293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2294. }
  2295. // ClickThroughUrl: Click-through URL
  2296. type ClickThroughUrl struct {
  2297. // ComputedClickThroughUrl: Read-only convenience field representing the
  2298. // actual URL that will be used for this click-through. The URL is
  2299. // computed as follows:
  2300. // - If defaultLandingPage is enabled then the campaign's default
  2301. // landing page URL is assigned to this field.
  2302. // - If defaultLandingPage is not enabled and a landingPageId is
  2303. // specified then that landing page's URL is assigned to this field.
  2304. // - If neither of the above cases apply, then the customClickThroughUrl
  2305. // is assigned to this field.
  2306. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  2307. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  2308. // defaultLandingPage field is set to false and the landingPageId field
  2309. // is left unset.
  2310. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  2311. // DefaultLandingPage: Whether the campaign default landing page is
  2312. // used.
  2313. DefaultLandingPage bool `json:"defaultLandingPage,omitempty"`
  2314. // LandingPageId: ID of the landing page for the click-through URL.
  2315. // Applicable if the defaultLandingPage field is set to false.
  2316. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  2317. // ForceSendFields is a list of field names (e.g.
  2318. // "ComputedClickThroughUrl") to unconditionally include in API
  2319. // requests. By default, fields with empty values are omitted from API
  2320. // requests. However, any non-pointer, non-interface field appearing in
  2321. // ForceSendFields will be sent to the server regardless of whether the
  2322. // field is empty or not. This may be used to include empty fields in
  2323. // Patch requests.
  2324. ForceSendFields []string `json:"-"`
  2325. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  2326. // to include in API requests with the JSON null value. By default,
  2327. // fields with empty values are omitted from API requests. However, any
  2328. // field with an empty value appearing in NullFields will be sent to the
  2329. // server as null. It is an error if a field in this list has a
  2330. // non-empty value. This may be used to include null fields in Patch
  2331. // requests.
  2332. NullFields []string `json:"-"`
  2333. }
  2334. func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) {
  2335. type NoMethod ClickThroughUrl
  2336. raw := NoMethod(*s)
  2337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2338. }
  2339. // ClickThroughUrlSuffixProperties: Click Through URL Suffix settings.
  2340. type ClickThroughUrlSuffixProperties struct {
  2341. // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads
  2342. // in this entity's scope. Must be less than 128 characters long.
  2343. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  2344. // OverrideInheritedSuffix: Whether this entity should override the
  2345. // inherited click-through URL suffix with its own defined value.
  2346. OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"`
  2347. // ForceSendFields is a list of field names (e.g.
  2348. // "ClickThroughUrlSuffix") to unconditionally include in API requests.
  2349. // By default, fields with empty values are omitted from API requests.
  2350. // However, any non-pointer, non-interface field appearing in
  2351. // ForceSendFields will be sent to the server regardless of whether the
  2352. // field is empty or not. This may be used to include empty fields in
  2353. // Patch requests.
  2354. ForceSendFields []string `json:"-"`
  2355. // NullFields is a list of field names (e.g. "ClickThroughUrlSuffix") to
  2356. // include in API requests with the JSON null value. By default, fields
  2357. // with empty values are omitted from API requests. However, any field
  2358. // with an empty value appearing in NullFields will be sent to the
  2359. // server as null. It is an error if a field in this list has a
  2360. // non-empty value. This may be used to include null fields in Patch
  2361. // requests.
  2362. NullFields []string `json:"-"`
  2363. }
  2364. func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) {
  2365. type NoMethod ClickThroughUrlSuffixProperties
  2366. raw := NoMethod(*s)
  2367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2368. }
  2369. // CompanionClickThroughOverride: Companion Click-through override.
  2370. type CompanionClickThroughOverride struct {
  2371. // ClickThroughUrl: Click-through URL of this companion click-through
  2372. // override.
  2373. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2374. // CreativeId: ID of the creative for this companion click-through
  2375. // override.
  2376. CreativeId int64 `json:"creativeId,omitempty,string"`
  2377. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2378. // unconditionally include in API requests. By default, fields with
  2379. // empty values are omitted from API requests. However, any non-pointer,
  2380. // non-interface field appearing in ForceSendFields will be sent to the
  2381. // server regardless of whether the field is empty or not. This may be
  2382. // used to include empty fields in Patch requests.
  2383. ForceSendFields []string `json:"-"`
  2384. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2385. // include in API requests with the JSON null value. By default, fields
  2386. // with empty values are omitted from API requests. However, any field
  2387. // with an empty value appearing in NullFields will be sent to the
  2388. // server as null. It is an error if a field in this list has a
  2389. // non-empty value. This may be used to include null fields in Patch
  2390. // requests.
  2391. NullFields []string `json:"-"`
  2392. }
  2393. func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) {
  2394. type NoMethod CompanionClickThroughOverride
  2395. raw := NoMethod(*s)
  2396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2397. }
  2398. // CompanionSetting: Companion Settings
  2399. type CompanionSetting struct {
  2400. // CompanionsDisabled: Whether companions are disabled for this
  2401. // placement.
  2402. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  2403. // EnabledSizes: Whitelist of companion sizes to be served to this
  2404. // placement. Set this list to null or empty to serve all companion
  2405. // sizes.
  2406. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  2407. // ImageOnly: Whether to serve only static images as companions.
  2408. ImageOnly bool `json:"imageOnly,omitempty"`
  2409. // Kind: Identifies what kind of resource this is. Value: the fixed
  2410. // string "dfareporting#companionSetting".
  2411. Kind string `json:"kind,omitempty"`
  2412. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  2413. // to unconditionally include in API requests. By default, fields with
  2414. // empty values are omitted from API requests. However, any non-pointer,
  2415. // non-interface field appearing in ForceSendFields will be sent to the
  2416. // server regardless of whether the field is empty or not. This may be
  2417. // used to include empty fields in Patch requests.
  2418. ForceSendFields []string `json:"-"`
  2419. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  2420. // include in API requests with the JSON null value. By default, fields
  2421. // with empty values are omitted from API requests. However, any field
  2422. // with an empty value appearing in NullFields will be sent to the
  2423. // server as null. It is an error if a field in this list has a
  2424. // non-empty value. This may be used to include null fields in Patch
  2425. // requests.
  2426. NullFields []string `json:"-"`
  2427. }
  2428. func (s *CompanionSetting) MarshalJSON() ([]byte, error) {
  2429. type NoMethod CompanionSetting
  2430. raw := NoMethod(*s)
  2431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2432. }
  2433. // CompatibleFields: Represents a response to the queryCompatibleFields
  2434. // method.
  2435. type CompatibleFields struct {
  2436. // CrossDimensionReachReportCompatibleFields: Contains items that are
  2437. // compatible to be selected for a report of type
  2438. // "CROSS_DIMENSION_REACH".
  2439. CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"`
  2440. // FloodlightReportCompatibleFields: Contains items that are compatible
  2441. // to be selected for a report of type "FLOODLIGHT".
  2442. FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"`
  2443. // Kind: The kind of resource this is, in this case
  2444. // dfareporting#compatibleFields.
  2445. Kind string `json:"kind,omitempty"`
  2446. // PathToConversionReportCompatibleFields: Contains items that are
  2447. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  2448. PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"`
  2449. // ReachReportCompatibleFields: Contains items that are compatible to be
  2450. // selected for a report of type "REACH".
  2451. ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"`
  2452. // ReportCompatibleFields: Contains items that are compatible to be
  2453. // selected for a report of type "STANDARD".
  2454. ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"`
  2455. // ServerResponse contains the HTTP response code and headers from the
  2456. // server.
  2457. googleapi.ServerResponse `json:"-"`
  2458. // ForceSendFields is a list of field names (e.g.
  2459. // "CrossDimensionReachReportCompatibleFields") to unconditionally
  2460. // include in API requests. By default, fields with empty values are
  2461. // omitted from API requests. However, any non-pointer, non-interface
  2462. // field appearing in ForceSendFields will be sent to the server
  2463. // regardless of whether the field is empty or not. This may be used to
  2464. // include empty fields in Patch requests.
  2465. ForceSendFields []string `json:"-"`
  2466. // NullFields is a list of field names (e.g.
  2467. // "CrossDimensionReachReportCompatibleFields") to include in API
  2468. // requests with the JSON null value. By default, fields with empty
  2469. // values are omitted from API requests. However, any field with an
  2470. // empty value appearing in NullFields will be sent to the server as
  2471. // null. It is an error if a field in this list has a non-empty value.
  2472. // This may be used to include null fields in Patch requests.
  2473. NullFields []string `json:"-"`
  2474. }
  2475. func (s *CompatibleFields) MarshalJSON() ([]byte, error) {
  2476. type NoMethod CompatibleFields
  2477. raw := NoMethod(*s)
  2478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2479. }
  2480. // ConnectionType: Contains information about an internet connection
  2481. // type that can be targeted by ads. Clients can use the connection type
  2482. // to target mobile vs. broadband users.
  2483. type ConnectionType struct {
  2484. // Id: ID of this connection type.
  2485. Id int64 `json:"id,omitempty,string"`
  2486. // Kind: Identifies what kind of resource this is. Value: the fixed
  2487. // string "dfareporting#connectionType".
  2488. Kind string `json:"kind,omitempty"`
  2489. // Name: Name of this connection type.
  2490. Name string `json:"name,omitempty"`
  2491. // ServerResponse contains the HTTP response code and headers from the
  2492. // server.
  2493. googleapi.ServerResponse `json:"-"`
  2494. // ForceSendFields is a list of field names (e.g. "Id") to
  2495. // unconditionally include in API requests. By default, fields with
  2496. // empty values are omitted from API requests. However, any non-pointer,
  2497. // non-interface field appearing in ForceSendFields will be sent to the
  2498. // server regardless of whether the field is empty or not. This may be
  2499. // used to include empty fields in Patch requests.
  2500. ForceSendFields []string `json:"-"`
  2501. // NullFields is a list of field names (e.g. "Id") to include in API
  2502. // requests with the JSON null value. By default, fields with empty
  2503. // values are omitted from API requests. However, any field with an
  2504. // empty value appearing in NullFields will be sent to the server as
  2505. // null. It is an error if a field in this list has a non-empty value.
  2506. // This may be used to include null fields in Patch requests.
  2507. NullFields []string `json:"-"`
  2508. }
  2509. func (s *ConnectionType) MarshalJSON() ([]byte, error) {
  2510. type NoMethod ConnectionType
  2511. raw := NoMethod(*s)
  2512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2513. }
  2514. // ConnectionTypesListResponse: Connection Type List Response
  2515. type ConnectionTypesListResponse struct {
  2516. // ConnectionTypes: Collection of connection types such as broadband and
  2517. // mobile.
  2518. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  2519. // Kind: Identifies what kind of resource this is. Value: the fixed
  2520. // string "dfareporting#connectionTypesListResponse".
  2521. Kind string `json:"kind,omitempty"`
  2522. // ServerResponse contains the HTTP response code and headers from the
  2523. // server.
  2524. googleapi.ServerResponse `json:"-"`
  2525. // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to
  2526. // unconditionally include in API requests. By default, fields with
  2527. // empty values are omitted from API requests. However, any non-pointer,
  2528. // non-interface field appearing in ForceSendFields will be sent to the
  2529. // server regardless of whether the field is empty or not. This may be
  2530. // used to include empty fields in Patch requests.
  2531. ForceSendFields []string `json:"-"`
  2532. // NullFields is a list of field names (e.g. "ConnectionTypes") to
  2533. // include in API requests with the JSON null value. By default, fields
  2534. // with empty values are omitted from API requests. However, any field
  2535. // with an empty value appearing in NullFields will be sent to the
  2536. // server as null. It is an error if a field in this list has a
  2537. // non-empty value. This may be used to include null fields in Patch
  2538. // requests.
  2539. NullFields []string `json:"-"`
  2540. }
  2541. func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) {
  2542. type NoMethod ConnectionTypesListResponse
  2543. raw := NoMethod(*s)
  2544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2545. }
  2546. // ContentCategoriesListResponse: Content Category List Response
  2547. type ContentCategoriesListResponse struct {
  2548. // ContentCategories: Content category collection.
  2549. ContentCategories []*ContentCategory `json:"contentCategories,omitempty"`
  2550. // Kind: Identifies what kind of resource this is. Value: the fixed
  2551. // string "dfareporting#contentCategoriesListResponse".
  2552. Kind string `json:"kind,omitempty"`
  2553. // NextPageToken: Pagination token to be used for the next list
  2554. // operation.
  2555. NextPageToken string `json:"nextPageToken,omitempty"`
  2556. // ServerResponse contains the HTTP response code and headers from the
  2557. // server.
  2558. googleapi.ServerResponse `json:"-"`
  2559. // ForceSendFields is a list of field names (e.g. "ContentCategories")
  2560. // to unconditionally include in API requests. By default, fields with
  2561. // empty values are omitted from API requests. However, any non-pointer,
  2562. // non-interface field appearing in ForceSendFields will be sent to the
  2563. // server regardless of whether the field is empty or not. This may be
  2564. // used to include empty fields in Patch requests.
  2565. ForceSendFields []string `json:"-"`
  2566. // NullFields is a list of field names (e.g. "ContentCategories") to
  2567. // include in API requests with the JSON null value. By default, fields
  2568. // with empty values are omitted from API requests. However, any field
  2569. // with an empty value appearing in NullFields will be sent to the
  2570. // server as null. It is an error if a field in this list has a
  2571. // non-empty value. This may be used to include null fields in Patch
  2572. // requests.
  2573. NullFields []string `json:"-"`
  2574. }
  2575. func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) {
  2576. type NoMethod ContentCategoriesListResponse
  2577. raw := NoMethod(*s)
  2578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2579. }
  2580. // ContentCategory: Organizes placements according to the contents of
  2581. // their associated webpages.
  2582. type ContentCategory struct {
  2583. // AccountId: Account ID of this content category. This is a read-only
  2584. // field that can be left blank.
  2585. AccountId int64 `json:"accountId,omitempty,string"`
  2586. // Id: ID of this content category. This is a read-only, auto-generated
  2587. // field.
  2588. Id int64 `json:"id,omitempty,string"`
  2589. // Kind: Identifies what kind of resource this is. Value: the fixed
  2590. // string "dfareporting#contentCategory".
  2591. Kind string `json:"kind,omitempty"`
  2592. // Name: Name of this content category. This is a required field and
  2593. // must be less than 256 characters long and unique among content
  2594. // categories of the same account.
  2595. Name string `json:"name,omitempty"`
  2596. // ServerResponse contains the HTTP response code and headers from the
  2597. // server.
  2598. googleapi.ServerResponse `json:"-"`
  2599. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2600. // unconditionally include in API requests. By default, fields with
  2601. // empty values are omitted from API requests. However, any non-pointer,
  2602. // non-interface field appearing in ForceSendFields will be sent to the
  2603. // server regardless of whether the field is empty or not. This may be
  2604. // used to include empty fields in Patch requests.
  2605. ForceSendFields []string `json:"-"`
  2606. // NullFields is a list of field names (e.g. "AccountId") to include in
  2607. // API requests with the JSON null value. By default, fields with empty
  2608. // values are omitted from API requests. However, any field with an
  2609. // empty value appearing in NullFields will be sent to the server as
  2610. // null. It is an error if a field in this list has a non-empty value.
  2611. // This may be used to include null fields in Patch requests.
  2612. NullFields []string `json:"-"`
  2613. }
  2614. func (s *ContentCategory) MarshalJSON() ([]byte, error) {
  2615. type NoMethod ContentCategory
  2616. raw := NoMethod(*s)
  2617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2618. }
  2619. // Conversion: A Conversion represents when a user successfully performs
  2620. // a desired action after seeing an ad.
  2621. type Conversion struct {
  2622. // ChildDirectedTreatment: Whether the conversion was directed toward
  2623. // children.
  2624. ChildDirectedTreatment bool `json:"childDirectedTreatment,omitempty"`
  2625. // CustomVariables: Custom floodlight variables.
  2626. CustomVariables []*CustomFloodlightVariable `json:"customVariables,omitempty"`
  2627. // EncryptedUserId: The alphanumeric encrypted user ID. When set,
  2628. // encryptionInfo should also be specified. This field is mutually
  2629. // exclusive with encryptedUserIdCandidates[], mobileDeviceId and gclid.
  2630. // This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a
  2631. // required field.
  2632. EncryptedUserId string `json:"encryptedUserId,omitempty"`
  2633. // EncryptedUserIdCandidates: A list of the alphanumeric encrypted user
  2634. // IDs. Any user ID with exposure prior to the conversion timestamp will
  2635. // be used in the inserted conversion. If no such user ID is found then
  2636. // the conversion will be rejected with NO_COOKIE_MATCH_FOUND error.
  2637. // When set, encryptionInfo should also be specified. This field may
  2638. // only be used when calling batchinsert; it is not supported by
  2639. // batchupdate. This field is mutually exclusive with encryptedUserId,
  2640. // mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId
  2641. // or gclid is a required field.
  2642. EncryptedUserIdCandidates []string `json:"encryptedUserIdCandidates,omitempty"`
  2643. // FloodlightActivityId: Floodlight Activity ID of this conversion. This
  2644. // is a required field.
  2645. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  2646. // FloodlightConfigurationId: Floodlight Configuration ID of this
  2647. // conversion. This is a required field.
  2648. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  2649. // Gclid: The Google click ID. This field is mutually exclusive with
  2650. // encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This
  2651. // or encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId
  2652. // is a required field.
  2653. Gclid string `json:"gclid,omitempty"`
  2654. // Kind: Identifies what kind of resource this is. Value: the fixed
  2655. // string "dfareporting#conversion".
  2656. Kind string `json:"kind,omitempty"`
  2657. // LimitAdTracking: Whether Limit Ad Tracking is enabled. When set to
  2658. // true, the conversion will be used for reporting but not targeting.
  2659. // This will prevent remarketing.
  2660. LimitAdTracking bool `json:"limitAdTracking,omitempty"`
  2661. // MobileDeviceId: The mobile device ID. This field is mutually
  2662. // exclusive with encryptedUserId, encryptedUserIdCandidates[] and
  2663. // gclid. This or encryptedUserId or encryptedUserIdCandidates[] or
  2664. // gclid is a required field.
  2665. MobileDeviceId string `json:"mobileDeviceId,omitempty"`
  2666. // Ordinal: The ordinal of the conversion. Use this field to control how
  2667. // conversions of the same user and day are de-duplicated. This is a
  2668. // required field.
  2669. Ordinal string `json:"ordinal,omitempty"`
  2670. // Quantity: The quantity of the conversion.
  2671. Quantity int64 `json:"quantity,omitempty,string"`
  2672. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2673. // This is a required field.
  2674. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2675. // Value: The value of the conversion.
  2676. Value float64 `json:"value,omitempty"`
  2677. // ForceSendFields is a list of field names (e.g.
  2678. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2679. // By default, fields with empty values are omitted from API requests.
  2680. // However, any non-pointer, non-interface field appearing in
  2681. // ForceSendFields will be sent to the server regardless of whether the
  2682. // field is empty or not. This may be used to include empty fields in
  2683. // Patch requests.
  2684. ForceSendFields []string `json:"-"`
  2685. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2686. // to include in API requests with the JSON null value. By default,
  2687. // fields with empty values are omitted from API requests. However, any
  2688. // field with an empty value appearing in NullFields will be sent to the
  2689. // server as null. It is an error if a field in this list has a
  2690. // non-empty value. This may be used to include null fields in Patch
  2691. // requests.
  2692. NullFields []string `json:"-"`
  2693. }
  2694. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2695. type NoMethod Conversion
  2696. raw := NoMethod(*s)
  2697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2698. }
  2699. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2700. type NoMethod Conversion
  2701. var s1 struct {
  2702. Value gensupport.JSONFloat64 `json:"value"`
  2703. *NoMethod
  2704. }
  2705. s1.NoMethod = (*NoMethod)(s)
  2706. if err := json.Unmarshal(data, &s1); err != nil {
  2707. return err
  2708. }
  2709. s.Value = float64(s1.Value)
  2710. return nil
  2711. }
  2712. // ConversionError: The error code and description for a conversion that
  2713. // failed to insert or update.
  2714. type ConversionError struct {
  2715. // Code: The error code.
  2716. //
  2717. // Possible values:
  2718. // "INTERNAL"
  2719. // "INVALID_ARGUMENT"
  2720. // "NOT_FOUND"
  2721. // "PERMISSION_DENIED"
  2722. Code string `json:"code,omitempty"`
  2723. // Kind: Identifies what kind of resource this is. Value: the fixed
  2724. // string "dfareporting#conversionError".
  2725. Kind string `json:"kind,omitempty"`
  2726. // Message: A description of the error.
  2727. Message string `json:"message,omitempty"`
  2728. // ForceSendFields is a list of field names (e.g. "Code") to
  2729. // unconditionally include in API requests. By default, fields with
  2730. // empty values are omitted from API requests. However, any non-pointer,
  2731. // non-interface field appearing in ForceSendFields will be sent to the
  2732. // server regardless of whether the field is empty or not. This may be
  2733. // used to include empty fields in Patch requests.
  2734. ForceSendFields []string `json:"-"`
  2735. // NullFields is a list of field names (e.g. "Code") to include in API
  2736. // requests with the JSON null value. By default, fields with empty
  2737. // values are omitted from API requests. However, any field with an
  2738. // empty value appearing in NullFields will be sent to the server as
  2739. // null. It is an error if a field in this list has a non-empty value.
  2740. // This may be used to include null fields in Patch requests.
  2741. NullFields []string `json:"-"`
  2742. }
  2743. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2744. type NoMethod ConversionError
  2745. raw := NoMethod(*s)
  2746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2747. }
  2748. // ConversionStatus: The original conversion that was inserted or
  2749. // updated and whether there were any errors.
  2750. type ConversionStatus struct {
  2751. // Conversion: The original conversion that was inserted or updated.
  2752. Conversion *Conversion `json:"conversion,omitempty"`
  2753. // Errors: A list of errors related to this conversion.
  2754. Errors []*ConversionError `json:"errors,omitempty"`
  2755. // Kind: Identifies what kind of resource this is. Value: the fixed
  2756. // string "dfareporting#conversionStatus".
  2757. Kind string `json:"kind,omitempty"`
  2758. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2759. // unconditionally include in API requests. By default, fields with
  2760. // empty values are omitted from API requests. However, any non-pointer,
  2761. // non-interface field appearing in ForceSendFields will be sent to the
  2762. // server regardless of whether the field is empty or not. This may be
  2763. // used to include empty fields in Patch requests.
  2764. ForceSendFields []string `json:"-"`
  2765. // NullFields is a list of field names (e.g. "Conversion") to include in
  2766. // API requests with the JSON null value. By default, fields with empty
  2767. // values are omitted from API requests. However, any field with an
  2768. // empty value appearing in NullFields will be sent to the server as
  2769. // null. It is an error if a field in this list has a non-empty value.
  2770. // This may be used to include null fields in Patch requests.
  2771. NullFields []string `json:"-"`
  2772. }
  2773. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2774. type NoMethod ConversionStatus
  2775. raw := NoMethod(*s)
  2776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2777. }
  2778. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2779. type ConversionsBatchInsertRequest struct {
  2780. // Conversions: The set of conversions to insert.
  2781. Conversions []*Conversion `json:"conversions,omitempty"`
  2782. // EncryptionInfo: Describes how encryptedUserId or
  2783. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2784. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2785. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2786. // Kind: Identifies what kind of resource this is. Value: the fixed
  2787. // string "dfareporting#conversionsBatchInsertRequest".
  2788. Kind string `json:"kind,omitempty"`
  2789. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2790. // unconditionally include in API requests. By default, fields with
  2791. // empty values are omitted from API requests. However, any non-pointer,
  2792. // non-interface field appearing in ForceSendFields will be sent to the
  2793. // server regardless of whether the field is empty or not. This may be
  2794. // used to include empty fields in Patch requests.
  2795. ForceSendFields []string `json:"-"`
  2796. // NullFields is a list of field names (e.g. "Conversions") to include
  2797. // in API requests with the JSON null value. By default, fields with
  2798. // empty values are omitted from API requests. However, any field with
  2799. // an empty value appearing in NullFields will be sent to the server as
  2800. // null. It is an error if a field in this list has a non-empty value.
  2801. // This may be used to include null fields in Patch requests.
  2802. NullFields []string `json:"-"`
  2803. }
  2804. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2805. type NoMethod ConversionsBatchInsertRequest
  2806. raw := NoMethod(*s)
  2807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2808. }
  2809. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2810. type ConversionsBatchInsertResponse struct {
  2811. // HasFailures: Indicates that some or all conversions failed to insert.
  2812. HasFailures bool `json:"hasFailures,omitempty"`
  2813. // Kind: Identifies what kind of resource this is. Value: the fixed
  2814. // string "dfareporting#conversionsBatchInsertResponse".
  2815. Kind string `json:"kind,omitempty"`
  2816. // Status: The insert status of each conversion. Statuses are returned
  2817. // in the same order that conversions are inserted.
  2818. Status []*ConversionStatus `json:"status,omitempty"`
  2819. // ServerResponse contains the HTTP response code and headers from the
  2820. // server.
  2821. googleapi.ServerResponse `json:"-"`
  2822. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2823. // unconditionally include in API requests. By default, fields with
  2824. // empty values are omitted from API requests. However, any non-pointer,
  2825. // non-interface field appearing in ForceSendFields will be sent to the
  2826. // server regardless of whether the field is empty or not. This may be
  2827. // used to include empty fields in Patch requests.
  2828. ForceSendFields []string `json:"-"`
  2829. // NullFields is a list of field names (e.g. "HasFailures") to include
  2830. // in API requests with the JSON null value. By default, fields with
  2831. // empty values are omitted from API requests. However, any field with
  2832. // an empty value appearing in NullFields will be sent to the server as
  2833. // null. It is an error if a field in this list has a non-empty value.
  2834. // This may be used to include null fields in Patch requests.
  2835. NullFields []string `json:"-"`
  2836. }
  2837. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2838. type NoMethod ConversionsBatchInsertResponse
  2839. raw := NoMethod(*s)
  2840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2841. }
  2842. // ConversionsBatchUpdateRequest: Update Conversions Request.
  2843. type ConversionsBatchUpdateRequest struct {
  2844. // Conversions: The set of conversions to update.
  2845. Conversions []*Conversion `json:"conversions,omitempty"`
  2846. // EncryptionInfo: Describes how encryptedUserId is encrypted. This is a
  2847. // required field if encryptedUserId is used.
  2848. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2849. // Kind: Identifies what kind of resource this is. Value: the fixed
  2850. // string "dfareporting#conversionsBatchUpdateRequest".
  2851. Kind string `json:"kind,omitempty"`
  2852. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2853. // unconditionally include in API requests. By default, fields with
  2854. // empty values are omitted from API requests. However, any non-pointer,
  2855. // non-interface field appearing in ForceSendFields will be sent to the
  2856. // server regardless of whether the field is empty or not. This may be
  2857. // used to include empty fields in Patch requests.
  2858. ForceSendFields []string `json:"-"`
  2859. // NullFields is a list of field names (e.g. "Conversions") to include
  2860. // in API requests with the JSON null value. By default, fields with
  2861. // empty values are omitted from API requests. However, any field with
  2862. // an empty value appearing in NullFields will be sent to the server as
  2863. // null. It is an error if a field in this list has a non-empty value.
  2864. // This may be used to include null fields in Patch requests.
  2865. NullFields []string `json:"-"`
  2866. }
  2867. func (s *ConversionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  2868. type NoMethod ConversionsBatchUpdateRequest
  2869. raw := NoMethod(*s)
  2870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2871. }
  2872. // ConversionsBatchUpdateResponse: Update Conversions Response.
  2873. type ConversionsBatchUpdateResponse struct {
  2874. // HasFailures: Indicates that some or all conversions failed to update.
  2875. HasFailures bool `json:"hasFailures,omitempty"`
  2876. // Kind: Identifies what kind of resource this is. Value: the fixed
  2877. // string "dfareporting#conversionsBatchUpdateResponse".
  2878. Kind string `json:"kind,omitempty"`
  2879. // Status: The update status of each conversion. Statuses are returned
  2880. // in the same order that conversions are updated.
  2881. Status []*ConversionStatus `json:"status,omitempty"`
  2882. // ServerResponse contains the HTTP response code and headers from the
  2883. // server.
  2884. googleapi.ServerResponse `json:"-"`
  2885. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2886. // unconditionally include in API requests. By default, fields with
  2887. // empty values are omitted from API requests. However, any non-pointer,
  2888. // non-interface field appearing in ForceSendFields will be sent to the
  2889. // server regardless of whether the field is empty or not. This may be
  2890. // used to include empty fields in Patch requests.
  2891. ForceSendFields []string `json:"-"`
  2892. // NullFields is a list of field names (e.g. "HasFailures") to include
  2893. // in API requests with the JSON null value. By default, fields with
  2894. // empty values are omitted from API requests. However, any field with
  2895. // an empty value appearing in NullFields will be sent to the server as
  2896. // null. It is an error if a field in this list has a non-empty value.
  2897. // This may be used to include null fields in Patch requests.
  2898. NullFields []string `json:"-"`
  2899. }
  2900. func (s *ConversionsBatchUpdateResponse) MarshalJSON() ([]byte, error) {
  2901. type NoMethod ConversionsBatchUpdateResponse
  2902. raw := NoMethod(*s)
  2903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2904. }
  2905. // CountriesListResponse: Country List Response
  2906. type CountriesListResponse struct {
  2907. // Countries: Country collection.
  2908. Countries []*Country `json:"countries,omitempty"`
  2909. // Kind: Identifies what kind of resource this is. Value: the fixed
  2910. // string "dfareporting#countriesListResponse".
  2911. Kind string `json:"kind,omitempty"`
  2912. // ServerResponse contains the HTTP response code and headers from the
  2913. // server.
  2914. googleapi.ServerResponse `json:"-"`
  2915. // ForceSendFields is a list of field names (e.g. "Countries") to
  2916. // unconditionally include in API requests. By default, fields with
  2917. // empty values are omitted from API requests. However, any non-pointer,
  2918. // non-interface field appearing in ForceSendFields will be sent to the
  2919. // server regardless of whether the field is empty or not. This may be
  2920. // used to include empty fields in Patch requests.
  2921. ForceSendFields []string `json:"-"`
  2922. // NullFields is a list of field names (e.g. "Countries") to include in
  2923. // API requests with the JSON null value. By default, fields with empty
  2924. // values are omitted from API requests. However, any field with an
  2925. // empty value appearing in NullFields will be sent to the server as
  2926. // null. It is an error if a field in this list has a non-empty value.
  2927. // This may be used to include null fields in Patch requests.
  2928. NullFields []string `json:"-"`
  2929. }
  2930. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2931. type NoMethod CountriesListResponse
  2932. raw := NoMethod(*s)
  2933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2934. }
  2935. // Country: Contains information about a country that can be targeted by
  2936. // ads.
  2937. type Country struct {
  2938. // CountryCode: Country code.
  2939. CountryCode string `json:"countryCode,omitempty"`
  2940. // DartId: DART ID of this country. This is the ID used for targeting
  2941. // and generating reports.
  2942. DartId int64 `json:"dartId,omitempty,string"`
  2943. // Kind: Identifies what kind of resource this is. Value: the fixed
  2944. // string "dfareporting#country".
  2945. Kind string `json:"kind,omitempty"`
  2946. // Name: Name of this country.
  2947. Name string `json:"name,omitempty"`
  2948. // SslEnabled: Whether ad serving supports secure servers in this
  2949. // country.
  2950. SslEnabled bool `json:"sslEnabled,omitempty"`
  2951. // ServerResponse contains the HTTP response code and headers from the
  2952. // server.
  2953. googleapi.ServerResponse `json:"-"`
  2954. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2955. // unconditionally include in API requests. By default, fields with
  2956. // empty values are omitted from API requests. However, any non-pointer,
  2957. // non-interface field appearing in ForceSendFields will be sent to the
  2958. // server regardless of whether the field is empty or not. This may be
  2959. // used to include empty fields in Patch requests.
  2960. ForceSendFields []string `json:"-"`
  2961. // NullFields is a list of field names (e.g. "CountryCode") to include
  2962. // in API requests with the JSON null value. By default, fields with
  2963. // empty values are omitted from API requests. However, any field with
  2964. // an empty value appearing in NullFields will be sent to the server as
  2965. // null. It is an error if a field in this list has a non-empty value.
  2966. // This may be used to include null fields in Patch requests.
  2967. NullFields []string `json:"-"`
  2968. }
  2969. func (s *Country) MarshalJSON() ([]byte, error) {
  2970. type NoMethod Country
  2971. raw := NoMethod(*s)
  2972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2973. }
  2974. // Creative: Contains properties of a Creative.
  2975. type Creative struct {
  2976. // AccountId: Account ID of this creative. This field, if left unset,
  2977. // will be auto-generated for both insert and update operations.
  2978. // Applicable to all creative types.
  2979. AccountId int64 `json:"accountId,omitempty,string"`
  2980. // Active: Whether the creative is active. Applicable to all creative
  2981. // types.
  2982. Active bool `json:"active,omitempty"`
  2983. // AdParameters: Ad parameters user for VPAID creative. This is a
  2984. // read-only field. Applicable to the following creative types: all
  2985. // VPAID.
  2986. AdParameters string `json:"adParameters,omitempty"`
  2987. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  2988. // customize the creative settings of a Rich Media ad running on your
  2989. // site without having to contact the advertiser. You can use keywords
  2990. // to dynamically change the look or functionality of a creative.
  2991. // Applicable to the following creative types: all RICH_MEDIA, and all
  2992. // VPAID.
  2993. AdTagKeys []string `json:"adTagKeys,omitempty"`
  2994. // AdvertiserId: Advertiser ID of this creative. This is a required
  2995. // field. Applicable to all creative types.
  2996. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  2997. // AllowScriptAccess: Whether script access is allowed for this
  2998. // creative. This is a read-only and deprecated field which will
  2999. // automatically be set to true on update. Applicable to the following
  3000. // creative types: FLASH_INPAGE.
  3001. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  3002. // Archived: Whether the creative is archived. Applicable to all
  3003. // creative types.
  3004. Archived bool `json:"archived,omitempty"`
  3005. // ArtworkType: Type of artwork used for the creative. This is a
  3006. // read-only field. Applicable to the following creative types: all
  3007. // RICH_MEDIA, and all VPAID.
  3008. //
  3009. // Possible values:
  3010. // "ARTWORK_TYPE_FLASH"
  3011. // "ARTWORK_TYPE_HTML5"
  3012. // "ARTWORK_TYPE_IMAGE"
  3013. // "ARTWORK_TYPE_MIXED"
  3014. ArtworkType string `json:"artworkType,omitempty"`
  3015. // AuthoringSource: Source application where creative was authored.
  3016. // Presently, only DBM authored creatives will have this field set.
  3017. // Applicable to all creative types.
  3018. //
  3019. // Possible values:
  3020. // "CREATIVE_AUTHORING_SOURCE_DBM"
  3021. // "CREATIVE_AUTHORING_SOURCE_DCM"
  3022. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  3023. AuthoringSource string `json:"authoringSource,omitempty"`
  3024. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  3025. // read-only field. Applicable to the following creative types:
  3026. // HTML5_BANNER.
  3027. //
  3028. // Possible values:
  3029. // "NINJA"
  3030. // "SWIFFY"
  3031. AuthoringTool string `json:"authoringTool,omitempty"`
  3032. // AutoAdvanceImages: Whether images are automatically advanced for
  3033. // image gallery creatives. Applicable to the following creative types:
  3034. // DISPLAY_IMAGE_GALLERY.
  3035. AutoAdvanceImages bool `json:"autoAdvanceImages,omitempty"`
  3036. // BackgroundColor: The 6-character HTML color code, beginning with #,
  3037. // for the background of the window area where the Flash file is
  3038. // displayed. Default is white. Applicable to the following creative
  3039. // types: FLASH_INPAGE.
  3040. BackgroundColor string `json:"backgroundColor,omitempty"`
  3041. // BackupImageClickThroughUrl: Click-through URL for backup image.
  3042. // Applicable to ENHANCED_BANNER when the primary asset type is not
  3043. // HTML_IMAGE.
  3044. BackupImageClickThroughUrl *CreativeClickThroughUrl `json:"backupImageClickThroughUrl,omitempty"`
  3045. // BackupImageFeatures: List of feature dependencies that will cause a
  3046. // backup image to be served if the browser that serves the ad does not
  3047. // support them. Feature dependencies are features that a browser must
  3048. // be able to support in order to render your HTML5 creative asset
  3049. // correctly. This field is initially auto-generated to contain all
  3050. // features detected by DCM for all the assets of this creative and can
  3051. // then be modified by the client. To reset this field, copy over all
  3052. // the creativeAssets' detected features. Applicable to the following
  3053. // creative types: HTML5_BANNER. Applicable to DISPLAY when the primary
  3054. // asset type is not HTML_IMAGE.
  3055. //
  3056. // Possible values:
  3057. // "APPLICATION_CACHE"
  3058. // "AUDIO"
  3059. // "CANVAS"
  3060. // "CANVAS_TEXT"
  3061. // "CSS_ANIMATIONS"
  3062. // "CSS_BACKGROUND_SIZE"
  3063. // "CSS_BORDER_IMAGE"
  3064. // "CSS_BORDER_RADIUS"
  3065. // "CSS_BOX_SHADOW"
  3066. // "CSS_COLUMNS"
  3067. // "CSS_FLEX_BOX"
  3068. // "CSS_FONT_FACE"
  3069. // "CSS_GENERATED_CONTENT"
  3070. // "CSS_GRADIENTS"
  3071. // "CSS_HSLA"
  3072. // "CSS_MULTIPLE_BGS"
  3073. // "CSS_OPACITY"
  3074. // "CSS_REFLECTIONS"
  3075. // "CSS_RGBA"
  3076. // "CSS_TEXT_SHADOW"
  3077. // "CSS_TRANSFORMS"
  3078. // "CSS_TRANSFORMS3D"
  3079. // "CSS_TRANSITIONS"
  3080. // "DRAG_AND_DROP"
  3081. // "GEO_LOCATION"
  3082. // "HASH_CHANGE"
  3083. // "HISTORY"
  3084. // "INDEXED_DB"
  3085. // "INLINE_SVG"
  3086. // "INPUT_ATTR_AUTOCOMPLETE"
  3087. // "INPUT_ATTR_AUTOFOCUS"
  3088. // "INPUT_ATTR_LIST"
  3089. // "INPUT_ATTR_MAX"
  3090. // "INPUT_ATTR_MIN"
  3091. // "INPUT_ATTR_MULTIPLE"
  3092. // "INPUT_ATTR_PATTERN"
  3093. // "INPUT_ATTR_PLACEHOLDER"
  3094. // "INPUT_ATTR_REQUIRED"
  3095. // "INPUT_ATTR_STEP"
  3096. // "INPUT_TYPE_COLOR"
  3097. // "INPUT_TYPE_DATE"
  3098. // "INPUT_TYPE_DATETIME"
  3099. // "INPUT_TYPE_DATETIME_LOCAL"
  3100. // "INPUT_TYPE_EMAIL"
  3101. // "INPUT_TYPE_MONTH"
  3102. // "INPUT_TYPE_NUMBER"
  3103. // "INPUT_TYPE_RANGE"
  3104. // "INPUT_TYPE_SEARCH"
  3105. // "INPUT_TYPE_TEL"
  3106. // "INPUT_TYPE_TIME"
  3107. // "INPUT_TYPE_URL"
  3108. // "INPUT_TYPE_WEEK"
  3109. // "LOCAL_STORAGE"
  3110. // "POST_MESSAGE"
  3111. // "SESSION_STORAGE"
  3112. // "SMIL"
  3113. // "SVG_CLIP_PATHS"
  3114. // "SVG_FE_IMAGE"
  3115. // "SVG_FILTERS"
  3116. // "SVG_HREF"
  3117. // "TOUCH"
  3118. // "VIDEO"
  3119. // "WEBGL"
  3120. // "WEB_SOCKETS"
  3121. // "WEB_SQL_DATABASE"
  3122. // "WEB_WORKERS"
  3123. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  3124. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  3125. // backup image. Applicable to the following creative types: DISPLAY
  3126. // when the primary asset type is not HTML_IMAGE.
  3127. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  3128. // BackupImageTargetWindow: Target window for backup image. Applicable
  3129. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  3130. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3131. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  3132. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  3133. // HTML5_BANNER creatives, this is a subset of detected click tags for
  3134. // the assets associated with this creative. After creating a flash
  3135. // asset, detected click tags will be returned in the
  3136. // creativeAssetMetadata. When inserting the creative, populate the
  3137. // creative clickTags field using the creativeAssetMetadata.clickTags
  3138. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  3139. // one entry in this list for each image creative asset. A click tag is
  3140. // matched with a corresponding creative asset by matching the
  3141. // clickTag.name field with the creativeAsset.assetIdentifier.name
  3142. // field. Applicable to the following creative types:
  3143. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  3144. // DISPLAY when the primary asset type is not HTML_IMAGE.
  3145. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3146. // CommercialId: Industry standard ID assigned to creative for reach and
  3147. // frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives.
  3148. CommercialId string `json:"commercialId,omitempty"`
  3149. // CompanionCreatives: List of companion creatives assigned to an
  3150. // in-Stream video creative. Acceptable values include IDs of existing
  3151. // flash and image creatives. Applicable to the following creative
  3152. // types: all VPAID, all INSTREAM_AUDIO and all INSTREAM_VIDEO with
  3153. // dynamicAssetSelection set to false.
  3154. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  3155. // Compatibility: Compatibilities associated with this creative. This is
  3156. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  3157. // rendering either on desktop or on mobile devices or in mobile apps
  3158. // for regular or interstitial ads, respectively. APP and
  3159. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3160. // creatives may have these compatibilities since new creatives will
  3161. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3162. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3163. // with the VAST standard. IN_STREAM_AUDIO refers to rendering in
  3164. // in-stream audio ads developed with the VAST standard. Applicable to
  3165. // all creative types.
  3166. //
  3167. // Acceptable values are:
  3168. // - "APP"
  3169. // - "APP_INTERSTITIAL"
  3170. // - "IN_STREAM_VIDEO"
  3171. // - "IN_STREAM_AUDIO"
  3172. // - "DISPLAY"
  3173. // - "DISPLAY_INTERSTITIAL"
  3174. //
  3175. // Possible values:
  3176. // "APP"
  3177. // "APP_INTERSTITIAL"
  3178. // "DISPLAY"
  3179. // "DISPLAY_INTERSTITIAL"
  3180. // "IN_STREAM_AUDIO"
  3181. // "IN_STREAM_VIDEO"
  3182. Compatibility []string `json:"compatibility,omitempty"`
  3183. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3184. // creative need to be automatically converted to HTML5. This flag is
  3185. // enabled by default and users can choose to disable it if they don't
  3186. // want the system to generate and use HTML5 asset for this creative.
  3187. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3188. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3189. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3190. // CounterCustomEvents: List of counter events configured for the
  3191. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3192. // and auto-generated from clickTags. Applicable to the following
  3193. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3194. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3195. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3196. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3197. // CreativeAssets: Assets associated with a creative. Applicable to all
  3198. // but the following creative types: INTERNAL_REDIRECT,
  3199. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3200. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3201. // CreativeFieldAssignments: Creative field assignments for this
  3202. // creative. Applicable to all creative types.
  3203. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3204. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3205. // Key-values let you customize the creative settings of a Rich Media ad
  3206. // running on your site without having to contact the advertiser. You
  3207. // can use key-values to dynamically change the look or functionality of
  3208. // a creative. Applicable to the following creative types: all
  3209. // RICH_MEDIA, and all VPAID.
  3210. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3211. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3212. // target individual assets in this creative. When set to true
  3213. // creativeAssetSelection must be set. This also controls asset-level
  3214. // companions. When this is true, companion creatives should be assigned
  3215. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3216. // creatives.
  3217. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3218. // ExitCustomEvents: List of exit events configured for the creative.
  3219. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3220. // and auto-generated from clickTags, For DISPLAY, an event is also
  3221. // created from the backupImageReportingLabel. Applicable to the
  3222. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3223. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3224. // HTML_IMAGE.
  3225. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3226. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3227. // file communicate with either Flash Player or the program hosting
  3228. // Flash Player, such as a web browser. This is only triggered if
  3229. // allowScriptAccess field is true. Applicable to the following creative
  3230. // types: FLASH_INPAGE.
  3231. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3232. // HtmlCode: HTML code for the creative. This is a required field when
  3233. // applicable. This field is ignored if htmlCodeLocked is true.
  3234. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3235. // and HTML5_BANNER, and all RICH_MEDIA.
  3236. HtmlCode string `json:"htmlCode,omitempty"`
  3237. // HtmlCodeLocked: Whether HTML code is DCM-generated or manually
  3238. // entered. Set to true to ignore changes to htmlCode. Applicable to the
  3239. // following creative types: FLASH_INPAGE and HTML5_BANNER.
  3240. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3241. // Id: ID of this creative. This is a read-only, auto-generated field.
  3242. // Applicable to all creative types.
  3243. Id int64 `json:"id,omitempty,string"`
  3244. // IdDimensionValue: Dimension value for the ID of this creative. This
  3245. // is a read-only field. Applicable to all creative types.
  3246. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3247. // Kind: Identifies what kind of resource this is. Value: the fixed
  3248. // string "dfareporting#creative".
  3249. Kind string `json:"kind,omitempty"`
  3250. // LastModifiedInfo: Creative last modification information. This is a
  3251. // read-only field. Applicable to all creative types.
  3252. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3253. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3254. // associated with rich media and VPAID creatives. This is a read-only
  3255. // field. Applicable to the following creative types: all RICH_MEDIA,
  3256. // and all VPAID.
  3257. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3258. // MediaDescription: Description of the audio or video ad. Applicable to
  3259. // the following creative types: all INSTREAM_VIDEO, INSTREAM_AUDIO, and
  3260. // all VPAID.
  3261. MediaDescription string `json:"mediaDescription,omitempty"`
  3262. // MediaDuration: Creative audio or video duration in seconds. This is a
  3263. // read-only field. Applicable to the following creative types:
  3264. // INSTREAM_VIDEO, INSTREAM_AUDIO, all RICH_MEDIA, and all VPAID.
  3265. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3266. // Name: Name of the creative. This is a required field and must be less
  3267. // than 256 characters long. Applicable to all creative types.
  3268. Name string `json:"name,omitempty"`
  3269. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3270. // to the following creative types: all RICH_MEDIA.
  3271. OverrideCss string `json:"overrideCss,omitempty"`
  3272. // PoliteLoadAssetId: The asset ID of the polite load image asset.
  3273. // Applicable to the creative type: DISPLAY.
  3274. PoliteLoadAssetId int64 `json:"politeLoadAssetId,omitempty,string"`
  3275. // ProgressOffset: Amount of time to play the video before counting a
  3276. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3277. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3278. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3279. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3280. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3281. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3282. // This is a required field when applicable. Applicable to the following
  3283. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3284. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3285. RedirectUrl string `json:"redirectUrl,omitempty"`
  3286. // RenderingId: ID of current rendering version. This is a read-only
  3287. // field. Applicable to all creative types.
  3288. RenderingId int64 `json:"renderingId,omitempty,string"`
  3289. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3290. // this creative. This is a read-only field. Applicable to all creative
  3291. // types.
  3292. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3293. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3294. // for this creative. For example, 11.2.202.235. This is a read-only
  3295. // field. Applicable to the following creative types: all RICH_MEDIA,
  3296. // and all VPAID.
  3297. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3298. // RequiredFlashVersion: The internal Flash version for this creative as
  3299. // calculated by DoubleClick Studio. This is a read-only field.
  3300. // Applicable to the following creative types: FLASH_INPAGE all
  3301. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3302. // asset type is not HTML_IMAGE.
  3303. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3304. // Size: Size associated with this creative. When inserting or updating
  3305. // a creative either the size ID field or size width and height fields
  3306. // can be used. This is a required field when applicable; however for
  3307. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3308. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3309. // automatically set using the actual size of the associated image
  3310. // assets. Applicable to the following creative types: DISPLAY,
  3311. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3312. // RICH_MEDIA.
  3313. Size *Size `json:"size,omitempty"`
  3314. // SkipOffset: Amount of time to play the video before the skip button
  3315. // appears. Applicable to the following creative types: all
  3316. // INSTREAM_VIDEO.
  3317. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3318. // Skippable: Whether the user can choose to skip the creative.
  3319. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3320. // all VPAID.
  3321. Skippable bool `json:"skippable,omitempty"`
  3322. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3323. // read-only field. Applicable to all creative types.
  3324. SslCompliant bool `json:"sslCompliant,omitempty"`
  3325. // SslOverride: Whether creative should be treated as SSL compliant even
  3326. // if the system scan shows it's not. Applicable to all creative types.
  3327. SslOverride bool `json:"sslOverride,omitempty"`
  3328. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3329. // and VPAID creatives. This is a read-only field. Applicable to the
  3330. // following creative types: all RICH_MEDIA, and all VPAID.
  3331. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3332. // StudioCreativeId: Studio creative ID associated with rich media and
  3333. // VPAID creatives. This is a read-only field. Applicable to the
  3334. // following creative types: all RICH_MEDIA, and all VPAID.
  3335. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3336. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3337. // with rich media and VPAID creatives. This is a read-only field.
  3338. // Applicable to the following creative types: all RICH_MEDIA, and all
  3339. // VPAID.
  3340. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3341. // SubaccountId: Subaccount ID of this creative. This field, if left
  3342. // unset, will be auto-generated for both insert and update operations.
  3343. // Applicable to all creative types.
  3344. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3345. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3346. // backup image impressions. Applicable to the following creative types:
  3347. // all RICH_MEDIA.
  3348. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3349. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3350. // rich media impressions. Applicable to the following creative types:
  3351. // all RICH_MEDIA.
  3352. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3353. // ThirdPartyUrls: Third-party URLs for tracking in-stream creative
  3354. // events. Applicable to the following creative types: all
  3355. // INSTREAM_VIDEO, all INSTREAM_AUDIO, and all VPAID.
  3356. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3357. // TimerCustomEvents: List of timer events configured for the creative.
  3358. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3359. // auto-generated from clickTags. Applicable to the following creative
  3360. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3361. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3362. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3363. // TotalFileSize: Combined size of all creative assets. This is a
  3364. // read-only field. Applicable to the following creative types: all
  3365. // RICH_MEDIA, and all VPAID.
  3366. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3367. // Type: Type of this creative. This is a required field. Applicable to
  3368. // all creative types.
  3369. //
  3370. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3371. // existing creatives. New creatives should use DISPLAY as a replacement
  3372. // for these types.
  3373. //
  3374. // Possible values:
  3375. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3376. // "CUSTOM_DISPLAY"
  3377. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3378. // "DISPLAY"
  3379. // "DISPLAY_IMAGE_GALLERY"
  3380. // "DISPLAY_REDIRECT"
  3381. // "FLASH_INPAGE"
  3382. // "HTML5_BANNER"
  3383. // "IMAGE"
  3384. // "INSTREAM_AUDIO"
  3385. // "INSTREAM_VIDEO"
  3386. // "INSTREAM_VIDEO_REDIRECT"
  3387. // "INTERNAL_REDIRECT"
  3388. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3389. // "RICH_MEDIA_DISPLAY_BANNER"
  3390. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3391. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3392. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3393. // "RICH_MEDIA_IM_EXPAND"
  3394. // "RICH_MEDIA_INPAGE_FLOATING"
  3395. // "RICH_MEDIA_MOBILE_IN_APP"
  3396. // "RICH_MEDIA_PEEL_DOWN"
  3397. // "TRACKING_TEXT"
  3398. // "VPAID_LINEAR_VIDEO"
  3399. // "VPAID_NON_LINEAR_VIDEO"
  3400. Type string `json:"type,omitempty"`
  3401. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  3402. // to the following creative types: INSTREAM_AUDIO and INSTREAM_VIDEO
  3403. // and VPAID.
  3404. UniversalAdId *UniversalAdId `json:"universalAdId,omitempty"`
  3405. // Version: The version number helps you keep track of multiple versions
  3406. // of your creative in your reports. The version number will always be
  3407. // auto-generated during insert operations to start at 1. For tracking
  3408. // creatives the version cannot be incremented and will always remain at
  3409. // 1. For all other creative types the version can be incremented only
  3410. // by 1 during update operations. In addition, the version will be
  3411. // automatically incremented by 1 when undergoing Rich Media creative
  3412. // merging. Applicable to all creative types.
  3413. Version int64 `json:"version,omitempty"`
  3414. // ServerResponse contains the HTTP response code and headers from the
  3415. // server.
  3416. googleapi.ServerResponse `json:"-"`
  3417. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3418. // unconditionally include in API requests. By default, fields with
  3419. // empty values are omitted from API requests. However, any non-pointer,
  3420. // non-interface field appearing in ForceSendFields will be sent to the
  3421. // server regardless of whether the field is empty or not. This may be
  3422. // used to include empty fields in Patch requests.
  3423. ForceSendFields []string `json:"-"`
  3424. // NullFields is a list of field names (e.g. "AccountId") to include in
  3425. // API requests with the JSON null value. By default, fields with empty
  3426. // values are omitted from API requests. However, any field with an
  3427. // empty value appearing in NullFields will be sent to the server as
  3428. // null. It is an error if a field in this list has a non-empty value.
  3429. // This may be used to include null fields in Patch requests.
  3430. NullFields []string `json:"-"`
  3431. }
  3432. func (s *Creative) MarshalJSON() ([]byte, error) {
  3433. type NoMethod Creative
  3434. raw := NoMethod(*s)
  3435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3436. }
  3437. func (s *Creative) UnmarshalJSON(data []byte) error {
  3438. type NoMethod Creative
  3439. var s1 struct {
  3440. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3441. *NoMethod
  3442. }
  3443. s1.NoMethod = (*NoMethod)(s)
  3444. if err := json.Unmarshal(data, &s1); err != nil {
  3445. return err
  3446. }
  3447. s.MediaDuration = float64(s1.MediaDuration)
  3448. return nil
  3449. }
  3450. // CreativeAsset: Creative Asset.
  3451. type CreativeAsset struct {
  3452. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3453. // This is a read-only field. Applicable to the following creative type:
  3454. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3455. // not HTML_IMAGE.
  3456. ActionScript3 bool `json:"actionScript3,omitempty"`
  3457. // Active: Whether the video or audio asset is active. This is a
  3458. // read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the
  3459. // following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and all
  3460. // VPAID.
  3461. Active bool `json:"active,omitempty"`
  3462. // Alignment: Possible alignments for an asset. This is a read-only
  3463. // field. Applicable to the following creative types:
  3464. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3465. //
  3466. // Possible values:
  3467. // "ALIGNMENT_BOTTOM"
  3468. // "ALIGNMENT_LEFT"
  3469. // "ALIGNMENT_RIGHT"
  3470. // "ALIGNMENT_TOP"
  3471. Alignment string `json:"alignment,omitempty"`
  3472. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3473. // field. Applicable to the following creative types: all RICH_MEDIA.
  3474. //
  3475. // Possible values:
  3476. // "ARTWORK_TYPE_FLASH"
  3477. // "ARTWORK_TYPE_HTML5"
  3478. // "ARTWORK_TYPE_IMAGE"
  3479. // "ARTWORK_TYPE_MIXED"
  3480. ArtworkType string `json:"artworkType,omitempty"`
  3481. // AssetIdentifier: Identifier of this asset. This is the same
  3482. // identifier returned during creative asset insert operation. This is a
  3483. // required field. Applicable to all but the following creative types:
  3484. // all REDIRECT and TRACKING_TEXT.
  3485. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3486. // BackupImageExit: Exit event configured for the backup image.
  3487. // Applicable to the following creative types: all RICH_MEDIA.
  3488. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3489. // BitRate: Detected bit-rate for audio or video asset. This is a
  3490. // read-only field. Applicable to the following creative types:
  3491. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3492. BitRate int64 `json:"bitRate,omitempty"`
  3493. // ChildAssetType: Rich media child asset type. This is a read-only
  3494. // field. Applicable to the following creative types: all VPAID.
  3495. //
  3496. // Possible values:
  3497. // "CHILD_ASSET_TYPE_DATA"
  3498. // "CHILD_ASSET_TYPE_FLASH"
  3499. // "CHILD_ASSET_TYPE_IMAGE"
  3500. // "CHILD_ASSET_TYPE_VIDEO"
  3501. ChildAssetType string `json:"childAssetType,omitempty"`
  3502. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3503. // field. Applicable to the following creative types: all RICH_MEDIA and
  3504. // all VPAID. Additionally, applicable to assets whose displayType is
  3505. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3506. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3507. // CompanionCreativeIds: List of companion creatives assigned to an
  3508. // in-stream video creative asset. Acceptable values include IDs of
  3509. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3510. // creative type with dynamicAssetSelection set to true.
  3511. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3512. // CustomStartTimeValue: Custom start time in seconds for making the
  3513. // asset visible. Applicable to the following creative types: all
  3514. // RICH_MEDIA. Value must be greater than or equal to 0.
  3515. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3516. // DetectedFeatures: List of feature dependencies for the creative asset
  3517. // that are detected by DCM. Feature dependencies are features that a
  3518. // browser must be able to support in order to render your HTML5
  3519. // creative correctly. This is a read-only, auto-generated field.
  3520. // Applicable to the following creative types: HTML5_BANNER. Applicable
  3521. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3522. //
  3523. // Possible values:
  3524. // "APPLICATION_CACHE"
  3525. // "AUDIO"
  3526. // "CANVAS"
  3527. // "CANVAS_TEXT"
  3528. // "CSS_ANIMATIONS"
  3529. // "CSS_BACKGROUND_SIZE"
  3530. // "CSS_BORDER_IMAGE"
  3531. // "CSS_BORDER_RADIUS"
  3532. // "CSS_BOX_SHADOW"
  3533. // "CSS_COLUMNS"
  3534. // "CSS_FLEX_BOX"
  3535. // "CSS_FONT_FACE"
  3536. // "CSS_GENERATED_CONTENT"
  3537. // "CSS_GRADIENTS"
  3538. // "CSS_HSLA"
  3539. // "CSS_MULTIPLE_BGS"
  3540. // "CSS_OPACITY"
  3541. // "CSS_REFLECTIONS"
  3542. // "CSS_RGBA"
  3543. // "CSS_TEXT_SHADOW"
  3544. // "CSS_TRANSFORMS"
  3545. // "CSS_TRANSFORMS3D"
  3546. // "CSS_TRANSITIONS"
  3547. // "DRAG_AND_DROP"
  3548. // "GEO_LOCATION"
  3549. // "HASH_CHANGE"
  3550. // "HISTORY"
  3551. // "INDEXED_DB"
  3552. // "INLINE_SVG"
  3553. // "INPUT_ATTR_AUTOCOMPLETE"
  3554. // "INPUT_ATTR_AUTOFOCUS"
  3555. // "INPUT_ATTR_LIST"
  3556. // "INPUT_ATTR_MAX"
  3557. // "INPUT_ATTR_MIN"
  3558. // "INPUT_ATTR_MULTIPLE"
  3559. // "INPUT_ATTR_PATTERN"
  3560. // "INPUT_ATTR_PLACEHOLDER"
  3561. // "INPUT_ATTR_REQUIRED"
  3562. // "INPUT_ATTR_STEP"
  3563. // "INPUT_TYPE_COLOR"
  3564. // "INPUT_TYPE_DATE"
  3565. // "INPUT_TYPE_DATETIME"
  3566. // "INPUT_TYPE_DATETIME_LOCAL"
  3567. // "INPUT_TYPE_EMAIL"
  3568. // "INPUT_TYPE_MONTH"
  3569. // "INPUT_TYPE_NUMBER"
  3570. // "INPUT_TYPE_RANGE"
  3571. // "INPUT_TYPE_SEARCH"
  3572. // "INPUT_TYPE_TEL"
  3573. // "INPUT_TYPE_TIME"
  3574. // "INPUT_TYPE_URL"
  3575. // "INPUT_TYPE_WEEK"
  3576. // "LOCAL_STORAGE"
  3577. // "POST_MESSAGE"
  3578. // "SESSION_STORAGE"
  3579. // "SMIL"
  3580. // "SVG_CLIP_PATHS"
  3581. // "SVG_FE_IMAGE"
  3582. // "SVG_FILTERS"
  3583. // "SVG_HREF"
  3584. // "TOUCH"
  3585. // "VIDEO"
  3586. // "WEBGL"
  3587. // "WEB_SOCKETS"
  3588. // "WEB_SQL_DATABASE"
  3589. // "WEB_WORKERS"
  3590. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3591. // DisplayType: Type of rich media asset. This is a read-only field.
  3592. // Applicable to the following creative types: all RICH_MEDIA.
  3593. //
  3594. // Possible values:
  3595. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3596. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3597. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3598. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3599. // "ASSET_DISPLAY_TYPE_FLOATING"
  3600. // "ASSET_DISPLAY_TYPE_INPAGE"
  3601. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3602. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3603. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3604. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3605. DisplayType string `json:"displayType,omitempty"`
  3606. // Duration: Duration in seconds for which an asset will be displayed.
  3607. // Applicable to the following creative types: INSTREAM_AUDIO,
  3608. // INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must be greater than or
  3609. // equal to 1.
  3610. Duration int64 `json:"duration,omitempty"`
  3611. // DurationType: Duration type for which an asset will be displayed.
  3612. // Applicable to the following creative types: all RICH_MEDIA.
  3613. //
  3614. // Possible values:
  3615. // "ASSET_DURATION_TYPE_AUTO"
  3616. // "ASSET_DURATION_TYPE_CUSTOM"
  3617. // "ASSET_DURATION_TYPE_NONE"
  3618. DurationType string `json:"durationType,omitempty"`
  3619. // ExpandedDimension: Detected expanded dimension for video asset. This
  3620. // is a read-only field. Applicable to the following creative types:
  3621. // INSTREAM_VIDEO and all VPAID.
  3622. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3623. // FileSize: File size associated with this creative asset. This is a
  3624. // read-only field. Applicable to all but the following creative types:
  3625. // all REDIRECT and TRACKING_TEXT.
  3626. FileSize int64 `json:"fileSize,omitempty,string"`
  3627. // FlashVersion: Flash version of the asset. This is a read-only field.
  3628. // Applicable to the following creative types: FLASH_INPAGE, all
  3629. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3630. // asset type is not HTML_IMAGE.
  3631. FlashVersion int64 `json:"flashVersion,omitempty"`
  3632. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3633. // Applicable to the following creative types: all RICH_MEDIA.
  3634. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3635. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3636. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3637. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3638. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3639. // a read-only field. Applicable to the following creative types: all
  3640. // RICH_MEDIA.
  3641. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3642. // Id: Numeric ID of this creative asset. This is a required field and
  3643. // should not be modified. Applicable to all but the following creative
  3644. // types: all REDIRECT and TRACKING_TEXT.
  3645. Id int64 `json:"id,omitempty,string"`
  3646. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3647. // read-only, auto-generated field.
  3648. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3649. // MediaDuration: Detected duration for audio or video asset. This is a
  3650. // read-only field. Applicable to the following creative types:
  3651. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3652. MediaDuration float64 `json:"mediaDuration,omitempty"`
  3653. // MimeType: Detected MIME type for audio or video asset. This is a
  3654. // read-only field. Applicable to the following creative types:
  3655. // INSTREAM_AUDIO, INSTREAM_VIDEO and all VPAID.
  3656. MimeType string `json:"mimeType,omitempty"`
  3657. // Offset: Offset position for an asset in collapsed mode. This is a
  3658. // read-only field. Applicable to the following creative types: all
  3659. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3660. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3661. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3662. Offset *OffsetPosition `json:"offset,omitempty"`
  3663. // Orientation: Orientation of video asset. This is a read-only,
  3664. // auto-generated field.
  3665. //
  3666. // Possible values:
  3667. // "LANDSCAPE"
  3668. // "PORTRAIT"
  3669. // "SQUARE"
  3670. Orientation string `json:"orientation,omitempty"`
  3671. // OriginalBackup: Whether the backup asset is original or changed by
  3672. // the user in DCM. Applicable to the following creative types: all
  3673. // RICH_MEDIA.
  3674. OriginalBackup bool `json:"originalBackup,omitempty"`
  3675. // Position: Offset position for an asset. Applicable to the following
  3676. // creative types: all RICH_MEDIA.
  3677. Position *OffsetPosition `json:"position,omitempty"`
  3678. // PositionLeftUnit: Offset left unit for an asset. This is a read-only
  3679. // field. Applicable to the following creative types: all RICH_MEDIA.
  3680. //
  3681. // Possible values:
  3682. // "OFFSET_UNIT_PERCENT"
  3683. // "OFFSET_UNIT_PIXEL"
  3684. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3685. PositionLeftUnit string `json:"positionLeftUnit,omitempty"`
  3686. // PositionTopUnit: Offset top unit for an asset. This is a read-only
  3687. // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY.
  3688. // Applicable to the following creative types: all RICH_MEDIA.
  3689. //
  3690. // Possible values:
  3691. // "OFFSET_UNIT_PERCENT"
  3692. // "OFFSET_UNIT_PIXEL"
  3693. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3694. PositionTopUnit string `json:"positionTopUnit,omitempty"`
  3695. // ProgressiveServingUrl: Progressive URL for video asset. This is a
  3696. // read-only field. Applicable to the following creative types:
  3697. // INSTREAM_VIDEO and all VPAID.
  3698. ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"`
  3699. // Pushdown: Whether the asset pushes down other content. Applicable to
  3700. // the following creative types: all RICH_MEDIA. Additionally, only
  3701. // applicable when the asset offsets are 0, the collapsedSize.width
  3702. // matches size.width, and the collapsedSize.height is less than
  3703. // size.height.
  3704. Pushdown bool `json:"pushdown,omitempty"`
  3705. // PushdownDuration: Pushdown duration in seconds for an asset.
  3706. // Applicable to the following creative types: all
  3707. // RICH_MEDIA.Additionally, only applicable when the asset pushdown
  3708. // field is true, the offsets are 0, the collapsedSize.width matches
  3709. // size.width, and the collapsedSize.height is less than size.height.
  3710. // Acceptable values are 0 to 9.99, inclusive.
  3711. PushdownDuration float64 `json:"pushdownDuration,omitempty"`
  3712. // Role: Role of the asset in relation to creative. Applicable to all
  3713. // but the following creative types: all REDIRECT and TRACKING_TEXT.
  3714. // This is a required field.
  3715. // PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE,
  3716. // DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple
  3717. // primary assets), and all VPAID creatives.
  3718. // BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA,
  3719. // and all VPAID creatives. Applicable to DISPLAY when the primary asset
  3720. // type is not HTML_IMAGE.
  3721. // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE
  3722. // creatives.
  3723. // OTHER refers to assets from sources other than DCM, such as Studio
  3724. // uploaded assets, applicable to all RICH_MEDIA and all VPAID
  3725. // creatives.
  3726. // PARENT_VIDEO refers to videos uploaded by the user in DCM and is
  3727. // applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3728. // creatives.
  3729. // TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO
  3730. // assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3731. // creatives.
  3732. // ALTERNATE_VIDEO refers to the DCM representation of child asset
  3733. // videos from Studio, and is applicable to VPAID_LINEAR_VIDEO
  3734. // creatives. These cannot be added or removed within DCM.
  3735. // For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and
  3736. // ALTERNATE_VIDEO assets that are marked active serve as backup in case
  3737. // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be
  3738. // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO
  3739. // creative.
  3740. // PARENT_AUDIO refers to audios uploaded by the user in DCM and is
  3741. // applicable to INSTREAM_AUDIO creatives.
  3742. // TRANSCODED_AUDIO refers to audios transcoded by DCM from PARENT_AUDIO
  3743. // assets and is applicable to INSTREAM_AUDIO creatives.
  3744. //
  3745. // Possible values:
  3746. // "ADDITIONAL_FLASH"
  3747. // "ADDITIONAL_IMAGE"
  3748. // "ALTERNATE_VIDEO"
  3749. // "BACKUP_IMAGE"
  3750. // "OTHER"
  3751. // "PARENT_AUDIO"
  3752. // "PARENT_VIDEO"
  3753. // "PRIMARY"
  3754. // "TRANSCODED_AUDIO"
  3755. // "TRANSCODED_VIDEO"
  3756. Role string `json:"role,omitempty"`
  3757. // Size: Size associated with this creative asset. This is a required
  3758. // field when applicable; however for IMAGE and FLASH_INPAGE, creatives
  3759. // if left blank, this field will be automatically set using the actual
  3760. // size of the associated image asset. Applicable to the following
  3761. // creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER,
  3762. // IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary
  3763. // asset type is not HTML_IMAGE.
  3764. Size *Size `json:"size,omitempty"`
  3765. // SslCompliant: Whether the asset is SSL-compliant. This is a read-only
  3766. // field. Applicable to all but the following creative types: all
  3767. // REDIRECT and TRACKING_TEXT.
  3768. SslCompliant bool `json:"sslCompliant,omitempty"`
  3769. // StartTimeType: Initial wait time type before making the asset
  3770. // visible. Applicable to the following creative types: all RICH_MEDIA.
  3771. //
  3772. // Possible values:
  3773. // "ASSET_START_TIME_TYPE_CUSTOM"
  3774. // "ASSET_START_TIME_TYPE_NONE"
  3775. StartTimeType string `json:"startTimeType,omitempty"`
  3776. // StreamingServingUrl: Streaming URL for video asset. This is a
  3777. // read-only field. Applicable to the following creative types:
  3778. // INSTREAM_VIDEO and all VPAID.
  3779. StreamingServingUrl string `json:"streamingServingUrl,omitempty"`
  3780. // Transparency: Whether the asset is transparent. Applicable to the
  3781. // following creative types: all RICH_MEDIA. Additionally, only
  3782. // applicable to HTML5 assets.
  3783. Transparency bool `json:"transparency,omitempty"`
  3784. // VerticallyLocked: Whether the asset is vertically locked. This is a
  3785. // read-only field. Applicable to the following creative types: all
  3786. // RICH_MEDIA.
  3787. VerticallyLocked bool `json:"verticallyLocked,omitempty"`
  3788. // WindowMode: Window mode options for flash assets. Applicable to the
  3789. // following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING,
  3790. // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and
  3791. // RICH_MEDIA_INPAGE_FLOATING.
  3792. //
  3793. // Possible values:
  3794. // "OPAQUE"
  3795. // "TRANSPARENT"
  3796. // "WINDOW"
  3797. WindowMode string `json:"windowMode,omitempty"`
  3798. // ZIndex: zIndex value of an asset. Applicable to the following
  3799. // creative types: all RICH_MEDIA.Additionally, only applicable to
  3800. // assets whose displayType is NOT one of the following types:
  3801. // ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable
  3802. // values are -999999999 to 999999999, inclusive.
  3803. ZIndex int64 `json:"zIndex,omitempty"`
  3804. // ZipFilename: File name of zip file. This is a read-only field.
  3805. // Applicable to the following creative types: HTML5_BANNER.
  3806. ZipFilename string `json:"zipFilename,omitempty"`
  3807. // ZipFilesize: Size of zip file. This is a read-only field. Applicable
  3808. // to the following creative types: HTML5_BANNER.
  3809. ZipFilesize string `json:"zipFilesize,omitempty"`
  3810. // ForceSendFields is a list of field names (e.g. "ActionScript3") to
  3811. // unconditionally include in API requests. By default, fields with
  3812. // empty values are omitted from API requests. However, any non-pointer,
  3813. // non-interface field appearing in ForceSendFields will be sent to the
  3814. // server regardless of whether the field is empty or not. This may be
  3815. // used to include empty fields in Patch requests.
  3816. ForceSendFields []string `json:"-"`
  3817. // NullFields is a list of field names (e.g. "ActionScript3") to include
  3818. // in API requests with the JSON null value. By default, fields with
  3819. // empty values are omitted from API requests. However, any field with
  3820. // an empty value appearing in NullFields will be sent to the server as
  3821. // null. It is an error if a field in this list has a non-empty value.
  3822. // This may be used to include null fields in Patch requests.
  3823. NullFields []string `json:"-"`
  3824. }
  3825. func (s *CreativeAsset) MarshalJSON() ([]byte, error) {
  3826. type NoMethod CreativeAsset
  3827. raw := NoMethod(*s)
  3828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3829. }
  3830. func (s *CreativeAsset) UnmarshalJSON(data []byte) error {
  3831. type NoMethod CreativeAsset
  3832. var s1 struct {
  3833. MediaDuration gensupport.JSONFloat64 `json:"mediaDuration"`
  3834. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3835. *NoMethod
  3836. }
  3837. s1.NoMethod = (*NoMethod)(s)
  3838. if err := json.Unmarshal(data, &s1); err != nil {
  3839. return err
  3840. }
  3841. s.MediaDuration = float64(s1.MediaDuration)
  3842. s.PushdownDuration = float64(s1.PushdownDuration)
  3843. return nil
  3844. }
  3845. // CreativeAssetId: Creative Asset ID.
  3846. type CreativeAssetId struct {
  3847. // Name: Name of the creative asset. This is a required field while
  3848. // inserting an asset. After insertion, this assetIdentifier is used to
  3849. // identify the uploaded asset. Characters in the name must be
  3850. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3851. Name string `json:"name,omitempty"`
  3852. // Type: Type of asset to upload. This is a required field. FLASH and
  3853. // IMAGE are no longer supported for new uploads. All image assets
  3854. // should use HTML_IMAGE.
  3855. //
  3856. // Possible values:
  3857. // "AUDIO"
  3858. // "FLASH"
  3859. // "HTML"
  3860. // "HTML_IMAGE"
  3861. // "IMAGE"
  3862. // "VIDEO"
  3863. Type string `json:"type,omitempty"`
  3864. // ForceSendFields is a list of field names (e.g. "Name") to
  3865. // unconditionally include in API requests. By default, fields with
  3866. // empty values are omitted from API requests. However, any non-pointer,
  3867. // non-interface field appearing in ForceSendFields will be sent to the
  3868. // server regardless of whether the field is empty or not. This may be
  3869. // used to include empty fields in Patch requests.
  3870. ForceSendFields []string `json:"-"`
  3871. // NullFields is a list of field names (e.g. "Name") to include in API
  3872. // requests with the JSON null value. By default, fields with empty
  3873. // values are omitted from API requests. However, any field with an
  3874. // empty value appearing in NullFields will be sent to the server as
  3875. // null. It is an error if a field in this list has a non-empty value.
  3876. // This may be used to include null fields in Patch requests.
  3877. NullFields []string `json:"-"`
  3878. }
  3879. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3880. type NoMethod CreativeAssetId
  3881. raw := NoMethod(*s)
  3882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3883. }
  3884. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3885. // creative asset file which will be uploaded or has already been
  3886. // uploaded. Refer to the creative sample code for how to upload assets
  3887. // and insert a creative.
  3888. type CreativeAssetMetadata struct {
  3889. // AssetIdentifier: ID of the creative asset. This is a required field.
  3890. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3891. // ClickTags: List of detected click tags for assets. This is a
  3892. // read-only auto-generated field.
  3893. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3894. // DetectedFeatures: List of feature dependencies for the creative asset
  3895. // that are detected by DCM. Feature dependencies are features that a
  3896. // browser must be able to support in order to render your HTML5
  3897. // creative correctly. This is a read-only, auto-generated field.
  3898. //
  3899. // Possible values:
  3900. // "APPLICATION_CACHE"
  3901. // "AUDIO"
  3902. // "CANVAS"
  3903. // "CANVAS_TEXT"
  3904. // "CSS_ANIMATIONS"
  3905. // "CSS_BACKGROUND_SIZE"
  3906. // "CSS_BORDER_IMAGE"
  3907. // "CSS_BORDER_RADIUS"
  3908. // "CSS_BOX_SHADOW"
  3909. // "CSS_COLUMNS"
  3910. // "CSS_FLEX_BOX"
  3911. // "CSS_FONT_FACE"
  3912. // "CSS_GENERATED_CONTENT"
  3913. // "CSS_GRADIENTS"
  3914. // "CSS_HSLA"
  3915. // "CSS_MULTIPLE_BGS"
  3916. // "CSS_OPACITY"
  3917. // "CSS_REFLECTIONS"
  3918. // "CSS_RGBA"
  3919. // "CSS_TEXT_SHADOW"
  3920. // "CSS_TRANSFORMS"
  3921. // "CSS_TRANSFORMS3D"
  3922. // "CSS_TRANSITIONS"
  3923. // "DRAG_AND_DROP"
  3924. // "GEO_LOCATION"
  3925. // "HASH_CHANGE"
  3926. // "HISTORY"
  3927. // "INDEXED_DB"
  3928. // "INLINE_SVG"
  3929. // "INPUT_ATTR_AUTOCOMPLETE"
  3930. // "INPUT_ATTR_AUTOFOCUS"
  3931. // "INPUT_ATTR_LIST"
  3932. // "INPUT_ATTR_MAX"
  3933. // "INPUT_ATTR_MIN"
  3934. // "INPUT_ATTR_MULTIPLE"
  3935. // "INPUT_ATTR_PATTERN"
  3936. // "INPUT_ATTR_PLACEHOLDER"
  3937. // "INPUT_ATTR_REQUIRED"
  3938. // "INPUT_ATTR_STEP"
  3939. // "INPUT_TYPE_COLOR"
  3940. // "INPUT_TYPE_DATE"
  3941. // "INPUT_TYPE_DATETIME"
  3942. // "INPUT_TYPE_DATETIME_LOCAL"
  3943. // "INPUT_TYPE_EMAIL"
  3944. // "INPUT_TYPE_MONTH"
  3945. // "INPUT_TYPE_NUMBER"
  3946. // "INPUT_TYPE_RANGE"
  3947. // "INPUT_TYPE_SEARCH"
  3948. // "INPUT_TYPE_TEL"
  3949. // "INPUT_TYPE_TIME"
  3950. // "INPUT_TYPE_URL"
  3951. // "INPUT_TYPE_WEEK"
  3952. // "LOCAL_STORAGE"
  3953. // "POST_MESSAGE"
  3954. // "SESSION_STORAGE"
  3955. // "SMIL"
  3956. // "SVG_CLIP_PATHS"
  3957. // "SVG_FE_IMAGE"
  3958. // "SVG_FILTERS"
  3959. // "SVG_HREF"
  3960. // "TOUCH"
  3961. // "VIDEO"
  3962. // "WEBGL"
  3963. // "WEB_SOCKETS"
  3964. // "WEB_SQL_DATABASE"
  3965. // "WEB_WORKERS"
  3966. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3967. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  3968. // field.
  3969. Id int64 `json:"id,omitempty,string"`
  3970. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  3971. // This is a read-only, auto-generated field.
  3972. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3973. // Kind: Identifies what kind of resource this is. Value: the fixed
  3974. // string "dfareporting#creativeAssetMetadata".
  3975. Kind string `json:"kind,omitempty"`
  3976. // WarnedValidationRules: Rules validated during code generation that
  3977. // generated a warning. This is a read-only, auto-generated
  3978. // field.
  3979. //
  3980. // Possible values are:
  3981. // - "ADMOB_REFERENCED"
  3982. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  3983. // - "ASSET_INVALID"
  3984. // - "CLICK_TAG_HARD_CODED"
  3985. // - "CLICK_TAG_INVALID"
  3986. // - "CLICK_TAG_IN_GWD"
  3987. // - "CLICK_TAG_MISSING"
  3988. // - "CLICK_TAG_MORE_THAN_ONE"
  3989. // - "CLICK_TAG_NON_TOP_LEVEL"
  3990. // - "COMPONENT_UNSUPPORTED_DCM"
  3991. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  3992. // - "EXTERNAL_FILE_REFERENCED"
  3993. // - "FILE_DETAIL_EMPTY"
  3994. // - "FILE_TYPE_INVALID"
  3995. // - "GWD_PROPERTIES_INVALID"
  3996. // - "HTML5_FEATURE_UNSUPPORTED"
  3997. // - "LINKED_FILE_NOT_FOUND"
  3998. // - "MAX_FLASH_VERSION_11"
  3999. // - "MRAID_REFERENCED"
  4000. // - "NOT_SSL_COMPLIANT"
  4001. // - "ORPHANED_ASSET"
  4002. // - "PRIMARY_HTML_MISSING"
  4003. // - "SVG_INVALID"
  4004. // - "ZIP_INVALID"
  4005. //
  4006. // Possible values:
  4007. // "ADMOB_REFERENCED"
  4008. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  4009. // "ASSET_INVALID"
  4010. // "CLICK_TAG_HARD_CODED"
  4011. // "CLICK_TAG_INVALID"
  4012. // "CLICK_TAG_IN_GWD"
  4013. // "CLICK_TAG_MISSING"
  4014. // "CLICK_TAG_MORE_THAN_ONE"
  4015. // "CLICK_TAG_NON_TOP_LEVEL"
  4016. // "COMPONENT_UNSUPPORTED_DCM"
  4017. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  4018. // "EXTERNAL_FILE_REFERENCED"
  4019. // "FILE_DETAIL_EMPTY"
  4020. // "FILE_TYPE_INVALID"
  4021. // "GWD_PROPERTIES_INVALID"
  4022. // "HTML5_FEATURE_UNSUPPORTED"
  4023. // "LINKED_FILE_NOT_FOUND"
  4024. // "MAX_FLASH_VERSION_11"
  4025. // "MRAID_REFERENCED"
  4026. // "NOT_SSL_COMPLIANT"
  4027. // "ORPHANED_ASSET"
  4028. // "PRIMARY_HTML_MISSING"
  4029. // "SVG_INVALID"
  4030. // "ZIP_INVALID"
  4031. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  4032. // ServerResponse contains the HTTP response code and headers from the
  4033. // server.
  4034. googleapi.ServerResponse `json:"-"`
  4035. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  4036. // unconditionally include in API requests. By default, fields with
  4037. // empty values are omitted from API requests. However, any non-pointer,
  4038. // non-interface field appearing in ForceSendFields will be sent to the
  4039. // server regardless of whether the field is empty or not. This may be
  4040. // used to include empty fields in Patch requests.
  4041. ForceSendFields []string `json:"-"`
  4042. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  4043. // include in API requests with the JSON null value. By default, fields
  4044. // with empty values are omitted from API requests. However, any field
  4045. // with an empty value appearing in NullFields will be sent to the
  4046. // server as null. It is an error if a field in this list has a
  4047. // non-empty value. This may be used to include null fields in Patch
  4048. // requests.
  4049. NullFields []string `json:"-"`
  4050. }
  4051. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  4052. type NoMethod CreativeAssetMetadata
  4053. raw := NoMethod(*s)
  4054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4055. }
  4056. // CreativeAssetSelection: Encapsulates the list of rules for asset
  4057. // selection and a default asset in case none of the rules match.
  4058. // Applicable to INSTREAM_VIDEO creatives.
  4059. type CreativeAssetSelection struct {
  4060. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  4061. // the parent assets in this creative, and will be served if none of the
  4062. // rules match. This is a required field.
  4063. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  4064. // Rules: Rules determine which asset will be served to a viewer. Rules
  4065. // will be evaluated in the order in which they are stored in this list.
  4066. // This list must contain at least one rule. Applicable to
  4067. // INSTREAM_VIDEO creatives.
  4068. Rules []*Rule `json:"rules,omitempty"`
  4069. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  4070. // unconditionally include in API requests. By default, fields with
  4071. // empty values are omitted from API requests. However, any non-pointer,
  4072. // non-interface field appearing in ForceSendFields will be sent to the
  4073. // server regardless of whether the field is empty or not. This may be
  4074. // used to include empty fields in Patch requests.
  4075. ForceSendFields []string `json:"-"`
  4076. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  4077. // include in API requests with the JSON null value. By default, fields
  4078. // with empty values are omitted from API requests. However, any field
  4079. // with an empty value appearing in NullFields will be sent to the
  4080. // server as null. It is an error if a field in this list has a
  4081. // non-empty value. This may be used to include null fields in Patch
  4082. // requests.
  4083. NullFields []string `json:"-"`
  4084. }
  4085. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  4086. type NoMethod CreativeAssetSelection
  4087. raw := NoMethod(*s)
  4088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4089. }
  4090. // CreativeAssignment: Creative Assignment.
  4091. type CreativeAssignment struct {
  4092. // Active: Whether this creative assignment is active. When true, the
  4093. // creative will be included in the ad's rotation.
  4094. Active bool `json:"active,omitempty"`
  4095. // ApplyEventTags: Whether applicable event tags should fire when this
  4096. // creative assignment is rendered. If this value is unset when the ad
  4097. // is inserted or updated, it will default to true for all creative
  4098. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  4099. // and INSTREAM_VIDEO.
  4100. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  4101. // ClickThroughUrl: Click-through URL of the creative assignment.
  4102. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  4103. // CompanionCreativeOverrides: Companion creative overrides for this
  4104. // creative assignment. Applicable to video ads.
  4105. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  4106. // CreativeGroupAssignments: Creative group assignments for this
  4107. // creative assignment. Only one assignment per creative group number is
  4108. // allowed for a maximum of two assignments.
  4109. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  4110. // CreativeId: ID of the creative to be assigned. This is a required
  4111. // field.
  4112. CreativeId int64 `json:"creativeId,omitempty,string"`
  4113. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  4114. // This is a read-only, auto-generated field.
  4115. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  4116. // EndTime: Date and time that the assigned creative should stop
  4117. // serving. Must be later than the start time.
  4118. EndTime string `json:"endTime,omitempty"`
  4119. // RichMediaExitOverrides: Rich media exit overrides for this creative
  4120. // assignment.
  4121. // Applicable when the creative type is any of the following:
  4122. // - DISPLAY
  4123. // - RICH_MEDIA_INPAGE
  4124. // - RICH_MEDIA_INPAGE_FLOATING
  4125. // - RICH_MEDIA_IM_EXPAND
  4126. // - RICH_MEDIA_EXPANDING
  4127. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  4128. // - RICH_MEDIA_MOBILE_IN_APP
  4129. // - RICH_MEDIA_MULTI_FLOATING
  4130. // - RICH_MEDIA_PEEL_DOWN
  4131. // - VPAID_LINEAR
  4132. // - VPAID_NON_LINEAR
  4133. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  4134. // Sequence: Sequence number of the creative assignment, applicable when
  4135. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  4136. // values are 1 to 65535, inclusive.
  4137. Sequence int64 `json:"sequence,omitempty"`
  4138. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  4139. // This is a read-only field that is auto-generated when the ad is
  4140. // inserted or updated.
  4141. SslCompliant bool `json:"sslCompliant,omitempty"`
  4142. // StartTime: Date and time that the assigned creative should start
  4143. // serving.
  4144. StartTime string `json:"startTime,omitempty"`
  4145. // Weight: Weight of the creative assignment, applicable when the
  4146. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  4147. // than or equal to 1.
  4148. Weight int64 `json:"weight,omitempty"`
  4149. // ForceSendFields is a list of field names (e.g. "Active") to
  4150. // unconditionally include in API requests. By default, fields with
  4151. // empty values are omitted from API requests. However, any non-pointer,
  4152. // non-interface field appearing in ForceSendFields will be sent to the
  4153. // server regardless of whether the field is empty or not. This may be
  4154. // used to include empty fields in Patch requests.
  4155. ForceSendFields []string `json:"-"`
  4156. // NullFields is a list of field names (e.g. "Active") to include in API
  4157. // requests with the JSON null value. By default, fields with empty
  4158. // values are omitted from API requests. However, any field with an
  4159. // empty value appearing in NullFields will be sent to the server as
  4160. // null. It is an error if a field in this list has a non-empty value.
  4161. // This may be used to include null fields in Patch requests.
  4162. NullFields []string `json:"-"`
  4163. }
  4164. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  4165. type NoMethod CreativeAssignment
  4166. raw := NoMethod(*s)
  4167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4168. }
  4169. // CreativeClickThroughUrl: Click-through URL
  4170. type CreativeClickThroughUrl struct {
  4171. // ComputedClickThroughUrl: Read-only convenience field representing the
  4172. // actual URL that will be used for this click-through. The URL is
  4173. // computed as follows:
  4174. // - If landingPageId is specified then that landing page's URL is
  4175. // assigned to this field.
  4176. // - Otherwise, the customClickThroughUrl is assigned to this field.
  4177. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  4178. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  4179. // landingPageId field is left unset.
  4180. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  4181. // LandingPageId: ID of the landing page for the click-through URL.
  4182. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  4183. // ForceSendFields is a list of field names (e.g.
  4184. // "ComputedClickThroughUrl") to unconditionally include in API
  4185. // requests. By default, fields with empty values are omitted from API
  4186. // requests. However, any non-pointer, non-interface field appearing in
  4187. // ForceSendFields will be sent to the server regardless of whether the
  4188. // field is empty or not. This may be used to include empty fields in
  4189. // Patch requests.
  4190. ForceSendFields []string `json:"-"`
  4191. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  4192. // to include in API requests with the JSON null value. By default,
  4193. // fields with empty values are omitted from API requests. However, any
  4194. // field with an empty value appearing in NullFields will be sent to the
  4195. // server as null. It is an error if a field in this list has a
  4196. // non-empty value. This may be used to include null fields in Patch
  4197. // requests.
  4198. NullFields []string `json:"-"`
  4199. }
  4200. func (s *CreativeClickThroughUrl) MarshalJSON() ([]byte, error) {
  4201. type NoMethod CreativeClickThroughUrl
  4202. raw := NoMethod(*s)
  4203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4204. }
  4205. // CreativeCustomEvent: Creative Custom Event.
  4206. type CreativeCustomEvent struct {
  4207. // AdvertiserCustomEventId: Unique ID of this event used by DDM
  4208. // Reporting and Data Transfer. This is a read-only field.
  4209. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  4210. // AdvertiserCustomEventName: User-entered name for the event.
  4211. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  4212. // AdvertiserCustomEventType: Type of the event. This is a read-only
  4213. // field.
  4214. //
  4215. // Possible values:
  4216. // "ADVERTISER_EVENT_COUNTER"
  4217. // "ADVERTISER_EVENT_EXIT"
  4218. // "ADVERTISER_EVENT_TIMER"
  4219. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  4220. // ArtworkLabel: Artwork label column, used to link events in DCM back
  4221. // to events in Studio. This is a required field and should not be
  4222. // modified after insertion.
  4223. ArtworkLabel string `json:"artworkLabel,omitempty"`
  4224. // ArtworkType: Artwork type used by the creative.This is a read-only
  4225. // field.
  4226. //
  4227. // Possible values:
  4228. // "ARTWORK_TYPE_FLASH"
  4229. // "ARTWORK_TYPE_HTML5"
  4230. // "ARTWORK_TYPE_IMAGE"
  4231. // "ARTWORK_TYPE_MIXED"
  4232. ArtworkType string `json:"artworkType,omitempty"`
  4233. // ExitClickThroughUrl: Exit click-through URL for the event. This field
  4234. // is used only for exit events.
  4235. ExitClickThroughUrl *CreativeClickThroughUrl `json:"exitClickThroughUrl,omitempty"`
  4236. // Id: ID of this event. This is a required field and should not be
  4237. // modified after insertion.
  4238. Id int64 `json:"id,omitempty,string"`
  4239. // PopupWindowProperties: Properties for rich media popup windows. This
  4240. // field is used only for exit events.
  4241. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4242. // TargetType: Target type used by the event.
  4243. //
  4244. // Possible values:
  4245. // "TARGET_BLANK"
  4246. // "TARGET_PARENT"
  4247. // "TARGET_POPUP"
  4248. // "TARGET_SELF"
  4249. // "TARGET_TOP"
  4250. TargetType string `json:"targetType,omitempty"`
  4251. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4252. // videos in a single creative. This is a read-only field.
  4253. VideoReportingId string `json:"videoReportingId,omitempty"`
  4254. // ForceSendFields is a list of field names (e.g.
  4255. // "AdvertiserCustomEventId") to unconditionally include in API
  4256. // requests. By default, fields with empty values are omitted from API
  4257. // requests. However, any non-pointer, non-interface field appearing in
  4258. // ForceSendFields will be sent to the server regardless of whether the
  4259. // field is empty or not. This may be used to include empty fields in
  4260. // Patch requests.
  4261. ForceSendFields []string `json:"-"`
  4262. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4263. // to include in API requests with the JSON null value. By default,
  4264. // fields with empty values are omitted from API requests. However, any
  4265. // field with an empty value appearing in NullFields will be sent to the
  4266. // server as null. It is an error if a field in this list has a
  4267. // non-empty value. This may be used to include null fields in Patch
  4268. // requests.
  4269. NullFields []string `json:"-"`
  4270. }
  4271. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4272. type NoMethod CreativeCustomEvent
  4273. raw := NoMethod(*s)
  4274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4275. }
  4276. // CreativeField: Contains properties of a creative field.
  4277. type CreativeField struct {
  4278. // AccountId: Account ID of this creative field. This is a read-only
  4279. // field that can be left blank.
  4280. AccountId int64 `json:"accountId,omitempty,string"`
  4281. // AdvertiserId: Advertiser ID of this creative field. This is a
  4282. // required field on insertion.
  4283. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4284. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4285. // advertiser. This is a read-only, auto-generated field.
  4286. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4287. // Id: ID of this creative field. This is a read-only, auto-generated
  4288. // field.
  4289. Id int64 `json:"id,omitempty,string"`
  4290. // Kind: Identifies what kind of resource this is. Value: the fixed
  4291. // string "dfareporting#creativeField".
  4292. Kind string `json:"kind,omitempty"`
  4293. // Name: Name of this creative field. This is a required field and must
  4294. // be less than 256 characters long and unique among creative fields of
  4295. // the same advertiser.
  4296. Name string `json:"name,omitempty"`
  4297. // SubaccountId: Subaccount ID of this creative field. This is a
  4298. // read-only field that can be left blank.
  4299. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4300. // ServerResponse contains the HTTP response code and headers from the
  4301. // server.
  4302. googleapi.ServerResponse `json:"-"`
  4303. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4304. // unconditionally include in API requests. By default, fields with
  4305. // empty values are omitted from API requests. However, any non-pointer,
  4306. // non-interface field appearing in ForceSendFields will be sent to the
  4307. // server regardless of whether the field is empty or not. This may be
  4308. // used to include empty fields in Patch requests.
  4309. ForceSendFields []string `json:"-"`
  4310. // NullFields is a list of field names (e.g. "AccountId") to include in
  4311. // API requests with the JSON null value. By default, fields with empty
  4312. // values are omitted from API requests. However, any field with an
  4313. // empty value appearing in NullFields will be sent to the server as
  4314. // null. It is an error if a field in this list has a non-empty value.
  4315. // This may be used to include null fields in Patch requests.
  4316. NullFields []string `json:"-"`
  4317. }
  4318. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4319. type NoMethod CreativeField
  4320. raw := NoMethod(*s)
  4321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4322. }
  4323. // CreativeFieldAssignment: Creative Field Assignment.
  4324. type CreativeFieldAssignment struct {
  4325. // CreativeFieldId: ID of the creative field.
  4326. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4327. // CreativeFieldValueId: ID of the creative field value.
  4328. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4329. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4330. // unconditionally include in API requests. By default, fields with
  4331. // empty values are omitted from API requests. However, any non-pointer,
  4332. // non-interface field appearing in ForceSendFields will be sent to the
  4333. // server regardless of whether the field is empty or not. This may be
  4334. // used to include empty fields in Patch requests.
  4335. ForceSendFields []string `json:"-"`
  4336. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4337. // include in API requests with the JSON null value. By default, fields
  4338. // with empty values are omitted from API requests. However, any field
  4339. // with an empty value appearing in NullFields will be sent to the
  4340. // server as null. It is an error if a field in this list has a
  4341. // non-empty value. This may be used to include null fields in Patch
  4342. // requests.
  4343. NullFields []string `json:"-"`
  4344. }
  4345. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4346. type NoMethod CreativeFieldAssignment
  4347. raw := NoMethod(*s)
  4348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4349. }
  4350. // CreativeFieldValue: Contains properties of a creative field value.
  4351. type CreativeFieldValue struct {
  4352. // Id: ID of this creative field value. This is a read-only,
  4353. // auto-generated field.
  4354. Id int64 `json:"id,omitempty,string"`
  4355. // Kind: Identifies what kind of resource this is. Value: the fixed
  4356. // string "dfareporting#creativeFieldValue".
  4357. Kind string `json:"kind,omitempty"`
  4358. // Value: Value of this creative field value. It needs to be less than
  4359. // 256 characters in length and unique per creative field.
  4360. Value string `json:"value,omitempty"`
  4361. // ServerResponse contains the HTTP response code and headers from the
  4362. // server.
  4363. googleapi.ServerResponse `json:"-"`
  4364. // ForceSendFields is a list of field names (e.g. "Id") to
  4365. // unconditionally include in API requests. By default, fields with
  4366. // empty values are omitted from API requests. However, any non-pointer,
  4367. // non-interface field appearing in ForceSendFields will be sent to the
  4368. // server regardless of whether the field is empty or not. This may be
  4369. // used to include empty fields in Patch requests.
  4370. ForceSendFields []string `json:"-"`
  4371. // NullFields is a list of field names (e.g. "Id") to include in API
  4372. // requests with the JSON null value. By default, fields with empty
  4373. // values are omitted from API requests. However, any field with an
  4374. // empty value appearing in NullFields will be sent to the server as
  4375. // null. It is an error if a field in this list has a non-empty value.
  4376. // This may be used to include null fields in Patch requests.
  4377. NullFields []string `json:"-"`
  4378. }
  4379. func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4380. type NoMethod CreativeFieldValue
  4381. raw := NoMethod(*s)
  4382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4383. }
  4384. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4385. type CreativeFieldValuesListResponse struct {
  4386. // CreativeFieldValues: Creative field value collection.
  4387. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4388. // Kind: Identifies what kind of resource this is. Value: the fixed
  4389. // string "dfareporting#creativeFieldValuesListResponse".
  4390. Kind string `json:"kind,omitempty"`
  4391. // NextPageToken: Pagination token to be used for the next list
  4392. // operation.
  4393. NextPageToken string `json:"nextPageToken,omitempty"`
  4394. // ServerResponse contains the HTTP response code and headers from the
  4395. // server.
  4396. googleapi.ServerResponse `json:"-"`
  4397. // ForceSendFields is a list of field names (e.g. "CreativeFieldValues")
  4398. // to unconditionally include in API requests. By default, fields with
  4399. // empty values are omitted from API requests. However, any non-pointer,
  4400. // non-interface field appearing in ForceSendFields will be sent to the
  4401. // server regardless of whether the field is empty or not. This may be
  4402. // used to include empty fields in Patch requests.
  4403. ForceSendFields []string `json:"-"`
  4404. // NullFields is a list of field names (e.g. "CreativeFieldValues") to
  4405. // include in API requests with the JSON null value. By default, fields
  4406. // with empty values are omitted from API requests. However, any field
  4407. // with an empty value appearing in NullFields will be sent to the
  4408. // server as null. It is an error if a field in this list has a
  4409. // non-empty value. This may be used to include null fields in Patch
  4410. // requests.
  4411. NullFields []string `json:"-"`
  4412. }
  4413. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4414. type NoMethod CreativeFieldValuesListResponse
  4415. raw := NoMethod(*s)
  4416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4417. }
  4418. // CreativeFieldsListResponse: Creative Field List Response
  4419. type CreativeFieldsListResponse struct {
  4420. // CreativeFields: Creative field collection.
  4421. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4422. // Kind: Identifies what kind of resource this is. Value: the fixed
  4423. // string "dfareporting#creativeFieldsListResponse".
  4424. Kind string `json:"kind,omitempty"`
  4425. // NextPageToken: Pagination token to be used for the next list
  4426. // operation.
  4427. NextPageToken string `json:"nextPageToken,omitempty"`
  4428. // ServerResponse contains the HTTP response code and headers from the
  4429. // server.
  4430. googleapi.ServerResponse `json:"-"`
  4431. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4432. // unconditionally include in API requests. By default, fields with
  4433. // empty values are omitted from API requests. However, any non-pointer,
  4434. // non-interface field appearing in ForceSendFields will be sent to the
  4435. // server regardless of whether the field is empty or not. This may be
  4436. // used to include empty fields in Patch requests.
  4437. ForceSendFields []string `json:"-"`
  4438. // NullFields is a list of field names (e.g. "CreativeFields") to
  4439. // include in API requests with the JSON null value. By default, fields
  4440. // with empty values are omitted from API requests. However, any field
  4441. // with an empty value appearing in NullFields will be sent to the
  4442. // server as null. It is an error if a field in this list has a
  4443. // non-empty value. This may be used to include null fields in Patch
  4444. // requests.
  4445. NullFields []string `json:"-"`
  4446. }
  4447. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4448. type NoMethod CreativeFieldsListResponse
  4449. raw := NoMethod(*s)
  4450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4451. }
  4452. // CreativeGroup: Contains properties of a creative group.
  4453. type CreativeGroup struct {
  4454. // AccountId: Account ID of this creative group. This is a read-only
  4455. // field that can be left blank.
  4456. AccountId int64 `json:"accountId,omitempty,string"`
  4457. // AdvertiserId: Advertiser ID of this creative group. This is a
  4458. // required field on insertion.
  4459. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4460. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4461. // advertiser. This is a read-only, auto-generated field.
  4462. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4463. // GroupNumber: Subgroup of the creative group. Assign your creative
  4464. // groups to a subgroup in order to filter or manage them more easily.
  4465. // This field is required on insertion and is read-only after insertion.
  4466. // Acceptable values are 1 to 2, inclusive.
  4467. GroupNumber int64 `json:"groupNumber,omitempty"`
  4468. // Id: ID of this creative group. This is a read-only, auto-generated
  4469. // field.
  4470. Id int64 `json:"id,omitempty,string"`
  4471. // Kind: Identifies what kind of resource this is. Value: the fixed
  4472. // string "dfareporting#creativeGroup".
  4473. Kind string `json:"kind,omitempty"`
  4474. // Name: Name of this creative group. This is a required field and must
  4475. // be less than 256 characters long and unique among creative groups of
  4476. // the same advertiser.
  4477. Name string `json:"name,omitempty"`
  4478. // SubaccountId: Subaccount ID of this creative group. This is a
  4479. // read-only field that can be left blank.
  4480. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4481. // ServerResponse contains the HTTP response code and headers from the
  4482. // server.
  4483. googleapi.ServerResponse `json:"-"`
  4484. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4485. // unconditionally include in API requests. By default, fields with
  4486. // empty values are omitted from API requests. However, any non-pointer,
  4487. // non-interface field appearing in ForceSendFields will be sent to the
  4488. // server regardless of whether the field is empty or not. This may be
  4489. // used to include empty fields in Patch requests.
  4490. ForceSendFields []string `json:"-"`
  4491. // NullFields is a list of field names (e.g. "AccountId") to include in
  4492. // API requests with the JSON null value. By default, fields with empty
  4493. // values are omitted from API requests. However, any field with an
  4494. // empty value appearing in NullFields will be sent to the server as
  4495. // null. It is an error if a field in this list has a non-empty value.
  4496. // This may be used to include null fields in Patch requests.
  4497. NullFields []string `json:"-"`
  4498. }
  4499. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4500. type NoMethod CreativeGroup
  4501. raw := NoMethod(*s)
  4502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4503. }
  4504. // CreativeGroupAssignment: Creative Group Assignment.
  4505. type CreativeGroupAssignment struct {
  4506. // CreativeGroupId: ID of the creative group to be assigned.
  4507. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4508. // CreativeGroupNumber: Creative group number of the creative group
  4509. // assignment.
  4510. //
  4511. // Possible values:
  4512. // "CREATIVE_GROUP_ONE"
  4513. // "CREATIVE_GROUP_TWO"
  4514. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4515. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to
  4516. // unconditionally include in API requests. By default, fields with
  4517. // empty values are omitted from API requests. However, any non-pointer,
  4518. // non-interface field appearing in ForceSendFields will be sent to the
  4519. // server regardless of whether the field is empty or not. This may be
  4520. // used to include empty fields in Patch requests.
  4521. ForceSendFields []string `json:"-"`
  4522. // NullFields is a list of field names (e.g. "CreativeGroupId") to
  4523. // include in API requests with the JSON null value. By default, fields
  4524. // with empty values are omitted from API requests. However, any field
  4525. // with an empty value appearing in NullFields will be sent to the
  4526. // server as null. It is an error if a field in this list has a
  4527. // non-empty value. This may be used to include null fields in Patch
  4528. // requests.
  4529. NullFields []string `json:"-"`
  4530. }
  4531. func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4532. type NoMethod CreativeGroupAssignment
  4533. raw := NoMethod(*s)
  4534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4535. }
  4536. // CreativeGroupsListResponse: Creative Group List Response
  4537. type CreativeGroupsListResponse struct {
  4538. // CreativeGroups: Creative group collection.
  4539. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4540. // Kind: Identifies what kind of resource this is. Value: the fixed
  4541. // string "dfareporting#creativeGroupsListResponse".
  4542. Kind string `json:"kind,omitempty"`
  4543. // NextPageToken: Pagination token to be used for the next list
  4544. // operation.
  4545. NextPageToken string `json:"nextPageToken,omitempty"`
  4546. // ServerResponse contains the HTTP response code and headers from the
  4547. // server.
  4548. googleapi.ServerResponse `json:"-"`
  4549. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4550. // unconditionally include in API requests. By default, fields with
  4551. // empty values are omitted from API requests. However, any non-pointer,
  4552. // non-interface field appearing in ForceSendFields will be sent to the
  4553. // server regardless of whether the field is empty or not. This may be
  4554. // used to include empty fields in Patch requests.
  4555. ForceSendFields []string `json:"-"`
  4556. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4557. // include in API requests with the JSON null value. By default, fields
  4558. // with empty values are omitted from API requests. However, any field
  4559. // with an empty value appearing in NullFields will be sent to the
  4560. // server as null. It is an error if a field in this list has a
  4561. // non-empty value. This may be used to include null fields in Patch
  4562. // requests.
  4563. NullFields []string `json:"-"`
  4564. }
  4565. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4566. type NoMethod CreativeGroupsListResponse
  4567. raw := NoMethod(*s)
  4568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4569. }
  4570. // CreativeOptimizationConfiguration: Creative optimization settings.
  4571. type CreativeOptimizationConfiguration struct {
  4572. // Id: ID of this creative optimization config. This field is
  4573. // auto-generated when the campaign is inserted or updated. It can be
  4574. // null for existing campaigns.
  4575. Id int64 `json:"id,omitempty,string"`
  4576. // Name: Name of this creative optimization config. This is a required
  4577. // field and must be less than 129 characters long.
  4578. Name string `json:"name,omitempty"`
  4579. // OptimizationActivitys: List of optimization activities associated
  4580. // with this configuration.
  4581. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4582. // OptimizationModel: Optimization model for this configuration.
  4583. //
  4584. // Possible values:
  4585. // "CLICK"
  4586. // "POST_CLICK"
  4587. // "POST_CLICK_AND_IMPRESSION"
  4588. // "POST_IMPRESSION"
  4589. // "VIDEO_COMPLETION"
  4590. OptimizationModel string `json:"optimizationModel,omitempty"`
  4591. // ForceSendFields is a list of field names (e.g. "Id") to
  4592. // unconditionally include in API requests. By default, fields with
  4593. // empty values are omitted from API requests. However, any non-pointer,
  4594. // non-interface field appearing in ForceSendFields will be sent to the
  4595. // server regardless of whether the field is empty or not. This may be
  4596. // used to include empty fields in Patch requests.
  4597. ForceSendFields []string `json:"-"`
  4598. // NullFields is a list of field names (e.g. "Id") to include in API
  4599. // requests with the JSON null value. By default, fields with empty
  4600. // values are omitted from API requests. However, any field with an
  4601. // empty value appearing in NullFields will be sent to the server as
  4602. // null. It is an error if a field in this list has a non-empty value.
  4603. // This may be used to include null fields in Patch requests.
  4604. NullFields []string `json:"-"`
  4605. }
  4606. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4607. type NoMethod CreativeOptimizationConfiguration
  4608. raw := NoMethod(*s)
  4609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4610. }
  4611. // CreativeRotation: Creative Rotation.
  4612. type CreativeRotation struct {
  4613. // CreativeAssignments: Creative assignments in this creative rotation.
  4614. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4615. // CreativeOptimizationConfigurationId: Creative optimization
  4616. // configuration that is used by this ad. It should refer to one of the
  4617. // existing optimization configurations in the ad's campaign. If it is
  4618. // unset or set to 0, then the campaign's default optimization
  4619. // configuration will be used for this ad.
  4620. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4621. // Type: Type of creative rotation. Can be used to specify whether to
  4622. // use sequential or random rotation.
  4623. //
  4624. // Possible values:
  4625. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4626. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4627. Type string `json:"type,omitempty"`
  4628. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4629. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4630. //
  4631. // Possible values:
  4632. // "WEIGHT_STRATEGY_CUSTOM"
  4633. // "WEIGHT_STRATEGY_EQUAL"
  4634. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4635. // "WEIGHT_STRATEGY_OPTIMIZED"
  4636. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4637. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4638. // to unconditionally include in API requests. By default, fields with
  4639. // empty values are omitted from API requests. However, any non-pointer,
  4640. // non-interface field appearing in ForceSendFields will be sent to the
  4641. // server regardless of whether the field is empty or not. This may be
  4642. // used to include empty fields in Patch requests.
  4643. ForceSendFields []string `json:"-"`
  4644. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4645. // include in API requests with the JSON null value. By default, fields
  4646. // with empty values are omitted from API requests. However, any field
  4647. // with an empty value appearing in NullFields will be sent to the
  4648. // server as null. It is an error if a field in this list has a
  4649. // non-empty value. This may be used to include null fields in Patch
  4650. // requests.
  4651. NullFields []string `json:"-"`
  4652. }
  4653. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4654. type NoMethod CreativeRotation
  4655. raw := NoMethod(*s)
  4656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4657. }
  4658. // CreativeSettings: Creative Settings
  4659. type CreativeSettings struct {
  4660. // IFrameFooter: Header text for iFrames for this site. Must be less
  4661. // than or equal to 2000 characters long.
  4662. IFrameFooter string `json:"iFrameFooter,omitempty"`
  4663. // IFrameHeader: Header text for iFrames for this site. Must be less
  4664. // than or equal to 2000 characters long.
  4665. IFrameHeader string `json:"iFrameHeader,omitempty"`
  4666. // ForceSendFields is a list of field names (e.g. "IFrameFooter") to
  4667. // unconditionally include in API requests. By default, fields with
  4668. // empty values are omitted from API requests. However, any non-pointer,
  4669. // non-interface field appearing in ForceSendFields will be sent to the
  4670. // server regardless of whether the field is empty or not. This may be
  4671. // used to include empty fields in Patch requests.
  4672. ForceSendFields []string `json:"-"`
  4673. // NullFields is a list of field names (e.g. "IFrameFooter") to include
  4674. // in API requests with the JSON null value. By default, fields with
  4675. // empty values are omitted from API requests. However, any field with
  4676. // an empty value appearing in NullFields will be sent to the server as
  4677. // null. It is an error if a field in this list has a non-empty value.
  4678. // This may be used to include null fields in Patch requests.
  4679. NullFields []string `json:"-"`
  4680. }
  4681. func (s *CreativeSettings) MarshalJSON() ([]byte, error) {
  4682. type NoMethod CreativeSettings
  4683. raw := NoMethod(*s)
  4684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4685. }
  4686. // CreativesListResponse: Creative List Response
  4687. type CreativesListResponse struct {
  4688. // Creatives: Creative collection.
  4689. Creatives []*Creative `json:"creatives,omitempty"`
  4690. // Kind: Identifies what kind of resource this is. Value: the fixed
  4691. // string "dfareporting#creativesListResponse".
  4692. Kind string `json:"kind,omitempty"`
  4693. // NextPageToken: Pagination token to be used for the next list
  4694. // operation.
  4695. NextPageToken string `json:"nextPageToken,omitempty"`
  4696. // ServerResponse contains the HTTP response code and headers from the
  4697. // server.
  4698. googleapi.ServerResponse `json:"-"`
  4699. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4700. // unconditionally include in API requests. By default, fields with
  4701. // empty values are omitted from API requests. However, any non-pointer,
  4702. // non-interface field appearing in ForceSendFields will be sent to the
  4703. // server regardless of whether the field is empty or not. This may be
  4704. // used to include empty fields in Patch requests.
  4705. ForceSendFields []string `json:"-"`
  4706. // NullFields is a list of field names (e.g. "Creatives") to include in
  4707. // API requests with the JSON null value. By default, fields with empty
  4708. // values are omitted from API requests. However, any field with an
  4709. // empty value appearing in NullFields will be sent to the server as
  4710. // null. It is an error if a field in this list has a non-empty value.
  4711. // This may be used to include null fields in Patch requests.
  4712. NullFields []string `json:"-"`
  4713. }
  4714. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4715. type NoMethod CreativesListResponse
  4716. raw := NoMethod(*s)
  4717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4718. }
  4719. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4720. // compatible to be selected for a report of type
  4721. // "CROSS_DIMENSION_REACH".
  4722. type CrossDimensionReachReportCompatibleFields struct {
  4723. // Breakdown: Dimensions which are compatible to be selected in the
  4724. // "breakdown" section of the report.
  4725. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4726. // DimensionFilters: Dimensions which are compatible to be selected in
  4727. // the "dimensionFilters" section of the report.
  4728. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4729. // Kind: The kind of resource this is, in this case
  4730. // dfareporting#crossDimensionReachReportCompatibleFields.
  4731. Kind string `json:"kind,omitempty"`
  4732. // Metrics: Metrics which are compatible to be selected in the
  4733. // "metricNames" section of the report.
  4734. Metrics []*Metric `json:"metrics,omitempty"`
  4735. // OverlapMetrics: Metrics which are compatible to be selected in the
  4736. // "overlapMetricNames" section of the report.
  4737. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4738. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4739. // unconditionally include in API requests. By default, fields with
  4740. // empty values are omitted from API requests. However, any non-pointer,
  4741. // non-interface field appearing in ForceSendFields will be sent to the
  4742. // server regardless of whether the field is empty or not. This may be
  4743. // used to include empty fields in Patch requests.
  4744. ForceSendFields []string `json:"-"`
  4745. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4746. // API requests with the JSON null value. By default, fields with empty
  4747. // values are omitted from API requests. However, any field with an
  4748. // empty value appearing in NullFields will be sent to the server as
  4749. // null. It is an error if a field in this list has a non-empty value.
  4750. // This may be used to include null fields in Patch requests.
  4751. NullFields []string `json:"-"`
  4752. }
  4753. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4754. type NoMethod CrossDimensionReachReportCompatibleFields
  4755. raw := NoMethod(*s)
  4756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4757. }
  4758. // CustomFloodlightVariable: A custom floodlight variable.
  4759. type CustomFloodlightVariable struct {
  4760. // Kind: Identifies what kind of resource this is. Value: the fixed
  4761. // string "dfareporting#customFloodlightVariable".
  4762. Kind string `json:"kind,omitempty"`
  4763. // Type: The type of custom floodlight variable to supply a value for.
  4764. // These map to the "u[1-20]=" in the tags.
  4765. //
  4766. // Possible values:
  4767. // "U1"
  4768. // "U10"
  4769. // "U100"
  4770. // "U11"
  4771. // "U12"
  4772. // "U13"
  4773. // "U14"
  4774. // "U15"
  4775. // "U16"
  4776. // "U17"
  4777. // "U18"
  4778. // "U19"
  4779. // "U2"
  4780. // "U20"
  4781. // "U21"
  4782. // "U22"
  4783. // "U23"
  4784. // "U24"
  4785. // "U25"
  4786. // "U26"
  4787. // "U27"
  4788. // "U28"
  4789. // "U29"
  4790. // "U3"
  4791. // "U30"
  4792. // "U31"
  4793. // "U32"
  4794. // "U33"
  4795. // "U34"
  4796. // "U35"
  4797. // "U36"
  4798. // "U37"
  4799. // "U38"
  4800. // "U39"
  4801. // "U4"
  4802. // "U40"
  4803. // "U41"
  4804. // "U42"
  4805. // "U43"
  4806. // "U44"
  4807. // "U45"
  4808. // "U46"
  4809. // "U47"
  4810. // "U48"
  4811. // "U49"
  4812. // "U5"
  4813. // "U50"
  4814. // "U51"
  4815. // "U52"
  4816. // "U53"
  4817. // "U54"
  4818. // "U55"
  4819. // "U56"
  4820. // "U57"
  4821. // "U58"
  4822. // "U59"
  4823. // "U6"
  4824. // "U60"
  4825. // "U61"
  4826. // "U62"
  4827. // "U63"
  4828. // "U64"
  4829. // "U65"
  4830. // "U66"
  4831. // "U67"
  4832. // "U68"
  4833. // "U69"
  4834. // "U7"
  4835. // "U70"
  4836. // "U71"
  4837. // "U72"
  4838. // "U73"
  4839. // "U74"
  4840. // "U75"
  4841. // "U76"
  4842. // "U77"
  4843. // "U78"
  4844. // "U79"
  4845. // "U8"
  4846. // "U80"
  4847. // "U81"
  4848. // "U82"
  4849. // "U83"
  4850. // "U84"
  4851. // "U85"
  4852. // "U86"
  4853. // "U87"
  4854. // "U88"
  4855. // "U89"
  4856. // "U9"
  4857. // "U90"
  4858. // "U91"
  4859. // "U92"
  4860. // "U93"
  4861. // "U94"
  4862. // "U95"
  4863. // "U96"
  4864. // "U97"
  4865. // "U98"
  4866. // "U99"
  4867. Type string `json:"type,omitempty"`
  4868. // Value: The value of the custom floodlight variable. The length of
  4869. // string must not exceed 50 characters.
  4870. Value string `json:"value,omitempty"`
  4871. // ForceSendFields is a list of field names (e.g. "Kind") to
  4872. // unconditionally include in API requests. By default, fields with
  4873. // empty values are omitted from API requests. However, any non-pointer,
  4874. // non-interface field appearing in ForceSendFields will be sent to the
  4875. // server regardless of whether the field is empty or not. This may be
  4876. // used to include empty fields in Patch requests.
  4877. ForceSendFields []string `json:"-"`
  4878. // NullFields is a list of field names (e.g. "Kind") to include in API
  4879. // requests with the JSON null value. By default, fields with empty
  4880. // values are omitted from API requests. However, any field with an
  4881. // empty value appearing in NullFields will be sent to the server as
  4882. // null. It is an error if a field in this list has a non-empty value.
  4883. // This may be used to include null fields in Patch requests.
  4884. NullFields []string `json:"-"`
  4885. }
  4886. func (s *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4887. type NoMethod CustomFloodlightVariable
  4888. raw := NoMethod(*s)
  4889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4890. }
  4891. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4892. type CustomRichMediaEvents struct {
  4893. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4894. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4895. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4896. // Kind: The kind of resource this is, in this case
  4897. // dfareporting#customRichMediaEvents.
  4898. Kind string `json:"kind,omitempty"`
  4899. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4900. // unconditionally include in API requests. By default, fields with
  4901. // empty values are omitted from API requests. However, any non-pointer,
  4902. // non-interface field appearing in ForceSendFields will be sent to the
  4903. // server regardless of whether the field is empty or not. This may be
  4904. // used to include empty fields in Patch requests.
  4905. ForceSendFields []string `json:"-"`
  4906. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4907. // include in API requests with the JSON null value. By default, fields
  4908. // with empty values are omitted from API requests. However, any field
  4909. // with an empty value appearing in NullFields will be sent to the
  4910. // server as null. It is an error if a field in this list has a
  4911. // non-empty value. This may be used to include null fields in Patch
  4912. // requests.
  4913. NullFields []string `json:"-"`
  4914. }
  4915. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4916. type NoMethod CustomRichMediaEvents
  4917. raw := NoMethod(*s)
  4918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4919. }
  4920. // DateRange: Represents a date range.
  4921. type DateRange struct {
  4922. // EndDate: The end date of the date range, inclusive. A string of the
  4923. // format: "yyyy-MM-dd".
  4924. EndDate string `json:"endDate,omitempty"`
  4925. // Kind: The kind of resource this is, in this case
  4926. // dfareporting#dateRange.
  4927. Kind string `json:"kind,omitempty"`
  4928. // RelativeDateRange: The date range relative to the date of when the
  4929. // report is run.
  4930. //
  4931. // Possible values:
  4932. // "LAST_24_MONTHS"
  4933. // "LAST_30_DAYS"
  4934. // "LAST_365_DAYS"
  4935. // "LAST_7_DAYS"
  4936. // "LAST_90_DAYS"
  4937. // "MONTH_TO_DATE"
  4938. // "PREVIOUS_MONTH"
  4939. // "PREVIOUS_QUARTER"
  4940. // "PREVIOUS_WEEK"
  4941. // "PREVIOUS_YEAR"
  4942. // "QUARTER_TO_DATE"
  4943. // "TODAY"
  4944. // "WEEK_TO_DATE"
  4945. // "YEAR_TO_DATE"
  4946. // "YESTERDAY"
  4947. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  4948. // StartDate: The start date of the date range, inclusive. A string of
  4949. // the format: "yyyy-MM-dd".
  4950. StartDate string `json:"startDate,omitempty"`
  4951. // ForceSendFields is a list of field names (e.g. "EndDate") to
  4952. // unconditionally include in API requests. By default, fields with
  4953. // empty values are omitted from API requests. However, any non-pointer,
  4954. // non-interface field appearing in ForceSendFields will be sent to the
  4955. // server regardless of whether the field is empty or not. This may be
  4956. // used to include empty fields in Patch requests.
  4957. ForceSendFields []string `json:"-"`
  4958. // NullFields is a list of field names (e.g. "EndDate") to include in
  4959. // API requests with the JSON null value. By default, fields with empty
  4960. // values are omitted from API requests. However, any field with an
  4961. // empty value appearing in NullFields will be sent to the server as
  4962. // null. It is an error if a field in this list has a non-empty value.
  4963. // This may be used to include null fields in Patch requests.
  4964. NullFields []string `json:"-"`
  4965. }
  4966. func (s *DateRange) MarshalJSON() ([]byte, error) {
  4967. type NoMethod DateRange
  4968. raw := NoMethod(*s)
  4969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4970. }
  4971. // DayPartTargeting: Day Part Targeting.
  4972. type DayPartTargeting struct {
  4973. // DaysOfWeek: Days of the week when the ad will serve.
  4974. //
  4975. // Acceptable values are:
  4976. // - "SUNDAY"
  4977. // - "MONDAY"
  4978. // - "TUESDAY"
  4979. // - "WEDNESDAY"
  4980. // - "THURSDAY"
  4981. // - "FRIDAY"
  4982. // - "SATURDAY"
  4983. //
  4984. // Possible values:
  4985. // "FRIDAY"
  4986. // "MONDAY"
  4987. // "SATURDAY"
  4988. // "SUNDAY"
  4989. // "THURSDAY"
  4990. // "TUESDAY"
  4991. // "WEDNESDAY"
  4992. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  4993. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  4994. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  4995. // days of week, in which case the ad would serve during these hours on
  4996. // the specified days. For example if Monday, Wednesday, Friday are the
  4997. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  4998. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  4999. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  5000. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  5001. // UserLocalTime: Whether or not to use the user's local time. If false,
  5002. // the America/New York time zone applies.
  5003. UserLocalTime bool `json:"userLocalTime,omitempty"`
  5004. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  5005. // unconditionally include in API requests. By default, fields with
  5006. // empty values are omitted from API requests. However, any non-pointer,
  5007. // non-interface field appearing in ForceSendFields will be sent to the
  5008. // server regardless of whether the field is empty or not. This may be
  5009. // used to include empty fields in Patch requests.
  5010. ForceSendFields []string `json:"-"`
  5011. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  5012. // API requests with the JSON null value. By default, fields with empty
  5013. // values are omitted from API requests. However, any field with an
  5014. // empty value appearing in NullFields will be sent to the server as
  5015. // null. It is an error if a field in this list has a non-empty value.
  5016. // This may be used to include null fields in Patch requests.
  5017. NullFields []string `json:"-"`
  5018. }
  5019. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  5020. type NoMethod DayPartTargeting
  5021. raw := NoMethod(*s)
  5022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5023. }
  5024. // DeepLink: Contains information about a landing page deep link.
  5025. type DeepLink struct {
  5026. // AppUrl: The URL of the mobile app being linked to.
  5027. AppUrl string `json:"appUrl,omitempty"`
  5028. // FallbackUrl: The fallback URL. This URL will be served to users who
  5029. // do not have the mobile app installed.
  5030. FallbackUrl string `json:"fallbackUrl,omitempty"`
  5031. // Kind: Identifies what kind of resource this is. Value: the fixed
  5032. // string "dfareporting#deepLink".
  5033. Kind string `json:"kind,omitempty"`
  5034. // MobileApp: The mobile app targeted by this deep link.
  5035. MobileApp *MobileApp `json:"mobileApp,omitempty"`
  5036. // RemarketingListIds: Ads served to users on these remarketing lists
  5037. // will use this deep link. Applicable when mobileApp.directory is
  5038. // APPLE_APP_STORE.
  5039. RemarketingListIds googleapi.Int64s `json:"remarketingListIds,omitempty"`
  5040. // ForceSendFields is a list of field names (e.g. "AppUrl") to
  5041. // unconditionally include in API requests. By default, fields with
  5042. // empty values are omitted from API requests. However, any non-pointer,
  5043. // non-interface field appearing in ForceSendFields will be sent to the
  5044. // server regardless of whether the field is empty or not. This may be
  5045. // used to include empty fields in Patch requests.
  5046. ForceSendFields []string `json:"-"`
  5047. // NullFields is a list of field names (e.g. "AppUrl") to include in API
  5048. // requests with the JSON null value. By default, fields with empty
  5049. // values are omitted from API requests. However, any field with an
  5050. // empty value appearing in NullFields will be sent to the server as
  5051. // null. It is an error if a field in this list has a non-empty value.
  5052. // This may be used to include null fields in Patch requests.
  5053. NullFields []string `json:"-"`
  5054. }
  5055. func (s *DeepLink) MarshalJSON() ([]byte, error) {
  5056. type NoMethod DeepLink
  5057. raw := NoMethod(*s)
  5058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5059. }
  5060. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  5061. // overriding the default click-through event tag. A campaign may
  5062. // override the event tag defined at the advertiser level, and an ad may
  5063. // also override the campaign's setting further.
  5064. type DefaultClickThroughEventTagProperties struct {
  5065. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  5066. // apply to all ads in this entity's scope.
  5067. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  5068. // OverrideInheritedEventTag: Whether this entity should override the
  5069. // inherited default click-through event tag with its own defined value.
  5070. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  5071. // ForceSendFields is a list of field names (e.g.
  5072. // "DefaultClickThroughEventTagId") to unconditionally include in API
  5073. // requests. By default, fields with empty values are omitted from API
  5074. // requests. However, any non-pointer, non-interface field appearing in
  5075. // ForceSendFields will be sent to the server regardless of whether the
  5076. // field is empty or not. This may be used to include empty fields in
  5077. // Patch requests.
  5078. ForceSendFields []string `json:"-"`
  5079. // NullFields is a list of field names (e.g.
  5080. // "DefaultClickThroughEventTagId") to include in API requests with the
  5081. // JSON null value. By default, fields with empty values are omitted
  5082. // from API requests. However, any field with an empty value appearing
  5083. // in NullFields will be sent to the server as null. It is an error if a
  5084. // field in this list has a non-empty value. This may be used to include
  5085. // null fields in Patch requests.
  5086. NullFields []string `json:"-"`
  5087. }
  5088. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  5089. type NoMethod DefaultClickThroughEventTagProperties
  5090. raw := NoMethod(*s)
  5091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5092. }
  5093. // DeliverySchedule: Delivery Schedule.
  5094. type DeliverySchedule struct {
  5095. // FrequencyCap: Limit on the number of times an individual user can be
  5096. // served the ad within a specified period of time.
  5097. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  5098. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  5099. // will not serve after the end date and time. Otherwise the ad will
  5100. // continue to be served until it has reached its delivery goals.
  5101. HardCutoff bool `json:"hardCutoff,omitempty"`
  5102. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  5103. // how often each ad is served relative to the others. For example, if
  5104. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  5105. // 3, then DCM will serve ad B three times as often as ad A. Acceptable
  5106. // values are 1 to 10, inclusive.
  5107. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  5108. // Priority: Serving priority of an ad, with respect to other ads. The
  5109. // lower the priority number, the greater the priority with which it is
  5110. // served.
  5111. //
  5112. // Possible values:
  5113. // "AD_PRIORITY_01"
  5114. // "AD_PRIORITY_02"
  5115. // "AD_PRIORITY_03"
  5116. // "AD_PRIORITY_04"
  5117. // "AD_PRIORITY_05"
  5118. // "AD_PRIORITY_06"
  5119. // "AD_PRIORITY_07"
  5120. // "AD_PRIORITY_08"
  5121. // "AD_PRIORITY_09"
  5122. // "AD_PRIORITY_10"
  5123. // "AD_PRIORITY_11"
  5124. // "AD_PRIORITY_12"
  5125. // "AD_PRIORITY_13"
  5126. // "AD_PRIORITY_14"
  5127. // "AD_PRIORITY_15"
  5128. // "AD_PRIORITY_16"
  5129. Priority string `json:"priority,omitempty"`
  5130. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  5131. // unconditionally include in API requests. By default, fields with
  5132. // empty values are omitted from API requests. However, any non-pointer,
  5133. // non-interface field appearing in ForceSendFields will be sent to the
  5134. // server regardless of whether the field is empty or not. This may be
  5135. // used to include empty fields in Patch requests.
  5136. ForceSendFields []string `json:"-"`
  5137. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  5138. // in API requests with the JSON null value. By default, fields with
  5139. // empty values are omitted from API requests. However, any field with
  5140. // an empty value appearing in NullFields will be sent to the server as
  5141. // null. It is an error if a field in this list has a non-empty value.
  5142. // This may be used to include null fields in Patch requests.
  5143. NullFields []string `json:"-"`
  5144. }
  5145. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  5146. type NoMethod DeliverySchedule
  5147. raw := NoMethod(*s)
  5148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5149. }
  5150. // DfpSettings: DFP Settings
  5151. type DfpSettings struct {
  5152. // DfpNetworkCode: DFP network code for this directory site.
  5153. DfpNetworkCode string `json:"dfpNetworkCode,omitempty"`
  5154. // DfpNetworkName: DFP network name for this directory site.
  5155. DfpNetworkName string `json:"dfpNetworkName,omitempty"`
  5156. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  5157. // programmatic placements.
  5158. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  5159. // PubPaidPlacementAccepted: Whether this directory site accepts
  5160. // publisher-paid tags.
  5161. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  5162. // PublisherPortalOnly: Whether this directory site is available only
  5163. // via DoubleClick Publisher Portal.
  5164. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  5165. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  5166. // unconditionally include in API requests. By default, fields with
  5167. // empty values are omitted from API requests. However, any non-pointer,
  5168. // non-interface field appearing in ForceSendFields will be sent to the
  5169. // server regardless of whether the field is empty or not. This may be
  5170. // used to include empty fields in Patch requests.
  5171. ForceSendFields []string `json:"-"`
  5172. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  5173. // include in API requests with the JSON null value. By default, fields
  5174. // with empty values are omitted from API requests. However, any field
  5175. // with an empty value appearing in NullFields will be sent to the
  5176. // server as null. It is an error if a field in this list has a
  5177. // non-empty value. This may be used to include null fields in Patch
  5178. // requests.
  5179. NullFields []string `json:"-"`
  5180. }
  5181. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  5182. type NoMethod DfpSettings
  5183. raw := NoMethod(*s)
  5184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5185. }
  5186. // Dimension: Represents a dimension.
  5187. type Dimension struct {
  5188. // Kind: The kind of resource this is, in this case
  5189. // dfareporting#dimension.
  5190. Kind string `json:"kind,omitempty"`
  5191. // Name: The dimension name, e.g. dfa:advertiser
  5192. Name string `json:"name,omitempty"`
  5193. // ForceSendFields is a list of field names (e.g. "Kind") to
  5194. // unconditionally include in API requests. By default, fields with
  5195. // empty values are omitted from API requests. However, any non-pointer,
  5196. // non-interface field appearing in ForceSendFields will be sent to the
  5197. // server regardless of whether the field is empty or not. This may be
  5198. // used to include empty fields in Patch requests.
  5199. ForceSendFields []string `json:"-"`
  5200. // NullFields is a list of field names (e.g. "Kind") to include in API
  5201. // requests with the JSON null value. By default, fields with empty
  5202. // values are omitted from API requests. However, any field with an
  5203. // empty value appearing in NullFields will be sent to the server as
  5204. // null. It is an error if a field in this list has a non-empty value.
  5205. // This may be used to include null fields in Patch requests.
  5206. NullFields []string `json:"-"`
  5207. }
  5208. func (s *Dimension) MarshalJSON() ([]byte, error) {
  5209. type NoMethod Dimension
  5210. raw := NoMethod(*s)
  5211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5212. }
  5213. // DimensionFilter: Represents a dimension filter.
  5214. type DimensionFilter struct {
  5215. // DimensionName: The name of the dimension to filter.
  5216. DimensionName string `json:"dimensionName,omitempty"`
  5217. // Kind: The kind of resource this is, in this case
  5218. // dfareporting#dimensionFilter.
  5219. Kind string `json:"kind,omitempty"`
  5220. // Value: The value of the dimension to filter.
  5221. Value string `json:"value,omitempty"`
  5222. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5223. // unconditionally include in API requests. By default, fields with
  5224. // empty values are omitted from API requests. However, any non-pointer,
  5225. // non-interface field appearing in ForceSendFields will be sent to the
  5226. // server regardless of whether the field is empty or not. This may be
  5227. // used to include empty fields in Patch requests.
  5228. ForceSendFields []string `json:"-"`
  5229. // NullFields is a list of field names (e.g. "DimensionName") to include
  5230. // in API requests with the JSON null value. By default, fields with
  5231. // empty values are omitted from API requests. However, any field with
  5232. // an empty value appearing in NullFields will be sent to the server as
  5233. // null. It is an error if a field in this list has a non-empty value.
  5234. // This may be used to include null fields in Patch requests.
  5235. NullFields []string `json:"-"`
  5236. }
  5237. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  5238. type NoMethod DimensionFilter
  5239. raw := NoMethod(*s)
  5240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5241. }
  5242. // DimensionValue: Represents a DimensionValue resource.
  5243. type DimensionValue struct {
  5244. // DimensionName: The name of the dimension.
  5245. DimensionName string `json:"dimensionName,omitempty"`
  5246. // Etag: The eTag of this response for caching purposes.
  5247. Etag string `json:"etag,omitempty"`
  5248. // Id: The ID associated with the value if available.
  5249. Id string `json:"id,omitempty"`
  5250. // Kind: The kind of resource this is, in this case
  5251. // dfareporting#dimensionValue.
  5252. Kind string `json:"kind,omitempty"`
  5253. // MatchType: Determines how the 'value' field is matched when
  5254. // filtering. If not specified, defaults to EXACT. If set to
  5255. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  5256. // length character sequences, and it can be escaped with a backslash.
  5257. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  5258. // matchType other than EXACT.
  5259. //
  5260. // Possible values:
  5261. // "BEGINS_WITH"
  5262. // "CONTAINS"
  5263. // "EXACT"
  5264. // "WILDCARD_EXPRESSION"
  5265. MatchType string `json:"matchType,omitempty"`
  5266. // Value: The value of the dimension.
  5267. Value string `json:"value,omitempty"`
  5268. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5269. // unconditionally include in API requests. By default, fields with
  5270. // empty values are omitted from API requests. However, any non-pointer,
  5271. // non-interface field appearing in ForceSendFields will be sent to the
  5272. // server regardless of whether the field is empty or not. This may be
  5273. // used to include empty fields in Patch requests.
  5274. ForceSendFields []string `json:"-"`
  5275. // NullFields is a list of field names (e.g. "DimensionName") to include
  5276. // in API requests with the JSON null value. By default, fields with
  5277. // empty values are omitted from API requests. However, any field with
  5278. // an empty value appearing in NullFields will be sent to the server as
  5279. // null. It is an error if a field in this list has a non-empty value.
  5280. // This may be used to include null fields in Patch requests.
  5281. NullFields []string `json:"-"`
  5282. }
  5283. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5284. type NoMethod DimensionValue
  5285. raw := NoMethod(*s)
  5286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5287. }
  5288. // DimensionValueList: Represents the list of DimensionValue resources.
  5289. type DimensionValueList struct {
  5290. // Etag: The eTag of this response for caching purposes.
  5291. Etag string `json:"etag,omitempty"`
  5292. // Items: The dimension values returned in this response.
  5293. Items []*DimensionValue `json:"items,omitempty"`
  5294. // Kind: The kind of list this is, in this case
  5295. // dfareporting#dimensionValueList.
  5296. Kind string `json:"kind,omitempty"`
  5297. // NextPageToken: Continuation token used to page through dimension
  5298. // values. To retrieve the next page of results, set the next request's
  5299. // "pageToken" to the value of this field. The page token is only valid
  5300. // for a limited amount of time and should not be persisted.
  5301. NextPageToken string `json:"nextPageToken,omitempty"`
  5302. // ServerResponse contains the HTTP response code and headers from the
  5303. // server.
  5304. googleapi.ServerResponse `json:"-"`
  5305. // ForceSendFields is a list of field names (e.g. "Etag") to
  5306. // unconditionally include in API requests. By default, fields with
  5307. // empty values are omitted from API requests. However, any non-pointer,
  5308. // non-interface field appearing in ForceSendFields will be sent to the
  5309. // server regardless of whether the field is empty or not. This may be
  5310. // used to include empty fields in Patch requests.
  5311. ForceSendFields []string `json:"-"`
  5312. // NullFields is a list of field names (e.g. "Etag") to include in API
  5313. // requests with the JSON null value. By default, fields with empty
  5314. // values are omitted from API requests. However, any field with an
  5315. // empty value appearing in NullFields will be sent to the server as
  5316. // null. It is an error if a field in this list has a non-empty value.
  5317. // This may be used to include null fields in Patch requests.
  5318. NullFields []string `json:"-"`
  5319. }
  5320. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5321. type NoMethod DimensionValueList
  5322. raw := NoMethod(*s)
  5323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5324. }
  5325. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5326. type DimensionValueRequest struct {
  5327. // DimensionName: The name of the dimension for which values should be
  5328. // requested.
  5329. DimensionName string `json:"dimensionName,omitempty"`
  5330. // EndDate: The end date of the date range for which to retrieve
  5331. // dimension values. A string of the format "yyyy-MM-dd".
  5332. EndDate string `json:"endDate,omitempty"`
  5333. // Filters: The list of filters by which to filter values. The filters
  5334. // are ANDed.
  5335. Filters []*DimensionFilter `json:"filters,omitempty"`
  5336. // Kind: The kind of request this is, in this case
  5337. // dfareporting#dimensionValueRequest.
  5338. Kind string `json:"kind,omitempty"`
  5339. // StartDate: The start date of the date range for which to retrieve
  5340. // dimension values. A string of the format "yyyy-MM-dd".
  5341. StartDate string `json:"startDate,omitempty"`
  5342. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5343. // unconditionally include in API requests. By default, fields with
  5344. // empty values are omitted from API requests. However, any non-pointer,
  5345. // non-interface field appearing in ForceSendFields will be sent to the
  5346. // server regardless of whether the field is empty or not. This may be
  5347. // used to include empty fields in Patch requests.
  5348. ForceSendFields []string `json:"-"`
  5349. // NullFields is a list of field names (e.g. "DimensionName") to include
  5350. // in API requests with the JSON null value. By default, fields with
  5351. // empty values are omitted from API requests. However, any field with
  5352. // an empty value appearing in NullFields will be sent to the server as
  5353. // null. It is an error if a field in this list has a non-empty value.
  5354. // This may be used to include null fields in Patch requests.
  5355. NullFields []string `json:"-"`
  5356. }
  5357. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5358. type NoMethod DimensionValueRequest
  5359. raw := NoMethod(*s)
  5360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5361. }
  5362. // DirectorySite: DirectorySites contains properties of a website from
  5363. // the Site Directory. Sites need to be added to an account via the
  5364. // Sites resource before they can be assigned to a placement.
  5365. type DirectorySite struct {
  5366. // Active: Whether this directory site is active.
  5367. Active bool `json:"active,omitempty"`
  5368. // ContactAssignments: Directory site contacts.
  5369. ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"`
  5370. // CountryId: Country ID of this directory site. This is a read-only
  5371. // field.
  5372. CountryId int64 `json:"countryId,omitempty,string"`
  5373. // CurrencyId: Currency ID of this directory site. This is a read-only
  5374. // field.
  5375. // Possible values are:
  5376. // - "1" for USD
  5377. // - "2" for GBP
  5378. // - "3" for ESP
  5379. // - "4" for SEK
  5380. // - "5" for CAD
  5381. // - "6" for JPY
  5382. // - "7" for DEM
  5383. // - "8" for AUD
  5384. // - "9" for FRF
  5385. // - "10" for ITL
  5386. // - "11" for DKK
  5387. // - "12" for NOK
  5388. // - "13" for FIM
  5389. // - "14" for ZAR
  5390. // - "15" for IEP
  5391. // - "16" for NLG
  5392. // - "17" for EUR
  5393. // - "18" for KRW
  5394. // - "19" for TWD
  5395. // - "20" for SGD
  5396. // - "21" for CNY
  5397. // - "22" for HKD
  5398. // - "23" for NZD
  5399. // - "24" for MYR
  5400. // - "25" for BRL
  5401. // - "26" for PTE
  5402. // - "27" for MXP
  5403. // - "28" for CLP
  5404. // - "29" for TRY
  5405. // - "30" for ARS
  5406. // - "31" for PEN
  5407. // - "32" for ILS
  5408. // - "33" for CHF
  5409. // - "34" for VEF
  5410. // - "35" for COP
  5411. // - "36" for GTQ
  5412. // - "37" for PLN
  5413. // - "39" for INR
  5414. // - "40" for THB
  5415. // - "41" for IDR
  5416. // - "42" for CZK
  5417. // - "43" for RON
  5418. // - "44" for HUF
  5419. // - "45" for RUB
  5420. // - "46" for AED
  5421. // - "47" for BGN
  5422. // - "48" for HRK
  5423. // - "49" for MXN
  5424. // - "50" for NGN
  5425. CurrencyId int64 `json:"currencyId,omitempty,string"`
  5426. // Description: Description of this directory site. This is a read-only
  5427. // field.
  5428. Description string `json:"description,omitempty"`
  5429. // Id: ID of this directory site. This is a read-only, auto-generated
  5430. // field.
  5431. Id int64 `json:"id,omitempty,string"`
  5432. // IdDimensionValue: Dimension value for the ID of this directory site.
  5433. // This is a read-only, auto-generated field.
  5434. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5435. // InpageTagFormats: Tag types for regular placements.
  5436. //
  5437. // Acceptable values are:
  5438. // - "STANDARD"
  5439. // - "IFRAME_JAVASCRIPT_INPAGE"
  5440. // - "INTERNAL_REDIRECT_INPAGE"
  5441. // - "JAVASCRIPT_INPAGE"
  5442. //
  5443. // Possible values:
  5444. // "IFRAME_JAVASCRIPT_INPAGE"
  5445. // "INTERNAL_REDIRECT_INPAGE"
  5446. // "JAVASCRIPT_INPAGE"
  5447. // "STANDARD"
  5448. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5449. // InterstitialTagFormats: Tag types for interstitial
  5450. // placements.
  5451. //
  5452. // Acceptable values are:
  5453. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5454. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5455. // - "JAVASCRIPT_INTERSTITIAL"
  5456. //
  5457. // Possible values:
  5458. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5459. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5460. // "JAVASCRIPT_INTERSTITIAL"
  5461. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5462. // Kind: Identifies what kind of resource this is. Value: the fixed
  5463. // string "dfareporting#directorySite".
  5464. Kind string `json:"kind,omitempty"`
  5465. // Name: Name of this directory site.
  5466. Name string `json:"name,omitempty"`
  5467. // ParentId: Parent directory site ID.
  5468. ParentId int64 `json:"parentId,omitempty,string"`
  5469. // Settings: Directory site settings.
  5470. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5471. // Url: URL of this directory site.
  5472. Url string `json:"url,omitempty"`
  5473. // ServerResponse contains the HTTP response code and headers from the
  5474. // server.
  5475. googleapi.ServerResponse `json:"-"`
  5476. // ForceSendFields is a list of field names (e.g. "Active") to
  5477. // unconditionally include in API requests. By default, fields with
  5478. // empty values are omitted from API requests. However, any non-pointer,
  5479. // non-interface field appearing in ForceSendFields will be sent to the
  5480. // server regardless of whether the field is empty or not. This may be
  5481. // used to include empty fields in Patch requests.
  5482. ForceSendFields []string `json:"-"`
  5483. // NullFields is a list of field names (e.g. "Active") to include in API
  5484. // requests with the JSON null value. By default, fields with empty
  5485. // values are omitted from API requests. However, any field with an
  5486. // empty value appearing in NullFields will be sent to the server as
  5487. // null. It is an error if a field in this list has a non-empty value.
  5488. // This may be used to include null fields in Patch requests.
  5489. NullFields []string `json:"-"`
  5490. }
  5491. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5492. type NoMethod DirectorySite
  5493. raw := NoMethod(*s)
  5494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5495. }
  5496. // DirectorySiteContact: Contains properties of a Site Directory
  5497. // contact.
  5498. type DirectorySiteContact struct {
  5499. // Address: Address of this directory site contact.
  5500. Address string `json:"address,omitempty"`
  5501. // Email: Email address of this directory site contact.
  5502. Email string `json:"email,omitempty"`
  5503. // FirstName: First name of this directory site contact.
  5504. FirstName string `json:"firstName,omitempty"`
  5505. // Id: ID of this directory site contact. This is a read-only,
  5506. // auto-generated field.
  5507. Id int64 `json:"id,omitempty,string"`
  5508. // Kind: Identifies what kind of resource this is. Value: the fixed
  5509. // string "dfareporting#directorySiteContact".
  5510. Kind string `json:"kind,omitempty"`
  5511. // LastName: Last name of this directory site contact.
  5512. LastName string `json:"lastName,omitempty"`
  5513. // Phone: Phone number of this directory site contact.
  5514. Phone string `json:"phone,omitempty"`
  5515. // Role: Directory site contact role.
  5516. //
  5517. // Possible values:
  5518. // "ADMIN"
  5519. // "EDIT"
  5520. // "VIEW"
  5521. Role string `json:"role,omitempty"`
  5522. // Title: Title or designation of this directory site contact.
  5523. Title string `json:"title,omitempty"`
  5524. // Type: Directory site contact type.
  5525. //
  5526. // Possible values:
  5527. // "BILLING"
  5528. // "OTHER"
  5529. // "SALES"
  5530. // "TECHNICAL"
  5531. Type string `json:"type,omitempty"`
  5532. // ServerResponse contains the HTTP response code and headers from the
  5533. // server.
  5534. googleapi.ServerResponse `json:"-"`
  5535. // ForceSendFields is a list of field names (e.g. "Address") to
  5536. // unconditionally include in API requests. By default, fields with
  5537. // empty values are omitted from API requests. However, any non-pointer,
  5538. // non-interface field appearing in ForceSendFields will be sent to the
  5539. // server regardless of whether the field is empty or not. This may be
  5540. // used to include empty fields in Patch requests.
  5541. ForceSendFields []string `json:"-"`
  5542. // NullFields is a list of field names (e.g. "Address") to include in
  5543. // API requests with the JSON null value. By default, fields with empty
  5544. // values are omitted from API requests. However, any field with an
  5545. // empty value appearing in NullFields will be sent to the server as
  5546. // null. It is an error if a field in this list has a non-empty value.
  5547. // This may be used to include null fields in Patch requests.
  5548. NullFields []string `json:"-"`
  5549. }
  5550. func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) {
  5551. type NoMethod DirectorySiteContact
  5552. raw := NoMethod(*s)
  5553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5554. }
  5555. // DirectorySiteContactAssignment: Directory Site Contact Assignment
  5556. type DirectorySiteContactAssignment struct {
  5557. // ContactId: ID of this directory site contact. This is a read-only,
  5558. // auto-generated field.
  5559. ContactId int64 `json:"contactId,omitempty,string"`
  5560. // Visibility: Visibility of this directory site contact assignment.
  5561. // When set to PUBLIC this contact assignment is visible to all account
  5562. // and agency users; when set to PRIVATE it is visible only to the site.
  5563. //
  5564. // Possible values:
  5565. // "PRIVATE"
  5566. // "PUBLIC"
  5567. Visibility string `json:"visibility,omitempty"`
  5568. // ForceSendFields is a list of field names (e.g. "ContactId") to
  5569. // unconditionally include in API requests. By default, fields with
  5570. // empty values are omitted from API requests. However, any non-pointer,
  5571. // non-interface field appearing in ForceSendFields will be sent to the
  5572. // server regardless of whether the field is empty or not. This may be
  5573. // used to include empty fields in Patch requests.
  5574. ForceSendFields []string `json:"-"`
  5575. // NullFields is a list of field names (e.g. "ContactId") to include in
  5576. // API requests with the JSON null value. By default, fields with empty
  5577. // values are omitted from API requests. However, any field with an
  5578. // empty value appearing in NullFields will be sent to the server as
  5579. // null. It is an error if a field in this list has a non-empty value.
  5580. // This may be used to include null fields in Patch requests.
  5581. NullFields []string `json:"-"`
  5582. }
  5583. func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) {
  5584. type NoMethod DirectorySiteContactAssignment
  5585. raw := NoMethod(*s)
  5586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5587. }
  5588. // DirectorySiteContactsListResponse: Directory Site Contact List
  5589. // Response
  5590. type DirectorySiteContactsListResponse struct {
  5591. // DirectorySiteContacts: Directory site contact collection
  5592. DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"`
  5593. // Kind: Identifies what kind of resource this is. Value: the fixed
  5594. // string "dfareporting#directorySiteContactsListResponse".
  5595. Kind string `json:"kind,omitempty"`
  5596. // NextPageToken: Pagination token to be used for the next list
  5597. // operation.
  5598. NextPageToken string `json:"nextPageToken,omitempty"`
  5599. // ServerResponse contains the HTTP response code and headers from the
  5600. // server.
  5601. googleapi.ServerResponse `json:"-"`
  5602. // ForceSendFields is a list of field names (e.g.
  5603. // "DirectorySiteContacts") to unconditionally include in API requests.
  5604. // By default, fields with empty values are omitted from API requests.
  5605. // However, any non-pointer, non-interface field appearing in
  5606. // ForceSendFields will be sent to the server regardless of whether the
  5607. // field is empty or not. This may be used to include empty fields in
  5608. // Patch requests.
  5609. ForceSendFields []string `json:"-"`
  5610. // NullFields is a list of field names (e.g. "DirectorySiteContacts") to
  5611. // include in API requests with the JSON null value. By default, fields
  5612. // with empty values are omitted from API requests. However, any field
  5613. // with an empty value appearing in NullFields will be sent to the
  5614. // server as null. It is an error if a field in this list has a
  5615. // non-empty value. This may be used to include null fields in Patch
  5616. // requests.
  5617. NullFields []string `json:"-"`
  5618. }
  5619. func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) {
  5620. type NoMethod DirectorySiteContactsListResponse
  5621. raw := NoMethod(*s)
  5622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5623. }
  5624. // DirectorySiteSettings: Directory Site Settings
  5625. type DirectorySiteSettings struct {
  5626. // ActiveViewOptOut: Whether this directory site has disabled active
  5627. // view creatives.
  5628. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5629. // DfpSettings: Directory site DFP settings.
  5630. DfpSettings *DfpSettings `json:"dfpSettings,omitempty"`
  5631. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5632. // video ads.
  5633. InstreamVideoPlacementAccepted bool `json:"instreamVideoPlacementAccepted,omitempty"`
  5634. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5635. // ads.
  5636. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5637. // NielsenOcrOptOut: Whether this directory site has disabled Nielsen
  5638. // OCR reach ratings.
  5639. NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"`
  5640. // VerificationTagOptOut: Whether this directory site has disabled
  5641. // generation of Verification ins tags.
  5642. VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"`
  5643. // VideoActiveViewOptOut: Whether this directory site has disabled
  5644. // active view for in-stream video creatives. This is a read-only field.
  5645. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  5646. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5647. // unconditionally include in API requests. By default, fields with
  5648. // empty values are omitted from API requests. However, any non-pointer,
  5649. // non-interface field appearing in ForceSendFields will be sent to the
  5650. // server regardless of whether the field is empty or not. This may be
  5651. // used to include empty fields in Patch requests.
  5652. ForceSendFields []string `json:"-"`
  5653. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5654. // include in API requests with the JSON null value. By default, fields
  5655. // with empty values are omitted from API requests. However, any field
  5656. // with an empty value appearing in NullFields will be sent to the
  5657. // server as null. It is an error if a field in this list has a
  5658. // non-empty value. This may be used to include null fields in Patch
  5659. // requests.
  5660. NullFields []string `json:"-"`
  5661. }
  5662. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5663. type NoMethod DirectorySiteSettings
  5664. raw := NoMethod(*s)
  5665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5666. }
  5667. // DirectorySitesListResponse: Directory Site List Response
  5668. type DirectorySitesListResponse struct {
  5669. // DirectorySites: Directory site collection.
  5670. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5671. // Kind: Identifies what kind of resource this is. Value: the fixed
  5672. // string "dfareporting#directorySitesListResponse".
  5673. Kind string `json:"kind,omitempty"`
  5674. // NextPageToken: Pagination token to be used for the next list
  5675. // operation.
  5676. NextPageToken string `json:"nextPageToken,omitempty"`
  5677. // ServerResponse contains the HTTP response code and headers from the
  5678. // server.
  5679. googleapi.ServerResponse `json:"-"`
  5680. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5681. // unconditionally include in API requests. By default, fields with
  5682. // empty values are omitted from API requests. However, any non-pointer,
  5683. // non-interface field appearing in ForceSendFields will be sent to the
  5684. // server regardless of whether the field is empty or not. This may be
  5685. // used to include empty fields in Patch requests.
  5686. ForceSendFields []string `json:"-"`
  5687. // NullFields is a list of field names (e.g. "DirectorySites") to
  5688. // include in API requests with the JSON null value. By default, fields
  5689. // with empty values are omitted from API requests. However, any field
  5690. // with an empty value appearing in NullFields will be sent to the
  5691. // server as null. It is an error if a field in this list has a
  5692. // non-empty value. This may be used to include null fields in Patch
  5693. // requests.
  5694. NullFields []string `json:"-"`
  5695. }
  5696. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5697. type NoMethod DirectorySitesListResponse
  5698. raw := NoMethod(*s)
  5699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5700. }
  5701. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5702. // Dynamic targeting keys are unique, user-friendly labels, created at
  5703. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5704. // and placements and used for targeting with DoubleClick Studio dynamic
  5705. // creatives. Use these labels instead of numeric DCM IDs (such as
  5706. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5707. type DynamicTargetingKey struct {
  5708. // Kind: Identifies what kind of resource this is. Value: the fixed
  5709. // string "dfareporting#dynamicTargetingKey".
  5710. Kind string `json:"kind,omitempty"`
  5711. // Name: Name of this dynamic targeting key. This is a required field.
  5712. // Must be less than 256 characters long and cannot contain commas. All
  5713. // characters are converted to lowercase.
  5714. Name string `json:"name,omitempty"`
  5715. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5716. // required field.
  5717. ObjectId int64 `json:"objectId,omitempty,string"`
  5718. // ObjectType: Type of the object of this dynamic targeting key. This is
  5719. // a required field.
  5720. //
  5721. // Possible values:
  5722. // "OBJECT_AD"
  5723. // "OBJECT_ADVERTISER"
  5724. // "OBJECT_CREATIVE"
  5725. // "OBJECT_PLACEMENT"
  5726. ObjectType string `json:"objectType,omitempty"`
  5727. // ServerResponse contains the HTTP response code and headers from the
  5728. // server.
  5729. googleapi.ServerResponse `json:"-"`
  5730. // ForceSendFields is a list of field names (e.g. "Kind") to
  5731. // unconditionally include in API requests. By default, fields with
  5732. // empty values are omitted from API requests. However, any non-pointer,
  5733. // non-interface field appearing in ForceSendFields will be sent to the
  5734. // server regardless of whether the field is empty or not. This may be
  5735. // used to include empty fields in Patch requests.
  5736. ForceSendFields []string `json:"-"`
  5737. // NullFields is a list of field names (e.g. "Kind") to include in API
  5738. // requests with the JSON null value. By default, fields with empty
  5739. // values are omitted from API requests. However, any field with an
  5740. // empty value appearing in NullFields will be sent to the server as
  5741. // null. It is an error if a field in this list has a non-empty value.
  5742. // This may be used to include null fields in Patch requests.
  5743. NullFields []string `json:"-"`
  5744. }
  5745. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5746. type NoMethod DynamicTargetingKey
  5747. raw := NoMethod(*s)
  5748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5749. }
  5750. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5751. type DynamicTargetingKeysListResponse struct {
  5752. // DynamicTargetingKeys: Dynamic targeting key collection.
  5753. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5754. // Kind: Identifies what kind of resource this is. Value: the fixed
  5755. // string "dfareporting#dynamicTargetingKeysListResponse".
  5756. Kind string `json:"kind,omitempty"`
  5757. // ServerResponse contains the HTTP response code and headers from the
  5758. // server.
  5759. googleapi.ServerResponse `json:"-"`
  5760. // ForceSendFields is a list of field names (e.g.
  5761. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5762. // By default, fields with empty values are omitted from API requests.
  5763. // However, any non-pointer, non-interface field appearing in
  5764. // ForceSendFields will be sent to the server regardless of whether the
  5765. // field is empty or not. This may be used to include empty fields in
  5766. // Patch requests.
  5767. ForceSendFields []string `json:"-"`
  5768. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5769. // include in API requests with the JSON null value. By default, fields
  5770. // with empty values are omitted from API requests. However, any field
  5771. // with an empty value appearing in NullFields will be sent to the
  5772. // server as null. It is an error if a field in this list has a
  5773. // non-empty value. This may be used to include null fields in Patch
  5774. // requests.
  5775. NullFields []string `json:"-"`
  5776. }
  5777. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5778. type NoMethod DynamicTargetingKeysListResponse
  5779. raw := NoMethod(*s)
  5780. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5781. }
  5782. // EncryptionInfo: A description of how user IDs are encrypted.
  5783. type EncryptionInfo struct {
  5784. // EncryptionEntityId: The encryption entity ID. This should match the
  5785. // encryption configuration for ad serving or Data Transfer.
  5786. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5787. // EncryptionEntityType: The encryption entity type. This should match
  5788. // the encryption configuration for ad serving or Data Transfer.
  5789. //
  5790. // Possible values:
  5791. // "ADWORDS_CUSTOMER"
  5792. // "DBM_ADVERTISER"
  5793. // "DBM_PARTNER"
  5794. // "DCM_ACCOUNT"
  5795. // "DCM_ADVERTISER"
  5796. // "DFP_NETWORK_CODE"
  5797. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5798. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5799. // EncryptionSource: Describes whether the encrypted cookie was received
  5800. // from ad serving (the %m macro) or from Data Transfer.
  5801. //
  5802. // Possible values:
  5803. // "AD_SERVING"
  5804. // "DATA_TRANSFER"
  5805. // "ENCRYPTION_SCOPE_UNKNOWN"
  5806. EncryptionSource string `json:"encryptionSource,omitempty"`
  5807. // Kind: Identifies what kind of resource this is. Value: the fixed
  5808. // string "dfareporting#encryptionInfo".
  5809. Kind string `json:"kind,omitempty"`
  5810. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5811. // to unconditionally include in API requests. By default, fields with
  5812. // empty values are omitted from API requests. However, any non-pointer,
  5813. // non-interface field appearing in ForceSendFields will be sent to the
  5814. // server regardless of whether the field is empty or not. This may be
  5815. // used to include empty fields in Patch requests.
  5816. ForceSendFields []string `json:"-"`
  5817. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5818. // include in API requests with the JSON null value. By default, fields
  5819. // with empty values are omitted from API requests. However, any field
  5820. // with an empty value appearing in NullFields will be sent to the
  5821. // server as null. It is an error if a field in this list has a
  5822. // non-empty value. This may be used to include null fields in Patch
  5823. // requests.
  5824. NullFields []string `json:"-"`
  5825. }
  5826. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5827. type NoMethod EncryptionInfo
  5828. raw := NoMethod(*s)
  5829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5830. }
  5831. // EventTag: Contains properties of an event tag.
  5832. type EventTag struct {
  5833. // AccountId: Account ID of this event tag. This is a read-only field
  5834. // that can be left blank.
  5835. AccountId int64 `json:"accountId,omitempty,string"`
  5836. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5837. // campaignId field is required on insertion.
  5838. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5839. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5840. // advertiser. This is a read-only, auto-generated field.
  5841. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5842. // CampaignId: Campaign ID of this event tag. This field or the
  5843. // advertiserId field is required on insertion.
  5844. CampaignId int64 `json:"campaignId,omitempty,string"`
  5845. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5846. // This is a read-only, auto-generated field.
  5847. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5848. // EnabledByDefault: Whether this event tag should be automatically
  5849. // enabled for all of the advertiser's campaigns and ads.
  5850. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5851. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5852. // that are trafficked through DoubleClick Bid Manager to Ad Exchange.
  5853. // This may be useful if the event tag uses a pixel that is unapproved
  5854. // for Ad Exchange bids on one or more networks, such as the Google
  5855. // Display Network.
  5856. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5857. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5858. Id int64 `json:"id,omitempty,string"`
  5859. // Kind: Identifies what kind of resource this is. Value: the fixed
  5860. // string "dfareporting#eventTag".
  5861. Kind string `json:"kind,omitempty"`
  5862. // Name: Name of this event tag. This is a required field and must be
  5863. // less than 256 characters long.
  5864. Name string `json:"name,omitempty"`
  5865. // SiteFilterType: Site filter type for this event tag. If no type is
  5866. // specified then the event tag will be applied to all sites.
  5867. //
  5868. // Possible values:
  5869. // "BLACKLIST"
  5870. // "WHITELIST"
  5871. SiteFilterType string `json:"siteFilterType,omitempty"`
  5872. // SiteIds: Filter list of site IDs associated with this event tag. The
  5873. // siteFilterType determines whether this is a whitelist or blacklist
  5874. // filter.
  5875. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5876. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5877. // read-only field.
  5878. SslCompliant bool `json:"sslCompliant,omitempty"`
  5879. // Status: Status of this event tag. Must be ENABLED for this event tag
  5880. // to fire. This is a required field.
  5881. //
  5882. // Possible values:
  5883. // "DISABLED"
  5884. // "ENABLED"
  5885. Status string `json:"status,omitempty"`
  5886. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5887. // field that can be left blank.
  5888. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5889. // Type: Event tag type. Can be used to specify whether to use a
  5890. // third-party pixel, a third-party JavaScript URL, or a third-party
  5891. // click-through URL for either impression or click tracking. This is a
  5892. // required field.
  5893. //
  5894. // Possible values:
  5895. // "CLICK_THROUGH_EVENT_TAG"
  5896. // "IMPRESSION_IMAGE_EVENT_TAG"
  5897. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5898. Type string `json:"type,omitempty"`
  5899. // Url: Payload URL for this event tag. The URL on a click-through event
  5900. // tag should have a landing page URL appended to the end of it. This
  5901. // field is required on insertion.
  5902. Url string `json:"url,omitempty"`
  5903. // UrlEscapeLevels: Number of times the landing page URL should be
  5904. // URL-escaped before being appended to the click-through event tag URL.
  5905. // Only applies to click-through event tags as specified by the event
  5906. // tag type.
  5907. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5908. // ServerResponse contains the HTTP response code and headers from the
  5909. // server.
  5910. googleapi.ServerResponse `json:"-"`
  5911. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5912. // unconditionally include in API requests. By default, fields with
  5913. // empty values are omitted from API requests. However, any non-pointer,
  5914. // non-interface field appearing in ForceSendFields will be sent to the
  5915. // server regardless of whether the field is empty or not. This may be
  5916. // used to include empty fields in Patch requests.
  5917. ForceSendFields []string `json:"-"`
  5918. // NullFields is a list of field names (e.g. "AccountId") to include in
  5919. // API requests with the JSON null value. By default, fields with empty
  5920. // values are omitted from API requests. However, any field with an
  5921. // empty value appearing in NullFields will be sent to the server as
  5922. // null. It is an error if a field in this list has a non-empty value.
  5923. // This may be used to include null fields in Patch requests.
  5924. NullFields []string `json:"-"`
  5925. }
  5926. func (s *EventTag) MarshalJSON() ([]byte, error) {
  5927. type NoMethod EventTag
  5928. raw := NoMethod(*s)
  5929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5930. }
  5931. // EventTagOverride: Event tag override information.
  5932. type EventTagOverride struct {
  5933. // Enabled: Whether this override is enabled.
  5934. Enabled bool `json:"enabled,omitempty"`
  5935. // Id: ID of this event tag override. This is a read-only,
  5936. // auto-generated field.
  5937. Id int64 `json:"id,omitempty,string"`
  5938. // ForceSendFields is a list of field names (e.g. "Enabled") to
  5939. // unconditionally include in API requests. By default, fields with
  5940. // empty values are omitted from API requests. However, any non-pointer,
  5941. // non-interface field appearing in ForceSendFields will be sent to the
  5942. // server regardless of whether the field is empty or not. This may be
  5943. // used to include empty fields in Patch requests.
  5944. ForceSendFields []string `json:"-"`
  5945. // NullFields is a list of field names (e.g. "Enabled") to include in
  5946. // API requests with the JSON null value. By default, fields with empty
  5947. // values are omitted from API requests. However, any field with an
  5948. // empty value appearing in NullFields will be sent to the server as
  5949. // null. It is an error if a field in this list has a non-empty value.
  5950. // This may be used to include null fields in Patch requests.
  5951. NullFields []string `json:"-"`
  5952. }
  5953. func (s *EventTagOverride) MarshalJSON() ([]byte, error) {
  5954. type NoMethod EventTagOverride
  5955. raw := NoMethod(*s)
  5956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5957. }
  5958. // EventTagsListResponse: Event Tag List Response
  5959. type EventTagsListResponse struct {
  5960. // EventTags: Event tag collection.
  5961. EventTags []*EventTag `json:"eventTags,omitempty"`
  5962. // Kind: Identifies what kind of resource this is. Value: the fixed
  5963. // string "dfareporting#eventTagsListResponse".
  5964. Kind string `json:"kind,omitempty"`
  5965. // ServerResponse contains the HTTP response code and headers from the
  5966. // server.
  5967. googleapi.ServerResponse `json:"-"`
  5968. // ForceSendFields is a list of field names (e.g. "EventTags") to
  5969. // unconditionally include in API requests. By default, fields with
  5970. // empty values are omitted from API requests. However, any non-pointer,
  5971. // non-interface field appearing in ForceSendFields will be sent to the
  5972. // server regardless of whether the field is empty or not. This may be
  5973. // used to include empty fields in Patch requests.
  5974. ForceSendFields []string `json:"-"`
  5975. // NullFields is a list of field names (e.g. "EventTags") to include in
  5976. // API requests with the JSON null value. By default, fields with empty
  5977. // values are omitted from API requests. However, any field with an
  5978. // empty value appearing in NullFields will be sent to the server as
  5979. // null. It is an error if a field in this list has a non-empty value.
  5980. // This may be used to include null fields in Patch requests.
  5981. NullFields []string `json:"-"`
  5982. }
  5983. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  5984. type NoMethod EventTagsListResponse
  5985. raw := NoMethod(*s)
  5986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5987. }
  5988. // File: Represents a File resource. A file contains the metadata for a
  5989. // report run. It shows the status of the run and holds the URLs to the
  5990. // generated report data if the run is finished and the status is
  5991. // "REPORT_AVAILABLE".
  5992. type File struct {
  5993. // DateRange: The date range for which the file has report data. The
  5994. // date range will always be the absolute date range for which the
  5995. // report is run.
  5996. DateRange *DateRange `json:"dateRange,omitempty"`
  5997. // Etag: The eTag of this response for caching purposes.
  5998. Etag string `json:"etag,omitempty"`
  5999. // FileName: The filename of the file.
  6000. FileName string `json:"fileName,omitempty"`
  6001. // Format: The output format of the report. Only available once the file
  6002. // is available.
  6003. //
  6004. // Possible values:
  6005. // "CSV"
  6006. // "EXCEL"
  6007. Format string `json:"format,omitempty"`
  6008. // Id: The unique ID of this report file.
  6009. Id int64 `json:"id,omitempty,string"`
  6010. // Kind: The kind of resource this is, in this case dfareporting#file.
  6011. Kind string `json:"kind,omitempty"`
  6012. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  6013. // file was last modified.
  6014. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  6015. // ReportId: The ID of the report this file was generated from.
  6016. ReportId int64 `json:"reportId,omitempty,string"`
  6017. // Status: The status of the report file.
  6018. //
  6019. // Possible values:
  6020. // "CANCELLED"
  6021. // "FAILED"
  6022. // "PROCESSING"
  6023. // "REPORT_AVAILABLE"
  6024. Status string `json:"status,omitempty"`
  6025. // Urls: The URLs where the completed report file can be downloaded.
  6026. Urls *FileUrls `json:"urls,omitempty"`
  6027. // ServerResponse contains the HTTP response code and headers from the
  6028. // server.
  6029. googleapi.ServerResponse `json:"-"`
  6030. // ForceSendFields is a list of field names (e.g. "DateRange") to
  6031. // unconditionally include in API requests. By default, fields with
  6032. // empty values are omitted from API requests. However, any non-pointer,
  6033. // non-interface field appearing in ForceSendFields will be sent to the
  6034. // server regardless of whether the field is empty or not. This may be
  6035. // used to include empty fields in Patch requests.
  6036. ForceSendFields []string `json:"-"`
  6037. // NullFields is a list of field names (e.g. "DateRange") to include in
  6038. // API requests with the JSON null value. By default, fields with empty
  6039. // values are omitted from API requests. However, any field with an
  6040. // empty value appearing in NullFields will be sent to the server as
  6041. // null. It is an error if a field in this list has a non-empty value.
  6042. // This may be used to include null fields in Patch requests.
  6043. NullFields []string `json:"-"`
  6044. }
  6045. func (s *File) MarshalJSON() ([]byte, error) {
  6046. type NoMethod File
  6047. raw := NoMethod(*s)
  6048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6049. }
  6050. // FileUrls: The URLs where the completed report file can be downloaded.
  6051. type FileUrls struct {
  6052. // ApiUrl: The URL for downloading the report data through the API.
  6053. ApiUrl string `json:"apiUrl,omitempty"`
  6054. // BrowserUrl: The URL for downloading the report data through a
  6055. // browser.
  6056. BrowserUrl string `json:"browserUrl,omitempty"`
  6057. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  6058. // unconditionally include in API requests. By default, fields with
  6059. // empty values are omitted from API requests. However, any non-pointer,
  6060. // non-interface field appearing in ForceSendFields will be sent to the
  6061. // server regardless of whether the field is empty or not. This may be
  6062. // used to include empty fields in Patch requests.
  6063. ForceSendFields []string `json:"-"`
  6064. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  6065. // requests with the JSON null value. By default, fields with empty
  6066. // values are omitted from API requests. However, any field with an
  6067. // empty value appearing in NullFields will be sent to the server as
  6068. // null. It is an error if a field in this list has a non-empty value.
  6069. // This may be used to include null fields in Patch requests.
  6070. NullFields []string `json:"-"`
  6071. }
  6072. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  6073. type NoMethod FileUrls
  6074. raw := NoMethod(*s)
  6075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6076. }
  6077. // FileList: Represents the list of File resources.
  6078. type FileList struct {
  6079. // Etag: The eTag of this response for caching purposes.
  6080. Etag string `json:"etag,omitempty"`
  6081. // Items: The files returned in this response.
  6082. Items []*File `json:"items,omitempty"`
  6083. // Kind: The kind of list this is, in this case dfareporting#fileList.
  6084. Kind string `json:"kind,omitempty"`
  6085. // NextPageToken: Continuation token used to page through files. To
  6086. // retrieve the next page of results, set the next request's "pageToken"
  6087. // to the value of this field. The page token is only valid for a
  6088. // limited amount of time and should not be persisted.
  6089. NextPageToken string `json:"nextPageToken,omitempty"`
  6090. // ServerResponse contains the HTTP response code and headers from the
  6091. // server.
  6092. googleapi.ServerResponse `json:"-"`
  6093. // ForceSendFields is a list of field names (e.g. "Etag") to
  6094. // unconditionally include in API requests. By default, fields with
  6095. // empty values are omitted from API requests. However, any non-pointer,
  6096. // non-interface field appearing in ForceSendFields will be sent to the
  6097. // server regardless of whether the field is empty or not. This may be
  6098. // used to include empty fields in Patch requests.
  6099. ForceSendFields []string `json:"-"`
  6100. // NullFields is a list of field names (e.g. "Etag") to include in API
  6101. // requests with the JSON null value. By default, fields with empty
  6102. // values are omitted from API requests. However, any field with an
  6103. // empty value appearing in NullFields will be sent to the server as
  6104. // null. It is an error if a field in this list has a non-empty value.
  6105. // This may be used to include null fields in Patch requests.
  6106. NullFields []string `json:"-"`
  6107. }
  6108. func (s *FileList) MarshalJSON() ([]byte, error) {
  6109. type NoMethod FileList
  6110. raw := NoMethod(*s)
  6111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6112. }
  6113. // Flight: Flight
  6114. type Flight struct {
  6115. // EndDate: Inventory item flight end date.
  6116. EndDate string `json:"endDate,omitempty"`
  6117. // RateOrCost: Rate or cost of this flight.
  6118. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  6119. // StartDate: Inventory item flight start date.
  6120. StartDate string `json:"startDate,omitempty"`
  6121. // Units: Units of this flight.
  6122. Units int64 `json:"units,omitempty,string"`
  6123. // ForceSendFields is a list of field names (e.g. "EndDate") to
  6124. // unconditionally include in API requests. By default, fields with
  6125. // empty values are omitted from API requests. However, any non-pointer,
  6126. // non-interface field appearing in ForceSendFields will be sent to the
  6127. // server regardless of whether the field is empty or not. This may be
  6128. // used to include empty fields in Patch requests.
  6129. ForceSendFields []string `json:"-"`
  6130. // NullFields is a list of field names (e.g. "EndDate") to include in
  6131. // API requests with the JSON null value. By default, fields with empty
  6132. // values are omitted from API requests. However, any field with an
  6133. // empty value appearing in NullFields will be sent to the server as
  6134. // null. It is an error if a field in this list has a non-empty value.
  6135. // This may be used to include null fields in Patch requests.
  6136. NullFields []string `json:"-"`
  6137. }
  6138. func (s *Flight) MarshalJSON() ([]byte, error) {
  6139. type NoMethod Flight
  6140. raw := NoMethod(*s)
  6141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6142. }
  6143. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  6144. // GenerateTag Response
  6145. type FloodlightActivitiesGenerateTagResponse struct {
  6146. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  6147. // For global site tags, this is the event snippet.
  6148. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  6149. // GlobalSiteTagGlobalSnippet: The global snippet section of a global
  6150. // site tag. The global site tag sets new cookies on your domain, which
  6151. // will store a unique identifier for a user or the ad click that
  6152. // brought the user to your site. Learn more.
  6153. GlobalSiteTagGlobalSnippet string `json:"globalSiteTagGlobalSnippet,omitempty"`
  6154. // Kind: Identifies what kind of resource this is. Value: the fixed
  6155. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  6156. Kind string `json:"kind,omitempty"`
  6157. // ServerResponse contains the HTTP response code and headers from the
  6158. // server.
  6159. googleapi.ServerResponse `json:"-"`
  6160. // ForceSendFields is a list of field names (e.g.
  6161. // "FloodlightActivityTag") to unconditionally include in API requests.
  6162. // By default, fields with empty values are omitted from API requests.
  6163. // However, any non-pointer, non-interface field appearing in
  6164. // ForceSendFields will be sent to the server regardless of whether the
  6165. // field is empty or not. This may be used to include empty fields in
  6166. // Patch requests.
  6167. ForceSendFields []string `json:"-"`
  6168. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  6169. // include in API requests with the JSON null value. By default, fields
  6170. // with empty values are omitted from API requests. However, any field
  6171. // with an empty value appearing in NullFields will be sent to the
  6172. // server as null. It is an error if a field in this list has a
  6173. // non-empty value. This may be used to include null fields in Patch
  6174. // requests.
  6175. NullFields []string `json:"-"`
  6176. }
  6177. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  6178. type NoMethod FloodlightActivitiesGenerateTagResponse
  6179. raw := NoMethod(*s)
  6180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6181. }
  6182. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  6183. type FloodlightActivitiesListResponse struct {
  6184. // FloodlightActivities: Floodlight activity collection.
  6185. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  6186. // Kind: Identifies what kind of resource this is. Value: the fixed
  6187. // string "dfareporting#floodlightActivitiesListResponse".
  6188. Kind string `json:"kind,omitempty"`
  6189. // NextPageToken: Pagination token to be used for the next list
  6190. // operation.
  6191. NextPageToken string `json:"nextPageToken,omitempty"`
  6192. // ServerResponse contains the HTTP response code and headers from the
  6193. // server.
  6194. googleapi.ServerResponse `json:"-"`
  6195. // ForceSendFields is a list of field names (e.g.
  6196. // "FloodlightActivities") to unconditionally include in API requests.
  6197. // By default, fields with empty values are omitted from API requests.
  6198. // However, any non-pointer, non-interface field appearing in
  6199. // ForceSendFields will be sent to the server regardless of whether the
  6200. // field is empty or not. This may be used to include empty fields in
  6201. // Patch requests.
  6202. ForceSendFields []string `json:"-"`
  6203. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  6204. // include in API requests with the JSON null value. By default, fields
  6205. // with empty values are omitted from API requests. However, any field
  6206. // with an empty value appearing in NullFields will be sent to the
  6207. // server as null. It is an error if a field in this list has a
  6208. // non-empty value. This may be used to include null fields in Patch
  6209. // requests.
  6210. NullFields []string `json:"-"`
  6211. }
  6212. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  6213. type NoMethod FloodlightActivitiesListResponse
  6214. raw := NoMethod(*s)
  6215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6216. }
  6217. // FloodlightActivity: Contains properties of a Floodlight activity.
  6218. type FloodlightActivity struct {
  6219. // AccountId: Account ID of this floodlight activity. This is a
  6220. // read-only field that can be left blank.
  6221. AccountId int64 `json:"accountId,omitempty,string"`
  6222. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  6223. // field is left blank, the value will be copied over either from the
  6224. // activity group's advertiser or the existing activity's advertiser.
  6225. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6226. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6227. // advertiser. This is a read-only, auto-generated field.
  6228. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6229. // CacheBustingType: Code type used for cache busting in the generated
  6230. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  6231. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  6232. //
  6233. // Possible values:
  6234. // "ACTIVE_SERVER_PAGE"
  6235. // "COLD_FUSION"
  6236. // "JAVASCRIPT"
  6237. // "JSP"
  6238. // "PHP"
  6239. CacheBustingType string `json:"cacheBustingType,omitempty"`
  6240. // CountingMethod: Counting method for conversions for this floodlight
  6241. // activity. This is a required field.
  6242. //
  6243. // Possible values:
  6244. // "ITEMS_SOLD_COUNTING"
  6245. // "SESSION_COUNTING"
  6246. // "STANDARD_COUNTING"
  6247. // "TRANSACTIONS_COUNTING"
  6248. // "UNIQUE_COUNTING"
  6249. CountingMethod string `json:"countingMethod,omitempty"`
  6250. // DefaultTags: Dynamic floodlight tags.
  6251. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  6252. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  6253. // be less than 256 characters long.
  6254. ExpectedUrl string `json:"expectedUrl,omitempty"`
  6255. // FloodlightActivityGroupId: Floodlight activity group ID of this
  6256. // floodlight activity. This is a required field.
  6257. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  6258. // FloodlightActivityGroupName: Name of the associated floodlight
  6259. // activity group. This is a read-only field.
  6260. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  6261. // FloodlightActivityGroupTagString: Tag string of the associated
  6262. // floodlight activity group. This is a read-only field.
  6263. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  6264. // FloodlightActivityGroupType: Type of the associated floodlight
  6265. // activity group. This is a read-only field.
  6266. //
  6267. // Possible values:
  6268. // "COUNTER"
  6269. // "SALE"
  6270. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6271. // FloodlightConfigurationId: Floodlight configuration ID of this
  6272. // floodlight activity. If this field is left blank, the value will be
  6273. // copied over either from the activity group's floodlight configuration
  6274. // or from the existing activity's floodlight configuration.
  6275. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6276. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6277. // of the floodlight configuration. This is a read-only, auto-generated
  6278. // field.
  6279. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6280. // FloodlightTagType: The type of Floodlight tag this activity will
  6281. // generate. This is a required field.
  6282. //
  6283. // Possible values:
  6284. // "GLOBAL_SITE_TAG"
  6285. // "IFRAME"
  6286. // "IMAGE"
  6287. FloodlightTagType string `json:"floodlightTagType,omitempty"`
  6288. // Hidden: Whether this activity is archived.
  6289. Hidden bool `json:"hidden,omitempty"`
  6290. // Id: ID of this floodlight activity. This is a read-only,
  6291. // auto-generated field.
  6292. Id int64 `json:"id,omitempty,string"`
  6293. // IdDimensionValue: Dimension value for the ID of this floodlight
  6294. // activity. This is a read-only, auto-generated field.
  6295. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6296. // Kind: Identifies what kind of resource this is. Value: the fixed
  6297. // string "dfareporting#floodlightActivity".
  6298. Kind string `json:"kind,omitempty"`
  6299. // Name: Name of this floodlight activity. This is a required field.
  6300. // Must be less than 129 characters long and cannot contain quotes.
  6301. Name string `json:"name,omitempty"`
  6302. // Notes: General notes or implementation instructions for the tag.
  6303. Notes string `json:"notes,omitempty"`
  6304. // PublisherTags: Publisher dynamic floodlight tags.
  6305. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6306. // Secure: Whether this tag should use SSL.
  6307. Secure bool `json:"secure,omitempty"`
  6308. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6309. // is a read-only field, its value detected by the system from the
  6310. // floodlight tags.
  6311. SslCompliant bool `json:"sslCompliant,omitempty"`
  6312. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6313. SslRequired bool `json:"sslRequired,omitempty"`
  6314. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6315. // read-only field that can be left blank.
  6316. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6317. // TagFormat: Tag format type for the floodlight activity. If left
  6318. // blank, the tag format will default to HTML.
  6319. //
  6320. // Possible values:
  6321. // "HTML"
  6322. // "XHTML"
  6323. TagFormat string `json:"tagFormat,omitempty"`
  6324. // TagString: Value of the cat= parameter in the floodlight tag, which
  6325. // the ad servers use to identify the activity. This is optional: if
  6326. // empty, a new tag string will be generated for you. This string must
  6327. // be 1 to 8 characters long, with valid characters being
  6328. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6329. // activities of the same activity group. This field is read-only after
  6330. // insertion.
  6331. TagString string `json:"tagString,omitempty"`
  6332. // UserDefinedVariableTypes: List of the user-defined variables used by
  6333. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6334. // of these can have a user defined type.
  6335. // Acceptable values are U1 to U100, inclusive.
  6336. //
  6337. // Possible values:
  6338. // "U1"
  6339. // "U10"
  6340. // "U100"
  6341. // "U11"
  6342. // "U12"
  6343. // "U13"
  6344. // "U14"
  6345. // "U15"
  6346. // "U16"
  6347. // "U17"
  6348. // "U18"
  6349. // "U19"
  6350. // "U2"
  6351. // "U20"
  6352. // "U21"
  6353. // "U22"
  6354. // "U23"
  6355. // "U24"
  6356. // "U25"
  6357. // "U26"
  6358. // "U27"
  6359. // "U28"
  6360. // "U29"
  6361. // "U3"
  6362. // "U30"
  6363. // "U31"
  6364. // "U32"
  6365. // "U33"
  6366. // "U34"
  6367. // "U35"
  6368. // "U36"
  6369. // "U37"
  6370. // "U38"
  6371. // "U39"
  6372. // "U4"
  6373. // "U40"
  6374. // "U41"
  6375. // "U42"
  6376. // "U43"
  6377. // "U44"
  6378. // "U45"
  6379. // "U46"
  6380. // "U47"
  6381. // "U48"
  6382. // "U49"
  6383. // "U5"
  6384. // "U50"
  6385. // "U51"
  6386. // "U52"
  6387. // "U53"
  6388. // "U54"
  6389. // "U55"
  6390. // "U56"
  6391. // "U57"
  6392. // "U58"
  6393. // "U59"
  6394. // "U6"
  6395. // "U60"
  6396. // "U61"
  6397. // "U62"
  6398. // "U63"
  6399. // "U64"
  6400. // "U65"
  6401. // "U66"
  6402. // "U67"
  6403. // "U68"
  6404. // "U69"
  6405. // "U7"
  6406. // "U70"
  6407. // "U71"
  6408. // "U72"
  6409. // "U73"
  6410. // "U74"
  6411. // "U75"
  6412. // "U76"
  6413. // "U77"
  6414. // "U78"
  6415. // "U79"
  6416. // "U8"
  6417. // "U80"
  6418. // "U81"
  6419. // "U82"
  6420. // "U83"
  6421. // "U84"
  6422. // "U85"
  6423. // "U86"
  6424. // "U87"
  6425. // "U88"
  6426. // "U89"
  6427. // "U9"
  6428. // "U90"
  6429. // "U91"
  6430. // "U92"
  6431. // "U93"
  6432. // "U94"
  6433. // "U95"
  6434. // "U96"
  6435. // "U97"
  6436. // "U98"
  6437. // "U99"
  6438. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6439. // ServerResponse contains the HTTP response code and headers from the
  6440. // server.
  6441. googleapi.ServerResponse `json:"-"`
  6442. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6443. // unconditionally include in API requests. By default, fields with
  6444. // empty values are omitted from API requests. However, any non-pointer,
  6445. // non-interface field appearing in ForceSendFields will be sent to the
  6446. // server regardless of whether the field is empty or not. This may be
  6447. // used to include empty fields in Patch requests.
  6448. ForceSendFields []string `json:"-"`
  6449. // NullFields is a list of field names (e.g. "AccountId") to include in
  6450. // API requests with the JSON null value. By default, fields with empty
  6451. // values are omitted from API requests. However, any field with an
  6452. // empty value appearing in NullFields will be sent to the server as
  6453. // null. It is an error if a field in this list has a non-empty value.
  6454. // This may be used to include null fields in Patch requests.
  6455. NullFields []string `json:"-"`
  6456. }
  6457. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6458. type NoMethod FloodlightActivity
  6459. raw := NoMethod(*s)
  6460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6461. }
  6462. // FloodlightActivityDynamicTag: Dynamic Tag
  6463. type FloodlightActivityDynamicTag struct {
  6464. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6465. // field.
  6466. Id int64 `json:"id,omitempty,string"`
  6467. // Name: Name of this tag.
  6468. Name string `json:"name,omitempty"`
  6469. // Tag: Tag code.
  6470. Tag string `json:"tag,omitempty"`
  6471. // ForceSendFields is a list of field names (e.g. "Id") to
  6472. // unconditionally include in API requests. By default, fields with
  6473. // empty values are omitted from API requests. However, any non-pointer,
  6474. // non-interface field appearing in ForceSendFields will be sent to the
  6475. // server regardless of whether the field is empty or not. This may be
  6476. // used to include empty fields in Patch requests.
  6477. ForceSendFields []string `json:"-"`
  6478. // NullFields is a list of field names (e.g. "Id") to include in API
  6479. // requests with the JSON null value. By default, fields with empty
  6480. // values are omitted from API requests. However, any field with an
  6481. // empty value appearing in NullFields will be sent to the server as
  6482. // null. It is an error if a field in this list has a non-empty value.
  6483. // This may be used to include null fields in Patch requests.
  6484. NullFields []string `json:"-"`
  6485. }
  6486. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6487. type NoMethod FloodlightActivityDynamicTag
  6488. raw := NoMethod(*s)
  6489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6490. }
  6491. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6492. // group.
  6493. type FloodlightActivityGroup struct {
  6494. // AccountId: Account ID of this floodlight activity group. This is a
  6495. // read-only field that can be left blank.
  6496. AccountId int64 `json:"accountId,omitempty,string"`
  6497. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6498. // this field is left blank, the value will be copied over either from
  6499. // the floodlight configuration's advertiser or from the existing
  6500. // activity group's advertiser.
  6501. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6502. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6503. // advertiser. This is a read-only, auto-generated field.
  6504. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6505. // FloodlightConfigurationId: Floodlight configuration ID of this
  6506. // floodlight activity group. This is a required field.
  6507. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6508. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6509. // of the floodlight configuration. This is a read-only, auto-generated
  6510. // field.
  6511. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6512. // Id: ID of this floodlight activity group. This is a read-only,
  6513. // auto-generated field.
  6514. Id int64 `json:"id,omitempty,string"`
  6515. // IdDimensionValue: Dimension value for the ID of this floodlight
  6516. // activity group. This is a read-only, auto-generated field.
  6517. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6518. // Kind: Identifies what kind of resource this is. Value: the fixed
  6519. // string "dfareporting#floodlightActivityGroup".
  6520. Kind string `json:"kind,omitempty"`
  6521. // Name: Name of this floodlight activity group. This is a required
  6522. // field. Must be less than 65 characters long and cannot contain
  6523. // quotes.
  6524. Name string `json:"name,omitempty"`
  6525. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6526. // is a read-only field that can be left blank.
  6527. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6528. // TagString: Value of the type= parameter in the floodlight tag, which
  6529. // the ad servers use to identify the activity group that the activity
  6530. // belongs to. This is optional: if empty, a new tag string will be
  6531. // generated for you. This string must be 1 to 8 characters long, with
  6532. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6533. // also be unique among activity groups of the same floodlight
  6534. // configuration. This field is read-only after insertion.
  6535. TagString string `json:"tagString,omitempty"`
  6536. // Type: Type of the floodlight activity group. This is a required field
  6537. // that is read-only after insertion.
  6538. //
  6539. // Possible values:
  6540. // "COUNTER"
  6541. // "SALE"
  6542. Type string `json:"type,omitempty"`
  6543. // ServerResponse contains the HTTP response code and headers from the
  6544. // server.
  6545. googleapi.ServerResponse `json:"-"`
  6546. // ForceSendFields is a list of field names (e.g. "AccountId") 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. "AccountId") 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 *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6562. type NoMethod FloodlightActivityGroup
  6563. raw := NoMethod(*s)
  6564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6565. }
  6566. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6567. // Response
  6568. type FloodlightActivityGroupsListResponse struct {
  6569. // FloodlightActivityGroups: Floodlight activity group collection.
  6570. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6571. // Kind: Identifies what kind of resource this is. Value: the fixed
  6572. // string "dfareporting#floodlightActivityGroupsListResponse".
  6573. Kind string `json:"kind,omitempty"`
  6574. // NextPageToken: Pagination token to be used for the next list
  6575. // operation.
  6576. NextPageToken string `json:"nextPageToken,omitempty"`
  6577. // ServerResponse contains the HTTP response code and headers from the
  6578. // server.
  6579. googleapi.ServerResponse `json:"-"`
  6580. // ForceSendFields is a list of field names (e.g.
  6581. // "FloodlightActivityGroups") to unconditionally include in API
  6582. // requests. By default, fields with empty values are omitted from API
  6583. // requests. However, any non-pointer, non-interface field appearing in
  6584. // ForceSendFields will be sent to the server regardless of whether the
  6585. // field is empty or not. This may be used to include empty fields in
  6586. // Patch requests.
  6587. ForceSendFields []string `json:"-"`
  6588. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6589. // to include in API requests with the JSON null value. By default,
  6590. // fields with empty values are omitted from API requests. However, any
  6591. // field with an empty value appearing in NullFields will be sent to the
  6592. // server as null. It is an error if a field in this list has a
  6593. // non-empty value. This may be used to include null fields in Patch
  6594. // requests.
  6595. NullFields []string `json:"-"`
  6596. }
  6597. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6598. type NoMethod FloodlightActivityGroupsListResponse
  6599. raw := NoMethod(*s)
  6600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6601. }
  6602. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6603. type FloodlightActivityPublisherDynamicTag struct {
  6604. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6605. ClickThrough bool `json:"clickThrough,omitempty"`
  6606. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6607. // write-only field that can be used as an alternative to the siteId
  6608. // field. When this resource is retrieved, only the siteId field will be
  6609. // populated.
  6610. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6611. // DynamicTag: Dynamic floodlight tag.
  6612. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6613. // SiteId: Site ID of this dynamic tag.
  6614. SiteId int64 `json:"siteId,omitempty,string"`
  6615. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6616. // a read-only, auto-generated field.
  6617. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6618. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6619. ViewThrough bool `json:"viewThrough,omitempty"`
  6620. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6621. // unconditionally include in API requests. By default, fields with
  6622. // empty values are omitted from API requests. However, any non-pointer,
  6623. // non-interface field appearing in ForceSendFields will be sent to the
  6624. // server regardless of whether the field is empty or not. This may be
  6625. // used to include empty fields in Patch requests.
  6626. ForceSendFields []string `json:"-"`
  6627. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6628. // in API requests with the JSON null value. By default, fields with
  6629. // empty values are omitted from API requests. However, any field with
  6630. // an empty value appearing in NullFields will be sent to the server as
  6631. // null. It is an error if a field in this list has a non-empty value.
  6632. // This may be used to include null fields in Patch requests.
  6633. NullFields []string `json:"-"`
  6634. }
  6635. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6636. type NoMethod FloodlightActivityPublisherDynamicTag
  6637. raw := NoMethod(*s)
  6638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6639. }
  6640. // FloodlightConfiguration: Contains properties of a Floodlight
  6641. // configuration.
  6642. type FloodlightConfiguration struct {
  6643. // AccountId: Account ID of this floodlight configuration. This is a
  6644. // read-only field that can be left blank.
  6645. AccountId int64 `json:"accountId,omitempty,string"`
  6646. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6647. // floodlight configuration.
  6648. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6649. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6650. // advertiser. This is a read-only, auto-generated field.
  6651. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6652. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6653. // Google Analytics.
  6654. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6655. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6656. // report is enabled. This report shows detailed pathway information on
  6657. // up to 10 of the most recent ad exposures seen by a user before
  6658. // converting.
  6659. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6660. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6661. // in reports. This is a required field.
  6662. //
  6663. // Possible values:
  6664. // "MONDAY"
  6665. // "SUNDAY"
  6666. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6667. // Id: ID of this floodlight configuration. This is a read-only,
  6668. // auto-generated field.
  6669. Id int64 `json:"id,omitempty,string"`
  6670. // IdDimensionValue: Dimension value for the ID of this floodlight
  6671. // configuration. This is a read-only, auto-generated field.
  6672. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6673. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6674. // is enabled.
  6675. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6676. // Kind: Identifies what kind of resource this is. Value: the fixed
  6677. // string "dfareporting#floodlightConfiguration".
  6678. Kind string `json:"kind,omitempty"`
  6679. // LookbackConfiguration: Lookback window settings for this floodlight
  6680. // configuration.
  6681. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6682. // NaturalSearchConversionAttributionOption: Types of attribution
  6683. // options for natural search conversions.
  6684. //
  6685. // Possible values:
  6686. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6687. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6688. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6689. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6690. // OmnitureSettings: Settings for DCM Omniture integration.
  6691. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6692. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6693. // a read-only field that can be left blank.
  6694. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6695. // TagSettings: Configuration settings for dynamic and image floodlight
  6696. // tags.
  6697. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6698. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6699. // tokens enabled for this configuration.
  6700. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6701. // UserDefinedVariableConfigurations: List of user defined variables
  6702. // enabled for this configuration.
  6703. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6704. // ServerResponse contains the HTTP response code and headers from the
  6705. // server.
  6706. googleapi.ServerResponse `json:"-"`
  6707. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6708. // unconditionally include in API requests. By default, fields with
  6709. // empty values are omitted from API requests. However, any non-pointer,
  6710. // non-interface field appearing in ForceSendFields will be sent to the
  6711. // server regardless of whether the field is empty or not. This may be
  6712. // used to include empty fields in Patch requests.
  6713. ForceSendFields []string `json:"-"`
  6714. // NullFields is a list of field names (e.g. "AccountId") to include in
  6715. // API requests with the JSON null value. By default, fields with empty
  6716. // values are omitted from API requests. However, any field with an
  6717. // empty value appearing in NullFields will be sent to the server as
  6718. // null. It is an error if a field in this list has a non-empty value.
  6719. // This may be used to include null fields in Patch requests.
  6720. NullFields []string `json:"-"`
  6721. }
  6722. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6723. type NoMethod FloodlightConfiguration
  6724. raw := NoMethod(*s)
  6725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6726. }
  6727. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6728. // Response
  6729. type FloodlightConfigurationsListResponse struct {
  6730. // FloodlightConfigurations: Floodlight configuration collection.
  6731. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6732. // Kind: Identifies what kind of resource this is. Value: the fixed
  6733. // string "dfareporting#floodlightConfigurationsListResponse".
  6734. Kind string `json:"kind,omitempty"`
  6735. // ServerResponse contains the HTTP response code and headers from the
  6736. // server.
  6737. googleapi.ServerResponse `json:"-"`
  6738. // ForceSendFields is a list of field names (e.g.
  6739. // "FloodlightConfigurations") to unconditionally include in API
  6740. // requests. By default, fields with empty values are omitted from API
  6741. // requests. However, any non-pointer, non-interface field appearing in
  6742. // ForceSendFields will be sent to the server regardless of whether the
  6743. // field is empty or not. This may be used to include empty fields in
  6744. // Patch requests.
  6745. ForceSendFields []string `json:"-"`
  6746. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6747. // to include in API requests with the JSON null value. By default,
  6748. // fields with empty values are omitted from API requests. However, any
  6749. // field with an empty value appearing in NullFields will be sent to the
  6750. // server as null. It is an error if a field in this list has a
  6751. // non-empty value. This may be used to include null fields in Patch
  6752. // requests.
  6753. NullFields []string `json:"-"`
  6754. }
  6755. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6756. type NoMethod FloodlightConfigurationsListResponse
  6757. raw := NoMethod(*s)
  6758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6759. }
  6760. // FloodlightReportCompatibleFields: Represents fields that are
  6761. // compatible to be selected for a report of type "FlOODLIGHT".
  6762. type FloodlightReportCompatibleFields struct {
  6763. // DimensionFilters: Dimensions which are compatible to be selected in
  6764. // the "dimensionFilters" section of the report.
  6765. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6766. // Dimensions: Dimensions which are compatible to be selected in the
  6767. // "dimensions" section of the report.
  6768. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6769. // Kind: The kind of resource this is, in this case
  6770. // dfareporting#floodlightReportCompatibleFields.
  6771. Kind string `json:"kind,omitempty"`
  6772. // Metrics: Metrics which are compatible to be selected in the
  6773. // "metricNames" section of the report.
  6774. Metrics []*Metric `json:"metrics,omitempty"`
  6775. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6776. // unconditionally include in API requests. By default, fields with
  6777. // empty values are omitted from API requests. However, any non-pointer,
  6778. // non-interface field appearing in ForceSendFields will be sent to the
  6779. // server regardless of whether the field is empty or not. This may be
  6780. // used to include empty fields in Patch requests.
  6781. ForceSendFields []string `json:"-"`
  6782. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6783. // include in API requests with the JSON null value. By default, fields
  6784. // with empty values are omitted from API requests. However, any field
  6785. // with an empty value appearing in NullFields will be sent to the
  6786. // server as null. It is an error if a field in this list has a
  6787. // non-empty value. This may be used to include null fields in Patch
  6788. // requests.
  6789. NullFields []string `json:"-"`
  6790. }
  6791. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6792. type NoMethod FloodlightReportCompatibleFields
  6793. raw := NoMethod(*s)
  6794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6795. }
  6796. // FrequencyCap: Frequency Cap.
  6797. type FrequencyCap struct {
  6798. // Duration: Duration of time, in seconds, for this frequency cap. The
  6799. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6800. // inclusive.
  6801. Duration int64 `json:"duration,omitempty,string"`
  6802. // Impressions: Number of times an individual user can be served the ad
  6803. // within the specified duration. Acceptable values are 1 to 15,
  6804. // inclusive.
  6805. Impressions int64 `json:"impressions,omitempty,string"`
  6806. // ForceSendFields is a list of field names (e.g. "Duration") to
  6807. // unconditionally include in API requests. By default, fields with
  6808. // empty values are omitted from API requests. However, any non-pointer,
  6809. // non-interface field appearing in ForceSendFields will be sent to the
  6810. // server regardless of whether the field is empty or not. This may be
  6811. // used to include empty fields in Patch requests.
  6812. ForceSendFields []string `json:"-"`
  6813. // NullFields is a list of field names (e.g. "Duration") to include in
  6814. // API requests with the JSON null value. By default, fields with empty
  6815. // values are omitted from API requests. However, any field with an
  6816. // empty value appearing in NullFields will be sent to the server as
  6817. // null. It is an error if a field in this list has a non-empty value.
  6818. // This may be used to include null fields in Patch requests.
  6819. NullFields []string `json:"-"`
  6820. }
  6821. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6822. type NoMethod FrequencyCap
  6823. raw := NoMethod(*s)
  6824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6825. }
  6826. // FsCommand: FsCommand.
  6827. type FsCommand struct {
  6828. // Left: Distance from the left of the browser.Applicable when
  6829. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6830. Left int64 `json:"left,omitempty"`
  6831. // PositionOption: Position in the browser where the window will open.
  6832. //
  6833. // Possible values:
  6834. // "CENTERED"
  6835. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6836. PositionOption string `json:"positionOption,omitempty"`
  6837. // Top: Distance from the top of the browser. Applicable when
  6838. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6839. Top int64 `json:"top,omitempty"`
  6840. // WindowHeight: Height of the window.
  6841. WindowHeight int64 `json:"windowHeight,omitempty"`
  6842. // WindowWidth: Width of the window.
  6843. WindowWidth int64 `json:"windowWidth,omitempty"`
  6844. // ForceSendFields is a list of field names (e.g. "Left") to
  6845. // unconditionally include in API requests. By default, fields with
  6846. // empty values are omitted from API requests. However, any non-pointer,
  6847. // non-interface field appearing in ForceSendFields will be sent to the
  6848. // server regardless of whether the field is empty or not. This may be
  6849. // used to include empty fields in Patch requests.
  6850. ForceSendFields []string `json:"-"`
  6851. // NullFields is a list of field names (e.g. "Left") to include in API
  6852. // requests with the JSON null value. By default, fields with empty
  6853. // values are omitted from API requests. However, any field with an
  6854. // empty value appearing in NullFields will be sent to the server as
  6855. // null. It is an error if a field in this list has a non-empty value.
  6856. // This may be used to include null fields in Patch requests.
  6857. NullFields []string `json:"-"`
  6858. }
  6859. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6860. type NoMethod FsCommand
  6861. raw := NoMethod(*s)
  6862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6863. }
  6864. // GeoTargeting: Geographical Targeting.
  6865. type GeoTargeting struct {
  6866. // Cities: Cities to be targeted. For each city only dartId is required.
  6867. // The other fields are populated automatically when the ad is inserted
  6868. // or updated. If targeting a city, do not target or exclude the country
  6869. // of the city, and do not target the metro or region of the city.
  6870. Cities []*City `json:"cities,omitempty"`
  6871. // Countries: Countries to be targeted or excluded from targeting,
  6872. // depending on the setting of the excludeCountries field. For each
  6873. // country only dartId is required. The other fields are populated
  6874. // automatically when the ad is inserted or updated. If targeting or
  6875. // excluding a country, do not target regions, cities, metros, or postal
  6876. // codes in the same country.
  6877. Countries []*Country `json:"countries,omitempty"`
  6878. // ExcludeCountries: Whether or not to exclude the countries in the
  6879. // countries field from targeting. If false, the countries field refers
  6880. // to countries which will be targeted by the ad.
  6881. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6882. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6883. // The other fields are populated automatically when the ad is inserted
  6884. // or updated. If targeting a metro, do not target or exclude the
  6885. // country of the metro.
  6886. Metros []*Metro `json:"metros,omitempty"`
  6887. // PostalCodes: Postal codes to be targeted. For each postal code only
  6888. // id is required. The other fields are populated automatically when the
  6889. // ad is inserted or updated. If targeting a postal code, do not target
  6890. // or exclude the country of the postal code.
  6891. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6892. // Regions: Regions to be targeted. For each region only dartId is
  6893. // required. The other fields are populated automatically when the ad is
  6894. // inserted or updated. If targeting a region, do not target or exclude
  6895. // the country of the region.
  6896. Regions []*Region `json:"regions,omitempty"`
  6897. // ForceSendFields is a list of field names (e.g. "Cities") to
  6898. // unconditionally include in API requests. By default, fields with
  6899. // empty values are omitted from API requests. However, any non-pointer,
  6900. // non-interface field appearing in ForceSendFields will be sent to the
  6901. // server regardless of whether the field is empty or not. This may be
  6902. // used to include empty fields in Patch requests.
  6903. ForceSendFields []string `json:"-"`
  6904. // NullFields is a list of field names (e.g. "Cities") to include in API
  6905. // requests with the JSON null value. By default, fields with empty
  6906. // values are omitted from API requests. However, any field with an
  6907. // empty value appearing in NullFields will be sent to the server as
  6908. // null. It is an error if a field in this list has a non-empty value.
  6909. // This may be used to include null fields in Patch requests.
  6910. NullFields []string `json:"-"`
  6911. }
  6912. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6913. type NoMethod GeoTargeting
  6914. raw := NoMethod(*s)
  6915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6916. }
  6917. // InventoryItem: Represents a buy from the DoubleClick Planning
  6918. // inventory store.
  6919. type InventoryItem struct {
  6920. // AccountId: Account ID of this inventory item.
  6921. AccountId int64 `json:"accountId,omitempty,string"`
  6922. // AdSlots: Ad slots of this inventory item. If this inventory item
  6923. // represents a standalone placement, there will be exactly one ad slot.
  6924. // If this inventory item represents a placement group, there will be
  6925. // more than one ad slot, each representing one child placement in that
  6926. // placement group.
  6927. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  6928. // AdvertiserId: Advertiser ID of this inventory item.
  6929. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6930. // ContentCategoryId: Content category ID of this inventory item.
  6931. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  6932. // EstimatedClickThroughRate: Estimated click-through rate of this
  6933. // inventory item.
  6934. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  6935. // EstimatedConversionRate: Estimated conversion rate of this inventory
  6936. // item.
  6937. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  6938. // Id: ID of this inventory item.
  6939. Id int64 `json:"id,omitempty,string"`
  6940. // InPlan: Whether this inventory item is in plan.
  6941. InPlan bool `json:"inPlan,omitempty"`
  6942. // Kind: Identifies what kind of resource this is. Value: the fixed
  6943. // string "dfareporting#inventoryItem".
  6944. Kind string `json:"kind,omitempty"`
  6945. // LastModifiedInfo: Information about the most recent modification of
  6946. // this inventory item.
  6947. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  6948. // Name: Name of this inventory item. For standalone inventory items,
  6949. // this is the same name as that of its only ad slot. For group
  6950. // inventory items, this can differ from the name of any of its ad
  6951. // slots.
  6952. Name string `json:"name,omitempty"`
  6953. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  6954. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  6955. // OrderId: Order ID of this inventory item.
  6956. OrderId int64 `json:"orderId,omitempty,string"`
  6957. // PlacementStrategyId: Placement strategy ID of this inventory item.
  6958. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  6959. // Pricing: Pricing of this inventory item.
  6960. Pricing *Pricing `json:"pricing,omitempty"`
  6961. // ProjectId: Project ID of this inventory item.
  6962. ProjectId int64 `json:"projectId,omitempty,string"`
  6963. // RfpId: RFP ID of this inventory item.
  6964. RfpId int64 `json:"rfpId,omitempty,string"`
  6965. // SiteId: ID of the site this inventory item is associated with.
  6966. SiteId int64 `json:"siteId,omitempty,string"`
  6967. // SubaccountId: Subaccount ID of this inventory item.
  6968. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6969. // Type: Type of inventory item.
  6970. //
  6971. // Possible values:
  6972. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  6973. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  6974. Type string `json:"type,omitempty"`
  6975. // ServerResponse contains the HTTP response code and headers from the
  6976. // server.
  6977. googleapi.ServerResponse `json:"-"`
  6978. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6979. // unconditionally include in API requests. By default, fields with
  6980. // empty values are omitted from API requests. However, any non-pointer,
  6981. // non-interface field appearing in ForceSendFields will be sent to the
  6982. // server regardless of whether the field is empty or not. This may be
  6983. // used to include empty fields in Patch requests.
  6984. ForceSendFields []string `json:"-"`
  6985. // NullFields is a list of field names (e.g. "AccountId") to include in
  6986. // API requests with the JSON null value. By default, fields with empty
  6987. // values are omitted from API requests. However, any field with an
  6988. // empty value appearing in NullFields will be sent to the server as
  6989. // null. It is an error if a field in this list has a non-empty value.
  6990. // This may be used to include null fields in Patch requests.
  6991. NullFields []string `json:"-"`
  6992. }
  6993. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  6994. type NoMethod InventoryItem
  6995. raw := NoMethod(*s)
  6996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6997. }
  6998. // InventoryItemsListResponse: Inventory item List Response
  6999. type InventoryItemsListResponse struct {
  7000. // InventoryItems: Inventory item collection
  7001. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  7002. // Kind: Identifies what kind of resource this is. Value: the fixed
  7003. // string "dfareporting#inventoryItemsListResponse".
  7004. Kind string `json:"kind,omitempty"`
  7005. // NextPageToken: Pagination token to be used for the next list
  7006. // operation.
  7007. NextPageToken string `json:"nextPageToken,omitempty"`
  7008. // ServerResponse contains the HTTP response code and headers from the
  7009. // server.
  7010. googleapi.ServerResponse `json:"-"`
  7011. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  7012. // unconditionally include in API requests. By default, fields with
  7013. // empty values are omitted from API requests. However, any non-pointer,
  7014. // non-interface field appearing in ForceSendFields will be sent to the
  7015. // server regardless of whether the field is empty or not. This may be
  7016. // used to include empty fields in Patch requests.
  7017. ForceSendFields []string `json:"-"`
  7018. // NullFields is a list of field names (e.g. "InventoryItems") to
  7019. // include in API requests with the JSON null value. By default, fields
  7020. // with empty values are omitted from API requests. However, any field
  7021. // with an empty value appearing in NullFields will be sent to the
  7022. // server as null. It is an error if a field in this list has a
  7023. // non-empty value. This may be used to include null fields in Patch
  7024. // requests.
  7025. NullFields []string `json:"-"`
  7026. }
  7027. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  7028. type NoMethod InventoryItemsListResponse
  7029. raw := NoMethod(*s)
  7030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7031. }
  7032. // KeyValueTargetingExpression: Key Value Targeting Expression.
  7033. type KeyValueTargetingExpression struct {
  7034. // Expression: Keyword expression being targeted by the ad.
  7035. Expression string `json:"expression,omitempty"`
  7036. // ForceSendFields is a list of field names (e.g. "Expression") to
  7037. // unconditionally include in API requests. By default, fields with
  7038. // empty values are omitted from API requests. However, any non-pointer,
  7039. // non-interface field appearing in ForceSendFields will be sent to the
  7040. // server regardless of whether the field is empty or not. This may be
  7041. // used to include empty fields in Patch requests.
  7042. ForceSendFields []string `json:"-"`
  7043. // NullFields is a list of field names (e.g. "Expression") to include in
  7044. // API requests with the JSON null value. By default, fields with empty
  7045. // values are omitted from API requests. However, any field with an
  7046. // empty value appearing in NullFields will be sent to the server as
  7047. // null. It is an error if a field in this list has a non-empty value.
  7048. // This may be used to include null fields in Patch requests.
  7049. NullFields []string `json:"-"`
  7050. }
  7051. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  7052. type NoMethod KeyValueTargetingExpression
  7053. raw := NoMethod(*s)
  7054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7055. }
  7056. // LandingPage: Contains information about where a user's browser is
  7057. // taken after the user clicks an ad.
  7058. type LandingPage struct {
  7059. // AdvertiserId: Advertiser ID of this landing page. This is a required
  7060. // field.
  7061. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7062. // Archived: Whether this landing page has been archived.
  7063. Archived bool `json:"archived,omitempty"`
  7064. // DeepLinks: Links that will direct the user to a mobile app, if
  7065. // installed.
  7066. DeepLinks []*DeepLink `json:"deepLinks,omitempty"`
  7067. // Id: ID of this landing page. This is a read-only, auto-generated
  7068. // field.
  7069. Id int64 `json:"id,omitempty,string"`
  7070. // Kind: Identifies what kind of resource this is. Value: the fixed
  7071. // string "dfareporting#landingPage".
  7072. Kind string `json:"kind,omitempty"`
  7073. // Name: Name of this landing page. This is a required field. It must be
  7074. // less than 256 characters long.
  7075. Name string `json:"name,omitempty"`
  7076. // Url: URL of this landing page. This is a required field.
  7077. Url string `json:"url,omitempty"`
  7078. // ServerResponse contains the HTTP response code and headers from the
  7079. // server.
  7080. googleapi.ServerResponse `json:"-"`
  7081. // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
  7082. // unconditionally include in API requests. By default, fields with
  7083. // empty values are omitted from API requests. However, any non-pointer,
  7084. // non-interface field appearing in ForceSendFields will be sent to the
  7085. // server regardless of whether the field is empty or not. This may be
  7086. // used to include empty fields in Patch requests.
  7087. ForceSendFields []string `json:"-"`
  7088. // NullFields is a list of field names (e.g. "AdvertiserId") to include
  7089. // in API requests with the JSON null value. By default, fields with
  7090. // empty values are omitted from API requests. However, any field with
  7091. // an empty value appearing in NullFields will be sent to the server as
  7092. // null. It is an error if a field in this list has a non-empty value.
  7093. // This may be used to include null fields in Patch requests.
  7094. NullFields []string `json:"-"`
  7095. }
  7096. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  7097. type NoMethod LandingPage
  7098. raw := NoMethod(*s)
  7099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7100. }
  7101. // Language: Contains information about a language that can be targeted
  7102. // by ads.
  7103. type Language struct {
  7104. // Id: Language ID of this language. This is the ID used for targeting
  7105. // and generating reports.
  7106. Id int64 `json:"id,omitempty,string"`
  7107. // Kind: Identifies what kind of resource this is. Value: the fixed
  7108. // string "dfareporting#language".
  7109. Kind string `json:"kind,omitempty"`
  7110. // LanguageCode: Format of language code is an ISO 639 two-letter
  7111. // language code optionally followed by an underscore followed by an ISO
  7112. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  7113. // Chinese.
  7114. LanguageCode string `json:"languageCode,omitempty"`
  7115. // Name: Name of this language.
  7116. Name string `json:"name,omitempty"`
  7117. // ForceSendFields is a list of field names (e.g. "Id") to
  7118. // unconditionally include in API requests. By default, fields with
  7119. // empty values are omitted from API requests. However, any non-pointer,
  7120. // non-interface field appearing in ForceSendFields will be sent to the
  7121. // server regardless of whether the field is empty or not. This may be
  7122. // used to include empty fields in Patch requests.
  7123. ForceSendFields []string `json:"-"`
  7124. // NullFields is a list of field names (e.g. "Id") to include in API
  7125. // requests with the JSON null value. By default, fields with empty
  7126. // values are omitted from API requests. However, any field with an
  7127. // empty value appearing in NullFields will be sent to the server as
  7128. // null. It is an error if a field in this list has a non-empty value.
  7129. // This may be used to include null fields in Patch requests.
  7130. NullFields []string `json:"-"`
  7131. }
  7132. func (s *Language) MarshalJSON() ([]byte, error) {
  7133. type NoMethod Language
  7134. raw := NoMethod(*s)
  7135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7136. }
  7137. // LanguageTargeting: Language Targeting.
  7138. type LanguageTargeting struct {
  7139. // Languages: Languages that this ad targets. For each language only
  7140. // languageId is required. The other fields are populated automatically
  7141. // when the ad is inserted or updated.
  7142. Languages []*Language `json:"languages,omitempty"`
  7143. // ForceSendFields is a list of field names (e.g. "Languages") to
  7144. // unconditionally include in API requests. By default, fields with
  7145. // empty values are omitted from API requests. However, any non-pointer,
  7146. // non-interface field appearing in ForceSendFields will be sent to the
  7147. // server regardless of whether the field is empty or not. This may be
  7148. // used to include empty fields in Patch requests.
  7149. ForceSendFields []string `json:"-"`
  7150. // NullFields is a list of field names (e.g. "Languages") to include in
  7151. // API requests with the JSON null value. By default, fields with empty
  7152. // values are omitted from API requests. However, any field with an
  7153. // empty value appearing in NullFields will be sent to the server as
  7154. // null. It is an error if a field in this list has a non-empty value.
  7155. // This may be used to include null fields in Patch requests.
  7156. NullFields []string `json:"-"`
  7157. }
  7158. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  7159. type NoMethod LanguageTargeting
  7160. raw := NoMethod(*s)
  7161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7162. }
  7163. // LanguagesListResponse: Language List Response
  7164. type LanguagesListResponse struct {
  7165. // Kind: Identifies what kind of resource this is. Value: the fixed
  7166. // string "dfareporting#languagesListResponse".
  7167. Kind string `json:"kind,omitempty"`
  7168. // Languages: Language collection.
  7169. Languages []*Language `json:"languages,omitempty"`
  7170. // ServerResponse contains the HTTP response code and headers from the
  7171. // server.
  7172. googleapi.ServerResponse `json:"-"`
  7173. // ForceSendFields is a list of field names (e.g. "Kind") to
  7174. // unconditionally include in API requests. By default, fields with
  7175. // empty values are omitted from API requests. However, any non-pointer,
  7176. // non-interface field appearing in ForceSendFields will be sent to the
  7177. // server regardless of whether the field is empty or not. This may be
  7178. // used to include empty fields in Patch requests.
  7179. ForceSendFields []string `json:"-"`
  7180. // NullFields is a list of field names (e.g. "Kind") to include in API
  7181. // requests with the JSON null value. By default, fields with empty
  7182. // values are omitted from API requests. However, any field with an
  7183. // empty value appearing in NullFields will be sent to the server as
  7184. // null. It is an error if a field in this list has a non-empty value.
  7185. // This may be used to include null fields in Patch requests.
  7186. NullFields []string `json:"-"`
  7187. }
  7188. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  7189. type NoMethod LanguagesListResponse
  7190. raw := NoMethod(*s)
  7191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7192. }
  7193. // LastModifiedInfo: Modification timestamp.
  7194. type LastModifiedInfo struct {
  7195. // Time: Timestamp of the last change in milliseconds since epoch.
  7196. Time int64 `json:"time,omitempty,string"`
  7197. // ForceSendFields is a list of field names (e.g. "Time") to
  7198. // unconditionally include in API requests. By default, fields with
  7199. // empty values are omitted from API requests. However, any non-pointer,
  7200. // non-interface field appearing in ForceSendFields will be sent to the
  7201. // server regardless of whether the field is empty or not. This may be
  7202. // used to include empty fields in Patch requests.
  7203. ForceSendFields []string `json:"-"`
  7204. // NullFields is a list of field names (e.g. "Time") to include in API
  7205. // requests with the JSON null value. By default, fields with empty
  7206. // values are omitted from API requests. However, any field with an
  7207. // empty value appearing in NullFields will be sent to the server as
  7208. // null. It is an error if a field in this list has a non-empty value.
  7209. // This may be used to include null fields in Patch requests.
  7210. NullFields []string `json:"-"`
  7211. }
  7212. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  7213. type NoMethod LastModifiedInfo
  7214. raw := NoMethod(*s)
  7215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7216. }
  7217. // ListPopulationClause: A group clause made up of list population terms
  7218. // representing constraints joined by ORs.
  7219. type ListPopulationClause struct {
  7220. // Terms: Terms of this list population clause. Each clause is made up
  7221. // of list population terms representing constraints and are joined by
  7222. // ORs.
  7223. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  7224. // ForceSendFields is a list of field names (e.g. "Terms") 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. "Terms") to include in API
  7232. // requests with the JSON null value. By default, fields with empty
  7233. // values are omitted from API requests. However, any field with an
  7234. // 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 *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7240. type NoMethod ListPopulationClause
  7241. raw := NoMethod(*s)
  7242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7243. }
  7244. // ListPopulationRule: Remarketing List Population Rule.
  7245. type ListPopulationRule struct {
  7246. // FloodlightActivityId: Floodlight activity ID associated with this
  7247. // rule. This field can be left blank.
  7248. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7249. // FloodlightActivityName: Name of floodlight activity associated with
  7250. // this rule. This is a read-only, auto-generated field.
  7251. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7252. // ListPopulationClauses: Clauses that make up this list population
  7253. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7254. // up of list population terms which are joined by ORs.
  7255. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7256. // ForceSendFields is a list of field names (e.g.
  7257. // "FloodlightActivityId") to unconditionally include in API requests.
  7258. // By default, fields with empty values are omitted from API requests.
  7259. // However, any non-pointer, non-interface field appearing in
  7260. // ForceSendFields will be sent to the server regardless of whether the
  7261. // field is empty or not. This may be used to include empty fields in
  7262. // Patch requests.
  7263. ForceSendFields []string `json:"-"`
  7264. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7265. // include in API requests with the JSON null value. By default, fields
  7266. // with empty values are omitted from API requests. However, any field
  7267. // with an empty value appearing in NullFields will be sent to the
  7268. // server as null. It is an error if a field in this list has a
  7269. // non-empty value. This may be used to include null fields in Patch
  7270. // requests.
  7271. NullFields []string `json:"-"`
  7272. }
  7273. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7274. type NoMethod ListPopulationRule
  7275. raw := NoMethod(*s)
  7276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7277. }
  7278. // ListPopulationTerm: Remarketing List Population Rule Term.
  7279. type ListPopulationTerm struct {
  7280. // Contains: Will be true if the term should check if the user is in the
  7281. // list and false if the term should check if the user is not in the
  7282. // list. This field is only relevant when type is set to
  7283. // LIST_MEMBERSHIP_TERM. False by default.
  7284. Contains bool `json:"contains,omitempty"`
  7285. // Negation: Whether to negate the comparison result of this term during
  7286. // rule evaluation. This field is only relevant when type is left unset
  7287. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7288. Negation bool `json:"negation,omitempty"`
  7289. // Operator: Comparison operator of this term. This field is only
  7290. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7291. // REFERRER_TERM.
  7292. //
  7293. // Possible values:
  7294. // "NUM_EQUALS"
  7295. // "NUM_GREATER_THAN"
  7296. // "NUM_GREATER_THAN_EQUAL"
  7297. // "NUM_LESS_THAN"
  7298. // "NUM_LESS_THAN_EQUAL"
  7299. // "STRING_CONTAINS"
  7300. // "STRING_EQUALS"
  7301. Operator string `json:"operator,omitempty"`
  7302. // RemarketingListId: ID of the list in question. This field is only
  7303. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7304. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7305. // Type: List population term type determines the applicable fields in
  7306. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7307. // variableName, variableFriendlyName, operator, value, and negation are
  7308. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7309. // contains are applicable. If set to REFERRER_TERM then operator,
  7310. // value, and negation are applicable.
  7311. //
  7312. // Possible values:
  7313. // "CUSTOM_VARIABLE_TERM"
  7314. // "LIST_MEMBERSHIP_TERM"
  7315. // "REFERRER_TERM"
  7316. Type string `json:"type,omitempty"`
  7317. // Value: Literal to compare the variable to. This field is only
  7318. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7319. // REFERRER_TERM.
  7320. Value string `json:"value,omitempty"`
  7321. // VariableFriendlyName: Friendly name of this term's variable. This is
  7322. // a read-only, auto-generated field. This field is only relevant when
  7323. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7324. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7325. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7326. // this term. This field is only relevant when type is set to null,
  7327. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7328. VariableName string `json:"variableName,omitempty"`
  7329. // ForceSendFields is a list of field names (e.g. "Contains") to
  7330. // unconditionally include in API requests. By default, fields with
  7331. // empty values are omitted from API requests. However, any non-pointer,
  7332. // non-interface field appearing in ForceSendFields will be sent to the
  7333. // server regardless of whether the field is empty or not. This may be
  7334. // used to include empty fields in Patch requests.
  7335. ForceSendFields []string `json:"-"`
  7336. // NullFields is a list of field names (e.g. "Contains") to include in
  7337. // API requests with the JSON null value. By default, fields with empty
  7338. // values are omitted from API requests. However, any field with an
  7339. // empty value appearing in NullFields will be sent to the server as
  7340. // null. It is an error if a field in this list has a non-empty value.
  7341. // This may be used to include null fields in Patch requests.
  7342. NullFields []string `json:"-"`
  7343. }
  7344. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7345. type NoMethod ListPopulationTerm
  7346. raw := NoMethod(*s)
  7347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7348. }
  7349. // ListTargetingExpression: Remarketing List Targeting Expression.
  7350. type ListTargetingExpression struct {
  7351. // Expression: Expression describing which lists are being targeted by
  7352. // the ad.
  7353. Expression string `json:"expression,omitempty"`
  7354. // ForceSendFields is a list of field names (e.g. "Expression") to
  7355. // unconditionally include in API requests. By default, fields with
  7356. // empty values are omitted from API requests. However, any non-pointer,
  7357. // non-interface field appearing in ForceSendFields will be sent to the
  7358. // server regardless of whether the field is empty or not. This may be
  7359. // used to include empty fields in Patch requests.
  7360. ForceSendFields []string `json:"-"`
  7361. // NullFields is a list of field names (e.g. "Expression") to include in
  7362. // API requests with the JSON null value. By default, fields with empty
  7363. // values are omitted from API requests. However, any field with an
  7364. // empty value appearing in NullFields will be sent to the server as
  7365. // null. It is an error if a field in this list has a non-empty value.
  7366. // This may be used to include null fields in Patch requests.
  7367. NullFields []string `json:"-"`
  7368. }
  7369. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7370. type NoMethod ListTargetingExpression
  7371. raw := NoMethod(*s)
  7372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7373. }
  7374. // LookbackConfiguration: Lookback configuration settings.
  7375. type LookbackConfiguration struct {
  7376. // ClickDuration: Lookback window, in days, from the last time a given
  7377. // user clicked on one of your ads. If you enter 0, clicks will not be
  7378. // considered as triggering events for floodlight tracking. If you leave
  7379. // this field blank, the default value for your account will be used.
  7380. // Acceptable values are 0 to 90, inclusive.
  7381. ClickDuration int64 `json:"clickDuration,omitempty"`
  7382. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7383. // last time a given user viewed one of your ads. If you enter 0,
  7384. // impressions will not be considered as triggering events for
  7385. // floodlight tracking. If you leave this field blank, the default value
  7386. // for your account will be used. Acceptable values are 0 to 90,
  7387. // inclusive.
  7388. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7389. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7390. // unconditionally include in API requests. By default, fields with
  7391. // empty values are omitted from API requests. However, any non-pointer,
  7392. // non-interface field appearing in ForceSendFields will be sent to the
  7393. // server regardless of whether the field is empty or not. This may be
  7394. // used to include empty fields in Patch requests.
  7395. ForceSendFields []string `json:"-"`
  7396. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7397. // in API requests with the JSON null value. By default, fields with
  7398. // empty values are omitted from API requests. However, any field with
  7399. // an empty value appearing in NullFields will be sent to the server as
  7400. // null. It is an error if a field in this list has a non-empty value.
  7401. // This may be used to include null fields in Patch requests.
  7402. NullFields []string `json:"-"`
  7403. }
  7404. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7405. type NoMethod LookbackConfiguration
  7406. raw := NoMethod(*s)
  7407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7408. }
  7409. // Metric: Represents a metric.
  7410. type Metric struct {
  7411. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7412. Kind string `json:"kind,omitempty"`
  7413. // Name: The metric name, e.g. dfa:impressions
  7414. Name string `json:"name,omitempty"`
  7415. // ForceSendFields is a list of field names (e.g. "Kind") to
  7416. // unconditionally include in API requests. By default, fields with
  7417. // empty values are omitted from API requests. However, any non-pointer,
  7418. // non-interface field appearing in ForceSendFields will be sent to the
  7419. // server regardless of whether the field is empty or not. This may be
  7420. // used to include empty fields in Patch requests.
  7421. ForceSendFields []string `json:"-"`
  7422. // NullFields is a list of field names (e.g. "Kind") to include in API
  7423. // requests with the JSON null value. By default, fields with empty
  7424. // values are omitted from API requests. However, any field with an
  7425. // empty value appearing in NullFields will be sent to the server as
  7426. // null. It is an error if a field in this list has a non-empty value.
  7427. // This may be used to include null fields in Patch requests.
  7428. NullFields []string `json:"-"`
  7429. }
  7430. func (s *Metric) MarshalJSON() ([]byte, error) {
  7431. type NoMethod Metric
  7432. raw := NoMethod(*s)
  7433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7434. }
  7435. // Metro: Contains information about a metro region that can be targeted
  7436. // by ads.
  7437. type Metro struct {
  7438. // CountryCode: Country code of the country to which this metro region
  7439. // belongs.
  7440. CountryCode string `json:"countryCode,omitempty"`
  7441. // CountryDartId: DART ID of the country to which this metro region
  7442. // belongs.
  7443. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7444. // DartId: DART ID of this metro region.
  7445. DartId int64 `json:"dartId,omitempty,string"`
  7446. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7447. // and generating reports, and is equivalent to metro_code.
  7448. DmaId int64 `json:"dmaId,omitempty,string"`
  7449. // Kind: Identifies what kind of resource this is. Value: the fixed
  7450. // string "dfareporting#metro".
  7451. Kind string `json:"kind,omitempty"`
  7452. // MetroCode: Metro code of this metro region. This is equivalent to
  7453. // dma_id.
  7454. MetroCode string `json:"metroCode,omitempty"`
  7455. // Name: Name of this metro region.
  7456. Name string `json:"name,omitempty"`
  7457. // ForceSendFields is a list of field names (e.g. "CountryCode") 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. "CountryCode") to include
  7465. // in API requests with the JSON null value. By default, fields with
  7466. // empty values are omitted from API requests. However, any field with
  7467. // an 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 *Metro) MarshalJSON() ([]byte, error) {
  7473. type NoMethod Metro
  7474. raw := NoMethod(*s)
  7475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7476. }
  7477. // MetrosListResponse: Metro List Response
  7478. type MetrosListResponse struct {
  7479. // Kind: Identifies what kind of resource this is. Value: the fixed
  7480. // string "dfareporting#metrosListResponse".
  7481. Kind string `json:"kind,omitempty"`
  7482. // Metros: Metro collection.
  7483. Metros []*Metro `json:"metros,omitempty"`
  7484. // ServerResponse contains the HTTP response code and headers from the
  7485. // server.
  7486. googleapi.ServerResponse `json:"-"`
  7487. // ForceSendFields is a list of field names (e.g. "Kind") to
  7488. // unconditionally include in API requests. By default, fields with
  7489. // empty values are omitted from API requests. However, any non-pointer,
  7490. // non-interface field appearing in ForceSendFields will be sent to the
  7491. // server regardless of whether the field is empty or not. This may be
  7492. // used to include empty fields in Patch requests.
  7493. ForceSendFields []string `json:"-"`
  7494. // NullFields is a list of field names (e.g. "Kind") to include in API
  7495. // requests with the JSON null value. By default, fields with empty
  7496. // values are omitted from API requests. However, any field with an
  7497. // empty value appearing in NullFields will be sent to the server as
  7498. // null. It is an error if a field in this list has a non-empty value.
  7499. // This may be used to include null fields in Patch requests.
  7500. NullFields []string `json:"-"`
  7501. }
  7502. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7503. type NoMethod MetrosListResponse
  7504. raw := NoMethod(*s)
  7505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7506. }
  7507. // MobileApp: Contains information about a mobile app. Used as a landing
  7508. // page deep link.
  7509. type MobileApp struct {
  7510. // Directory: Mobile app directory.
  7511. //
  7512. // Possible values:
  7513. // "APPLE_APP_STORE"
  7514. // "GOOGLE_PLAY_STORE"
  7515. // "UNKNOWN"
  7516. Directory string `json:"directory,omitempty"`
  7517. // Id: ID of this mobile app.
  7518. Id string `json:"id,omitempty"`
  7519. // Kind: Identifies what kind of resource this is. Value: the fixed
  7520. // string "dfareporting#mobileApp".
  7521. Kind string `json:"kind,omitempty"`
  7522. // PublisherName: Publisher name.
  7523. PublisherName string `json:"publisherName,omitempty"`
  7524. // Title: Title of this mobile app.
  7525. Title string `json:"title,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. "Directory") 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. "Directory") to include in
  7537. // API 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 *MobileApp) MarshalJSON() ([]byte, error) {
  7545. type NoMethod MobileApp
  7546. raw := NoMethod(*s)
  7547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7548. }
  7549. // MobileAppsListResponse: Mobile app List Response
  7550. type MobileAppsListResponse struct {
  7551. // Kind: Identifies what kind of resource this is. Value: the fixed
  7552. // string "dfareporting#mobileAppsListResponse".
  7553. Kind string `json:"kind,omitempty"`
  7554. // MobileApps: Mobile apps collection.
  7555. MobileApps []*MobileApp `json:"mobileApps,omitempty"`
  7556. // NextPageToken: Pagination token to be used for the next list
  7557. // operation.
  7558. NextPageToken string `json:"nextPageToken,omitempty"`
  7559. // ServerResponse contains the HTTP response code and headers from the
  7560. // server.
  7561. googleapi.ServerResponse `json:"-"`
  7562. // ForceSendFields is a list of field names (e.g. "Kind") to
  7563. // unconditionally include in API requests. By default, fields with
  7564. // empty values are omitted from API requests. However, any non-pointer,
  7565. // non-interface field appearing in ForceSendFields will be sent to the
  7566. // server regardless of whether the field is empty or not. This may be
  7567. // used to include empty fields in Patch requests.
  7568. ForceSendFields []string `json:"-"`
  7569. // NullFields is a list of field names (e.g. "Kind") to include in API
  7570. // requests with the JSON null value. By default, fields with empty
  7571. // values are omitted from API requests. However, any field with an
  7572. // empty value appearing in NullFields will be sent to the server as
  7573. // null. It is an error if a field in this list has a non-empty value.
  7574. // This may be used to include null fields in Patch requests.
  7575. NullFields []string `json:"-"`
  7576. }
  7577. func (s *MobileAppsListResponse) MarshalJSON() ([]byte, error) {
  7578. type NoMethod MobileAppsListResponse
  7579. raw := NoMethod(*s)
  7580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7581. }
  7582. // MobileCarrier: Contains information about a mobile carrier that can
  7583. // be targeted by ads.
  7584. type MobileCarrier struct {
  7585. // CountryCode: Country code of the country to which this mobile carrier
  7586. // belongs.
  7587. CountryCode string `json:"countryCode,omitempty"`
  7588. // CountryDartId: DART ID of the country to which this mobile carrier
  7589. // belongs.
  7590. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7591. // Id: ID of this mobile carrier.
  7592. Id int64 `json:"id,omitempty,string"`
  7593. // Kind: Identifies what kind of resource this is. Value: the fixed
  7594. // string "dfareporting#mobileCarrier".
  7595. Kind string `json:"kind,omitempty"`
  7596. // Name: Name of this mobile carrier.
  7597. Name string `json:"name,omitempty"`
  7598. // ServerResponse contains the HTTP response code and headers from the
  7599. // server.
  7600. googleapi.ServerResponse `json:"-"`
  7601. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7602. // unconditionally include in API requests. By default, fields with
  7603. // empty values are omitted from API requests. However, any non-pointer,
  7604. // non-interface field appearing in ForceSendFields will be sent to the
  7605. // server regardless of whether the field is empty or not. This may be
  7606. // used to include empty fields in Patch requests.
  7607. ForceSendFields []string `json:"-"`
  7608. // NullFields is a list of field names (e.g. "CountryCode") to include
  7609. // in API requests with the JSON null value. By default, fields with
  7610. // empty values are omitted from API requests. However, any field with
  7611. // an empty value appearing in NullFields will be sent to the server as
  7612. // null. It is an error if a field in this list has a non-empty value.
  7613. // This may be used to include null fields in Patch requests.
  7614. NullFields []string `json:"-"`
  7615. }
  7616. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7617. type NoMethod MobileCarrier
  7618. raw := NoMethod(*s)
  7619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7620. }
  7621. // MobileCarriersListResponse: Mobile Carrier List Response
  7622. type MobileCarriersListResponse struct {
  7623. // Kind: Identifies what kind of resource this is. Value: the fixed
  7624. // string "dfareporting#mobileCarriersListResponse".
  7625. Kind string `json:"kind,omitempty"`
  7626. // MobileCarriers: Mobile carrier collection.
  7627. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7628. // ServerResponse contains the HTTP response code and headers from the
  7629. // server.
  7630. googleapi.ServerResponse `json:"-"`
  7631. // ForceSendFields is a list of field names (e.g. "Kind") to
  7632. // unconditionally include in API requests. By default, fields with
  7633. // empty values are omitted from API requests. However, any non-pointer,
  7634. // non-interface field appearing in ForceSendFields will be sent to the
  7635. // server regardless of whether the field is empty or not. This may be
  7636. // used to include empty fields in Patch requests.
  7637. ForceSendFields []string `json:"-"`
  7638. // NullFields is a list of field names (e.g. "Kind") to include in API
  7639. // requests with the JSON null value. By default, fields with empty
  7640. // values are omitted from API requests. However, any field with an
  7641. // empty value appearing in NullFields will be sent to the server as
  7642. // null. It is an error if a field in this list has a non-empty value.
  7643. // This may be used to include null fields in Patch requests.
  7644. NullFields []string `json:"-"`
  7645. }
  7646. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7647. type NoMethod MobileCarriersListResponse
  7648. raw := NoMethod(*s)
  7649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7650. }
  7651. // ObjectFilter: Object Filter.
  7652. type ObjectFilter struct {
  7653. // Kind: Identifies what kind of resource this is. Value: the fixed
  7654. // string "dfareporting#objectFilter".
  7655. Kind string `json:"kind,omitempty"`
  7656. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7657. // objects with these object IDs.
  7658. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7659. // Status: Status of the filter. NONE means the user has access to none
  7660. // of the objects. ALL means the user has access to all objects.
  7661. // ASSIGNED means the user has access to the objects with IDs in the
  7662. // objectIds list.
  7663. //
  7664. // Possible values:
  7665. // "ALL"
  7666. // "ASSIGNED"
  7667. // "NONE"
  7668. Status string `json:"status,omitempty"`
  7669. // ForceSendFields is a list of field names (e.g. "Kind") to
  7670. // unconditionally include in API requests. By default, fields with
  7671. // empty values are omitted from API requests. However, any non-pointer,
  7672. // non-interface field appearing in ForceSendFields will be sent to the
  7673. // server regardless of whether the field is empty or not. This may be
  7674. // used to include empty fields in Patch requests.
  7675. ForceSendFields []string `json:"-"`
  7676. // NullFields is a list of field names (e.g. "Kind") to include in API
  7677. // requests with the JSON null value. By default, fields with empty
  7678. // values are omitted from API requests. However, any field with an
  7679. // empty value appearing in NullFields will be sent to the server as
  7680. // null. It is an error if a field in this list has a non-empty value.
  7681. // This may be used to include null fields in Patch requests.
  7682. NullFields []string `json:"-"`
  7683. }
  7684. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7685. type NoMethod ObjectFilter
  7686. raw := NoMethod(*s)
  7687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7688. }
  7689. // OffsetPosition: Offset Position.
  7690. type OffsetPosition struct {
  7691. // Left: Offset distance from left side of an asset or a window.
  7692. Left int64 `json:"left,omitempty"`
  7693. // Top: Offset distance from top side of an asset or a window.
  7694. Top int64 `json:"top,omitempty"`
  7695. // ForceSendFields is a list of field names (e.g. "Left") to
  7696. // unconditionally include in API requests. By default, fields with
  7697. // empty values are omitted from API requests. However, any non-pointer,
  7698. // non-interface field appearing in ForceSendFields will be sent to the
  7699. // server regardless of whether the field is empty or not. This may be
  7700. // used to include empty fields in Patch requests.
  7701. ForceSendFields []string `json:"-"`
  7702. // NullFields is a list of field names (e.g. "Left") to include in API
  7703. // requests with the JSON null value. By default, fields with empty
  7704. // values are omitted from API requests. However, any field with an
  7705. // empty value appearing in NullFields will be sent to the server as
  7706. // null. It is an error if a field in this list has a non-empty value.
  7707. // This may be used to include null fields in Patch requests.
  7708. NullFields []string `json:"-"`
  7709. }
  7710. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7711. type NoMethod OffsetPosition
  7712. raw := NoMethod(*s)
  7713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7714. }
  7715. // OmnitureSettings: Omniture Integration Settings.
  7716. type OmnitureSettings struct {
  7717. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7718. // Omniture. This property can be enabled only if
  7719. // omnitureIntegrationEnabled is true.
  7720. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7721. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7722. // This property can be enabled only when the "Advanced Ad Serving"
  7723. // account setting is enabled.
  7724. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7725. // ForceSendFields is a list of field names (e.g.
  7726. // "OmnitureCostDataEnabled") to unconditionally include in API
  7727. // requests. By default, fields with empty values are omitted from API
  7728. // requests. However, any non-pointer, non-interface field appearing in
  7729. // ForceSendFields will be sent to the server regardless of whether the
  7730. // field is empty or not. This may be used to include empty fields in
  7731. // Patch requests.
  7732. ForceSendFields []string `json:"-"`
  7733. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7734. // to include in API requests with the JSON null value. By default,
  7735. // fields with empty values are omitted from API requests. However, any
  7736. // field with an empty value appearing in NullFields will be sent to the
  7737. // server as null. It is an error if a field in this list has a
  7738. // non-empty value. This may be used to include null fields in Patch
  7739. // requests.
  7740. NullFields []string `json:"-"`
  7741. }
  7742. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7743. type NoMethod OmnitureSettings
  7744. raw := NoMethod(*s)
  7745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7746. }
  7747. // OperatingSystem: Contains information about an operating system that
  7748. // can be targeted by ads.
  7749. type OperatingSystem struct {
  7750. // DartId: DART ID of this operating system. This is the ID used for
  7751. // targeting.
  7752. DartId int64 `json:"dartId,omitempty,string"`
  7753. // Desktop: Whether this operating system is for desktop.
  7754. Desktop bool `json:"desktop,omitempty"`
  7755. // Kind: Identifies what kind of resource this is. Value: the fixed
  7756. // string "dfareporting#operatingSystem".
  7757. Kind string `json:"kind,omitempty"`
  7758. // Mobile: Whether this operating system is for mobile.
  7759. Mobile bool `json:"mobile,omitempty"`
  7760. // Name: Name of this operating system.
  7761. Name string `json:"name,omitempty"`
  7762. // ServerResponse contains the HTTP response code and headers from the
  7763. // server.
  7764. googleapi.ServerResponse `json:"-"`
  7765. // ForceSendFields is a list of field names (e.g. "DartId") to
  7766. // unconditionally include in API requests. By default, fields with
  7767. // empty values are omitted from API requests. However, any non-pointer,
  7768. // non-interface field appearing in ForceSendFields will be sent to the
  7769. // server regardless of whether the field is empty or not. This may be
  7770. // used to include empty fields in Patch requests.
  7771. ForceSendFields []string `json:"-"`
  7772. // NullFields is a list of field names (e.g. "DartId") to include in API
  7773. // requests with the JSON null value. By default, fields with empty
  7774. // values are omitted from API requests. However, any field with an
  7775. // empty value appearing in NullFields will be sent to the server as
  7776. // null. It is an error if a field in this list has a non-empty value.
  7777. // This may be used to include null fields in Patch requests.
  7778. NullFields []string `json:"-"`
  7779. }
  7780. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7781. type NoMethod OperatingSystem
  7782. raw := NoMethod(*s)
  7783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7784. }
  7785. // OperatingSystemVersion: Contains information about a particular
  7786. // version of an operating system that can be targeted by ads.
  7787. type OperatingSystemVersion struct {
  7788. // Id: ID of this operating system version.
  7789. Id int64 `json:"id,omitempty,string"`
  7790. // Kind: Identifies what kind of resource this is. Value: the fixed
  7791. // string "dfareporting#operatingSystemVersion".
  7792. Kind string `json:"kind,omitempty"`
  7793. // MajorVersion: Major version (leftmost number) of this operating
  7794. // system version.
  7795. MajorVersion string `json:"majorVersion,omitempty"`
  7796. // MinorVersion: Minor version (number after the first dot) of this
  7797. // operating system version.
  7798. MinorVersion string `json:"minorVersion,omitempty"`
  7799. // Name: Name of this operating system version.
  7800. Name string `json:"name,omitempty"`
  7801. // OperatingSystem: Operating system of this operating system version.
  7802. OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"`
  7803. // ServerResponse contains the HTTP response code and headers from the
  7804. // server.
  7805. googleapi.ServerResponse `json:"-"`
  7806. // ForceSendFields is a list of field names (e.g. "Id") to
  7807. // unconditionally include in API requests. By default, fields with
  7808. // empty values are omitted from API requests. However, any non-pointer,
  7809. // non-interface field appearing in ForceSendFields will be sent to the
  7810. // server regardless of whether the field is empty or not. This may be
  7811. // used to include empty fields in Patch requests.
  7812. ForceSendFields []string `json:"-"`
  7813. // NullFields is a list of field names (e.g. "Id") to include in API
  7814. // requests with the JSON null value. By default, fields with empty
  7815. // values are omitted from API requests. However, any field with an
  7816. // empty value appearing in NullFields will be sent to the server as
  7817. // null. It is an error if a field in this list has a non-empty value.
  7818. // This may be used to include null fields in Patch requests.
  7819. NullFields []string `json:"-"`
  7820. }
  7821. func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7822. type NoMethod OperatingSystemVersion
  7823. raw := NoMethod(*s)
  7824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7825. }
  7826. // OperatingSystemVersionsListResponse: Operating System Version List
  7827. // Response
  7828. type OperatingSystemVersionsListResponse struct {
  7829. // Kind: Identifies what kind of resource this is. Value: the fixed
  7830. // string "dfareporting#operatingSystemVersionsListResponse".
  7831. Kind string `json:"kind,omitempty"`
  7832. // OperatingSystemVersions: Operating system version collection.
  7833. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7834. // ServerResponse contains the HTTP response code and headers from the
  7835. // server.
  7836. googleapi.ServerResponse `json:"-"`
  7837. // ForceSendFields is a list of field names (e.g. "Kind") to
  7838. // unconditionally include in API requests. By default, fields with
  7839. // empty values are omitted from API requests. However, any non-pointer,
  7840. // non-interface field appearing in ForceSendFields will be sent to the
  7841. // server regardless of whether the field is empty or not. This may be
  7842. // used to include empty fields in Patch requests.
  7843. ForceSendFields []string `json:"-"`
  7844. // NullFields is a list of field names (e.g. "Kind") to include in API
  7845. // requests with the JSON null value. By default, fields with empty
  7846. // values are omitted from API requests. However, any field with an
  7847. // empty value appearing in NullFields will be sent to the server as
  7848. // null. It is an error if a field in this list has a non-empty value.
  7849. // This may be used to include null fields in Patch requests.
  7850. NullFields []string `json:"-"`
  7851. }
  7852. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7853. type NoMethod OperatingSystemVersionsListResponse
  7854. raw := NoMethod(*s)
  7855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7856. }
  7857. // OperatingSystemsListResponse: Operating System List Response
  7858. type OperatingSystemsListResponse struct {
  7859. // Kind: Identifies what kind of resource this is. Value: the fixed
  7860. // string "dfareporting#operatingSystemsListResponse".
  7861. Kind string `json:"kind,omitempty"`
  7862. // OperatingSystems: Operating system collection.
  7863. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7864. // ServerResponse contains the HTTP response code and headers from the
  7865. // server.
  7866. googleapi.ServerResponse `json:"-"`
  7867. // ForceSendFields is a list of field names (e.g. "Kind") to
  7868. // unconditionally include in API requests. By default, fields with
  7869. // empty values are omitted from API requests. However, any non-pointer,
  7870. // non-interface field appearing in ForceSendFields will be sent to the
  7871. // server regardless of whether the field is empty or not. This may be
  7872. // used to include empty fields in Patch requests.
  7873. ForceSendFields []string `json:"-"`
  7874. // NullFields is a list of field names (e.g. "Kind") to include in API
  7875. // requests with the JSON null value. By default, fields with empty
  7876. // values are omitted from API requests. However, any field with an
  7877. // empty value appearing in NullFields will be sent to the server as
  7878. // null. It is an error if a field in this list has a non-empty value.
  7879. // This may be used to include null fields in Patch requests.
  7880. NullFields []string `json:"-"`
  7881. }
  7882. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7883. type NoMethod OperatingSystemsListResponse
  7884. raw := NoMethod(*s)
  7885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7886. }
  7887. // OptimizationActivity: Creative optimization activity.
  7888. type OptimizationActivity struct {
  7889. // FloodlightActivityId: Floodlight activity ID of this optimization
  7890. // activity. This is a required field.
  7891. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7892. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7893. // floodlight activity. This is a read-only, auto-generated field.
  7894. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7895. // Weight: Weight associated with this optimization. The weight assigned
  7896. // will be understood in proportion to the weights assigned to the other
  7897. // optimization activities. Value must be greater than or equal to 1.
  7898. Weight int64 `json:"weight,omitempty"`
  7899. // ForceSendFields is a list of field names (e.g.
  7900. // "FloodlightActivityId") to unconditionally include in API requests.
  7901. // By default, fields with empty values are omitted from API requests.
  7902. // However, any non-pointer, non-interface field appearing in
  7903. // ForceSendFields will be sent to the server regardless of whether the
  7904. // field is empty or not. This may be used to include empty fields in
  7905. // Patch requests.
  7906. ForceSendFields []string `json:"-"`
  7907. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7908. // include in API requests with the JSON null value. By default, fields
  7909. // with empty values are omitted from API requests. However, any field
  7910. // with an empty value appearing in NullFields will be sent to the
  7911. // server as null. It is an error if a field in this list has a
  7912. // non-empty value. This may be used to include null fields in Patch
  7913. // requests.
  7914. NullFields []string `json:"-"`
  7915. }
  7916. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7917. type NoMethod OptimizationActivity
  7918. raw := NoMethod(*s)
  7919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7920. }
  7921. // Order: Describes properties of a DoubleClick Planning order.
  7922. type Order struct {
  7923. // AccountId: Account ID of this order.
  7924. AccountId int64 `json:"accountId,omitempty,string"`
  7925. // AdvertiserId: Advertiser ID of this order.
  7926. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7927. // ApproverUserProfileIds: IDs for users that have to approve documents
  7928. // created for this order.
  7929. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  7930. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  7931. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  7932. // BuyerOrganizationName: Name of the buyer organization.
  7933. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  7934. // Comments: Comments in this order.
  7935. Comments string `json:"comments,omitempty"`
  7936. // Contacts: Contacts for this order.
  7937. Contacts []*OrderContact `json:"contacts,omitempty"`
  7938. // Id: ID of this order. This is a read-only, auto-generated field.
  7939. Id int64 `json:"id,omitempty,string"`
  7940. // Kind: Identifies what kind of resource this is. Value: the fixed
  7941. // string "dfareporting#order".
  7942. Kind string `json:"kind,omitempty"`
  7943. // LastModifiedInfo: Information about the most recent modification of
  7944. // this order.
  7945. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7946. // Name: Name of this order.
  7947. Name string `json:"name,omitempty"`
  7948. // Notes: Notes of this order.
  7949. Notes string `json:"notes,omitempty"`
  7950. // PlanningTermId: ID of the terms and conditions template used in this
  7951. // order.
  7952. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  7953. // ProjectId: Project ID of this order.
  7954. ProjectId int64 `json:"projectId,omitempty,string"`
  7955. // SellerOrderId: Seller order ID associated with this order.
  7956. SellerOrderId string `json:"sellerOrderId,omitempty"`
  7957. // SellerOrganizationName: Name of the seller organization.
  7958. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  7959. // SiteId: Site IDs this order is associated with.
  7960. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  7961. // SiteNames: Free-form site names this order is associated with.
  7962. SiteNames []string `json:"siteNames,omitempty"`
  7963. // SubaccountId: Subaccount ID of this order.
  7964. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7965. // TermsAndConditions: Terms and conditions of this order.
  7966. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  7967. // ServerResponse contains the HTTP response code and headers from the
  7968. // server.
  7969. googleapi.ServerResponse `json:"-"`
  7970. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7971. // unconditionally include in API requests. By default, fields with
  7972. // empty values are omitted from API requests. However, any non-pointer,
  7973. // non-interface field appearing in ForceSendFields will be sent to the
  7974. // server regardless of whether the field is empty or not. This may be
  7975. // used to include empty fields in Patch requests.
  7976. ForceSendFields []string `json:"-"`
  7977. // NullFields is a list of field names (e.g. "AccountId") to include in
  7978. // API requests with the JSON null value. By default, fields with empty
  7979. // values are omitted from API requests. However, any field with an
  7980. // empty value appearing in NullFields will be sent to the server as
  7981. // null. It is an error if a field in this list has a non-empty value.
  7982. // This may be used to include null fields in Patch requests.
  7983. NullFields []string `json:"-"`
  7984. }
  7985. func (s *Order) MarshalJSON() ([]byte, error) {
  7986. type NoMethod Order
  7987. raw := NoMethod(*s)
  7988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7989. }
  7990. // OrderContact: Contact of an order.
  7991. type OrderContact struct {
  7992. // ContactInfo: Free-form information about this contact. It could be
  7993. // any information related to this contact in addition to type, title,
  7994. // name, and signature user profile ID.
  7995. ContactInfo string `json:"contactInfo,omitempty"`
  7996. // ContactName: Name of this contact.
  7997. ContactName string `json:"contactName,omitempty"`
  7998. // ContactTitle: Title of this contact.
  7999. ContactTitle string `json:"contactTitle,omitempty"`
  8000. // ContactType: Type of this contact.
  8001. //
  8002. // Possible values:
  8003. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  8004. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  8005. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  8006. ContactType string `json:"contactType,omitempty"`
  8007. // SignatureUserProfileId: ID of the user profile containing the
  8008. // signature that will be embedded into order documents.
  8009. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  8010. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  8011. // unconditionally include in API requests. By default, fields with
  8012. // empty values are omitted from API requests. However, any non-pointer,
  8013. // non-interface field appearing in ForceSendFields will be sent to the
  8014. // server regardless of whether the field is empty or not. This may be
  8015. // used to include empty fields in Patch requests.
  8016. ForceSendFields []string `json:"-"`
  8017. // NullFields is a list of field names (e.g. "ContactInfo") to include
  8018. // in API requests with the JSON null value. By default, fields with
  8019. // empty values are omitted from API requests. However, any field with
  8020. // an empty value appearing in NullFields will be sent to the server as
  8021. // null. It is an error if a field in this list has a non-empty value.
  8022. // This may be used to include null fields in Patch requests.
  8023. NullFields []string `json:"-"`
  8024. }
  8025. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  8026. type NoMethod OrderContact
  8027. raw := NoMethod(*s)
  8028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8029. }
  8030. // OrderDocument: Contains properties of a DoubleClick Planning order
  8031. // document.
  8032. type OrderDocument struct {
  8033. // AccountId: Account ID of this order document.
  8034. AccountId int64 `json:"accountId,omitempty,string"`
  8035. // AdvertiserId: Advertiser ID of this order document.
  8036. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8037. // AmendedOrderDocumentId: The amended order document ID of this order
  8038. // document. An order document can be created by optionally amending
  8039. // another order document so that the change history can be preserved.
  8040. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  8041. // ApprovedByUserProfileIds: IDs of users who have approved this order
  8042. // document.
  8043. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  8044. // Cancelled: Whether this order document is cancelled.
  8045. Cancelled bool `json:"cancelled,omitempty"`
  8046. // CreatedInfo: Information about the creation of this order document.
  8047. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  8048. // EffectiveDate: Effective date of this order document.
  8049. EffectiveDate string `json:"effectiveDate,omitempty"`
  8050. // Id: ID of this order document.
  8051. Id int64 `json:"id,omitempty,string"`
  8052. // Kind: Identifies what kind of resource this is. Value: the fixed
  8053. // string "dfareporting#orderDocument".
  8054. Kind string `json:"kind,omitempty"`
  8055. // LastSentRecipients: List of email addresses that received the last
  8056. // sent document.
  8057. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  8058. // LastSentTime: Timestamp of the last email sent with this order
  8059. // document.
  8060. LastSentTime string `json:"lastSentTime,omitempty"`
  8061. // OrderId: ID of the order from which this order document is created.
  8062. OrderId int64 `json:"orderId,omitempty,string"`
  8063. // ProjectId: Project ID of this order document.
  8064. ProjectId int64 `json:"projectId,omitempty,string"`
  8065. // Signed: Whether this order document has been signed.
  8066. Signed bool `json:"signed,omitempty"`
  8067. // SubaccountId: Subaccount ID of this order document.
  8068. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8069. // Title: Title of this order document.
  8070. Title string `json:"title,omitempty"`
  8071. // Type: Type of this order document
  8072. //
  8073. // Possible values:
  8074. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  8075. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  8076. Type string `json:"type,omitempty"`
  8077. // ServerResponse contains the HTTP response code and headers from the
  8078. // server.
  8079. googleapi.ServerResponse `json:"-"`
  8080. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8081. // unconditionally include in API requests. By default, fields with
  8082. // empty values are omitted from API requests. However, any non-pointer,
  8083. // non-interface field appearing in ForceSendFields will be sent to the
  8084. // server regardless of whether the field is empty or not. This may be
  8085. // used to include empty fields in Patch requests.
  8086. ForceSendFields []string `json:"-"`
  8087. // NullFields is a list of field names (e.g. "AccountId") to include in
  8088. // API requests with the JSON null value. By default, fields with empty
  8089. // values are omitted from API requests. However, any field with an
  8090. // empty value appearing in NullFields will be sent to the server as
  8091. // null. It is an error if a field in this list has a non-empty value.
  8092. // This may be used to include null fields in Patch requests.
  8093. NullFields []string `json:"-"`
  8094. }
  8095. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  8096. type NoMethod OrderDocument
  8097. raw := NoMethod(*s)
  8098. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8099. }
  8100. // OrderDocumentsListResponse: Order document List Response
  8101. type OrderDocumentsListResponse struct {
  8102. // Kind: Identifies what kind of resource this is. Value: the fixed
  8103. // string "dfareporting#orderDocumentsListResponse".
  8104. Kind string `json:"kind,omitempty"`
  8105. // NextPageToken: Pagination token to be used for the next list
  8106. // operation.
  8107. NextPageToken string `json:"nextPageToken,omitempty"`
  8108. // OrderDocuments: Order document collection
  8109. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  8110. // ServerResponse contains the HTTP response code and headers from the
  8111. // server.
  8112. googleapi.ServerResponse `json:"-"`
  8113. // ForceSendFields is a list of field names (e.g. "Kind") to
  8114. // unconditionally include in API requests. By default, fields with
  8115. // empty values are omitted from API requests. However, any non-pointer,
  8116. // non-interface field appearing in ForceSendFields will be sent to the
  8117. // server regardless of whether the field is empty or not. This may be
  8118. // used to include empty fields in Patch requests.
  8119. ForceSendFields []string `json:"-"`
  8120. // NullFields is a list of field names (e.g. "Kind") to include in API
  8121. // requests with the JSON null value. By default, fields with empty
  8122. // values are omitted from API requests. However, any field with an
  8123. // empty value appearing in NullFields will be sent to the server as
  8124. // null. It is an error if a field in this list has a non-empty value.
  8125. // This may be used to include null fields in Patch requests.
  8126. NullFields []string `json:"-"`
  8127. }
  8128. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  8129. type NoMethod OrderDocumentsListResponse
  8130. raw := NoMethod(*s)
  8131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8132. }
  8133. // OrdersListResponse: Order List Response
  8134. type OrdersListResponse struct {
  8135. // Kind: Identifies what kind of resource this is. Value: the fixed
  8136. // string "dfareporting#ordersListResponse".
  8137. Kind string `json:"kind,omitempty"`
  8138. // NextPageToken: Pagination token to be used for the next list
  8139. // operation.
  8140. NextPageToken string `json:"nextPageToken,omitempty"`
  8141. // Orders: Order collection.
  8142. Orders []*Order `json:"orders,omitempty"`
  8143. // ServerResponse contains the HTTP response code and headers from the
  8144. // server.
  8145. googleapi.ServerResponse `json:"-"`
  8146. // ForceSendFields is a list of field names (e.g. "Kind") to
  8147. // unconditionally include in API requests. By default, fields with
  8148. // empty values are omitted from API requests. However, any non-pointer,
  8149. // non-interface field appearing in ForceSendFields will be sent to the
  8150. // server regardless of whether the field is empty or not. This may be
  8151. // used to include empty fields in Patch requests.
  8152. ForceSendFields []string `json:"-"`
  8153. // NullFields is a list of field names (e.g. "Kind") to include in API
  8154. // requests with the JSON null value. By default, fields with empty
  8155. // values are omitted from API requests. However, any field with an
  8156. // empty value appearing in NullFields will be sent to the server as
  8157. // null. It is an error if a field in this list has a non-empty value.
  8158. // This may be used to include null fields in Patch requests.
  8159. NullFields []string `json:"-"`
  8160. }
  8161. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  8162. type NoMethod OrdersListResponse
  8163. raw := NoMethod(*s)
  8164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8165. }
  8166. // PathToConversionReportCompatibleFields: Represents fields that are
  8167. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  8168. type PathToConversionReportCompatibleFields struct {
  8169. // ConversionDimensions: Conversion dimensions which are compatible to
  8170. // be selected in the "conversionDimensions" section of the report.
  8171. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  8172. // CustomFloodlightVariables: Custom floodlight variables which are
  8173. // compatible to be selected in the "customFloodlightVariables" section
  8174. // of the report.
  8175. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  8176. // Kind: The kind of resource this is, in this case
  8177. // dfareporting#pathToConversionReportCompatibleFields.
  8178. Kind string `json:"kind,omitempty"`
  8179. // Metrics: Metrics which are compatible to be selected in the
  8180. // "metricNames" section of the report.
  8181. Metrics []*Metric `json:"metrics,omitempty"`
  8182. // PerInteractionDimensions: Per-interaction dimensions which are
  8183. // compatible to be selected in the "perInteractionDimensions" section
  8184. // of the report.
  8185. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  8186. // ForceSendFields is a list of field names (e.g.
  8187. // "ConversionDimensions") to unconditionally include in API requests.
  8188. // By default, fields with empty values are omitted from API requests.
  8189. // However, any non-pointer, non-interface field appearing in
  8190. // ForceSendFields will be sent to the server regardless of whether the
  8191. // field is empty or not. This may be used to include empty fields in
  8192. // Patch requests.
  8193. ForceSendFields []string `json:"-"`
  8194. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  8195. // include in API requests with the JSON null value. By default, fields
  8196. // with empty values are omitted from API requests. However, any field
  8197. // with an empty value appearing in NullFields will be sent to the
  8198. // server as null. It is an error if a field in this list has a
  8199. // non-empty value. This may be used to include null fields in Patch
  8200. // requests.
  8201. NullFields []string `json:"-"`
  8202. }
  8203. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8204. type NoMethod PathToConversionReportCompatibleFields
  8205. raw := NoMethod(*s)
  8206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8207. }
  8208. // Placement: Contains properties of a placement.
  8209. type Placement struct {
  8210. // AccountId: Account ID of this placement. This field can be left
  8211. // blank.
  8212. AccountId int64 `json:"accountId,omitempty,string"`
  8213. // AdBlockingOptOut: Whether this placement opts out of ad blocking.
  8214. // When true, ad blocking is disabled for this placement. When false,
  8215. // the campaign and site settings take effect.
  8216. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  8217. // AdvertiserId: Advertiser ID of this placement. This field can be left
  8218. // blank.
  8219. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8220. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8221. // advertiser. This is a read-only, auto-generated field.
  8222. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8223. // Archived: Whether this placement is archived.
  8224. Archived bool `json:"archived,omitempty"`
  8225. // CampaignId: Campaign ID of this placement. This field is a required
  8226. // field on insertion.
  8227. CampaignId int64 `json:"campaignId,omitempty,string"`
  8228. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8229. // This is a read-only, auto-generated field.
  8230. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8231. // Comment: Comments for this placement.
  8232. Comment string `json:"comment,omitempty"`
  8233. // Compatibility: Placement compatibility. DISPLAY and
  8234. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  8235. // or in mobile apps for regular or interstitial ads respectively. APP
  8236. // and APP_INTERSTITIAL are no longer allowed for new placement
  8237. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  8238. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  8239. // with the VAST standard. This field is required on insertion.
  8240. //
  8241. // Possible values:
  8242. // "APP"
  8243. // "APP_INTERSTITIAL"
  8244. // "DISPLAY"
  8245. // "DISPLAY_INTERSTITIAL"
  8246. // "IN_STREAM_AUDIO"
  8247. // "IN_STREAM_VIDEO"
  8248. Compatibility string `json:"compatibility,omitempty"`
  8249. // ContentCategoryId: ID of the content category assigned to this
  8250. // placement.
  8251. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8252. // CreateInfo: Information about the creation of this placement. This is
  8253. // a read-only field.
  8254. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8255. // DirectorySiteId: Directory site ID of this placement. On insert, you
  8256. // must set either this field or the siteId field to specify the site
  8257. // associated with this placement. This is a required field that is
  8258. // read-only after insertion.
  8259. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8260. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8261. // directory site. This is a read-only, auto-generated field.
  8262. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8263. // ExternalId: External ID for this placement.
  8264. ExternalId string `json:"externalId,omitempty"`
  8265. // Id: ID of this placement. This is a read-only, auto-generated field.
  8266. Id int64 `json:"id,omitempty,string"`
  8267. // IdDimensionValue: Dimension value for the ID of this placement. This
  8268. // is a read-only, auto-generated field.
  8269. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8270. // KeyName: Key name of this placement. This is a read-only,
  8271. // auto-generated field.
  8272. KeyName string `json:"keyName,omitempty"`
  8273. // Kind: Identifies what kind of resource this is. Value: the fixed
  8274. // string "dfareporting#placement".
  8275. Kind string `json:"kind,omitempty"`
  8276. // LastModifiedInfo: Information about the most recent modification of
  8277. // this placement. This is a read-only field.
  8278. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8279. // LookbackConfiguration: Lookback window settings for this placement.
  8280. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  8281. // Name: Name of this placement.This is a required field and must be
  8282. // less than 256 characters long.
  8283. Name string `json:"name,omitempty"`
  8284. // PaymentApproved: Whether payment was approved for this placement.
  8285. // This is a read-only field relevant only to publisher-paid placements.
  8286. PaymentApproved bool `json:"paymentApproved,omitempty"`
  8287. // PaymentSource: Payment source for this placement. This is a required
  8288. // field that is read-only after insertion.
  8289. //
  8290. // Possible values:
  8291. // "PLACEMENT_AGENCY_PAID"
  8292. // "PLACEMENT_PUBLISHER_PAID"
  8293. PaymentSource string `json:"paymentSource,omitempty"`
  8294. // PlacementGroupId: ID of this placement's group, if applicable.
  8295. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  8296. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  8297. // placement group. This is a read-only, auto-generated field.
  8298. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  8299. // PlacementStrategyId: ID of the placement strategy assigned to this
  8300. // placement.
  8301. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8302. // PricingSchedule: Pricing schedule of this placement. This field is
  8303. // required on insertion, specifically subfields startDate, endDate and
  8304. // pricingType.
  8305. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8306. // Primary: Whether this placement is the primary placement of a
  8307. // roadblock (placement group). You cannot change this field from true
  8308. // to false. Setting this field to true will automatically set the
  8309. // primary field on the original primary placement of the roadblock to
  8310. // false, and it will automatically set the roadblock's
  8311. // primaryPlacementId field to the ID of this placement.
  8312. Primary bool `json:"primary,omitempty"`
  8313. // PublisherUpdateInfo: Information about the last publisher update.
  8314. // This is a read-only field.
  8315. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8316. // SiteId: Site ID associated with this placement. On insert, you must
  8317. // set either this field or the directorySiteId field to specify the
  8318. // site associated with this placement. This is a required field that is
  8319. // read-only after insertion.
  8320. SiteId int64 `json:"siteId,omitempty,string"`
  8321. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8322. // a read-only, auto-generated field.
  8323. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8324. // Size: Size associated with this placement. When inserting or updating
  8325. // a placement, only the size ID field is used. This field is required
  8326. // on insertion.
  8327. Size *Size `json:"size,omitempty"`
  8328. // SslRequired: Whether creatives assigned to this placement must be
  8329. // SSL-compliant.
  8330. SslRequired bool `json:"sslRequired,omitempty"`
  8331. // Status: Third-party placement status.
  8332. //
  8333. // Possible values:
  8334. // "ACKNOWLEDGE_ACCEPTANCE"
  8335. // "ACKNOWLEDGE_REJECTION"
  8336. // "DRAFT"
  8337. // "PAYMENT_ACCEPTED"
  8338. // "PAYMENT_REJECTED"
  8339. // "PENDING_REVIEW"
  8340. Status string `json:"status,omitempty"`
  8341. // SubaccountId: Subaccount ID of this placement. This field can be left
  8342. // blank.
  8343. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8344. // TagFormats: Tag formats to generate for this placement. This field is
  8345. // required on insertion.
  8346. // Acceptable values are:
  8347. // - "PLACEMENT_TAG_STANDARD"
  8348. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8349. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8350. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8351. // - "PLACEMENT_TAG_JAVASCRIPT"
  8352. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8353. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8354. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8355. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8356. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8357. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8358. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8359. // - "PLACEMENT_TAG_TRACKING"
  8360. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8361. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8362. //
  8363. // Possible values:
  8364. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8365. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8366. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8367. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8368. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8369. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8370. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8371. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8372. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8373. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8374. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8375. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8376. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8377. // "PLACEMENT_TAG_JAVASCRIPT"
  8378. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8379. // "PLACEMENT_TAG_STANDARD"
  8380. // "PLACEMENT_TAG_TRACKING"
  8381. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8382. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8383. TagFormats []string `json:"tagFormats,omitempty"`
  8384. // TagSetting: Tag settings for this placement.
  8385. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8386. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8387. // disabled for in-stream video creatives for this placement. The same
  8388. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8389. // occurs if either of these settings are true. These settings are
  8390. // distinct from DirectorySites.settings.activeViewOptOut or
  8391. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8392. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8393. // well as display ads, from Verification and ActiveView.
  8394. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8395. // VideoSettings: A collection of settings which affect video creatives
  8396. // served through this placement. Applicable to placements with
  8397. // IN_STREAM_VIDEO compatibility.
  8398. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8399. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8400. // Controls which VPAID format the measurement adapter will use for
  8401. // in-stream video creatives assigned to this placement.
  8402. //
  8403. // Note: Flash is no longer supported. This field now defaults to HTML5
  8404. // when the following values are provided: FLASH, BOTH.
  8405. //
  8406. // Possible values:
  8407. // "BOTH"
  8408. // "DEFAULT"
  8409. // "FLASH"
  8410. // "HTML5"
  8411. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8412. // ServerResponse contains the HTTP response code and headers from the
  8413. // server.
  8414. googleapi.ServerResponse `json:"-"`
  8415. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8416. // unconditionally include in API requests. By default, fields with
  8417. // empty values are omitted from API requests. However, any non-pointer,
  8418. // non-interface field appearing in ForceSendFields will be sent to the
  8419. // server regardless of whether the field is empty or not. This may be
  8420. // used to include empty fields in Patch requests.
  8421. ForceSendFields []string `json:"-"`
  8422. // NullFields is a list of field names (e.g. "AccountId") to include in
  8423. // API requests with the JSON null value. By default, fields with empty
  8424. // values are omitted from API requests. However, any field with an
  8425. // empty value appearing in NullFields will be sent to the server as
  8426. // null. It is an error if a field in this list has a non-empty value.
  8427. // This may be used to include null fields in Patch requests.
  8428. NullFields []string `json:"-"`
  8429. }
  8430. func (s *Placement) MarshalJSON() ([]byte, error) {
  8431. type NoMethod Placement
  8432. raw := NoMethod(*s)
  8433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8434. }
  8435. // PlacementAssignment: Placement Assignment.
  8436. type PlacementAssignment struct {
  8437. // Active: Whether this placement assignment is active. When true, the
  8438. // placement will be included in the ad's rotation.
  8439. Active bool `json:"active,omitempty"`
  8440. // PlacementId: ID of the placement to be assigned. This is a required
  8441. // field.
  8442. PlacementId int64 `json:"placementId,omitempty,string"`
  8443. // PlacementIdDimensionValue: Dimension value for the ID of the
  8444. // placement. This is a read-only, auto-generated field.
  8445. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8446. // SslRequired: Whether the placement to be assigned requires SSL. This
  8447. // is a read-only field that is auto-generated when the ad is inserted
  8448. // or updated.
  8449. SslRequired bool `json:"sslRequired,omitempty"`
  8450. // ForceSendFields is a list of field names (e.g. "Active") to
  8451. // unconditionally include in API requests. By default, fields with
  8452. // empty values are omitted from API requests. However, any non-pointer,
  8453. // non-interface field appearing in ForceSendFields will be sent to the
  8454. // server regardless of whether the field is empty or not. This may be
  8455. // used to include empty fields in Patch requests.
  8456. ForceSendFields []string `json:"-"`
  8457. // NullFields is a list of field names (e.g. "Active") to include in API
  8458. // requests with the JSON null value. By default, fields with empty
  8459. // values are omitted from API requests. However, any field with an
  8460. // empty value appearing in NullFields will be sent to the server as
  8461. // null. It is an error if a field in this list has a non-empty value.
  8462. // This may be used to include null fields in Patch requests.
  8463. NullFields []string `json:"-"`
  8464. }
  8465. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8466. type NoMethod PlacementAssignment
  8467. raw := NoMethod(*s)
  8468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8469. }
  8470. // PlacementGroup: Contains properties of a package or roadblock.
  8471. type PlacementGroup struct {
  8472. // AccountId: Account ID of this placement group. This is a read-only
  8473. // field that can be left blank.
  8474. AccountId int64 `json:"accountId,omitempty,string"`
  8475. // AdvertiserId: Advertiser ID of this placement group. This is a
  8476. // required field on insertion.
  8477. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8478. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8479. // advertiser. This is a read-only, auto-generated field.
  8480. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8481. // Archived: Whether this placement group is archived.
  8482. Archived bool `json:"archived,omitempty"`
  8483. // CampaignId: Campaign ID of this placement group. This field is
  8484. // required on insertion.
  8485. CampaignId int64 `json:"campaignId,omitempty,string"`
  8486. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8487. // This is a read-only, auto-generated field.
  8488. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8489. // ChildPlacementIds: IDs of placements which are assigned to this
  8490. // placement group. This is a read-only, auto-generated field.
  8491. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8492. // Comment: Comments for this placement group.
  8493. Comment string `json:"comment,omitempty"`
  8494. // ContentCategoryId: ID of the content category assigned to this
  8495. // placement group.
  8496. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8497. // CreateInfo: Information about the creation of this placement group.
  8498. // This is a read-only field.
  8499. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8500. // DirectorySiteId: Directory site ID associated with this placement
  8501. // group. On insert, you must set either this field or the site_id field
  8502. // to specify the site associated with this placement group. This is a
  8503. // required field that is read-only after insertion.
  8504. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8505. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8506. // directory site. This is a read-only, auto-generated field.
  8507. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8508. // ExternalId: External ID for this placement.
  8509. ExternalId string `json:"externalId,omitempty"`
  8510. // Id: ID of this placement group. This is a read-only, auto-generated
  8511. // field.
  8512. Id int64 `json:"id,omitempty,string"`
  8513. // IdDimensionValue: Dimension value for the ID of this placement group.
  8514. // This is a read-only, auto-generated field.
  8515. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8516. // Kind: Identifies what kind of resource this is. Value: the fixed
  8517. // string "dfareporting#placementGroup".
  8518. Kind string `json:"kind,omitempty"`
  8519. // LastModifiedInfo: Information about the most recent modification of
  8520. // this placement group. This is a read-only field.
  8521. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8522. // Name: Name of this placement group. This is a required field and must
  8523. // be less than 256 characters long.
  8524. Name string `json:"name,omitempty"`
  8525. // PlacementGroupType: Type of this placement group. A package is a
  8526. // simple group of placements that acts as a single pricing point for a
  8527. // group of tags. A roadblock is a group of placements that not only
  8528. // acts as a single pricing point, but also assumes that all the tags in
  8529. // it will be served at the same time. A roadblock requires one of its
  8530. // assigned placements to be marked as primary for reporting. This field
  8531. // is required on insertion.
  8532. //
  8533. // Possible values:
  8534. // "PLACEMENT_PACKAGE"
  8535. // "PLACEMENT_ROADBLOCK"
  8536. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8537. // PlacementStrategyId: ID of the placement strategy assigned to this
  8538. // placement group.
  8539. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8540. // PricingSchedule: Pricing schedule of this placement group. This field
  8541. // is required on insertion.
  8542. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8543. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8544. // the media cost of a roadblock (placement group). Modifying this field
  8545. // will automatically modify the primary field on all affected roadblock
  8546. // child placements.
  8547. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8548. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8549. // primary placement. This is a read-only, auto-generated field.
  8550. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8551. // SiteId: Site ID associated with this placement group. On insert, you
  8552. // must set either this field or the directorySiteId field to specify
  8553. // the site associated with this placement group. This is a required
  8554. // field that is read-only after insertion.
  8555. SiteId int64 `json:"siteId,omitempty,string"`
  8556. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8557. // a read-only, auto-generated field.
  8558. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8559. // SubaccountId: Subaccount ID of this placement group. This is a
  8560. // read-only field that can be left blank.
  8561. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8562. // ServerResponse contains the HTTP response code and headers from the
  8563. // server.
  8564. googleapi.ServerResponse `json:"-"`
  8565. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8566. // unconditionally include in API requests. By default, fields with
  8567. // empty values are omitted from API requests. However, any non-pointer,
  8568. // non-interface field appearing in ForceSendFields will be sent to the
  8569. // server regardless of whether the field is empty or not. This may be
  8570. // used to include empty fields in Patch requests.
  8571. ForceSendFields []string `json:"-"`
  8572. // NullFields is a list of field names (e.g. "AccountId") to include in
  8573. // API requests with the JSON null value. By default, fields with empty
  8574. // values are omitted from API requests. However, any field with an
  8575. // empty value appearing in NullFields will be sent to the server as
  8576. // null. It is an error if a field in this list has a non-empty value.
  8577. // This may be used to include null fields in Patch requests.
  8578. NullFields []string `json:"-"`
  8579. }
  8580. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8581. type NoMethod PlacementGroup
  8582. raw := NoMethod(*s)
  8583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8584. }
  8585. // PlacementGroupsListResponse: Placement Group List Response
  8586. type PlacementGroupsListResponse struct {
  8587. // Kind: Identifies what kind of resource this is. Value: the fixed
  8588. // string "dfareporting#placementGroupsListResponse".
  8589. Kind string `json:"kind,omitempty"`
  8590. // NextPageToken: Pagination token to be used for the next list
  8591. // operation.
  8592. NextPageToken string `json:"nextPageToken,omitempty"`
  8593. // PlacementGroups: Placement group collection.
  8594. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8595. // ServerResponse contains the HTTP response code and headers from the
  8596. // server.
  8597. googleapi.ServerResponse `json:"-"`
  8598. // ForceSendFields is a list of field names (e.g. "Kind") to
  8599. // unconditionally include in API requests. By default, fields with
  8600. // empty values are omitted from API requests. However, any non-pointer,
  8601. // non-interface field appearing in ForceSendFields will be sent to the
  8602. // server regardless of whether the field is empty or not. This may be
  8603. // used to include empty fields in Patch requests.
  8604. ForceSendFields []string `json:"-"`
  8605. // NullFields is a list of field names (e.g. "Kind") to include in API
  8606. // requests with the JSON null value. By default, fields with empty
  8607. // values are omitted from API requests. However, any field with an
  8608. // empty value appearing in NullFields will be sent to the server as
  8609. // null. It is an error if a field in this list has a non-empty value.
  8610. // This may be used to include null fields in Patch requests.
  8611. NullFields []string `json:"-"`
  8612. }
  8613. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8614. type NoMethod PlacementGroupsListResponse
  8615. raw := NoMethod(*s)
  8616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8617. }
  8618. // PlacementStrategiesListResponse: Placement Strategy List Response
  8619. type PlacementStrategiesListResponse struct {
  8620. // Kind: Identifies what kind of resource this is. Value: the fixed
  8621. // string "dfareporting#placementStrategiesListResponse".
  8622. Kind string `json:"kind,omitempty"`
  8623. // NextPageToken: Pagination token to be used for the next list
  8624. // operation.
  8625. NextPageToken string `json:"nextPageToken,omitempty"`
  8626. // PlacementStrategies: Placement strategy collection.
  8627. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8628. // ServerResponse contains the HTTP response code and headers from the
  8629. // server.
  8630. googleapi.ServerResponse `json:"-"`
  8631. // ForceSendFields is a list of field names (e.g. "Kind") to
  8632. // unconditionally include in API requests. By default, fields with
  8633. // empty values are omitted from API requests. However, any non-pointer,
  8634. // non-interface field appearing in ForceSendFields will be sent to the
  8635. // server regardless of whether the field is empty or not. This may be
  8636. // used to include empty fields in Patch requests.
  8637. ForceSendFields []string `json:"-"`
  8638. // NullFields is a list of field names (e.g. "Kind") to include in API
  8639. // requests with the JSON null value. By default, fields with empty
  8640. // values are omitted from API requests. However, any field with an
  8641. // empty value appearing in NullFields will be sent to the server as
  8642. // null. It is an error if a field in this list has a non-empty value.
  8643. // This may be used to include null fields in Patch requests.
  8644. NullFields []string `json:"-"`
  8645. }
  8646. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8647. type NoMethod PlacementStrategiesListResponse
  8648. raw := NoMethod(*s)
  8649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8650. }
  8651. // PlacementStrategy: Contains properties of a placement strategy.
  8652. type PlacementStrategy struct {
  8653. // AccountId: Account ID of this placement strategy.This is a read-only
  8654. // field that can be left blank.
  8655. AccountId int64 `json:"accountId,omitempty,string"`
  8656. // Id: ID of this placement strategy. This is a read-only,
  8657. // auto-generated field.
  8658. Id int64 `json:"id,omitempty,string"`
  8659. // Kind: Identifies what kind of resource this is. Value: the fixed
  8660. // string "dfareporting#placementStrategy".
  8661. Kind string `json:"kind,omitempty"`
  8662. // Name: Name of this placement strategy. This is a required field. It
  8663. // must be less than 256 characters long and unique among placement
  8664. // strategies of the same account.
  8665. Name string `json:"name,omitempty"`
  8666. // ServerResponse contains the HTTP response code and headers from the
  8667. // server.
  8668. googleapi.ServerResponse `json:"-"`
  8669. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8670. // unconditionally include in API requests. By default, fields with
  8671. // empty values are omitted from API requests. However, any non-pointer,
  8672. // non-interface field appearing in ForceSendFields will be sent to the
  8673. // server regardless of whether the field is empty or not. This may be
  8674. // used to include empty fields in Patch requests.
  8675. ForceSendFields []string `json:"-"`
  8676. // NullFields is a list of field names (e.g. "AccountId") to include in
  8677. // API requests with the JSON null value. By default, fields with empty
  8678. // values are omitted from API requests. However, any field with an
  8679. // empty value appearing in NullFields will be sent to the server as
  8680. // null. It is an error if a field in this list has a non-empty value.
  8681. // This may be used to include null fields in Patch requests.
  8682. NullFields []string `json:"-"`
  8683. }
  8684. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8685. type NoMethod PlacementStrategy
  8686. raw := NoMethod(*s)
  8687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8688. }
  8689. // PlacementTag: Placement Tag
  8690. type PlacementTag struct {
  8691. // PlacementId: Placement ID
  8692. PlacementId int64 `json:"placementId,omitempty,string"`
  8693. // TagDatas: Tags generated for this placement.
  8694. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8695. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8696. // unconditionally include in API requests. By default, fields with
  8697. // empty values are omitted from API requests. However, any non-pointer,
  8698. // non-interface field appearing in ForceSendFields will be sent to the
  8699. // server regardless of whether the field is empty or not. This may be
  8700. // used to include empty fields in Patch requests.
  8701. ForceSendFields []string `json:"-"`
  8702. // NullFields is a list of field names (e.g. "PlacementId") to include
  8703. // in API requests with the JSON null value. By default, fields with
  8704. // empty values are omitted from API requests. However, any field with
  8705. // an empty value appearing in NullFields will be sent to the server as
  8706. // null. It is an error if a field in this list has a non-empty value.
  8707. // This may be used to include null fields in Patch requests.
  8708. NullFields []string `json:"-"`
  8709. }
  8710. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8711. type NoMethod PlacementTag
  8712. raw := NoMethod(*s)
  8713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8714. }
  8715. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8716. type PlacementsGenerateTagsResponse struct {
  8717. // Kind: Identifies what kind of resource this is. Value: the fixed
  8718. // string "dfareporting#placementsGenerateTagsResponse".
  8719. Kind string `json:"kind,omitempty"`
  8720. // PlacementTags: Set of generated tags for the specified placements.
  8721. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8722. // ServerResponse contains the HTTP response code and headers from the
  8723. // server.
  8724. googleapi.ServerResponse `json:"-"`
  8725. // ForceSendFields is a list of field names (e.g. "Kind") to
  8726. // unconditionally include in API requests. By default, fields with
  8727. // empty values are omitted from API requests. However, any non-pointer,
  8728. // non-interface field appearing in ForceSendFields will be sent to the
  8729. // server regardless of whether the field is empty or not. This may be
  8730. // used to include empty fields in Patch requests.
  8731. ForceSendFields []string `json:"-"`
  8732. // NullFields is a list of field names (e.g. "Kind") to include in API
  8733. // requests with the JSON null value. By default, fields with empty
  8734. // values are omitted from API requests. However, any field with an
  8735. // empty value appearing in NullFields will be sent to the server as
  8736. // null. It is an error if a field in this list has a non-empty value.
  8737. // This may be used to include null fields in Patch requests.
  8738. NullFields []string `json:"-"`
  8739. }
  8740. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8741. type NoMethod PlacementsGenerateTagsResponse
  8742. raw := NoMethod(*s)
  8743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8744. }
  8745. // PlacementsListResponse: Placement List Response
  8746. type PlacementsListResponse struct {
  8747. // Kind: Identifies what kind of resource this is. Value: the fixed
  8748. // string "dfareporting#placementsListResponse".
  8749. Kind string `json:"kind,omitempty"`
  8750. // NextPageToken: Pagination token to be used for the next list
  8751. // operation.
  8752. NextPageToken string `json:"nextPageToken,omitempty"`
  8753. // Placements: Placement collection.
  8754. Placements []*Placement `json:"placements,omitempty"`
  8755. // ServerResponse contains the HTTP response code and headers from the
  8756. // server.
  8757. googleapi.ServerResponse `json:"-"`
  8758. // ForceSendFields is a list of field names (e.g. "Kind") to
  8759. // unconditionally include in API requests. By default, fields with
  8760. // empty values are omitted from API requests. However, any non-pointer,
  8761. // non-interface field appearing in ForceSendFields will be sent to the
  8762. // server regardless of whether the field is empty or not. This may be
  8763. // used to include empty fields in Patch requests.
  8764. ForceSendFields []string `json:"-"`
  8765. // NullFields is a list of field names (e.g. "Kind") to include in API
  8766. // requests with the JSON null value. By default, fields with empty
  8767. // values are omitted from API requests. However, any field with an
  8768. // empty value appearing in NullFields will be sent to the server as
  8769. // null. It is an error if a field in this list has a non-empty value.
  8770. // This may be used to include null fields in Patch requests.
  8771. NullFields []string `json:"-"`
  8772. }
  8773. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8774. type NoMethod PlacementsListResponse
  8775. raw := NoMethod(*s)
  8776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8777. }
  8778. // PlatformType: Contains information about a platform type that can be
  8779. // targeted by ads.
  8780. type PlatformType struct {
  8781. // Id: ID of this platform type.
  8782. Id int64 `json:"id,omitempty,string"`
  8783. // Kind: Identifies what kind of resource this is. Value: the fixed
  8784. // string "dfareporting#platformType".
  8785. Kind string `json:"kind,omitempty"`
  8786. // Name: Name of this platform type.
  8787. Name string `json:"name,omitempty"`
  8788. // ServerResponse contains the HTTP response code and headers from the
  8789. // server.
  8790. googleapi.ServerResponse `json:"-"`
  8791. // ForceSendFields is a list of field names (e.g. "Id") to
  8792. // unconditionally include in API requests. By default, fields with
  8793. // empty values are omitted from API requests. However, any non-pointer,
  8794. // non-interface field appearing in ForceSendFields will be sent to the
  8795. // server regardless of whether the field is empty or not. This may be
  8796. // used to include empty fields in Patch requests.
  8797. ForceSendFields []string `json:"-"`
  8798. // NullFields is a list of field names (e.g. "Id") to include in API
  8799. // requests with the JSON null value. By default, fields with empty
  8800. // values are omitted from API requests. However, any field with an
  8801. // empty value appearing in NullFields will be sent to the server as
  8802. // null. It is an error if a field in this list has a non-empty value.
  8803. // This may be used to include null fields in Patch requests.
  8804. NullFields []string `json:"-"`
  8805. }
  8806. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8807. type NoMethod PlatformType
  8808. raw := NoMethod(*s)
  8809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8810. }
  8811. // PlatformTypesListResponse: Platform Type List Response
  8812. type PlatformTypesListResponse struct {
  8813. // Kind: Identifies what kind of resource this is. Value: the fixed
  8814. // string "dfareporting#platformTypesListResponse".
  8815. Kind string `json:"kind,omitempty"`
  8816. // PlatformTypes: Platform type collection.
  8817. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8818. // ServerResponse contains the HTTP response code and headers from the
  8819. // server.
  8820. googleapi.ServerResponse `json:"-"`
  8821. // ForceSendFields is a list of field names (e.g. "Kind") to
  8822. // unconditionally include in API requests. By default, fields with
  8823. // empty values are omitted from API requests. However, any non-pointer,
  8824. // non-interface field appearing in ForceSendFields will be sent to the
  8825. // server regardless of whether the field is empty or not. This may be
  8826. // used to include empty fields in Patch requests.
  8827. ForceSendFields []string `json:"-"`
  8828. // NullFields is a list of field names (e.g. "Kind") to include in API
  8829. // requests with the JSON null value. By default, fields with empty
  8830. // values are omitted from API requests. However, any field with an
  8831. // empty value appearing in NullFields will be sent to the server as
  8832. // null. It is an error if a field in this list has a non-empty value.
  8833. // This may be used to include null fields in Patch requests.
  8834. NullFields []string `json:"-"`
  8835. }
  8836. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8837. type NoMethod PlatformTypesListResponse
  8838. raw := NoMethod(*s)
  8839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8840. }
  8841. // PopupWindowProperties: Popup Window Properties.
  8842. type PopupWindowProperties struct {
  8843. // Dimension: Popup dimension for a creative. This is a read-only field.
  8844. // Applicable to the following creative types: all RICH_MEDIA and all
  8845. // VPAID
  8846. Dimension *Size `json:"dimension,omitempty"`
  8847. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8848. // if positionType is COORDINATES.
  8849. Offset *OffsetPosition `json:"offset,omitempty"`
  8850. // PositionType: Popup window position either centered or at specific
  8851. // coordinate.
  8852. //
  8853. // Possible values:
  8854. // "CENTER"
  8855. // "COORDINATES"
  8856. PositionType string `json:"positionType,omitempty"`
  8857. // ShowAddressBar: Whether to display the browser address bar.
  8858. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8859. // ShowMenuBar: Whether to display the browser menu bar.
  8860. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8861. // ShowScrollBar: Whether to display the browser scroll bar.
  8862. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8863. // ShowStatusBar: Whether to display the browser status bar.
  8864. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8865. // ShowToolBar: Whether to display the browser tool bar.
  8866. ShowToolBar bool `json:"showToolBar,omitempty"`
  8867. // Title: Title of popup window.
  8868. Title string `json:"title,omitempty"`
  8869. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8870. // unconditionally include in API requests. By default, fields with
  8871. // empty values are omitted from API requests. However, any non-pointer,
  8872. // non-interface field appearing in ForceSendFields will be sent to the
  8873. // server regardless of whether the field is empty or not. This may be
  8874. // used to include empty fields in Patch requests.
  8875. ForceSendFields []string `json:"-"`
  8876. // NullFields is a list of field names (e.g. "Dimension") to include in
  8877. // API requests with the JSON null value. By default, fields with empty
  8878. // values are omitted from API requests. However, any field with an
  8879. // empty value appearing in NullFields will be sent to the server as
  8880. // null. It is an error if a field in this list has a non-empty value.
  8881. // This may be used to include null fields in Patch requests.
  8882. NullFields []string `json:"-"`
  8883. }
  8884. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8885. type NoMethod PopupWindowProperties
  8886. raw := NoMethod(*s)
  8887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8888. }
  8889. // PostalCode: Contains information about a postal code that can be
  8890. // targeted by ads.
  8891. type PostalCode struct {
  8892. // Code: Postal code. This is equivalent to the id field.
  8893. Code string `json:"code,omitempty"`
  8894. // CountryCode: Country code of the country to which this postal code
  8895. // belongs.
  8896. CountryCode string `json:"countryCode,omitempty"`
  8897. // CountryDartId: DART ID of the country to which this postal code
  8898. // belongs.
  8899. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8900. // Id: ID of this postal code.
  8901. Id string `json:"id,omitempty"`
  8902. // Kind: Identifies what kind of resource this is. Value: the fixed
  8903. // string "dfareporting#postalCode".
  8904. Kind string `json:"kind,omitempty"`
  8905. // ServerResponse contains the HTTP response code and headers from the
  8906. // server.
  8907. googleapi.ServerResponse `json:"-"`
  8908. // ForceSendFields is a list of field names (e.g. "Code") to
  8909. // unconditionally include in API requests. By default, fields with
  8910. // empty values are omitted from API requests. However, any non-pointer,
  8911. // non-interface field appearing in ForceSendFields will be sent to the
  8912. // server regardless of whether the field is empty or not. This may be
  8913. // used to include empty fields in Patch requests.
  8914. ForceSendFields []string `json:"-"`
  8915. // NullFields is a list of field names (e.g. "Code") to include in API
  8916. // requests with the JSON null value. By default, fields with empty
  8917. // values are omitted from API requests. However, any field with an
  8918. // empty value appearing in NullFields will be sent to the server as
  8919. // null. It is an error if a field in this list has a non-empty value.
  8920. // This may be used to include null fields in Patch requests.
  8921. NullFields []string `json:"-"`
  8922. }
  8923. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  8924. type NoMethod PostalCode
  8925. raw := NoMethod(*s)
  8926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8927. }
  8928. // PostalCodesListResponse: Postal Code List Response
  8929. type PostalCodesListResponse struct {
  8930. // Kind: Identifies what kind of resource this is. Value: the fixed
  8931. // string "dfareporting#postalCodesListResponse".
  8932. Kind string `json:"kind,omitempty"`
  8933. // PostalCodes: Postal code collection.
  8934. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  8935. // ServerResponse contains the HTTP response code and headers from the
  8936. // server.
  8937. googleapi.ServerResponse `json:"-"`
  8938. // ForceSendFields is a list of field names (e.g. "Kind") to
  8939. // unconditionally include in API requests. By default, fields with
  8940. // empty values are omitted from API requests. However, any non-pointer,
  8941. // non-interface field appearing in ForceSendFields will be sent to the
  8942. // server regardless of whether the field is empty or not. This may be
  8943. // used to include empty fields in Patch requests.
  8944. ForceSendFields []string `json:"-"`
  8945. // NullFields is a list of field names (e.g. "Kind") to include in API
  8946. // requests with the JSON null value. By default, fields with empty
  8947. // values are omitted from API requests. However, any field with an
  8948. // empty value appearing in NullFields will be sent to the server as
  8949. // null. It is an error if a field in this list has a non-empty value.
  8950. // This may be used to include null fields in Patch requests.
  8951. NullFields []string `json:"-"`
  8952. }
  8953. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  8954. type NoMethod PostalCodesListResponse
  8955. raw := NoMethod(*s)
  8956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8957. }
  8958. // Pricing: Pricing Information
  8959. type Pricing struct {
  8960. // CapCostType: Cap cost type of this inventory item.
  8961. //
  8962. // Possible values:
  8963. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  8964. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  8965. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  8966. CapCostType string `json:"capCostType,omitempty"`
  8967. // EndDate: End date of this inventory item.
  8968. EndDate string `json:"endDate,omitempty"`
  8969. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  8970. // period) represents the inventory item pricing information for a
  8971. // specific period of time.
  8972. Flights []*Flight `json:"flights,omitempty"`
  8973. // GroupType: Group type of this inventory item if it represents a
  8974. // placement group. Is null otherwise. There are two type of placement
  8975. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  8976. // inventory items that acts as a single pricing point for a group of
  8977. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  8978. // items that not only acts as a single pricing point, but also assumes
  8979. // that all the tags in it will be served at the same time. A roadblock
  8980. // requires one of its assigned inventory items to be marked as primary.
  8981. //
  8982. // Possible values:
  8983. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  8984. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  8985. GroupType string `json:"groupType,omitempty"`
  8986. // PricingType: Pricing type of this inventory item.
  8987. //
  8988. // Possible values:
  8989. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  8990. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  8991. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  8992. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  8993. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  8994. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  8995. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8996. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  8997. PricingType string `json:"pricingType,omitempty"`
  8998. // StartDate: Start date of this inventory item.
  8999. StartDate string `json:"startDate,omitempty"`
  9000. // ForceSendFields is a list of field names (e.g. "CapCostType") to
  9001. // unconditionally include in API requests. By default, fields with
  9002. // empty values are omitted from API requests. However, any non-pointer,
  9003. // non-interface field appearing in ForceSendFields will be sent to the
  9004. // server regardless of whether the field is empty or not. This may be
  9005. // used to include empty fields in Patch requests.
  9006. ForceSendFields []string `json:"-"`
  9007. // NullFields is a list of field names (e.g. "CapCostType") to include
  9008. // in API requests with the JSON null value. By default, fields with
  9009. // empty values are omitted from API requests. However, any field with
  9010. // an empty value appearing in NullFields will be sent to the server as
  9011. // null. It is an error if a field in this list has a non-empty value.
  9012. // This may be used to include null fields in Patch requests.
  9013. NullFields []string `json:"-"`
  9014. }
  9015. func (s *Pricing) MarshalJSON() ([]byte, error) {
  9016. type NoMethod Pricing
  9017. raw := NoMethod(*s)
  9018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9019. }
  9020. // PricingSchedule: Pricing Schedule
  9021. type PricingSchedule struct {
  9022. // CapCostOption: Placement cap cost option.
  9023. //
  9024. // Possible values:
  9025. // "CAP_COST_CUMULATIVE"
  9026. // "CAP_COST_MONTHLY"
  9027. // "CAP_COST_NONE"
  9028. CapCostOption string `json:"capCostOption,omitempty"`
  9029. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  9030. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  9031. // EndDate: Placement end date. This date must be later than, or the
  9032. // same day as, the placement start date, but not later than the
  9033. // campaign end date. If, for example, you set 6/25/2015 as both the
  9034. // start and end dates, the effective placement date is just that day
  9035. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  9036. // should not be set, as doing so will result in an error. This field is
  9037. // required on insertion.
  9038. EndDate string `json:"endDate,omitempty"`
  9039. // Flighted: Whether this placement is flighted. If true, pricing
  9040. // periods will be computed automatically.
  9041. Flighted bool `json:"flighted,omitempty"`
  9042. // FloodlightActivityId: Floodlight activity ID associated with this
  9043. // placement. This field should be set when placement pricing type is
  9044. // set to PRICING_TYPE_CPA.
  9045. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  9046. // PricingPeriods: Pricing periods for this placement.
  9047. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  9048. // PricingType: Placement pricing type. This field is required on
  9049. // insertion.
  9050. //
  9051. // Possible values:
  9052. // "PRICING_TYPE_CPA"
  9053. // "PRICING_TYPE_CPC"
  9054. // "PRICING_TYPE_CPM"
  9055. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  9056. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  9057. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  9058. PricingType string `json:"pricingType,omitempty"`
  9059. // StartDate: Placement start date. This date must be later than, or the
  9060. // same day as, the campaign start date. The hours, minutes, and seconds
  9061. // of the start date should not be set, as doing so will result in an
  9062. // error. This field is required on insertion.
  9063. StartDate string `json:"startDate,omitempty"`
  9064. // TestingStartDate: Testing start date of this placement. The hours,
  9065. // minutes, and seconds of the start date should not be set, as doing so
  9066. // will result in an error.
  9067. TestingStartDate string `json:"testingStartDate,omitempty"`
  9068. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  9069. // unconditionally include in API requests. By default, fields with
  9070. // empty values are omitted from API requests. However, any non-pointer,
  9071. // non-interface field appearing in ForceSendFields will be sent to the
  9072. // server regardless of whether the field is empty or not. This may be
  9073. // used to include empty fields in Patch requests.
  9074. ForceSendFields []string `json:"-"`
  9075. // NullFields is a list of field names (e.g. "CapCostOption") to include
  9076. // in API requests with the JSON null value. By default, fields with
  9077. // empty values are omitted from API requests. However, any field with
  9078. // an empty value appearing in NullFields will be sent to the server as
  9079. // null. It is an error if a field in this list has a non-empty value.
  9080. // This may be used to include null fields in Patch requests.
  9081. NullFields []string `json:"-"`
  9082. }
  9083. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  9084. type NoMethod PricingSchedule
  9085. raw := NoMethod(*s)
  9086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9087. }
  9088. // PricingSchedulePricingPeriod: Pricing Period
  9089. type PricingSchedulePricingPeriod struct {
  9090. // EndDate: Pricing period end date. This date must be later than, or
  9091. // the same day as, the pricing period start date, but not later than
  9092. // the placement end date. The period end date can be the same date as
  9093. // the period start date. If, for example, you set 6/25/2015 as both the
  9094. // start and end dates, the effective pricing period date is just that
  9095. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  9096. // should not be set, as doing so will result in an error.
  9097. EndDate string `json:"endDate,omitempty"`
  9098. // PricingComment: Comments for this pricing period.
  9099. PricingComment string `json:"pricingComment,omitempty"`
  9100. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  9101. // multipled by 1000000000). Acceptable values are 0 to
  9102. // 1000000000000000000, inclusive.
  9103. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  9104. // StartDate: Pricing period start date. This date must be later than,
  9105. // or the same day as, the placement start date. The hours, minutes, and
  9106. // seconds of the start date should not be set, as doing so will result
  9107. // in an error.
  9108. StartDate string `json:"startDate,omitempty"`
  9109. // Units: Units of this pricing period. Acceptable values are 0 to
  9110. // 10000000000, inclusive.
  9111. Units int64 `json:"units,omitempty,string"`
  9112. // ForceSendFields is a list of field names (e.g. "EndDate") to
  9113. // unconditionally include in API requests. By default, fields with
  9114. // empty values are omitted from API requests. However, any non-pointer,
  9115. // non-interface field appearing in ForceSendFields will be sent to the
  9116. // server regardless of whether the field is empty or not. This may be
  9117. // used to include empty fields in Patch requests.
  9118. ForceSendFields []string `json:"-"`
  9119. // NullFields is a list of field names (e.g. "EndDate") to include in
  9120. // API requests with the JSON null value. By default, fields with empty
  9121. // values are omitted from API requests. However, any field with an
  9122. // empty value appearing in NullFields will be sent to the server as
  9123. // null. It is an error if a field in this list has a non-empty value.
  9124. // This may be used to include null fields in Patch requests.
  9125. NullFields []string `json:"-"`
  9126. }
  9127. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  9128. type NoMethod PricingSchedulePricingPeriod
  9129. raw := NoMethod(*s)
  9130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9131. }
  9132. // Project: Contains properties of a DoubleClick Planning project.
  9133. type Project struct {
  9134. // AccountId: Account ID of this project.
  9135. AccountId int64 `json:"accountId,omitempty,string"`
  9136. // AdvertiserId: Advertiser ID of this project.
  9137. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9138. // AudienceAgeGroup: Audience age group of this project.
  9139. //
  9140. // Possible values:
  9141. // "PLANNING_AUDIENCE_AGE_18_24"
  9142. // "PLANNING_AUDIENCE_AGE_25_34"
  9143. // "PLANNING_AUDIENCE_AGE_35_44"
  9144. // "PLANNING_AUDIENCE_AGE_45_54"
  9145. // "PLANNING_AUDIENCE_AGE_55_64"
  9146. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  9147. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  9148. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  9149. // AudienceGender: Audience gender of this project.
  9150. //
  9151. // Possible values:
  9152. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  9153. // "PLANNING_AUDIENCE_GENDER_MALE"
  9154. AudienceGender string `json:"audienceGender,omitempty"`
  9155. // Budget: Budget of this project in the currency specified by the
  9156. // current account. The value stored in this field represents only the
  9157. // non-fractional amount. For example, for USD, the smallest value that
  9158. // can be represented by this field is 1 US dollar.
  9159. Budget int64 `json:"budget,omitempty,string"`
  9160. // ClientBillingCode: Client billing code of this project.
  9161. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  9162. // ClientName: Name of the project client.
  9163. ClientName string `json:"clientName,omitempty"`
  9164. // EndDate: End date of the project.
  9165. EndDate string `json:"endDate,omitempty"`
  9166. // Id: ID of this project. This is a read-only, auto-generated field.
  9167. Id int64 `json:"id,omitempty,string"`
  9168. // Kind: Identifies what kind of resource this is. Value: the fixed
  9169. // string "dfareporting#project".
  9170. Kind string `json:"kind,omitempty"`
  9171. // LastModifiedInfo: Information about the most recent modification of
  9172. // this project.
  9173. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  9174. // Name: Name of this project.
  9175. Name string `json:"name,omitempty"`
  9176. // Overview: Overview of this project.
  9177. Overview string `json:"overview,omitempty"`
  9178. // StartDate: Start date of the project.
  9179. StartDate string `json:"startDate,omitempty"`
  9180. // SubaccountId: Subaccount ID of this project.
  9181. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9182. // TargetClicks: Number of clicks that the advertiser is targeting.
  9183. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  9184. // TargetConversions: Number of conversions that the advertiser is
  9185. // targeting.
  9186. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  9187. // TargetCpaNanos: CPA that the advertiser is targeting.
  9188. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  9189. // TargetCpcNanos: CPC that the advertiser is targeting.
  9190. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  9191. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  9192. // is targeting.
  9193. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  9194. // TargetCpmNanos: CPM that the advertiser is targeting.
  9195. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  9196. // TargetImpressions: Number of impressions that the advertiser is
  9197. // targeting.
  9198. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  9199. // ServerResponse contains the HTTP response code and headers from the
  9200. // server.
  9201. googleapi.ServerResponse `json:"-"`
  9202. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9203. // unconditionally include in API requests. By default, fields with
  9204. // empty values are omitted from API requests. However, any non-pointer,
  9205. // non-interface field appearing in ForceSendFields will be sent to the
  9206. // server regardless of whether the field is empty or not. This may be
  9207. // used to include empty fields in Patch requests.
  9208. ForceSendFields []string `json:"-"`
  9209. // NullFields is a list of field names (e.g. "AccountId") to include in
  9210. // API requests with the JSON null value. By default, fields with empty
  9211. // values are omitted from API requests. However, any field with an
  9212. // empty value appearing in NullFields will be sent to the server as
  9213. // null. It is an error if a field in this list has a non-empty value.
  9214. // This may be used to include null fields in Patch requests.
  9215. NullFields []string `json:"-"`
  9216. }
  9217. func (s *Project) MarshalJSON() ([]byte, error) {
  9218. type NoMethod Project
  9219. raw := NoMethod(*s)
  9220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9221. }
  9222. // ProjectsListResponse: Project List Response
  9223. type ProjectsListResponse struct {
  9224. // Kind: Identifies what kind of resource this is. Value: the fixed
  9225. // string "dfareporting#projectsListResponse".
  9226. Kind string `json:"kind,omitempty"`
  9227. // NextPageToken: Pagination token to be used for the next list
  9228. // operation.
  9229. NextPageToken string `json:"nextPageToken,omitempty"`
  9230. // Projects: Project collection.
  9231. Projects []*Project `json:"projects,omitempty"`
  9232. // ServerResponse contains the HTTP response code and headers from the
  9233. // server.
  9234. googleapi.ServerResponse `json:"-"`
  9235. // ForceSendFields is a list of field names (e.g. "Kind") to
  9236. // unconditionally include in API requests. By default, fields with
  9237. // empty values are omitted from API requests. However, any non-pointer,
  9238. // non-interface field appearing in ForceSendFields will be sent to the
  9239. // server regardless of whether the field is empty or not. This may be
  9240. // used to include empty fields in Patch requests.
  9241. ForceSendFields []string `json:"-"`
  9242. // NullFields is a list of field names (e.g. "Kind") to include in API
  9243. // requests with the JSON null value. By default, fields with empty
  9244. // values are omitted from API requests. However, any field with an
  9245. // empty value appearing in NullFields will be sent to the server as
  9246. // null. It is an error if a field in this list has a non-empty value.
  9247. // This may be used to include null fields in Patch requests.
  9248. NullFields []string `json:"-"`
  9249. }
  9250. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  9251. type NoMethod ProjectsListResponse
  9252. raw := NoMethod(*s)
  9253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9254. }
  9255. // ReachReportCompatibleFields: Represents fields that are compatible to
  9256. // be selected for a report of type "REACH".
  9257. type ReachReportCompatibleFields struct {
  9258. // DimensionFilters: Dimensions which are compatible to be selected in
  9259. // the "dimensionFilters" section of the report.
  9260. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9261. // Dimensions: Dimensions which are compatible to be selected in the
  9262. // "dimensions" section of the report.
  9263. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9264. // Kind: The kind of resource this is, in this case
  9265. // dfareporting#reachReportCompatibleFields.
  9266. Kind string `json:"kind,omitempty"`
  9267. // Metrics: Metrics which are compatible to be selected in the
  9268. // "metricNames" section of the report.
  9269. Metrics []*Metric `json:"metrics,omitempty"`
  9270. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9271. // as activity metrics to pivot on in the "activities" section of the
  9272. // report.
  9273. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9274. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  9275. // in the "reachByFrequencyMetricNames" section of the report.
  9276. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  9277. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9278. // unconditionally include in API requests. By default, fields with
  9279. // empty values are omitted from API requests. However, any non-pointer,
  9280. // non-interface field appearing in ForceSendFields will be sent to the
  9281. // server regardless of whether the field is empty or not. This may be
  9282. // used to include empty fields in Patch requests.
  9283. ForceSendFields []string `json:"-"`
  9284. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9285. // include in API requests with the JSON null value. By default, fields
  9286. // with empty values are omitted from API requests. However, any field
  9287. // with an empty value appearing in NullFields will be sent to the
  9288. // server as null. It is an error if a field in this list has a
  9289. // non-empty value. This may be used to include null fields in Patch
  9290. // requests.
  9291. NullFields []string `json:"-"`
  9292. }
  9293. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9294. type NoMethod ReachReportCompatibleFields
  9295. raw := NoMethod(*s)
  9296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9297. }
  9298. // Recipient: Represents a recipient.
  9299. type Recipient struct {
  9300. // DeliveryType: The delivery type for the recipient.
  9301. //
  9302. // Possible values:
  9303. // "ATTACHMENT"
  9304. // "LINK"
  9305. DeliveryType string `json:"deliveryType,omitempty"`
  9306. // Email: The email address of the recipient.
  9307. Email string `json:"email,omitempty"`
  9308. // Kind: The kind of resource this is, in this case
  9309. // dfareporting#recipient.
  9310. Kind string `json:"kind,omitempty"`
  9311. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  9312. // unconditionally include in API requests. By default, fields with
  9313. // empty values are omitted from API requests. However, any non-pointer,
  9314. // non-interface field appearing in ForceSendFields will be sent to the
  9315. // server regardless of whether the field is empty or not. This may be
  9316. // used to include empty fields in Patch requests.
  9317. ForceSendFields []string `json:"-"`
  9318. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9319. // in API requests with the JSON null value. By default, fields with
  9320. // empty values are omitted from API requests. However, any field with
  9321. // an empty value appearing in NullFields will be sent to the server as
  9322. // null. It is an error if a field in this list has a non-empty value.
  9323. // This may be used to include null fields in Patch requests.
  9324. NullFields []string `json:"-"`
  9325. }
  9326. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9327. type NoMethod Recipient
  9328. raw := NoMethod(*s)
  9329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9330. }
  9331. // Region: Contains information about a region that can be targeted by
  9332. // ads.
  9333. type Region struct {
  9334. // CountryCode: Country code of the country to which this region
  9335. // belongs.
  9336. CountryCode string `json:"countryCode,omitempty"`
  9337. // CountryDartId: DART ID of the country to which this region belongs.
  9338. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9339. // DartId: DART ID of this region.
  9340. DartId int64 `json:"dartId,omitempty,string"`
  9341. // Kind: Identifies what kind of resource this is. Value: the fixed
  9342. // string "dfareporting#region".
  9343. Kind string `json:"kind,omitempty"`
  9344. // Name: Name of this region.
  9345. Name string `json:"name,omitempty"`
  9346. // RegionCode: Region code.
  9347. RegionCode string `json:"regionCode,omitempty"`
  9348. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9349. // unconditionally include in API requests. By default, fields with
  9350. // empty values are omitted from API requests. However, any non-pointer,
  9351. // non-interface field appearing in ForceSendFields will be sent to the
  9352. // server regardless of whether the field is empty or not. This may be
  9353. // used to include empty fields in Patch requests.
  9354. ForceSendFields []string `json:"-"`
  9355. // NullFields is a list of field names (e.g. "CountryCode") to include
  9356. // in API requests with the JSON null value. By default, fields with
  9357. // empty values are omitted from API requests. However, any field with
  9358. // an empty value appearing in NullFields will be sent to the server as
  9359. // null. It is an error if a field in this list has a non-empty value.
  9360. // This may be used to include null fields in Patch requests.
  9361. NullFields []string `json:"-"`
  9362. }
  9363. func (s *Region) MarshalJSON() ([]byte, error) {
  9364. type NoMethod Region
  9365. raw := NoMethod(*s)
  9366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9367. }
  9368. // RegionsListResponse: Region List Response
  9369. type RegionsListResponse struct {
  9370. // Kind: Identifies what kind of resource this is. Value: the fixed
  9371. // string "dfareporting#regionsListResponse".
  9372. Kind string `json:"kind,omitempty"`
  9373. // Regions: Region collection.
  9374. Regions []*Region `json:"regions,omitempty"`
  9375. // ServerResponse contains the HTTP response code and headers from the
  9376. // server.
  9377. googleapi.ServerResponse `json:"-"`
  9378. // ForceSendFields is a list of field names (e.g. "Kind") to
  9379. // unconditionally include in API requests. By default, fields with
  9380. // empty values are omitted from API requests. However, any non-pointer,
  9381. // non-interface field appearing in ForceSendFields will be sent to the
  9382. // server regardless of whether the field is empty or not. This may be
  9383. // used to include empty fields in Patch requests.
  9384. ForceSendFields []string `json:"-"`
  9385. // NullFields is a list of field names (e.g. "Kind") to include in API
  9386. // requests with the JSON null value. By default, fields with empty
  9387. // values are omitted from API requests. However, any field with an
  9388. // empty value appearing in NullFields will be sent to the server as
  9389. // null. It is an error if a field in this list has a non-empty value.
  9390. // This may be used to include null fields in Patch requests.
  9391. NullFields []string `json:"-"`
  9392. }
  9393. func (s *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9394. type NoMethod RegionsListResponse
  9395. raw := NoMethod(*s)
  9396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9397. }
  9398. // RemarketingList: Contains properties of a remarketing list.
  9399. // Remarketing enables you to create lists of users who have performed
  9400. // specific actions on a site, then target ads to members of those
  9401. // lists. This resource can be used to manage remarketing lists that are
  9402. // owned by your advertisers. To see all remarketing lists that are
  9403. // visible to your advertisers, including those that are shared to your
  9404. // advertiser or account, use the TargetableRemarketingLists resource.
  9405. type RemarketingList struct {
  9406. // AccountId: Account ID of this remarketing list. This is a read-only,
  9407. // auto-generated field that is only returned in GET requests.
  9408. AccountId int64 `json:"accountId,omitempty,string"`
  9409. // Active: Whether this remarketing list is active.
  9410. Active bool `json:"active,omitempty"`
  9411. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9412. // remarketing list. This is a required field.
  9413. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9414. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9415. // advertiser. This is a read-only, auto-generated field.
  9416. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9417. // Description: Remarketing list description.
  9418. Description string `json:"description,omitempty"`
  9419. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9420. Id int64 `json:"id,omitempty,string"`
  9421. // Kind: Identifies what kind of resource this is. Value: the fixed
  9422. // string "dfareporting#remarketingList".
  9423. Kind string `json:"kind,omitempty"`
  9424. // LifeSpan: Number of days that a user should remain in the remarketing
  9425. // list without an impression. Acceptable values are 1 to 540,
  9426. // inclusive.
  9427. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9428. // ListPopulationRule: Rule used to populate the remarketing list with
  9429. // users.
  9430. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9431. // ListSize: Number of users currently in the list. This is a read-only
  9432. // field.
  9433. ListSize int64 `json:"listSize,omitempty,string"`
  9434. // ListSource: Product from which this remarketing list was originated.
  9435. //
  9436. // Possible values:
  9437. // "REMARKETING_LIST_SOURCE_ADX"
  9438. // "REMARKETING_LIST_SOURCE_DBM"
  9439. // "REMARKETING_LIST_SOURCE_DFA"
  9440. // "REMARKETING_LIST_SOURCE_DFP"
  9441. // "REMARKETING_LIST_SOURCE_DMP"
  9442. // "REMARKETING_LIST_SOURCE_GA"
  9443. // "REMARKETING_LIST_SOURCE_GPLUS"
  9444. // "REMARKETING_LIST_SOURCE_OTHER"
  9445. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9446. // "REMARKETING_LIST_SOURCE_XFP"
  9447. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9448. ListSource string `json:"listSource,omitempty"`
  9449. // Name: Name of the remarketing list. This is a required field. Must be
  9450. // no greater than 128 characters long.
  9451. Name string `json:"name,omitempty"`
  9452. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9453. // read-only, auto-generated field that is only returned in GET
  9454. // requests.
  9455. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9456. // ServerResponse contains the HTTP response code and headers from the
  9457. // server.
  9458. googleapi.ServerResponse `json:"-"`
  9459. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9460. // unconditionally include in API requests. By default, fields with
  9461. // empty values are omitted from API requests. However, any non-pointer,
  9462. // non-interface field appearing in ForceSendFields will be sent to the
  9463. // server regardless of whether the field is empty or not. This may be
  9464. // used to include empty fields in Patch requests.
  9465. ForceSendFields []string `json:"-"`
  9466. // NullFields is a list of field names (e.g. "AccountId") to include in
  9467. // API requests with the JSON null value. By default, fields with empty
  9468. // values are omitted from API requests. However, any field with an
  9469. // empty value appearing in NullFields will be sent to the server as
  9470. // null. It is an error if a field in this list has a non-empty value.
  9471. // This may be used to include null fields in Patch requests.
  9472. NullFields []string `json:"-"`
  9473. }
  9474. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9475. type NoMethod RemarketingList
  9476. raw := NoMethod(*s)
  9477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9478. }
  9479. // RemarketingListShare: Contains properties of a remarketing list's
  9480. // sharing information. Sharing allows other accounts or advertisers to
  9481. // target to your remarketing lists. This resource can be used to manage
  9482. // remarketing list sharing to other accounts and advertisers.
  9483. type RemarketingListShare struct {
  9484. // Kind: Identifies what kind of resource this is. Value: the fixed
  9485. // string "dfareporting#remarketingListShare".
  9486. Kind string `json:"kind,omitempty"`
  9487. // RemarketingListId: Remarketing list ID. This is a read-only,
  9488. // auto-generated field.
  9489. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9490. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9491. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9492. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9493. // with.
  9494. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9495. // ServerResponse contains the HTTP response code and headers from the
  9496. // server.
  9497. googleapi.ServerResponse `json:"-"`
  9498. // ForceSendFields is a list of field names (e.g. "Kind") to
  9499. // unconditionally include in API requests. By default, fields with
  9500. // empty values are omitted from API requests. However, any non-pointer,
  9501. // non-interface field appearing in ForceSendFields will be sent to the
  9502. // server regardless of whether the field is empty or not. This may be
  9503. // used to include empty fields in Patch requests.
  9504. ForceSendFields []string `json:"-"`
  9505. // NullFields is a list of field names (e.g. "Kind") to include in API
  9506. // requests with the JSON null value. By default, fields with empty
  9507. // values are omitted from API requests. However, any field with an
  9508. // empty value appearing in NullFields will be sent to the server as
  9509. // null. It is an error if a field in this list has a non-empty value.
  9510. // This may be used to include null fields in Patch requests.
  9511. NullFields []string `json:"-"`
  9512. }
  9513. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9514. type NoMethod RemarketingListShare
  9515. raw := NoMethod(*s)
  9516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9517. }
  9518. // RemarketingListsListResponse: Remarketing list response
  9519. type RemarketingListsListResponse struct {
  9520. // Kind: Identifies what kind of resource this is. Value: the fixed
  9521. // string "dfareporting#remarketingListsListResponse".
  9522. Kind string `json:"kind,omitempty"`
  9523. // NextPageToken: Pagination token to be used for the next list
  9524. // operation.
  9525. NextPageToken string `json:"nextPageToken,omitempty"`
  9526. // RemarketingLists: Remarketing list collection.
  9527. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9528. // ServerResponse contains the HTTP response code and headers from the
  9529. // server.
  9530. googleapi.ServerResponse `json:"-"`
  9531. // ForceSendFields is a list of field names (e.g. "Kind") to
  9532. // unconditionally include in API requests. By default, fields with
  9533. // empty values are omitted from API requests. However, any non-pointer,
  9534. // non-interface field appearing in ForceSendFields will be sent to the
  9535. // server regardless of whether the field is empty or not. This may be
  9536. // used to include empty fields in Patch requests.
  9537. ForceSendFields []string `json:"-"`
  9538. // NullFields is a list of field names (e.g. "Kind") to include in API
  9539. // requests with the JSON null value. By default, fields with empty
  9540. // values are omitted from API requests. However, any field with an
  9541. // empty value appearing in NullFields will be sent to the server as
  9542. // null. It is an error if a field in this list has a non-empty value.
  9543. // This may be used to include null fields in Patch requests.
  9544. NullFields []string `json:"-"`
  9545. }
  9546. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9547. type NoMethod RemarketingListsListResponse
  9548. raw := NoMethod(*s)
  9549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9550. }
  9551. // Report: Represents a Report resource.
  9552. type Report struct {
  9553. // AccountId: The account ID to which this report belongs.
  9554. AccountId int64 `json:"accountId,omitempty,string"`
  9555. // Criteria: The report criteria for a report of type "STANDARD".
  9556. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9557. // CrossDimensionReachCriteria: The report criteria for a report of type
  9558. // "CROSS_DIMENSION_REACH".
  9559. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9560. // Delivery: The report's email delivery settings.
  9561. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9562. // Etag: The eTag of this response for caching purposes.
  9563. Etag string `json:"etag,omitempty"`
  9564. // FileName: The filename used when generating report files for this
  9565. // report.
  9566. FileName string `json:"fileName,omitempty"`
  9567. // FloodlightCriteria: The report criteria for a report of type
  9568. // "FLOODLIGHT".
  9569. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9570. // Format: The output format of the report. If not specified, default
  9571. // format is "CSV". Note that the actual format in the completed report
  9572. // file might differ if for instance the report's size exceeds the
  9573. // format's capabilities. "CSV" will then be the fallback format.
  9574. //
  9575. // Possible values:
  9576. // "CSV"
  9577. // "EXCEL"
  9578. Format string `json:"format,omitempty"`
  9579. // Id: The unique ID identifying this report resource.
  9580. Id int64 `json:"id,omitempty,string"`
  9581. // Kind: The kind of resource this is, in this case dfareporting#report.
  9582. Kind string `json:"kind,omitempty"`
  9583. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9584. // this report was last modified.
  9585. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9586. // Name: The name of the report.
  9587. Name string `json:"name,omitempty"`
  9588. // OwnerProfileId: The user profile id of the owner of this report.
  9589. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9590. // PathToConversionCriteria: The report criteria for a report of type
  9591. // "PATH_TO_CONVERSION".
  9592. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9593. // ReachCriteria: The report criteria for a report of type "REACH".
  9594. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9595. // Schedule: The report's schedule. Can only be set if the report's
  9596. // 'dateRange' is a relative date range and the relative date range is
  9597. // not "TODAY".
  9598. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9599. // SubAccountId: The subaccount ID to which this report belongs if
  9600. // applicable.
  9601. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9602. // Type: The type of the report.
  9603. //
  9604. // Possible values:
  9605. // "CROSS_DIMENSION_REACH"
  9606. // "FLOODLIGHT"
  9607. // "PATH_TO_CONVERSION"
  9608. // "REACH"
  9609. // "STANDARD"
  9610. Type string `json:"type,omitempty"`
  9611. // ServerResponse contains the HTTP response code and headers from the
  9612. // server.
  9613. googleapi.ServerResponse `json:"-"`
  9614. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9615. // unconditionally include in API requests. By default, fields with
  9616. // empty values are omitted from API requests. However, any non-pointer,
  9617. // non-interface field appearing in ForceSendFields will be sent to the
  9618. // server regardless of whether the field is empty or not. This may be
  9619. // used to include empty fields in Patch requests.
  9620. ForceSendFields []string `json:"-"`
  9621. // NullFields is a list of field names (e.g. "AccountId") to include in
  9622. // API requests with the JSON null value. By default, fields with empty
  9623. // values are omitted from API requests. However, any field with an
  9624. // empty value appearing in NullFields will be sent to the server as
  9625. // null. It is an error if a field in this list has a non-empty value.
  9626. // This may be used to include null fields in Patch requests.
  9627. NullFields []string `json:"-"`
  9628. }
  9629. func (s *Report) MarshalJSON() ([]byte, error) {
  9630. type NoMethod Report
  9631. raw := NoMethod(*s)
  9632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9633. }
  9634. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9635. type ReportCriteria struct {
  9636. // Activities: Activity group.
  9637. Activities *Activities `json:"activities,omitempty"`
  9638. // CustomRichMediaEvents: Custom Rich Media Events group.
  9639. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9640. // DateRange: The date range for which this report should be run.
  9641. DateRange *DateRange `json:"dateRange,omitempty"`
  9642. // DimensionFilters: The list of filters on which dimensions are
  9643. // filtered.
  9644. // Filters for different dimensions are ANDed, filters for the same
  9645. // dimension are grouped together and ORed.
  9646. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9647. // Dimensions: The list of standard dimensions the report should
  9648. // include.
  9649. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9650. // MetricNames: The list of names of metrics the report should include.
  9651. MetricNames []string `json:"metricNames,omitempty"`
  9652. // ForceSendFields is a list of field names (e.g. "Activities") to
  9653. // unconditionally include in API requests. By default, fields with
  9654. // empty values are omitted from API requests. However, any non-pointer,
  9655. // non-interface field appearing in ForceSendFields will be sent to the
  9656. // server regardless of whether the field is empty or not. This may be
  9657. // used to include empty fields in Patch requests.
  9658. ForceSendFields []string `json:"-"`
  9659. // NullFields is a list of field names (e.g. "Activities") to include in
  9660. // API requests with the JSON null value. By default, fields with empty
  9661. // values are omitted from API requests. However, any field with an
  9662. // empty value appearing in NullFields will be sent to the server as
  9663. // null. It is an error if a field in this list has a non-empty value.
  9664. // This may be used to include null fields in Patch requests.
  9665. NullFields []string `json:"-"`
  9666. }
  9667. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9668. type NoMethod ReportCriteria
  9669. raw := NoMethod(*s)
  9670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9671. }
  9672. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9673. // of type "CROSS_DIMENSION_REACH".
  9674. type ReportCrossDimensionReachCriteria struct {
  9675. // Breakdown: The list of dimensions the report should include.
  9676. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9677. // DateRange: The date range this report should be run for.
  9678. DateRange *DateRange `json:"dateRange,omitempty"`
  9679. // Dimension: The dimension option.
  9680. //
  9681. // Possible values:
  9682. // "ADVERTISER"
  9683. // "CAMPAIGN"
  9684. // "SITE_BY_ADVERTISER"
  9685. // "SITE_BY_CAMPAIGN"
  9686. Dimension string `json:"dimension,omitempty"`
  9687. // DimensionFilters: The list of filters on which dimensions are
  9688. // filtered.
  9689. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9690. // MetricNames: The list of names of metrics the report should include.
  9691. MetricNames []string `json:"metricNames,omitempty"`
  9692. // OverlapMetricNames: The list of names of overlap metrics the report
  9693. // should include.
  9694. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9695. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9696. Pivoted bool `json:"pivoted,omitempty"`
  9697. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9698. // unconditionally include in API requests. By default, fields with
  9699. // empty values are omitted from API requests. However, any non-pointer,
  9700. // non-interface field appearing in ForceSendFields will be sent to the
  9701. // server regardless of whether the field is empty or not. This may be
  9702. // used to include empty fields in Patch requests.
  9703. ForceSendFields []string `json:"-"`
  9704. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9705. // API requests with the JSON null value. By default, fields with empty
  9706. // values are omitted from API requests. However, any field with an
  9707. // empty value appearing in NullFields will be sent to the server as
  9708. // null. It is an error if a field in this list has a non-empty value.
  9709. // This may be used to include null fields in Patch requests.
  9710. NullFields []string `json:"-"`
  9711. }
  9712. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9713. type NoMethod ReportCrossDimensionReachCriteria
  9714. raw := NoMethod(*s)
  9715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9716. }
  9717. // ReportDelivery: The report's email delivery settings.
  9718. type ReportDelivery struct {
  9719. // EmailOwner: Whether the report should be emailed to the report owner.
  9720. EmailOwner bool `json:"emailOwner,omitempty"`
  9721. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9722. // receive, if enabled.
  9723. //
  9724. // Possible values:
  9725. // "ATTACHMENT"
  9726. // "LINK"
  9727. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9728. // Message: The message to be sent with each email.
  9729. Message string `json:"message,omitempty"`
  9730. // Recipients: The list of recipients to which to email the report.
  9731. Recipients []*Recipient `json:"recipients,omitempty"`
  9732. // ForceSendFields is a list of field names (e.g. "EmailOwner") 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. "EmailOwner") to include in
  9740. // API 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 *ReportDelivery) MarshalJSON() ([]byte, error) {
  9748. type NoMethod ReportDelivery
  9749. raw := NoMethod(*s)
  9750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9751. }
  9752. // ReportFloodlightCriteria: The report criteria for a report of type
  9753. // "FLOODLIGHT".
  9754. type ReportFloodlightCriteria struct {
  9755. // CustomRichMediaEvents: The list of custom rich media events to
  9756. // include.
  9757. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9758. // DateRange: The date range this report should be run for.
  9759. DateRange *DateRange `json:"dateRange,omitempty"`
  9760. // DimensionFilters: The list of filters on which dimensions are
  9761. // filtered.
  9762. // Filters for different dimensions are ANDed, filters for the same
  9763. // dimension are grouped together and ORed.
  9764. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9765. // Dimensions: The list of dimensions the report should include.
  9766. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9767. // FloodlightConfigId: The floodlight ID for which to show data in this
  9768. // report. All advertisers associated with that ID will automatically be
  9769. // added. The dimension of the value needs to be
  9770. // 'dfa:floodlightConfigId'.
  9771. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9772. // MetricNames: The list of names of metrics the report should include.
  9773. MetricNames []string `json:"metricNames,omitempty"`
  9774. // ReportProperties: The properties of the report.
  9775. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9776. // ForceSendFields is a list of field names (e.g.
  9777. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9778. // By default, fields with empty values are omitted from API requests.
  9779. // However, any non-pointer, non-interface field appearing in
  9780. // ForceSendFields will be sent to the server regardless of whether the
  9781. // field is empty or not. This may be used to include empty fields in
  9782. // Patch requests.
  9783. ForceSendFields []string `json:"-"`
  9784. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9785. // include in API requests with the JSON null value. By default, fields
  9786. // with empty values are omitted from API requests. However, any field
  9787. // with an empty value appearing in NullFields will be sent to the
  9788. // server as null. It is an error if a field in this list has a
  9789. // non-empty value. This may be used to include null fields in Patch
  9790. // requests.
  9791. NullFields []string `json:"-"`
  9792. }
  9793. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9794. type NoMethod ReportFloodlightCriteria
  9795. raw := NoMethod(*s)
  9796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9797. }
  9798. // ReportFloodlightCriteriaReportProperties: The properties of the
  9799. // report.
  9800. type ReportFloodlightCriteriaReportProperties struct {
  9801. // IncludeAttributedIPConversions: Include conversions that have no
  9802. // cookie, but do have an exposure path.
  9803. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9804. // IncludeUnattributedCookieConversions: Include conversions of users
  9805. // with a DoubleClick cookie but without an exposure. That means the
  9806. // user did not click or see an ad from the advertiser within the
  9807. // Floodlight group, or that the interaction happened outside the
  9808. // lookback window.
  9809. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9810. // IncludeUnattributedIPConversions: Include conversions that have no
  9811. // associated cookies and no exposures. It’s therefore impossible to
  9812. // know how the user was exposed to your ads during the lookback window
  9813. // prior to a conversion.
  9814. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9815. // ForceSendFields is a list of field names (e.g.
  9816. // "IncludeAttributedIPConversions") to unconditionally include in API
  9817. // requests. By default, fields with empty values are omitted from API
  9818. // requests. However, any non-pointer, non-interface field appearing in
  9819. // ForceSendFields will be sent to the server regardless of whether the
  9820. // field is empty or not. This may be used to include empty fields in
  9821. // Patch requests.
  9822. ForceSendFields []string `json:"-"`
  9823. // NullFields is a list of field names (e.g.
  9824. // "IncludeAttributedIPConversions") to include in API requests with the
  9825. // JSON null value. By default, fields with empty values are omitted
  9826. // from API requests. However, any field with an empty value appearing
  9827. // in NullFields will be sent to the server as null. It is an error if a
  9828. // field in this list has a non-empty value. This may be used to include
  9829. // null fields in Patch requests.
  9830. NullFields []string `json:"-"`
  9831. }
  9832. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9833. type NoMethod ReportFloodlightCriteriaReportProperties
  9834. raw := NoMethod(*s)
  9835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9836. }
  9837. // ReportPathToConversionCriteria: The report criteria for a report of
  9838. // type "PATH_TO_CONVERSION".
  9839. type ReportPathToConversionCriteria struct {
  9840. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9841. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9842. // ConversionDimensions: The list of conversion dimensions the report
  9843. // should include.
  9844. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9845. // CustomFloodlightVariables: The list of custom floodlight variables
  9846. // the report should include.
  9847. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9848. // CustomRichMediaEvents: The list of custom rich media events to
  9849. // include.
  9850. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9851. // DateRange: The date range this report should be run for.
  9852. DateRange *DateRange `json:"dateRange,omitempty"`
  9853. // FloodlightConfigId: The floodlight ID for which to show data in this
  9854. // report. All advertisers associated with that ID will automatically be
  9855. // added. The dimension of the value needs to be
  9856. // 'dfa:floodlightConfigId'.
  9857. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9858. // MetricNames: The list of names of metrics the report should include.
  9859. MetricNames []string `json:"metricNames,omitempty"`
  9860. // PerInteractionDimensions: The list of per interaction dimensions the
  9861. // report should include.
  9862. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9863. // ReportProperties: The properties of the report.
  9864. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9865. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9866. // unconditionally include in API requests. By default, fields with
  9867. // empty values are omitted from API requests. However, any non-pointer,
  9868. // non-interface field appearing in ForceSendFields will be sent to the
  9869. // server regardless of whether the field is empty or not. This may be
  9870. // used to include empty fields in Patch requests.
  9871. ForceSendFields []string `json:"-"`
  9872. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9873. // include in API requests with the JSON null value. By default, fields
  9874. // with empty values are omitted from API requests. However, any field
  9875. // with an empty value appearing in NullFields will be sent to the
  9876. // server as null. It is an error if a field in this list has a
  9877. // non-empty value. This may be used to include null fields in Patch
  9878. // requests.
  9879. NullFields []string `json:"-"`
  9880. }
  9881. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9882. type NoMethod ReportPathToConversionCriteria
  9883. raw := NoMethod(*s)
  9884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9885. }
  9886. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9887. // report.
  9888. type ReportPathToConversionCriteriaReportProperties struct {
  9889. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9890. // occurred within the specified period of time before a conversion. By
  9891. // default the value is pulled from Floodlight or you can manually enter
  9892. // a custom value. Valid values: 1-90.
  9893. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9894. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9895. // interaction occurred within the specified period of time before a
  9896. // conversion. By default the value is pulled from Floodlight or you can
  9897. // manually enter a custom value. Valid values: 1-90.
  9898. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9899. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9900. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9901. // IncludeUnattributedCookieConversions: Include conversions of users
  9902. // with a DoubleClick cookie but without an exposure. That means the
  9903. // user did not click or see an ad from the advertiser within the
  9904. // Floodlight group, or that the interaction happened outside the
  9905. // lookback window.
  9906. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9907. // IncludeUnattributedIPConversions: Include conversions that have no
  9908. // associated cookies and no exposures. It’s therefore impossible to
  9909. // know how the user was exposed to your ads during the lookback window
  9910. // prior to a conversion.
  9911. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9912. // MaximumClickInteractions: The maximum number of click interactions to
  9913. // include in the report. Advertisers currently paying for E2C reports
  9914. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9915. // your network is paying for E2C, you can have up to 5 total exposures
  9916. // per report.
  9917. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9918. // MaximumImpressionInteractions: The maximum number of click
  9919. // interactions to include in the report. Advertisers currently paying
  9920. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  9921. // another advertiser in your network is paying for E2C, you can have up
  9922. // to 5 total exposures per report.
  9923. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  9924. // MaximumInteractionGap: The maximum amount of time that can take place
  9925. // between interactions (clicks or impressions) by the same user. Valid
  9926. // values: 1-90.
  9927. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  9928. // PivotOnInteractionPath: Enable pivoting on interaction path.
  9929. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  9930. // ForceSendFields is a list of field names (e.g.
  9931. // "ClicksLookbackWindow") to unconditionally include in API requests.
  9932. // By default, fields with empty values are omitted from API requests.
  9933. // However, any non-pointer, non-interface field appearing in
  9934. // ForceSendFields will be sent to the server regardless of whether the
  9935. // field is empty or not. This may be used to include empty fields in
  9936. // Patch requests.
  9937. ForceSendFields []string `json:"-"`
  9938. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  9939. // include in API requests with the JSON null value. By default, fields
  9940. // with empty values are omitted from API requests. However, any field
  9941. // with an empty value appearing in NullFields will be sent to the
  9942. // server as null. It is an error if a field in this list has a
  9943. // non-empty value. This may be used to include null fields in Patch
  9944. // requests.
  9945. NullFields []string `json:"-"`
  9946. }
  9947. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9948. type NoMethod ReportPathToConversionCriteriaReportProperties
  9949. raw := NoMethod(*s)
  9950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9951. }
  9952. // ReportReachCriteria: The report criteria for a report of type
  9953. // "REACH".
  9954. type ReportReachCriteria struct {
  9955. // Activities: Activity group.
  9956. Activities *Activities `json:"activities,omitempty"`
  9957. // CustomRichMediaEvents: Custom Rich Media Events group.
  9958. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9959. // DateRange: The date range this report should be run for.
  9960. DateRange *DateRange `json:"dateRange,omitempty"`
  9961. // DimensionFilters: The list of filters on which dimensions are
  9962. // filtered.
  9963. // Filters for different dimensions are ANDed, filters for the same
  9964. // dimension are grouped together and ORed.
  9965. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9966. // Dimensions: The list of dimensions the report should include.
  9967. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9968. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  9969. // combinations in the report. Defaults to false. If enabled, the date
  9970. // range of the report should be within the last 42 days.
  9971. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  9972. // MetricNames: The list of names of metrics the report should include.
  9973. MetricNames []string `json:"metricNames,omitempty"`
  9974. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  9975. // metrics the report should include.
  9976. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  9977. // ForceSendFields is a list of field names (e.g. "Activities") to
  9978. // unconditionally include in API requests. By default, fields with
  9979. // empty values are omitted from API requests. However, any non-pointer,
  9980. // non-interface field appearing in ForceSendFields will be sent to the
  9981. // server regardless of whether the field is empty or not. This may be
  9982. // used to include empty fields in Patch requests.
  9983. ForceSendFields []string `json:"-"`
  9984. // NullFields is a list of field names (e.g. "Activities") to include in
  9985. // API requests with the JSON null value. By default, fields with empty
  9986. // values are omitted from API requests. However, any field with an
  9987. // empty value appearing in NullFields will be sent to the server as
  9988. // null. It is an error if a field in this list has a non-empty value.
  9989. // This may be used to include null fields in Patch requests.
  9990. NullFields []string `json:"-"`
  9991. }
  9992. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  9993. type NoMethod ReportReachCriteria
  9994. raw := NoMethod(*s)
  9995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9996. }
  9997. // ReportSchedule: The report's schedule. Can only be set if the
  9998. // report's 'dateRange' is a relative date range and the relative date
  9999. // range is not "TODAY".
  10000. type ReportSchedule struct {
  10001. // Active: Whether the schedule is active or not. Must be set to either
  10002. // true or false.
  10003. Active bool `json:"active,omitempty"`
  10004. // Every: Defines every how many days, weeks or months the report should
  10005. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  10006. // "MONTHLY".
  10007. Every int64 `json:"every,omitempty"`
  10008. // ExpirationDate: The expiration date when the scheduled report stops
  10009. // running.
  10010. ExpirationDate string `json:"expirationDate,omitempty"`
  10011. // Repeats: The interval for which the report is repeated. Note:
  10012. // - "DAILY" also requires field "every" to be set.
  10013. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  10014. // set.
  10015. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  10016. // set.
  10017. Repeats string `json:"repeats,omitempty"`
  10018. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  10019. // reports should run.
  10020. //
  10021. // Possible values:
  10022. // "FRIDAY"
  10023. // "MONDAY"
  10024. // "SATURDAY"
  10025. // "SUNDAY"
  10026. // "THURSDAY"
  10027. // "TUESDAY"
  10028. // "WEDNESDAY"
  10029. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  10030. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  10031. // whether reports should be repeated on the same day of the month as
  10032. // "startDate" or the same day of the week of the month.
  10033. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  10034. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  10035. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  10036. // Monday of the month.
  10037. //
  10038. // Possible values:
  10039. // "DAY_OF_MONTH"
  10040. // "WEEK_OF_MONTH"
  10041. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  10042. // StartDate: Start date of date range for which scheduled reports
  10043. // should be run.
  10044. StartDate string `json:"startDate,omitempty"`
  10045. // ForceSendFields is a list of field names (e.g. "Active") to
  10046. // unconditionally include in API requests. By default, fields with
  10047. // empty values are omitted from API requests. However, any non-pointer,
  10048. // non-interface field appearing in ForceSendFields will be sent to the
  10049. // server regardless of whether the field is empty or not. This may be
  10050. // used to include empty fields in Patch requests.
  10051. ForceSendFields []string `json:"-"`
  10052. // NullFields is a list of field names (e.g. "Active") to include in API
  10053. // requests with the JSON null value. By default, fields with empty
  10054. // values are omitted from API requests. However, any field with an
  10055. // empty value appearing in NullFields will be sent to the server as
  10056. // null. It is an error if a field in this list has a non-empty value.
  10057. // This may be used to include null fields in Patch requests.
  10058. NullFields []string `json:"-"`
  10059. }
  10060. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  10061. type NoMethod ReportSchedule
  10062. raw := NoMethod(*s)
  10063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10064. }
  10065. // ReportCompatibleFields: Represents fields that are compatible to be
  10066. // selected for a report of type "STANDARD".
  10067. type ReportCompatibleFields struct {
  10068. // DimensionFilters: Dimensions which are compatible to be selected in
  10069. // the "dimensionFilters" section of the report.
  10070. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  10071. // Dimensions: Dimensions which are compatible to be selected in the
  10072. // "dimensions" section of the report.
  10073. Dimensions []*Dimension `json:"dimensions,omitempty"`
  10074. // Kind: The kind of resource this is, in this case
  10075. // dfareporting#reportCompatibleFields.
  10076. Kind string `json:"kind,omitempty"`
  10077. // Metrics: Metrics which are compatible to be selected in the
  10078. // "metricNames" section of the report.
  10079. Metrics []*Metric `json:"metrics,omitempty"`
  10080. // PivotedActivityMetrics: Metrics which are compatible to be selected
  10081. // as activity metrics to pivot on in the "activities" section of the
  10082. // report.
  10083. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  10084. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  10085. // unconditionally include in API requests. By default, fields with
  10086. // empty values are omitted from API requests. However, any non-pointer,
  10087. // non-interface field appearing in ForceSendFields will be sent to the
  10088. // server regardless of whether the field is empty or not. This may be
  10089. // used to include empty fields in Patch requests.
  10090. ForceSendFields []string `json:"-"`
  10091. // NullFields is a list of field names (e.g. "DimensionFilters") to
  10092. // include in API requests with the JSON null value. By default, fields
  10093. // with empty values are omitted from API requests. However, any field
  10094. // with an empty value appearing in NullFields will be sent to the
  10095. // server as null. It is an error if a field in this list has a
  10096. // non-empty value. This may be used to include null fields in Patch
  10097. // requests.
  10098. NullFields []string `json:"-"`
  10099. }
  10100. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  10101. type NoMethod ReportCompatibleFields
  10102. raw := NoMethod(*s)
  10103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10104. }
  10105. // ReportList: Represents the list of reports.
  10106. type ReportList struct {
  10107. // Etag: The eTag of this response for caching purposes.
  10108. Etag string `json:"etag,omitempty"`
  10109. // Items: The reports returned in this response.
  10110. Items []*Report `json:"items,omitempty"`
  10111. // Kind: The kind of list this is, in this case dfareporting#reportList.
  10112. Kind string `json:"kind,omitempty"`
  10113. // NextPageToken: Continuation token used to page through reports. To
  10114. // retrieve the next page of results, set the next request's "pageToken"
  10115. // to the value of this field. The page token is only valid for a
  10116. // limited amount of time and should not be persisted.
  10117. NextPageToken string `json:"nextPageToken,omitempty"`
  10118. // ServerResponse contains the HTTP response code and headers from the
  10119. // server.
  10120. googleapi.ServerResponse `json:"-"`
  10121. // ForceSendFields is a list of field names (e.g. "Etag") to
  10122. // unconditionally include in API requests. By default, fields with
  10123. // empty values are omitted from API requests. However, any non-pointer,
  10124. // non-interface field appearing in ForceSendFields will be sent to the
  10125. // server regardless of whether the field is empty or not. This may be
  10126. // used to include empty fields in Patch requests.
  10127. ForceSendFields []string `json:"-"`
  10128. // NullFields is a list of field names (e.g. "Etag") to include in API
  10129. // requests with the JSON null value. By default, fields with empty
  10130. // values are omitted from API requests. However, any field with an
  10131. // empty value appearing in NullFields will be sent to the server as
  10132. // null. It is an error if a field in this list has a non-empty value.
  10133. // This may be used to include null fields in Patch requests.
  10134. NullFields []string `json:"-"`
  10135. }
  10136. func (s *ReportList) MarshalJSON() ([]byte, error) {
  10137. type NoMethod ReportList
  10138. raw := NoMethod(*s)
  10139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10140. }
  10141. // ReportsConfiguration: Reporting Configuration
  10142. type ReportsConfiguration struct {
  10143. // ExposureToConversionEnabled: Whether the exposure to conversion
  10144. // report is enabled. This report shows detailed pathway information on
  10145. // up to 10 of the most recent ad exposures seen by a user before
  10146. // converting.
  10147. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  10148. // LookbackConfiguration: Default lookback windows for new advertisers
  10149. // in this account.
  10150. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10151. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  10152. // account. This is a required field that can only be changed by a
  10153. // superuser.
  10154. // Acceptable values are:
  10155. //
  10156. // - "1" for "America/New_York"
  10157. // - "2" for "Europe/London"
  10158. // - "3" for "Europe/Paris"
  10159. // - "4" for "Africa/Johannesburg"
  10160. // - "5" for "Asia/Jerusalem"
  10161. // - "6" for "Asia/Shanghai"
  10162. // - "7" for "Asia/Hong_Kong"
  10163. // - "8" for "Asia/Tokyo"
  10164. // - "9" for "Australia/Sydney"
  10165. // - "10" for "Asia/Dubai"
  10166. // - "11" for "America/Los_Angeles"
  10167. // - "12" for "Pacific/Auckland"
  10168. // - "13" for "America/Sao_Paulo"
  10169. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  10170. // ForceSendFields is a list of field names (e.g.
  10171. // "ExposureToConversionEnabled") to unconditionally include in API
  10172. // requests. By default, fields with empty values are omitted from API
  10173. // requests. However, any non-pointer, non-interface field appearing in
  10174. // ForceSendFields will be sent to the server regardless of whether the
  10175. // field is empty or not. This may be used to include empty fields in
  10176. // Patch requests.
  10177. ForceSendFields []string `json:"-"`
  10178. // NullFields is a list of field names (e.g.
  10179. // "ExposureToConversionEnabled") to include in API requests with the
  10180. // JSON null value. By default, fields with empty values are omitted
  10181. // from API requests. However, any field with an empty value appearing
  10182. // in NullFields will be sent to the server as null. It is an error if a
  10183. // field in this list has a non-empty value. This may be used to include
  10184. // null fields in Patch requests.
  10185. NullFields []string `json:"-"`
  10186. }
  10187. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  10188. type NoMethod ReportsConfiguration
  10189. raw := NoMethod(*s)
  10190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10191. }
  10192. // RichMediaExitOverride: Rich Media Exit Override.
  10193. type RichMediaExitOverride struct {
  10194. // ClickThroughUrl: Click-through URL of this rich media exit override.
  10195. // Applicable if the enabled field is set to true.
  10196. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  10197. // Enabled: Whether to use the clickThroughUrl. If false, the
  10198. // creative-level exit will be used.
  10199. Enabled bool `json:"enabled,omitempty"`
  10200. // ExitId: ID for the override to refer to a specific exit in the
  10201. // creative.
  10202. ExitId int64 `json:"exitId,omitempty,string"`
  10203. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  10204. // unconditionally include in API requests. By default, fields with
  10205. // empty values are omitted from API requests. However, any non-pointer,
  10206. // non-interface field appearing in ForceSendFields will be sent to the
  10207. // server regardless of whether the field is empty or not. This may be
  10208. // used to include empty fields in Patch requests.
  10209. ForceSendFields []string `json:"-"`
  10210. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  10211. // include in API requests with the JSON null value. By default, fields
  10212. // with empty values are omitted from API requests. However, any field
  10213. // with an empty value appearing in NullFields will be sent to the
  10214. // server as null. It is an error if a field in this list has a
  10215. // non-empty value. This may be used to include null fields in Patch
  10216. // requests.
  10217. NullFields []string `json:"-"`
  10218. }
  10219. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  10220. type NoMethod RichMediaExitOverride
  10221. raw := NoMethod(*s)
  10222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10223. }
  10224. // Rule: A rule associates an asset with a targeting template for
  10225. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  10226. type Rule struct {
  10227. // AssetId: A creativeAssets[].id. This should refer to one of the
  10228. // parent assets in this creative. This is a required field.
  10229. AssetId int64 `json:"assetId,omitempty,string"`
  10230. // Name: A user-friendly name for this rule. This is a required field.
  10231. Name string `json:"name,omitempty"`
  10232. // TargetingTemplateId: A targeting template ID. The targeting from the
  10233. // targeting template will be used to determine whether this asset
  10234. // should be served. This is a required field.
  10235. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  10236. // ForceSendFields is a list of field names (e.g. "AssetId") to
  10237. // unconditionally include in API requests. By default, fields with
  10238. // empty values are omitted from API requests. However, any non-pointer,
  10239. // non-interface field appearing in ForceSendFields will be sent to the
  10240. // server regardless of whether the field is empty or not. This may be
  10241. // used to include empty fields in Patch requests.
  10242. ForceSendFields []string `json:"-"`
  10243. // NullFields is a list of field names (e.g. "AssetId") to include in
  10244. // API requests with the JSON null value. By default, fields with empty
  10245. // values are omitted from API requests. However, any field with an
  10246. // empty value appearing in NullFields will be sent to the server as
  10247. // null. It is an error if a field in this list has a non-empty value.
  10248. // This may be used to include null fields in Patch requests.
  10249. NullFields []string `json:"-"`
  10250. }
  10251. func (s *Rule) MarshalJSON() ([]byte, error) {
  10252. type NoMethod Rule
  10253. raw := NoMethod(*s)
  10254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10255. }
  10256. // Site: Contains properties of a site.
  10257. type Site struct {
  10258. // AccountId: Account ID of this site. This is a read-only field that
  10259. // can be left blank.
  10260. AccountId int64 `json:"accountId,omitempty,string"`
  10261. // Approved: Whether this site is approved.
  10262. Approved bool `json:"approved,omitempty"`
  10263. // DirectorySiteId: Directory site associated with this site. This is a
  10264. // required field that is read-only after insertion.
  10265. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  10266. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  10267. // directory site. This is a read-only, auto-generated field.
  10268. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  10269. // Id: ID of this site. This is a read-only, auto-generated field.
  10270. Id int64 `json:"id,omitempty,string"`
  10271. // IdDimensionValue: Dimension value for the ID of this site. This is a
  10272. // read-only, auto-generated field.
  10273. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  10274. // KeyName: Key name of this site. This is a read-only, auto-generated
  10275. // field.
  10276. KeyName string `json:"keyName,omitempty"`
  10277. // Kind: Identifies what kind of resource this is. Value: the fixed
  10278. // string "dfareporting#site".
  10279. Kind string `json:"kind,omitempty"`
  10280. // Name: Name of this site.This is a required field. Must be less than
  10281. // 128 characters long. If this site is under a subaccount, the name
  10282. // must be unique among sites of the same subaccount. Otherwise, this
  10283. // site is a top-level site, and the name must be unique among top-level
  10284. // sites of the same account.
  10285. Name string `json:"name,omitempty"`
  10286. // SiteContacts: Site contacts.
  10287. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  10288. // SiteSettings: Site-wide settings.
  10289. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  10290. // SubaccountId: Subaccount ID of this site. This is a read-only field
  10291. // that can be left blank.
  10292. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10293. // ServerResponse contains the HTTP response code and headers from the
  10294. // server.
  10295. googleapi.ServerResponse `json:"-"`
  10296. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10297. // unconditionally include in API requests. By default, fields with
  10298. // empty values are omitted from API requests. However, any non-pointer,
  10299. // non-interface field appearing in ForceSendFields will be sent to the
  10300. // server regardless of whether the field is empty or not. This may be
  10301. // used to include empty fields in Patch requests.
  10302. ForceSendFields []string `json:"-"`
  10303. // NullFields is a list of field names (e.g. "AccountId") to include in
  10304. // API requests with the JSON null value. By default, fields with empty
  10305. // values are omitted from API requests. However, any field with an
  10306. // empty value appearing in NullFields will be sent to the server as
  10307. // null. It is an error if a field in this list has a non-empty value.
  10308. // This may be used to include null fields in Patch requests.
  10309. NullFields []string `json:"-"`
  10310. }
  10311. func (s *Site) MarshalJSON() ([]byte, error) {
  10312. type NoMethod Site
  10313. raw := NoMethod(*s)
  10314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10315. }
  10316. // SiteContact: Site Contact
  10317. type SiteContact struct {
  10318. // Address: Address of this site contact.
  10319. Address string `json:"address,omitempty"`
  10320. // ContactType: Site contact type.
  10321. //
  10322. // Possible values:
  10323. // "SALES_PERSON"
  10324. // "TRAFFICKER"
  10325. ContactType string `json:"contactType,omitempty"`
  10326. // Email: Email address of this site contact. This is a required field.
  10327. Email string `json:"email,omitempty"`
  10328. // FirstName: First name of this site contact.
  10329. FirstName string `json:"firstName,omitempty"`
  10330. // Id: ID of this site contact. This is a read-only, auto-generated
  10331. // field.
  10332. Id int64 `json:"id,omitempty,string"`
  10333. // LastName: Last name of this site contact.
  10334. LastName string `json:"lastName,omitempty"`
  10335. // Phone: Primary phone number of this site contact.
  10336. Phone string `json:"phone,omitempty"`
  10337. // Title: Title or designation of this site contact.
  10338. Title string `json:"title,omitempty"`
  10339. // ForceSendFields is a list of field names (e.g. "Address") to
  10340. // unconditionally include in API requests. By default, fields with
  10341. // empty values are omitted from API requests. However, any non-pointer,
  10342. // non-interface field appearing in ForceSendFields will be sent to the
  10343. // server regardless of whether the field is empty or not. This may be
  10344. // used to include empty fields in Patch requests.
  10345. ForceSendFields []string `json:"-"`
  10346. // NullFields is a list of field names (e.g. "Address") to include in
  10347. // API requests with the JSON null value. By default, fields with empty
  10348. // values are omitted from API requests. However, any field with an
  10349. // empty value appearing in NullFields will be sent to the server as
  10350. // null. It is an error if a field in this list has a non-empty value.
  10351. // This may be used to include null fields in Patch requests.
  10352. NullFields []string `json:"-"`
  10353. }
  10354. func (s *SiteContact) MarshalJSON() ([]byte, error) {
  10355. type NoMethod SiteContact
  10356. raw := NoMethod(*s)
  10357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10358. }
  10359. // SiteSettings: Site Settings
  10360. type SiteSettings struct {
  10361. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10362. // site.
  10363. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10364. // AdBlockingOptOut: Whether this site opts out of ad blocking. When
  10365. // true, ad blocking is disabled for all placements under the site,
  10366. // regardless of the individual placement settings. When false, the
  10367. // campaign and placement settings take effect.
  10368. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  10369. // CreativeSettings: Site-wide creative settings.
  10370. CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"`
  10371. // DisableNewCookie: Whether new cookies are disabled for this site.
  10372. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10373. // LookbackConfiguration: Lookback window settings for this site.
  10374. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10375. // TagSetting: Configuration settings for dynamic and image floodlight
  10376. // tags.
  10377. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10378. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10379. // for in-stream video creatives are disabled by default for new
  10380. // placements created under this site. This value will be used to
  10381. // populate the placement.videoActiveViewOptOut field, when no value is
  10382. // specified for the new placement.
  10383. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10384. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10385. // placements created under this site. This value will be used to
  10386. // populate the placements.vpaidAdapterChoice field, when no value is
  10387. // specified for the new placement. Controls which VPAID format the
  10388. // measurement adapter will use for in-stream video creatives assigned
  10389. // to the placement. The publisher's specifications will typically
  10390. // determine this setting. For VPAID creatives, the adapter format will
  10391. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10392. // adapter).
  10393. //
  10394. // Note: Flash is no longer supported. This field now defaults to HTML5
  10395. // when the following values are provided: FLASH, BOTH.
  10396. //
  10397. // Possible values:
  10398. // "BOTH"
  10399. // "DEFAULT"
  10400. // "FLASH"
  10401. // "HTML5"
  10402. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10403. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10404. // unconditionally include in API requests. By default, fields with
  10405. // empty values are omitted from API requests. However, any non-pointer,
  10406. // non-interface field appearing in ForceSendFields will be sent to the
  10407. // server regardless of whether the field is empty or not. This may be
  10408. // used to include empty fields in Patch requests.
  10409. ForceSendFields []string `json:"-"`
  10410. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10411. // include in API requests with the JSON null value. By default, fields
  10412. // with empty values are omitted from API requests. However, any field
  10413. // with an empty value appearing in NullFields will be sent to the
  10414. // server as null. It is an error if a field in this list has a
  10415. // non-empty value. This may be used to include null fields in Patch
  10416. // requests.
  10417. NullFields []string `json:"-"`
  10418. }
  10419. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10420. type NoMethod SiteSettings
  10421. raw := NoMethod(*s)
  10422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10423. }
  10424. // SitesListResponse: Site List Response
  10425. type SitesListResponse struct {
  10426. // Kind: Identifies what kind of resource this is. Value: the fixed
  10427. // string "dfareporting#sitesListResponse".
  10428. Kind string `json:"kind,omitempty"`
  10429. // NextPageToken: Pagination token to be used for the next list
  10430. // operation.
  10431. NextPageToken string `json:"nextPageToken,omitempty"`
  10432. // Sites: Site collection.
  10433. Sites []*Site `json:"sites,omitempty"`
  10434. // ServerResponse contains the HTTP response code and headers from the
  10435. // server.
  10436. googleapi.ServerResponse `json:"-"`
  10437. // ForceSendFields is a list of field names (e.g. "Kind") to
  10438. // unconditionally include in API requests. By default, fields with
  10439. // empty values are omitted from API requests. However, any non-pointer,
  10440. // non-interface field appearing in ForceSendFields will be sent to the
  10441. // server regardless of whether the field is empty or not. This may be
  10442. // used to include empty fields in Patch requests.
  10443. ForceSendFields []string `json:"-"`
  10444. // NullFields is a list of field names (e.g. "Kind") to include in API
  10445. // requests with the JSON null value. By default, fields with empty
  10446. // values are omitted from API requests. However, any field with an
  10447. // empty value appearing in NullFields will be sent to the server as
  10448. // null. It is an error if a field in this list has a non-empty value.
  10449. // This may be used to include null fields in Patch requests.
  10450. NullFields []string `json:"-"`
  10451. }
  10452. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10453. type NoMethod SitesListResponse
  10454. raw := NoMethod(*s)
  10455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10456. }
  10457. // Size: Represents the dimensions of ads, placements, creatives, or
  10458. // creative assets.
  10459. type Size struct {
  10460. // Height: Height of this size. Acceptable values are 0 to 32767,
  10461. // inclusive.
  10462. Height int64 `json:"height,omitempty"`
  10463. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10464. Iab bool `json:"iab,omitempty"`
  10465. // Id: ID of this size. This is a read-only, auto-generated field.
  10466. Id int64 `json:"id,omitempty,string"`
  10467. // Kind: Identifies what kind of resource this is. Value: the fixed
  10468. // string "dfareporting#size".
  10469. Kind string `json:"kind,omitempty"`
  10470. // Width: Width of this size. Acceptable values are 0 to 32767,
  10471. // inclusive.
  10472. Width int64 `json:"width,omitempty"`
  10473. // ServerResponse contains the HTTP response code and headers from the
  10474. // server.
  10475. googleapi.ServerResponse `json:"-"`
  10476. // ForceSendFields is a list of field names (e.g. "Height") to
  10477. // unconditionally include in API requests. By default, fields with
  10478. // empty values are omitted from API requests. However, any non-pointer,
  10479. // non-interface field appearing in ForceSendFields will be sent to the
  10480. // server regardless of whether the field is empty or not. This may be
  10481. // used to include empty fields in Patch requests.
  10482. ForceSendFields []string `json:"-"`
  10483. // NullFields is a list of field names (e.g. "Height") to include in API
  10484. // requests with the JSON null value. By default, fields with empty
  10485. // values are omitted from API requests. However, any field with an
  10486. // empty value appearing in NullFields will be sent to the server as
  10487. // null. It is an error if a field in this list has a non-empty value.
  10488. // This may be used to include null fields in Patch requests.
  10489. NullFields []string `json:"-"`
  10490. }
  10491. func (s *Size) MarshalJSON() ([]byte, error) {
  10492. type NoMethod Size
  10493. raw := NoMethod(*s)
  10494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10495. }
  10496. // SizesListResponse: Size List Response
  10497. type SizesListResponse struct {
  10498. // Kind: Identifies what kind of resource this is. Value: the fixed
  10499. // string "dfareporting#sizesListResponse".
  10500. Kind string `json:"kind,omitempty"`
  10501. // Sizes: Size collection.
  10502. Sizes []*Size `json:"sizes,omitempty"`
  10503. // ServerResponse contains the HTTP response code and headers from the
  10504. // server.
  10505. googleapi.ServerResponse `json:"-"`
  10506. // ForceSendFields is a list of field names (e.g. "Kind") to
  10507. // unconditionally include in API requests. By default, fields with
  10508. // empty values are omitted from API requests. However, any non-pointer,
  10509. // non-interface field appearing in ForceSendFields will be sent to the
  10510. // server regardless of whether the field is empty or not. This may be
  10511. // used to include empty fields in Patch requests.
  10512. ForceSendFields []string `json:"-"`
  10513. // NullFields is a list of field names (e.g. "Kind") to include in API
  10514. // requests with the JSON null value. By default, fields with empty
  10515. // values are omitted from API requests. However, any field with an
  10516. // empty value appearing in NullFields will be sent to the server as
  10517. // null. It is an error if a field in this list has a non-empty value.
  10518. // This may be used to include null fields in Patch requests.
  10519. NullFields []string `json:"-"`
  10520. }
  10521. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10522. type NoMethod SizesListResponse
  10523. raw := NoMethod(*s)
  10524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10525. }
  10526. // SkippableSetting: Skippable Settings
  10527. type SkippableSetting struct {
  10528. // Kind: Identifies what kind of resource this is. Value: the fixed
  10529. // string "dfareporting#skippableSetting".
  10530. Kind string `json:"kind,omitempty"`
  10531. // ProgressOffset: Amount of time to play videos served to this
  10532. // placement before counting a view. Applicable when skippable is true.
  10533. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10534. // SkipOffset: Amount of time to play videos served to this placement
  10535. // before the skip button should appear. Applicable when skippable is
  10536. // true.
  10537. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10538. // Skippable: Whether the user can skip creatives served to this
  10539. // placement.
  10540. Skippable bool `json:"skippable,omitempty"`
  10541. // ForceSendFields is a list of field names (e.g. "Kind") to
  10542. // unconditionally include in API requests. By default, fields with
  10543. // empty values are omitted from API requests. However, any non-pointer,
  10544. // non-interface field appearing in ForceSendFields will be sent to the
  10545. // server regardless of whether the field is empty or not. This may be
  10546. // used to include empty fields in Patch requests.
  10547. ForceSendFields []string `json:"-"`
  10548. // NullFields is a list of field names (e.g. "Kind") to include in API
  10549. // requests with the JSON null value. By default, fields with empty
  10550. // values are omitted from API requests. However, any field with an
  10551. // empty value appearing in NullFields will be sent to the server as
  10552. // null. It is an error if a field in this list has a non-empty value.
  10553. // This may be used to include null fields in Patch requests.
  10554. NullFields []string `json:"-"`
  10555. }
  10556. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10557. type NoMethod SkippableSetting
  10558. raw := NoMethod(*s)
  10559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10560. }
  10561. // SortedDimension: Represents a sorted dimension.
  10562. type SortedDimension struct {
  10563. // Kind: The kind of resource this is, in this case
  10564. // dfareporting#sortedDimension.
  10565. Kind string `json:"kind,omitempty"`
  10566. // Name: The name of the dimension.
  10567. Name string `json:"name,omitempty"`
  10568. // SortOrder: An optional sort order for the dimension column.
  10569. //
  10570. // Possible values:
  10571. // "ASCENDING"
  10572. // "DESCENDING"
  10573. SortOrder string `json:"sortOrder,omitempty"`
  10574. // ForceSendFields is a list of field names (e.g. "Kind") to
  10575. // unconditionally include in API requests. By default, fields with
  10576. // empty values are omitted from API requests. However, any non-pointer,
  10577. // non-interface field appearing in ForceSendFields will be sent to the
  10578. // server regardless of whether the field is empty or not. This may be
  10579. // used to include empty fields in Patch requests.
  10580. ForceSendFields []string `json:"-"`
  10581. // NullFields is a list of field names (e.g. "Kind") to include in API
  10582. // requests with the JSON null value. By default, fields with empty
  10583. // values are omitted from API requests. However, any field with an
  10584. // empty value appearing in NullFields will be sent to the server as
  10585. // null. It is an error if a field in this list has a non-empty value.
  10586. // This may be used to include null fields in Patch requests.
  10587. NullFields []string `json:"-"`
  10588. }
  10589. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10590. type NoMethod SortedDimension
  10591. raw := NoMethod(*s)
  10592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10593. }
  10594. // Subaccount: Contains properties of a DCM subaccount.
  10595. type Subaccount struct {
  10596. // AccountId: ID of the account that contains this subaccount. This is a
  10597. // read-only field that can be left blank.
  10598. AccountId int64 `json:"accountId,omitempty,string"`
  10599. // AvailablePermissionIds: IDs of the available user role permissions
  10600. // for this subaccount.
  10601. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10602. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10603. Id int64 `json:"id,omitempty,string"`
  10604. // Kind: Identifies what kind of resource this is. Value: the fixed
  10605. // string "dfareporting#subaccount".
  10606. Kind string `json:"kind,omitempty"`
  10607. // Name: Name of this subaccount. This is a required field. Must be less
  10608. // than 128 characters long and be unique among subaccounts of the same
  10609. // account.
  10610. Name string `json:"name,omitempty"`
  10611. // ServerResponse contains the HTTP response code and headers from the
  10612. // server.
  10613. googleapi.ServerResponse `json:"-"`
  10614. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10615. // unconditionally include in API requests. By default, fields with
  10616. // empty values are omitted from API requests. However, any non-pointer,
  10617. // non-interface field appearing in ForceSendFields will be sent to the
  10618. // server regardless of whether the field is empty or not. This may be
  10619. // used to include empty fields in Patch requests.
  10620. ForceSendFields []string `json:"-"`
  10621. // NullFields is a list of field names (e.g. "AccountId") to include in
  10622. // API requests with the JSON null value. By default, fields with empty
  10623. // values are omitted from API requests. However, any field with an
  10624. // empty value appearing in NullFields will be sent to the server as
  10625. // null. It is an error if a field in this list has a non-empty value.
  10626. // This may be used to include null fields in Patch requests.
  10627. NullFields []string `json:"-"`
  10628. }
  10629. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10630. type NoMethod Subaccount
  10631. raw := NoMethod(*s)
  10632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10633. }
  10634. // SubaccountsListResponse: Subaccount List Response
  10635. type SubaccountsListResponse struct {
  10636. // Kind: Identifies what kind of resource this is. Value: the fixed
  10637. // string "dfareporting#subaccountsListResponse".
  10638. Kind string `json:"kind,omitempty"`
  10639. // NextPageToken: Pagination token to be used for the next list
  10640. // operation.
  10641. NextPageToken string `json:"nextPageToken,omitempty"`
  10642. // Subaccounts: Subaccount collection.
  10643. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10644. // ServerResponse contains the HTTP response code and headers from the
  10645. // server.
  10646. googleapi.ServerResponse `json:"-"`
  10647. // ForceSendFields is a list of field names (e.g. "Kind") to
  10648. // unconditionally include in API requests. By default, fields with
  10649. // empty values are omitted from API requests. However, any non-pointer,
  10650. // non-interface field appearing in ForceSendFields will be sent to the
  10651. // server regardless of whether the field is empty or not. This may be
  10652. // used to include empty fields in Patch requests.
  10653. ForceSendFields []string `json:"-"`
  10654. // NullFields is a list of field names (e.g. "Kind") to include in API
  10655. // requests with the JSON null value. By default, fields with empty
  10656. // values are omitted from API requests. However, any field with an
  10657. // empty value appearing in NullFields will be sent to the server as
  10658. // null. It is an error if a field in this list has a non-empty value.
  10659. // This may be used to include null fields in Patch requests.
  10660. NullFields []string `json:"-"`
  10661. }
  10662. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10663. type NoMethod SubaccountsListResponse
  10664. raw := NoMethod(*s)
  10665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10666. }
  10667. // TagData: Placement Tag Data
  10668. type TagData struct {
  10669. // AdId: Ad associated with this placement tag. Applicable only when
  10670. // format is PLACEMENT_TAG_TRACKING.
  10671. AdId int64 `json:"adId,omitempty,string"`
  10672. // ClickTag: Tag string to record a click.
  10673. ClickTag string `json:"clickTag,omitempty"`
  10674. // CreativeId: Creative associated with this placement tag. Applicable
  10675. // only when format is PLACEMENT_TAG_TRACKING.
  10676. CreativeId int64 `json:"creativeId,omitempty,string"`
  10677. // Format: TagData tag format of this tag.
  10678. //
  10679. // Possible values:
  10680. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10681. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10682. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10683. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10684. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10685. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10686. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10687. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10688. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10689. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10690. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10691. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10692. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10693. // "PLACEMENT_TAG_JAVASCRIPT"
  10694. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10695. // "PLACEMENT_TAG_STANDARD"
  10696. // "PLACEMENT_TAG_TRACKING"
  10697. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10698. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10699. Format string `json:"format,omitempty"`
  10700. // ImpressionTag: Tag string for serving an ad.
  10701. ImpressionTag string `json:"impressionTag,omitempty"`
  10702. // ForceSendFields is a list of field names (e.g. "AdId") to
  10703. // unconditionally include in API requests. By default, fields with
  10704. // empty values are omitted from API requests. However, any non-pointer,
  10705. // non-interface field appearing in ForceSendFields will be sent to the
  10706. // server regardless of whether the field is empty or not. This may be
  10707. // used to include empty fields in Patch requests.
  10708. ForceSendFields []string `json:"-"`
  10709. // NullFields is a list of field names (e.g. "AdId") to include in API
  10710. // requests with the JSON null value. By default, fields with empty
  10711. // values are omitted from API requests. However, any field with an
  10712. // empty value appearing in NullFields will be sent to the server as
  10713. // null. It is an error if a field in this list has a non-empty value.
  10714. // This may be used to include null fields in Patch requests.
  10715. NullFields []string `json:"-"`
  10716. }
  10717. func (s *TagData) MarshalJSON() ([]byte, error) {
  10718. type NoMethod TagData
  10719. raw := NoMethod(*s)
  10720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10721. }
  10722. // TagSetting: Tag Settings
  10723. type TagSetting struct {
  10724. // AdditionalKeyValues: Additional key-values to be included in tags.
  10725. // Each key-value pair must be of the form key=value, and pairs must be
  10726. // separated by a semicolon (;). Keys and values must not contain
  10727. // commas. For example, id=2;color=red is a valid value for this field.
  10728. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10729. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10730. // included in the tags. This setting applies only to placements.
  10731. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10732. // IncludeClickTracking: Whether click-tracking string should be
  10733. // included in the tags.
  10734. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10735. // KeywordOption: Option specifying how keywords are embedded in ad
  10736. // tags. This setting can be used to specify whether keyword
  10737. // placeholders are inserted in placement tags for this site. Publishers
  10738. // can then add keywords to those placeholders.
  10739. //
  10740. // Possible values:
  10741. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10742. // "IGNORE"
  10743. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10744. KeywordOption string `json:"keywordOption,omitempty"`
  10745. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10746. // to unconditionally include in API requests. By default, fields with
  10747. // empty values are omitted from API requests. However, any non-pointer,
  10748. // non-interface field appearing in ForceSendFields will be sent to the
  10749. // server regardless of whether the field is empty or not. This may be
  10750. // used to include empty fields in Patch requests.
  10751. ForceSendFields []string `json:"-"`
  10752. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10753. // include in API requests with the JSON null value. By default, fields
  10754. // with empty values are omitted from API requests. However, any field
  10755. // with an empty value appearing in NullFields will be sent to the
  10756. // server as null. It is an error if a field in this list has a
  10757. // non-empty value. This may be used to include null fields in Patch
  10758. // requests.
  10759. NullFields []string `json:"-"`
  10760. }
  10761. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10762. type NoMethod TagSetting
  10763. raw := NoMethod(*s)
  10764. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10765. }
  10766. // TagSettings: Dynamic and Image Tag Settings.
  10767. type TagSettings struct {
  10768. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10769. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10770. // ImageTagEnabled: Whether image tags are enabled.
  10771. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10772. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10773. // to unconditionally include in API requests. By default, fields with
  10774. // empty values are omitted from API requests. However, any non-pointer,
  10775. // non-interface field appearing in ForceSendFields will be sent to the
  10776. // server regardless of whether the field is empty or not. This may be
  10777. // used to include empty fields in Patch requests.
  10778. ForceSendFields []string `json:"-"`
  10779. // NullFields is a list of field names (e.g. "DynamicTagEnabled") to
  10780. // include in API requests with the JSON null value. By default, fields
  10781. // with empty values are omitted from API requests. However, any field
  10782. // with an empty value appearing in NullFields will be sent to the
  10783. // server as null. It is an error if a field in this list has a
  10784. // non-empty value. This may be used to include null fields in Patch
  10785. // requests.
  10786. NullFields []string `json:"-"`
  10787. }
  10788. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10789. type NoMethod TagSettings
  10790. raw := NoMethod(*s)
  10791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10792. }
  10793. // TargetWindow: Target Window.
  10794. type TargetWindow struct {
  10795. // CustomHtml: User-entered value.
  10796. CustomHtml string `json:"customHtml,omitempty"`
  10797. // TargetWindowOption: Type of browser window for which the backup image
  10798. // of the flash creative can be displayed.
  10799. //
  10800. // Possible values:
  10801. // "CURRENT_WINDOW"
  10802. // "CUSTOM"
  10803. // "NEW_WINDOW"
  10804. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10805. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10806. // unconditionally include in API requests. By default, fields with
  10807. // empty values are omitted from API requests. However, any non-pointer,
  10808. // non-interface field appearing in ForceSendFields will be sent to the
  10809. // server regardless of whether the field is empty or not. This may be
  10810. // used to include empty fields in Patch requests.
  10811. ForceSendFields []string `json:"-"`
  10812. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10813. // API requests with the JSON null value. By default, fields with empty
  10814. // values are omitted from API requests. However, any field with an
  10815. // empty value appearing in NullFields will be sent to the server as
  10816. // null. It is an error if a field in this list has a non-empty value.
  10817. // This may be used to include null fields in Patch requests.
  10818. NullFields []string `json:"-"`
  10819. }
  10820. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10821. type NoMethod TargetWindow
  10822. raw := NoMethod(*s)
  10823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10824. }
  10825. // TargetableRemarketingList: Contains properties of a targetable
  10826. // remarketing list. Remarketing enables you to create lists of users
  10827. // who have performed specific actions on a site, then target ads to
  10828. // members of those lists. This resource is a read-only view of a
  10829. // remarketing list to be used to faciliate targeting ads to specific
  10830. // lists. Remarketing lists that are owned by your advertisers and those
  10831. // that are shared to your advertisers or account are accessible via
  10832. // this resource. To manage remarketing lists that are owned by your
  10833. // advertisers, use the RemarketingLists resource.
  10834. type TargetableRemarketingList struct {
  10835. // AccountId: Account ID of this remarketing list. This is a read-only,
  10836. // auto-generated field that is only returned in GET requests.
  10837. AccountId int64 `json:"accountId,omitempty,string"`
  10838. // Active: Whether this targetable remarketing list is active.
  10839. Active bool `json:"active,omitempty"`
  10840. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10841. // targetable remarketing list.
  10842. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10843. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10844. // advertiser.
  10845. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10846. // Description: Targetable remarketing list description.
  10847. Description string `json:"description,omitempty"`
  10848. // Id: Targetable remarketing list ID.
  10849. Id int64 `json:"id,omitempty,string"`
  10850. // Kind: Identifies what kind of resource this is. Value: the fixed
  10851. // string "dfareporting#targetableRemarketingList".
  10852. Kind string `json:"kind,omitempty"`
  10853. // LifeSpan: Number of days that a user should remain in the targetable
  10854. // remarketing list without an impression.
  10855. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10856. // ListSize: Number of users currently in the list. This is a read-only
  10857. // field.
  10858. ListSize int64 `json:"listSize,omitempty,string"`
  10859. // ListSource: Product from which this targetable remarketing list was
  10860. // originated.
  10861. //
  10862. // Possible values:
  10863. // "REMARKETING_LIST_SOURCE_ADX"
  10864. // "REMARKETING_LIST_SOURCE_DBM"
  10865. // "REMARKETING_LIST_SOURCE_DFA"
  10866. // "REMARKETING_LIST_SOURCE_DFP"
  10867. // "REMARKETING_LIST_SOURCE_DMP"
  10868. // "REMARKETING_LIST_SOURCE_GA"
  10869. // "REMARKETING_LIST_SOURCE_GPLUS"
  10870. // "REMARKETING_LIST_SOURCE_OTHER"
  10871. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10872. // "REMARKETING_LIST_SOURCE_XFP"
  10873. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10874. ListSource string `json:"listSource,omitempty"`
  10875. // Name: Name of the targetable remarketing list. Is no greater than 128
  10876. // characters long.
  10877. Name string `json:"name,omitempty"`
  10878. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10879. // read-only, auto-generated field that is only returned in GET
  10880. // requests.
  10881. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10882. // ServerResponse contains the HTTP response code and headers from the
  10883. // server.
  10884. googleapi.ServerResponse `json:"-"`
  10885. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10886. // unconditionally include in API requests. By default, fields with
  10887. // empty values are omitted from API requests. However, any non-pointer,
  10888. // non-interface field appearing in ForceSendFields will be sent to the
  10889. // server regardless of whether the field is empty or not. This may be
  10890. // used to include empty fields in Patch requests.
  10891. ForceSendFields []string `json:"-"`
  10892. // NullFields is a list of field names (e.g. "AccountId") to include in
  10893. // API requests with the JSON null value. By default, fields with empty
  10894. // values are omitted from API requests. However, any field with an
  10895. // empty value appearing in NullFields will be sent to the server as
  10896. // null. It is an error if a field in this list has a non-empty value.
  10897. // This may be used to include null fields in Patch requests.
  10898. NullFields []string `json:"-"`
  10899. }
  10900. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10901. type NoMethod TargetableRemarketingList
  10902. raw := NoMethod(*s)
  10903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10904. }
  10905. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10906. // response
  10907. type TargetableRemarketingListsListResponse struct {
  10908. // Kind: Identifies what kind of resource this is. Value: the fixed
  10909. // string "dfareporting#targetableRemarketingListsListResponse".
  10910. Kind string `json:"kind,omitempty"`
  10911. // NextPageToken: Pagination token to be used for the next list
  10912. // operation.
  10913. NextPageToken string `json:"nextPageToken,omitempty"`
  10914. // TargetableRemarketingLists: Targetable remarketing list collection.
  10915. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10916. // ServerResponse contains the HTTP response code and headers from the
  10917. // server.
  10918. googleapi.ServerResponse `json:"-"`
  10919. // ForceSendFields is a list of field names (e.g. "Kind") to
  10920. // unconditionally include in API requests. By default, fields with
  10921. // empty values are omitted from API requests. However, any non-pointer,
  10922. // non-interface field appearing in ForceSendFields will be sent to the
  10923. // server regardless of whether the field is empty or not. This may be
  10924. // used to include empty fields in Patch requests.
  10925. ForceSendFields []string `json:"-"`
  10926. // NullFields is a list of field names (e.g. "Kind") to include in API
  10927. // requests with the JSON null value. By default, fields with empty
  10928. // values are omitted from API requests. However, any field with an
  10929. // empty value appearing in NullFields will be sent to the server as
  10930. // null. It is an error if a field in this list has a non-empty value.
  10931. // This may be used to include null fields in Patch requests.
  10932. NullFields []string `json:"-"`
  10933. }
  10934. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  10935. type NoMethod TargetableRemarketingListsListResponse
  10936. raw := NoMethod(*s)
  10937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10938. }
  10939. // TargetingTemplate: Contains properties of a targeting template. A
  10940. // targeting template encapsulates targeting information which can be
  10941. // reused across multiple ads.
  10942. type TargetingTemplate struct {
  10943. // AccountId: Account ID of this targeting template. This field, if left
  10944. // unset, will be auto-generated on insert and is read-only after
  10945. // insert.
  10946. AccountId int64 `json:"accountId,omitempty,string"`
  10947. // AdvertiserId: Advertiser ID of this targeting template. This is a
  10948. // required field on insert and is read-only after insert.
  10949. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10950. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10951. // advertiser. This is a read-only, auto-generated field.
  10952. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10953. // DayPartTargeting: Time and day targeting criteria.
  10954. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  10955. // GeoTargeting: Geographical targeting criteria.
  10956. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  10957. // Id: ID of this targeting template. This is a read-only,
  10958. // auto-generated field.
  10959. Id int64 `json:"id,omitempty,string"`
  10960. // KeyValueTargetingExpression: Key-value targeting criteria.
  10961. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  10962. // Kind: Identifies what kind of resource this is. Value: the fixed
  10963. // string "dfareporting#targetingTemplate".
  10964. Kind string `json:"kind,omitempty"`
  10965. // LanguageTargeting: Language targeting criteria.
  10966. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  10967. // ListTargetingExpression: Remarketing list targeting criteria.
  10968. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  10969. // Name: Name of this targeting template. This field is required. It
  10970. // must be less than 256 characters long and unique within an
  10971. // advertiser.
  10972. Name string `json:"name,omitempty"`
  10973. // SubaccountId: Subaccount ID of this targeting template. This field,
  10974. // if left unset, will be auto-generated on insert and is read-only
  10975. // after insert.
  10976. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10977. // TechnologyTargeting: Technology platform targeting criteria.
  10978. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  10979. // ServerResponse contains the HTTP response code and headers from the
  10980. // server.
  10981. googleapi.ServerResponse `json:"-"`
  10982. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10983. // unconditionally include in API requests. By default, fields with
  10984. // empty values are omitted from API requests. However, any non-pointer,
  10985. // non-interface field appearing in ForceSendFields will be sent to the
  10986. // server regardless of whether the field is empty or not. This may be
  10987. // used to include empty fields in Patch requests.
  10988. ForceSendFields []string `json:"-"`
  10989. // NullFields is a list of field names (e.g. "AccountId") to include in
  10990. // API requests with the JSON null value. By default, fields with empty
  10991. // values are omitted from API requests. However, any field with an
  10992. // empty value appearing in NullFields will be sent to the server as
  10993. // null. It is an error if a field in this list has a non-empty value.
  10994. // This may be used to include null fields in Patch requests.
  10995. NullFields []string `json:"-"`
  10996. }
  10997. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  10998. type NoMethod TargetingTemplate
  10999. raw := NoMethod(*s)
  11000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11001. }
  11002. // TargetingTemplatesListResponse: Targeting Template List Response
  11003. type TargetingTemplatesListResponse struct {
  11004. // Kind: Identifies what kind of resource this is. Value: the fixed
  11005. // string "dfareporting#targetingTemplatesListResponse".
  11006. Kind string `json:"kind,omitempty"`
  11007. // NextPageToken: Pagination token to be used for the next list
  11008. // operation.
  11009. NextPageToken string `json:"nextPageToken,omitempty"`
  11010. // TargetingTemplates: Targeting template collection.
  11011. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  11012. // ServerResponse contains the HTTP response code and headers from the
  11013. // server.
  11014. googleapi.ServerResponse `json:"-"`
  11015. // ForceSendFields is a list of field names (e.g. "Kind") to
  11016. // unconditionally include in API requests. By default, fields with
  11017. // empty values are omitted from API requests. However, any non-pointer,
  11018. // non-interface field appearing in ForceSendFields will be sent to the
  11019. // server regardless of whether the field is empty or not. This may be
  11020. // used to include empty fields in Patch requests.
  11021. ForceSendFields []string `json:"-"`
  11022. // NullFields is a list of field names (e.g. "Kind") to include in API
  11023. // requests with the JSON null value. By default, fields with empty
  11024. // values are omitted from API requests. However, any field with an
  11025. // empty value appearing in NullFields will be sent to the server as
  11026. // null. It is an error if a field in this list has a non-empty value.
  11027. // This may be used to include null fields in Patch requests.
  11028. NullFields []string `json:"-"`
  11029. }
  11030. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  11031. type NoMethod TargetingTemplatesListResponse
  11032. raw := NoMethod(*s)
  11033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11034. }
  11035. // TechnologyTargeting: Technology Targeting.
  11036. type TechnologyTargeting struct {
  11037. // Browsers: Browsers that this ad targets. For each browser either set
  11038. // browserVersionId or dartId along with the version numbers. If both
  11039. // are specified, only browserVersionId will be used. The other fields
  11040. // are populated automatically when the ad is inserted or updated.
  11041. Browsers []*Browser `json:"browsers,omitempty"`
  11042. // ConnectionTypes: Connection types that this ad targets. For each
  11043. // connection type only id is required. The other fields are populated
  11044. // automatically when the ad is inserted or updated.
  11045. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  11046. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  11047. // carrier only id is required, and the other fields are populated
  11048. // automatically when the ad is inserted or updated. If targeting a
  11049. // mobile carrier, do not set targeting for any zip codes.
  11050. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  11051. // OperatingSystemVersions: Operating system versions that this ad
  11052. // targets. To target all versions, use operatingSystems. For each
  11053. // operating system version, only id is required. The other fields are
  11054. // populated automatically when the ad is inserted or updated. If
  11055. // targeting an operating system version, do not set targeting for the
  11056. // corresponding operating system in operatingSystems.
  11057. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  11058. // OperatingSystems: Operating systems that this ad targets. To target
  11059. // specific versions, use operatingSystemVersions. For each operating
  11060. // system only dartId is required. The other fields are populated
  11061. // automatically when the ad is inserted or updated. If targeting an
  11062. // operating system, do not set targeting for operating system versions
  11063. // for the same operating system.
  11064. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  11065. // PlatformTypes: Platform types that this ad targets. For example,
  11066. // desktop, mobile, or tablet. For each platform type, only id is
  11067. // required, and the other fields are populated automatically when the
  11068. // ad is inserted or updated.
  11069. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  11070. // ForceSendFields is a list of field names (e.g. "Browsers") to
  11071. // unconditionally include in API requests. By default, fields with
  11072. // empty values are omitted from API requests. However, any non-pointer,
  11073. // non-interface field appearing in ForceSendFields will be sent to the
  11074. // server regardless of whether the field is empty or not. This may be
  11075. // used to include empty fields in Patch requests.
  11076. ForceSendFields []string `json:"-"`
  11077. // NullFields is a list of field names (e.g. "Browsers") to include in
  11078. // API requests with the JSON null value. By default, fields with empty
  11079. // values are omitted from API requests. However, any field with an
  11080. // empty value appearing in NullFields will be sent to the server as
  11081. // null. It is an error if a field in this list has a non-empty value.
  11082. // This may be used to include null fields in Patch requests.
  11083. NullFields []string `json:"-"`
  11084. }
  11085. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  11086. type NoMethod TechnologyTargeting
  11087. raw := NoMethod(*s)
  11088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11089. }
  11090. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  11091. type ThirdPartyAuthenticationToken struct {
  11092. // Name: Name of the third-party authentication token.
  11093. Name string `json:"name,omitempty"`
  11094. // Value: Value of the third-party authentication token. This is a
  11095. // read-only, auto-generated field.
  11096. Value string `json:"value,omitempty"`
  11097. // ForceSendFields is a list of field names (e.g. "Name") to
  11098. // unconditionally include in API requests. By default, fields with
  11099. // empty values are omitted from API requests. However, any non-pointer,
  11100. // non-interface field appearing in ForceSendFields will be sent to the
  11101. // server regardless of whether the field is empty or not. This may be
  11102. // used to include empty fields in Patch requests.
  11103. ForceSendFields []string `json:"-"`
  11104. // NullFields is a list of field names (e.g. "Name") to include in API
  11105. // requests with the JSON null value. By default, fields with empty
  11106. // values are omitted from API requests. However, any field with an
  11107. // empty value appearing in NullFields will be sent to the server as
  11108. // null. It is an error if a field in this list has a non-empty value.
  11109. // This may be used to include null fields in Patch requests.
  11110. NullFields []string `json:"-"`
  11111. }
  11112. func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  11113. type NoMethod ThirdPartyAuthenticationToken
  11114. raw := NoMethod(*s)
  11115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11116. }
  11117. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  11118. type ThirdPartyTrackingUrl struct {
  11119. // ThirdPartyUrlType: Third-party URL type for in-stream video and
  11120. // in-stream audio creatives.
  11121. //
  11122. // Possible values:
  11123. // "CLICK_TRACKING"
  11124. // "IMPRESSION"
  11125. // "RICH_MEDIA_BACKUP_IMPRESSION"
  11126. // "RICH_MEDIA_IMPRESSION"
  11127. // "RICH_MEDIA_RM_IMPRESSION"
  11128. // "SURVEY"
  11129. // "VIDEO_COMPLETE"
  11130. // "VIDEO_CUSTOM"
  11131. // "VIDEO_FIRST_QUARTILE"
  11132. // "VIDEO_FULLSCREEN"
  11133. // "VIDEO_MIDPOINT"
  11134. // "VIDEO_MUTE"
  11135. // "VIDEO_PAUSE"
  11136. // "VIDEO_PROGRESS"
  11137. // "VIDEO_REWIND"
  11138. // "VIDEO_SKIP"
  11139. // "VIDEO_START"
  11140. // "VIDEO_STOP"
  11141. // "VIDEO_THIRD_QUARTILE"
  11142. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  11143. // Url: URL for the specified third-party URL type.
  11144. Url string `json:"url,omitempty"`
  11145. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  11146. // to unconditionally include in API requests. By default, fields with
  11147. // empty values are omitted from API requests. However, any non-pointer,
  11148. // non-interface field appearing in ForceSendFields will be sent to the
  11149. // server regardless of whether the field is empty or not. This may be
  11150. // used to include empty fields in Patch requests.
  11151. ForceSendFields []string `json:"-"`
  11152. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  11153. // include in API requests with the JSON null value. By default, fields
  11154. // with empty values are omitted from API requests. However, any field
  11155. // with an empty value appearing in NullFields will be sent to the
  11156. // server as null. It is an error if a field in this list has a
  11157. // non-empty value. This may be used to include null fields in Patch
  11158. // requests.
  11159. NullFields []string `json:"-"`
  11160. }
  11161. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  11162. type NoMethod ThirdPartyTrackingUrl
  11163. raw := NoMethod(*s)
  11164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11165. }
  11166. // TranscodeSetting: Transcode Settings
  11167. type TranscodeSetting struct {
  11168. // EnabledVideoFormats: Whitelist of video formats to be served to this
  11169. // placement. Set this list to null or empty to serve all video formats.
  11170. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  11171. // Kind: Identifies what kind of resource this is. Value: the fixed
  11172. // string "dfareporting#transcodeSetting".
  11173. Kind string `json:"kind,omitempty"`
  11174. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  11175. // to unconditionally include in API requests. By default, fields with
  11176. // empty values are omitted from API requests. However, any non-pointer,
  11177. // non-interface field appearing in ForceSendFields will be sent to the
  11178. // server regardless of whether the field is empty or not. This may be
  11179. // used to include empty fields in Patch requests.
  11180. ForceSendFields []string `json:"-"`
  11181. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  11182. // include in API requests with the JSON null value. By default, fields
  11183. // with empty values are omitted from API requests. However, any field
  11184. // with an empty value appearing in NullFields will be sent to the
  11185. // server as null. It is an error if a field in this list has a
  11186. // non-empty value. This may be used to include null fields in Patch
  11187. // requests.
  11188. NullFields []string `json:"-"`
  11189. }
  11190. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  11191. type NoMethod TranscodeSetting
  11192. raw := NoMethod(*s)
  11193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11194. }
  11195. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  11196. // to the following creative types: INSTREAM_AUDIO, INSTREAM_VIDEO and
  11197. // VPAID.
  11198. type UniversalAdId struct {
  11199. // Registry: Registry used for the Ad ID value.
  11200. //
  11201. // Possible values:
  11202. // "AD_ID.ORG"
  11203. // "CLEARCAST"
  11204. // "DCM"
  11205. // "OTHER"
  11206. Registry string `json:"registry,omitempty"`
  11207. // Value: ID value for this creative. Only alphanumeric characters and
  11208. // the following symbols are valid: "_/\-". Maximum length is 64
  11209. // characters. Read only when registry is DCM.
  11210. Value string `json:"value,omitempty"`
  11211. // ForceSendFields is a list of field names (e.g. "Registry") to
  11212. // unconditionally include in API requests. By default, fields with
  11213. // empty values are omitted from API requests. However, any non-pointer,
  11214. // non-interface field appearing in ForceSendFields will be sent to the
  11215. // server regardless of whether the field is empty or not. This may be
  11216. // used to include empty fields in Patch requests.
  11217. ForceSendFields []string `json:"-"`
  11218. // NullFields is a list of field names (e.g. "Registry") to include in
  11219. // API requests with the JSON null value. By default, fields with empty
  11220. // values are omitted from API requests. However, any field with an
  11221. // empty value appearing in NullFields will be sent to the server as
  11222. // null. It is an error if a field in this list has a non-empty value.
  11223. // This may be used to include null fields in Patch requests.
  11224. NullFields []string `json:"-"`
  11225. }
  11226. func (s *UniversalAdId) MarshalJSON() ([]byte, error) {
  11227. type NoMethod UniversalAdId
  11228. raw := NoMethod(*s)
  11229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11230. }
  11231. // UserDefinedVariableConfiguration: User Defined Variable
  11232. // configuration.
  11233. type UserDefinedVariableConfiguration struct {
  11234. // DataType: Data type for the variable. This is a required field.
  11235. //
  11236. // Possible values:
  11237. // "NUMBER"
  11238. // "STRING"
  11239. DataType string `json:"dataType,omitempty"`
  11240. // ReportName: User-friendly name for the variable which will appear in
  11241. // reports. This is a required field, must be less than 64 characters
  11242. // long, and cannot contain the following characters: ""<>".
  11243. ReportName string `json:"reportName,omitempty"`
  11244. // VariableType: Variable name in the tag. This is a required field.
  11245. //
  11246. // Possible values:
  11247. // "U1"
  11248. // "U10"
  11249. // "U100"
  11250. // "U11"
  11251. // "U12"
  11252. // "U13"
  11253. // "U14"
  11254. // "U15"
  11255. // "U16"
  11256. // "U17"
  11257. // "U18"
  11258. // "U19"
  11259. // "U2"
  11260. // "U20"
  11261. // "U21"
  11262. // "U22"
  11263. // "U23"
  11264. // "U24"
  11265. // "U25"
  11266. // "U26"
  11267. // "U27"
  11268. // "U28"
  11269. // "U29"
  11270. // "U3"
  11271. // "U30"
  11272. // "U31"
  11273. // "U32"
  11274. // "U33"
  11275. // "U34"
  11276. // "U35"
  11277. // "U36"
  11278. // "U37"
  11279. // "U38"
  11280. // "U39"
  11281. // "U4"
  11282. // "U40"
  11283. // "U41"
  11284. // "U42"
  11285. // "U43"
  11286. // "U44"
  11287. // "U45"
  11288. // "U46"
  11289. // "U47"
  11290. // "U48"
  11291. // "U49"
  11292. // "U5"
  11293. // "U50"
  11294. // "U51"
  11295. // "U52"
  11296. // "U53"
  11297. // "U54"
  11298. // "U55"
  11299. // "U56"
  11300. // "U57"
  11301. // "U58"
  11302. // "U59"
  11303. // "U6"
  11304. // "U60"
  11305. // "U61"
  11306. // "U62"
  11307. // "U63"
  11308. // "U64"
  11309. // "U65"
  11310. // "U66"
  11311. // "U67"
  11312. // "U68"
  11313. // "U69"
  11314. // "U7"
  11315. // "U70"
  11316. // "U71"
  11317. // "U72"
  11318. // "U73"
  11319. // "U74"
  11320. // "U75"
  11321. // "U76"
  11322. // "U77"
  11323. // "U78"
  11324. // "U79"
  11325. // "U8"
  11326. // "U80"
  11327. // "U81"
  11328. // "U82"
  11329. // "U83"
  11330. // "U84"
  11331. // "U85"
  11332. // "U86"
  11333. // "U87"
  11334. // "U88"
  11335. // "U89"
  11336. // "U9"
  11337. // "U90"
  11338. // "U91"
  11339. // "U92"
  11340. // "U93"
  11341. // "U94"
  11342. // "U95"
  11343. // "U96"
  11344. // "U97"
  11345. // "U98"
  11346. // "U99"
  11347. VariableType string `json:"variableType,omitempty"`
  11348. // ForceSendFields is a list of field names (e.g. "DataType") to
  11349. // unconditionally include in API requests. By default, fields with
  11350. // empty values are omitted from API requests. However, any non-pointer,
  11351. // non-interface field appearing in ForceSendFields will be sent to the
  11352. // server regardless of whether the field is empty or not. This may be
  11353. // used to include empty fields in Patch requests.
  11354. ForceSendFields []string `json:"-"`
  11355. // NullFields is a list of field names (e.g. "DataType") to include in
  11356. // API requests with the JSON null value. By default, fields with empty
  11357. // values are omitted from API requests. However, any field with an
  11358. // empty value appearing in NullFields will be sent to the server as
  11359. // null. It is an error if a field in this list has a non-empty value.
  11360. // This may be used to include null fields in Patch requests.
  11361. NullFields []string `json:"-"`
  11362. }
  11363. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11364. type NoMethod UserDefinedVariableConfiguration
  11365. raw := NoMethod(*s)
  11366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11367. }
  11368. // UserProfile: Represents a UserProfile resource.
  11369. type UserProfile struct {
  11370. // AccountId: The account ID to which this profile belongs.
  11371. AccountId int64 `json:"accountId,omitempty,string"`
  11372. // AccountName: The account name this profile belongs to.
  11373. AccountName string `json:"accountName,omitempty"`
  11374. // Etag: The eTag of this response for caching purposes.
  11375. Etag string `json:"etag,omitempty"`
  11376. // Kind: The kind of resource this is, in this case
  11377. // dfareporting#userProfile.
  11378. Kind string `json:"kind,omitempty"`
  11379. // ProfileId: The unique ID of the user profile.
  11380. ProfileId int64 `json:"profileId,omitempty,string"`
  11381. // SubAccountId: The sub account ID this profile belongs to if
  11382. // applicable.
  11383. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11384. // SubAccountName: The sub account name this profile belongs to if
  11385. // applicable.
  11386. SubAccountName string `json:"subAccountName,omitempty"`
  11387. // UserName: The user name.
  11388. UserName string `json:"userName,omitempty"`
  11389. // ServerResponse contains the HTTP response code and headers from the
  11390. // server.
  11391. googleapi.ServerResponse `json:"-"`
  11392. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11393. // unconditionally include in API requests. By default, fields with
  11394. // empty values are omitted from API requests. However, any non-pointer,
  11395. // non-interface field appearing in ForceSendFields will be sent to the
  11396. // server regardless of whether the field is empty or not. This may be
  11397. // used to include empty fields in Patch requests.
  11398. ForceSendFields []string `json:"-"`
  11399. // NullFields is a list of field names (e.g. "AccountId") to include in
  11400. // API requests with the JSON null value. By default, fields with empty
  11401. // values are omitted from API requests. However, any field with an
  11402. // empty value appearing in NullFields will be sent to the server as
  11403. // null. It is an error if a field in this list has a non-empty value.
  11404. // This may be used to include null fields in Patch requests.
  11405. NullFields []string `json:"-"`
  11406. }
  11407. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11408. type NoMethod UserProfile
  11409. raw := NoMethod(*s)
  11410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11411. }
  11412. // UserProfileList: Represents the list of user profiles.
  11413. type UserProfileList struct {
  11414. // Etag: The eTag of this response for caching purposes.
  11415. Etag string `json:"etag,omitempty"`
  11416. // Items: The user profiles returned in this response.
  11417. Items []*UserProfile `json:"items,omitempty"`
  11418. // Kind: The kind of list this is, in this case
  11419. // dfareporting#userProfileList.
  11420. Kind string `json:"kind,omitempty"`
  11421. // ServerResponse contains the HTTP response code and headers from the
  11422. // server.
  11423. googleapi.ServerResponse `json:"-"`
  11424. // ForceSendFields is a list of field names (e.g. "Etag") to
  11425. // unconditionally include in API requests. By default, fields with
  11426. // empty values are omitted from API requests. However, any non-pointer,
  11427. // non-interface field appearing in ForceSendFields will be sent to the
  11428. // server regardless of whether the field is empty or not. This may be
  11429. // used to include empty fields in Patch requests.
  11430. ForceSendFields []string `json:"-"`
  11431. // NullFields is a list of field names (e.g. "Etag") to include in API
  11432. // requests with the JSON null value. By default, fields with empty
  11433. // values are omitted from API requests. However, any field with an
  11434. // empty value appearing in NullFields will be sent to the server as
  11435. // null. It is an error if a field in this list has a non-empty value.
  11436. // This may be used to include null fields in Patch requests.
  11437. NullFields []string `json:"-"`
  11438. }
  11439. func (s *UserProfileList) MarshalJSON() ([]byte, error) {
  11440. type NoMethod UserProfileList
  11441. raw := NoMethod(*s)
  11442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11443. }
  11444. // UserRole: Contains properties of auser role, which is used to manage
  11445. // user access.
  11446. type UserRole struct {
  11447. // AccountId: Account ID of this user role. This is a read-only field
  11448. // that can be left blank.
  11449. AccountId int64 `json:"accountId,omitempty,string"`
  11450. // DefaultUserRole: Whether this is a default user role. Default user
  11451. // roles are created by the system for the account/subaccount and cannot
  11452. // be modified or deleted. Each default user role comes with a basic set
  11453. // of preassigned permissions.
  11454. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11455. // Id: ID of this user role. This is a read-only, auto-generated field.
  11456. Id int64 `json:"id,omitempty,string"`
  11457. // Kind: Identifies what kind of resource this is. Value: the fixed
  11458. // string "dfareporting#userRole".
  11459. Kind string `json:"kind,omitempty"`
  11460. // Name: Name of this user role. This is a required field. Must be less
  11461. // than 256 characters long. If this user role is under a subaccount,
  11462. // the name must be unique among sites of the same subaccount.
  11463. // Otherwise, this user role is a top-level user role, and the name must
  11464. // be unique among top-level user roles of the same account.
  11465. Name string `json:"name,omitempty"`
  11466. // ParentUserRoleId: ID of the user role that this user role is based on
  11467. // or copied from. This is a required field.
  11468. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11469. // Permissions: List of permissions associated with this user role.
  11470. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11471. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11472. // field that can be left blank.
  11473. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11474. // ServerResponse contains the HTTP response code and headers from the
  11475. // server.
  11476. googleapi.ServerResponse `json:"-"`
  11477. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11478. // unconditionally include in API requests. By default, fields with
  11479. // empty values are omitted from API requests. However, any non-pointer,
  11480. // non-interface field appearing in ForceSendFields will be sent to the
  11481. // server regardless of whether the field is empty or not. This may be
  11482. // used to include empty fields in Patch requests.
  11483. ForceSendFields []string `json:"-"`
  11484. // NullFields is a list of field names (e.g. "AccountId") to include in
  11485. // API requests with the JSON null value. By default, fields with empty
  11486. // values are omitted from API requests. However, any field with an
  11487. // empty value appearing in NullFields will be sent to the server as
  11488. // null. It is an error if a field in this list has a non-empty value.
  11489. // This may be used to include null fields in Patch requests.
  11490. NullFields []string `json:"-"`
  11491. }
  11492. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11493. type NoMethod UserRole
  11494. raw := NoMethod(*s)
  11495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11496. }
  11497. // UserRolePermission: Contains properties of a user role permission.
  11498. type UserRolePermission struct {
  11499. // Availability: Levels of availability for a user role permission.
  11500. //
  11501. // Possible values:
  11502. // "ACCOUNT_ALWAYS"
  11503. // "ACCOUNT_BY_DEFAULT"
  11504. // "NOT_AVAILABLE_BY_DEFAULT"
  11505. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11506. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11507. Availability string `json:"availability,omitempty"`
  11508. // Id: ID of this user role permission.
  11509. Id int64 `json:"id,omitempty,string"`
  11510. // Kind: Identifies what kind of resource this is. Value: the fixed
  11511. // string "dfareporting#userRolePermission".
  11512. Kind string `json:"kind,omitempty"`
  11513. // Name: Name of this user role permission.
  11514. Name string `json:"name,omitempty"`
  11515. // PermissionGroupId: ID of the permission group that this user role
  11516. // permission belongs to.
  11517. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11518. // ServerResponse contains the HTTP response code and headers from the
  11519. // server.
  11520. googleapi.ServerResponse `json:"-"`
  11521. // ForceSendFields is a list of field names (e.g. "Availability") to
  11522. // unconditionally include in API requests. By default, fields with
  11523. // empty values are omitted from API requests. However, any non-pointer,
  11524. // non-interface field appearing in ForceSendFields will be sent to the
  11525. // server regardless of whether the field is empty or not. This may be
  11526. // used to include empty fields in Patch requests.
  11527. ForceSendFields []string `json:"-"`
  11528. // NullFields is a list of field names (e.g. "Availability") to include
  11529. // in API requests with the JSON null value. By default, fields with
  11530. // empty values are omitted from API requests. However, any field with
  11531. // an empty value appearing in NullFields will be sent to the server as
  11532. // null. It is an error if a field in this list has a non-empty value.
  11533. // This may be used to include null fields in Patch requests.
  11534. NullFields []string `json:"-"`
  11535. }
  11536. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11537. type NoMethod UserRolePermission
  11538. raw := NoMethod(*s)
  11539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11540. }
  11541. // UserRolePermissionGroup: Represents a grouping of related user role
  11542. // permissions.
  11543. type UserRolePermissionGroup struct {
  11544. // Id: ID of this user role permission.
  11545. Id int64 `json:"id,omitempty,string"`
  11546. // Kind: Identifies what kind of resource this is. Value: the fixed
  11547. // string "dfareporting#userRolePermissionGroup".
  11548. Kind string `json:"kind,omitempty"`
  11549. // Name: Name of this user role permission group.
  11550. Name string `json:"name,omitempty"`
  11551. // ServerResponse contains the HTTP response code and headers from the
  11552. // server.
  11553. googleapi.ServerResponse `json:"-"`
  11554. // ForceSendFields is a list of field names (e.g. "Id") to
  11555. // unconditionally include in API requests. By default, fields with
  11556. // empty values are omitted from API requests. However, any non-pointer,
  11557. // non-interface field appearing in ForceSendFields will be sent to the
  11558. // server regardless of whether the field is empty or not. This may be
  11559. // used to include empty fields in Patch requests.
  11560. ForceSendFields []string `json:"-"`
  11561. // NullFields is a list of field names (e.g. "Id") to include in API
  11562. // requests with the JSON null value. By default, fields with empty
  11563. // values are omitted from API requests. However, any field with an
  11564. // empty value appearing in NullFields will be sent to the server as
  11565. // null. It is an error if a field in this list has a non-empty value.
  11566. // This may be used to include null fields in Patch requests.
  11567. NullFields []string `json:"-"`
  11568. }
  11569. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11570. type NoMethod UserRolePermissionGroup
  11571. raw := NoMethod(*s)
  11572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11573. }
  11574. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11575. // Response
  11576. type UserRolePermissionGroupsListResponse struct {
  11577. // Kind: Identifies what kind of resource this is. Value: the fixed
  11578. // string "dfareporting#userRolePermissionGroupsListResponse".
  11579. Kind string `json:"kind,omitempty"`
  11580. // UserRolePermissionGroups: User role permission group collection.
  11581. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11582. // ServerResponse contains the HTTP response code and headers from the
  11583. // server.
  11584. googleapi.ServerResponse `json:"-"`
  11585. // ForceSendFields is a list of field names (e.g. "Kind") to
  11586. // unconditionally include in API requests. By default, fields with
  11587. // empty values are omitted from API requests. However, any non-pointer,
  11588. // non-interface field appearing in ForceSendFields will be sent to the
  11589. // server regardless of whether the field is empty or not. This may be
  11590. // used to include empty fields in Patch requests.
  11591. ForceSendFields []string `json:"-"`
  11592. // NullFields is a list of field names (e.g. "Kind") to include in API
  11593. // requests with the JSON null value. By default, fields with empty
  11594. // values are omitted from API requests. However, any field with an
  11595. // empty value appearing in NullFields will be sent to the server as
  11596. // null. It is an error if a field in this list has a non-empty value.
  11597. // This may be used to include null fields in Patch requests.
  11598. NullFields []string `json:"-"`
  11599. }
  11600. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11601. type NoMethod UserRolePermissionGroupsListResponse
  11602. raw := NoMethod(*s)
  11603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11604. }
  11605. // UserRolePermissionsListResponse: User Role Permission List Response
  11606. type UserRolePermissionsListResponse struct {
  11607. // Kind: Identifies what kind of resource this is. Value: the fixed
  11608. // string "dfareporting#userRolePermissionsListResponse".
  11609. Kind string `json:"kind,omitempty"`
  11610. // UserRolePermissions: User role permission collection.
  11611. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11612. // ServerResponse contains the HTTP response code and headers from the
  11613. // server.
  11614. googleapi.ServerResponse `json:"-"`
  11615. // ForceSendFields is a list of field names (e.g. "Kind") to
  11616. // unconditionally include in API requests. By default, fields with
  11617. // empty values are omitted from API requests. However, any non-pointer,
  11618. // non-interface field appearing in ForceSendFields will be sent to the
  11619. // server regardless of whether the field is empty or not. This may be
  11620. // used to include empty fields in Patch requests.
  11621. ForceSendFields []string `json:"-"`
  11622. // NullFields is a list of field names (e.g. "Kind") to include in API
  11623. // requests with the JSON null value. By default, fields with empty
  11624. // values are omitted from API requests. However, any field with an
  11625. // empty value appearing in NullFields will be sent to the server as
  11626. // null. It is an error if a field in this list has a non-empty value.
  11627. // This may be used to include null fields in Patch requests.
  11628. NullFields []string `json:"-"`
  11629. }
  11630. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11631. type NoMethod UserRolePermissionsListResponse
  11632. raw := NoMethod(*s)
  11633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11634. }
  11635. // UserRolesListResponse: User Role List Response
  11636. type UserRolesListResponse struct {
  11637. // Kind: Identifies what kind of resource this is. Value: the fixed
  11638. // string "dfareporting#userRolesListResponse".
  11639. Kind string `json:"kind,omitempty"`
  11640. // NextPageToken: Pagination token to be used for the next list
  11641. // operation.
  11642. NextPageToken string `json:"nextPageToken,omitempty"`
  11643. // UserRoles: User role collection.
  11644. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11645. // ServerResponse contains the HTTP response code and headers from the
  11646. // server.
  11647. googleapi.ServerResponse `json:"-"`
  11648. // ForceSendFields is a list of field names (e.g. "Kind") to
  11649. // unconditionally include in API requests. By default, fields with
  11650. // empty values are omitted from API requests. However, any non-pointer,
  11651. // non-interface field appearing in ForceSendFields will be sent to the
  11652. // server regardless of whether the field is empty or not. This may be
  11653. // used to include empty fields in Patch requests.
  11654. ForceSendFields []string `json:"-"`
  11655. // NullFields is a list of field names (e.g. "Kind") to include in API
  11656. // requests with the JSON null value. By default, fields with empty
  11657. // values are omitted from API requests. However, any field with an
  11658. // empty value appearing in NullFields will be sent to the server as
  11659. // null. It is an error if a field in this list has a non-empty value.
  11660. // This may be used to include null fields in Patch requests.
  11661. NullFields []string `json:"-"`
  11662. }
  11663. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11664. type NoMethod UserRolesListResponse
  11665. raw := NoMethod(*s)
  11666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11667. }
  11668. // VideoFormat: Contains information about supported video formats.
  11669. type VideoFormat struct {
  11670. // FileType: File type of the video format.
  11671. //
  11672. // Possible values:
  11673. // "FLV"
  11674. // "M3U8"
  11675. // "MP4"
  11676. // "THREEGPP"
  11677. // "WEBM"
  11678. FileType string `json:"fileType,omitempty"`
  11679. // Id: ID of the video format.
  11680. Id int64 `json:"id,omitempty"`
  11681. // Kind: Identifies what kind of resource this is. Value: the fixed
  11682. // string "dfareporting#videoFormat".
  11683. Kind string `json:"kind,omitempty"`
  11684. // Resolution: The resolution of this video format.
  11685. Resolution *Size `json:"resolution,omitempty"`
  11686. // TargetBitRate: The target bit rate of this video format.
  11687. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11688. // ServerResponse contains the HTTP response code and headers from the
  11689. // server.
  11690. googleapi.ServerResponse `json:"-"`
  11691. // ForceSendFields is a list of field names (e.g. "FileType") to
  11692. // unconditionally include in API requests. By default, fields with
  11693. // empty values are omitted from API requests. However, any non-pointer,
  11694. // non-interface field appearing in ForceSendFields will be sent to the
  11695. // server regardless of whether the field is empty or not. This may be
  11696. // used to include empty fields in Patch requests.
  11697. ForceSendFields []string `json:"-"`
  11698. // NullFields is a list of field names (e.g. "FileType") to include in
  11699. // API requests with the JSON null value. By default, fields with empty
  11700. // values are omitted from API requests. However, any field with an
  11701. // empty value appearing in NullFields will be sent to the server as
  11702. // null. It is an error if a field in this list has a non-empty value.
  11703. // This may be used to include null fields in Patch requests.
  11704. NullFields []string `json:"-"`
  11705. }
  11706. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11707. type NoMethod VideoFormat
  11708. raw := NoMethod(*s)
  11709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11710. }
  11711. // VideoFormatsListResponse: Video Format List Response
  11712. type VideoFormatsListResponse struct {
  11713. // Kind: Identifies what kind of resource this is. Value: the fixed
  11714. // string "dfareporting#videoFormatsListResponse".
  11715. Kind string `json:"kind,omitempty"`
  11716. // VideoFormats: Video format collection.
  11717. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11718. // ServerResponse contains the HTTP response code and headers from the
  11719. // server.
  11720. googleapi.ServerResponse `json:"-"`
  11721. // ForceSendFields is a list of field names (e.g. "Kind") to
  11722. // unconditionally include in API requests. By default, fields with
  11723. // empty values are omitted from API requests. However, any non-pointer,
  11724. // non-interface field appearing in ForceSendFields will be sent to the
  11725. // server regardless of whether the field is empty or not. This may be
  11726. // used to include empty fields in Patch requests.
  11727. ForceSendFields []string `json:"-"`
  11728. // NullFields is a list of field names (e.g. "Kind") to include in API
  11729. // requests with the JSON null value. By default, fields with empty
  11730. // values are omitted from API requests. However, any field with an
  11731. // empty value appearing in NullFields will be sent to the server as
  11732. // null. It is an error if a field in this list has a non-empty value.
  11733. // This may be used to include null fields in Patch requests.
  11734. NullFields []string `json:"-"`
  11735. }
  11736. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11737. type NoMethod VideoFormatsListResponse
  11738. raw := NoMethod(*s)
  11739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11740. }
  11741. // VideoOffset: Video Offset
  11742. type VideoOffset struct {
  11743. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11744. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11745. // inclusive.
  11746. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11747. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11748. // is set. Acceptable values are 0 to 86399, inclusive.
  11749. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11750. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11751. // unconditionally include in API requests. By default, fields with
  11752. // empty values are omitted from API requests. However, any non-pointer,
  11753. // non-interface field appearing in ForceSendFields will be sent to the
  11754. // server regardless of whether the field is empty or not. This may be
  11755. // used to include empty fields in Patch requests.
  11756. ForceSendFields []string `json:"-"`
  11757. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11758. // include in API requests with the JSON null value. By default, fields
  11759. // with empty values are omitted from API requests. However, any field
  11760. // with an empty value appearing in NullFields will be sent to the
  11761. // server as null. It is an error if a field in this list has a
  11762. // non-empty value. This may be used to include null fields in Patch
  11763. // requests.
  11764. NullFields []string `json:"-"`
  11765. }
  11766. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11767. type NoMethod VideoOffset
  11768. raw := NoMethod(*s)
  11769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11770. }
  11771. // VideoSettings: Video Settings
  11772. type VideoSettings struct {
  11773. // CompanionSettings: Settings for the companion creatives of video
  11774. // creatives served to this placement.
  11775. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11776. // Kind: Identifies what kind of resource this is. Value: the fixed
  11777. // string "dfareporting#videoSettings".
  11778. Kind string `json:"kind,omitempty"`
  11779. // Orientation: Orientation of a video placement. If this value is set,
  11780. // placement will return assets matching the specified orientation.
  11781. //
  11782. // Possible values:
  11783. // "ANY"
  11784. // "LANDSCAPE"
  11785. // "PORTRAIT"
  11786. Orientation string `json:"orientation,omitempty"`
  11787. // SkippableSettings: Settings for the skippability of video creatives
  11788. // served to this placement. If this object is provided, the
  11789. // creative-level skippable settings will be overridden.
  11790. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11791. // TranscodeSettings: Settings for the transcodes of video creatives
  11792. // served to this placement. If this object is provided, the
  11793. // creative-level transcode settings will be overridden.
  11794. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11795. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11796. // to unconditionally include in API requests. By default, fields with
  11797. // empty values are omitted from API requests. However, any non-pointer,
  11798. // non-interface field appearing in ForceSendFields will be sent to the
  11799. // server regardless of whether the field is empty or not. This may be
  11800. // used to include empty fields in Patch requests.
  11801. ForceSendFields []string `json:"-"`
  11802. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11803. // include in API requests with the JSON null value. By default, fields
  11804. // with empty values are omitted from API requests. However, any field
  11805. // with an empty value appearing in NullFields will be sent to the
  11806. // server as null. It is an error if a field in this list has a
  11807. // non-empty value. This may be used to include null fields in Patch
  11808. // requests.
  11809. NullFields []string `json:"-"`
  11810. }
  11811. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11812. type NoMethod VideoSettings
  11813. raw := NoMethod(*s)
  11814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11815. }
  11816. // method id "dfareporting.accountActiveAdSummaries.get":
  11817. type AccountActiveAdSummariesGetCall struct {
  11818. s *Service
  11819. profileId int64
  11820. summaryAccountId int64
  11821. urlParams_ gensupport.URLParams
  11822. ifNoneMatch_ string
  11823. ctx_ context.Context
  11824. header_ http.Header
  11825. }
  11826. // Get: Gets the account's active ad summary by account ID.
  11827. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11828. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11829. c.profileId = profileId
  11830. c.summaryAccountId = summaryAccountId
  11831. return c
  11832. }
  11833. // Fields allows partial responses to be retrieved. See
  11834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11835. // for more information.
  11836. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11838. return c
  11839. }
  11840. // IfNoneMatch sets the optional parameter which makes the operation
  11841. // fail if the object's ETag matches the given value. This is useful for
  11842. // getting updates only after the object has changed since the last
  11843. // request. Use googleapi.IsNotModified to check whether the response
  11844. // error from Do is the result of In-None-Match.
  11845. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11846. c.ifNoneMatch_ = entityTag
  11847. return c
  11848. }
  11849. // Context sets the context to be used in this call's Do method. Any
  11850. // pending HTTP request will be aborted if the provided context is
  11851. // canceled.
  11852. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11853. c.ctx_ = ctx
  11854. return c
  11855. }
  11856. // Header returns an http.Header that can be modified by the caller to
  11857. // add HTTP headers to the request.
  11858. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11859. if c.header_ == nil {
  11860. c.header_ = make(http.Header)
  11861. }
  11862. return c.header_
  11863. }
  11864. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11865. reqHeaders := make(http.Header)
  11866. for k, v := range c.header_ {
  11867. reqHeaders[k] = v
  11868. }
  11869. reqHeaders.Set("User-Agent", c.s.userAgent())
  11870. if c.ifNoneMatch_ != "" {
  11871. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11872. }
  11873. var body io.Reader = nil
  11874. c.urlParams_.Set("alt", alt)
  11875. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11876. urls += "?" + c.urlParams_.Encode()
  11877. req, _ := http.NewRequest("GET", urls, body)
  11878. req.Header = reqHeaders
  11879. googleapi.Expand(req.URL, map[string]string{
  11880. "profileId": strconv.FormatInt(c.profileId, 10),
  11881. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11882. })
  11883. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11884. }
  11885. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11886. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11887. // non-2xx status code is an error. Response headers are in either
  11888. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11889. // returned at all) in error.(*googleapi.Error).Header. Use
  11890. // googleapi.IsNotModified to check whether the returned error was
  11891. // because http.StatusNotModified was returned.
  11892. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11893. gensupport.SetOptions(c.urlParams_, opts...)
  11894. res, err := c.doRequest("json")
  11895. if res != nil && res.StatusCode == http.StatusNotModified {
  11896. if res.Body != nil {
  11897. res.Body.Close()
  11898. }
  11899. return nil, &googleapi.Error{
  11900. Code: res.StatusCode,
  11901. Header: res.Header,
  11902. }
  11903. }
  11904. if err != nil {
  11905. return nil, err
  11906. }
  11907. defer googleapi.CloseBody(res)
  11908. if err := googleapi.CheckResponse(res); err != nil {
  11909. return nil, err
  11910. }
  11911. ret := &AccountActiveAdSummary{
  11912. ServerResponse: googleapi.ServerResponse{
  11913. Header: res.Header,
  11914. HTTPStatusCode: res.StatusCode,
  11915. },
  11916. }
  11917. target := &ret
  11918. if err := gensupport.DecodeResponse(target, res); err != nil {
  11919. return nil, err
  11920. }
  11921. return ret, nil
  11922. // {
  11923. // "description": "Gets the account's active ad summary by account ID.",
  11924. // "httpMethod": "GET",
  11925. // "id": "dfareporting.accountActiveAdSummaries.get",
  11926. // "parameterOrder": [
  11927. // "profileId",
  11928. // "summaryAccountId"
  11929. // ],
  11930. // "parameters": {
  11931. // "profileId": {
  11932. // "description": "User profile ID associated with this request.",
  11933. // "format": "int64",
  11934. // "location": "path",
  11935. // "required": true,
  11936. // "type": "string"
  11937. // },
  11938. // "summaryAccountId": {
  11939. // "description": "Account ID.",
  11940. // "format": "int64",
  11941. // "location": "path",
  11942. // "required": true,
  11943. // "type": "string"
  11944. // }
  11945. // },
  11946. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  11947. // "response": {
  11948. // "$ref": "AccountActiveAdSummary"
  11949. // },
  11950. // "scopes": [
  11951. // "https://www.googleapis.com/auth/dfatrafficking"
  11952. // ]
  11953. // }
  11954. }
  11955. // method id "dfareporting.accountPermissionGroups.get":
  11956. type AccountPermissionGroupsGetCall struct {
  11957. s *Service
  11958. profileId int64
  11959. id int64
  11960. urlParams_ gensupport.URLParams
  11961. ifNoneMatch_ string
  11962. ctx_ context.Context
  11963. header_ http.Header
  11964. }
  11965. // Get: Gets one account permission group by ID.
  11966. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  11967. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11968. c.profileId = profileId
  11969. c.id = id
  11970. return c
  11971. }
  11972. // Fields allows partial responses to be retrieved. See
  11973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11974. // for more information.
  11975. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  11976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11977. return c
  11978. }
  11979. // IfNoneMatch sets the optional parameter which makes the operation
  11980. // fail if the object's ETag matches the given value. This is useful for
  11981. // getting updates only after the object has changed since the last
  11982. // request. Use googleapi.IsNotModified to check whether the response
  11983. // error from Do is the result of In-None-Match.
  11984. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  11985. c.ifNoneMatch_ = entityTag
  11986. return c
  11987. }
  11988. // Context sets the context to be used in this call's Do method. Any
  11989. // pending HTTP request will be aborted if the provided context is
  11990. // canceled.
  11991. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  11992. c.ctx_ = ctx
  11993. return c
  11994. }
  11995. // Header returns an http.Header that can be modified by the caller to
  11996. // add HTTP headers to the request.
  11997. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  11998. if c.header_ == nil {
  11999. c.header_ = make(http.Header)
  12000. }
  12001. return c.header_
  12002. }
  12003. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  12004. reqHeaders := make(http.Header)
  12005. for k, v := range c.header_ {
  12006. reqHeaders[k] = v
  12007. }
  12008. reqHeaders.Set("User-Agent", c.s.userAgent())
  12009. if c.ifNoneMatch_ != "" {
  12010. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12011. }
  12012. var body io.Reader = nil
  12013. c.urlParams_.Set("alt", alt)
  12014. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  12015. urls += "?" + c.urlParams_.Encode()
  12016. req, _ := http.NewRequest("GET", urls, body)
  12017. req.Header = reqHeaders
  12018. googleapi.Expand(req.URL, map[string]string{
  12019. "profileId": strconv.FormatInt(c.profileId, 10),
  12020. "id": strconv.FormatInt(c.id, 10),
  12021. })
  12022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12023. }
  12024. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  12025. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  12026. // non-2xx status code is an error. Response headers are in either
  12027. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  12028. // returned at all) in error.(*googleapi.Error).Header. Use
  12029. // googleapi.IsNotModified to check whether the returned error was
  12030. // because http.StatusNotModified was returned.
  12031. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  12032. gensupport.SetOptions(c.urlParams_, opts...)
  12033. res, err := c.doRequest("json")
  12034. if res != nil && res.StatusCode == http.StatusNotModified {
  12035. if res.Body != nil {
  12036. res.Body.Close()
  12037. }
  12038. return nil, &googleapi.Error{
  12039. Code: res.StatusCode,
  12040. Header: res.Header,
  12041. }
  12042. }
  12043. if err != nil {
  12044. return nil, err
  12045. }
  12046. defer googleapi.CloseBody(res)
  12047. if err := googleapi.CheckResponse(res); err != nil {
  12048. return nil, err
  12049. }
  12050. ret := &AccountPermissionGroup{
  12051. ServerResponse: googleapi.ServerResponse{
  12052. Header: res.Header,
  12053. HTTPStatusCode: res.StatusCode,
  12054. },
  12055. }
  12056. target := &ret
  12057. if err := gensupport.DecodeResponse(target, res); err != nil {
  12058. return nil, err
  12059. }
  12060. return ret, nil
  12061. // {
  12062. // "description": "Gets one account permission group by ID.",
  12063. // "httpMethod": "GET",
  12064. // "id": "dfareporting.accountPermissionGroups.get",
  12065. // "parameterOrder": [
  12066. // "profileId",
  12067. // "id"
  12068. // ],
  12069. // "parameters": {
  12070. // "id": {
  12071. // "description": "Account permission group ID.",
  12072. // "format": "int64",
  12073. // "location": "path",
  12074. // "required": true,
  12075. // "type": "string"
  12076. // },
  12077. // "profileId": {
  12078. // "description": "User profile ID associated with this request.",
  12079. // "format": "int64",
  12080. // "location": "path",
  12081. // "required": true,
  12082. // "type": "string"
  12083. // }
  12084. // },
  12085. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  12086. // "response": {
  12087. // "$ref": "AccountPermissionGroup"
  12088. // },
  12089. // "scopes": [
  12090. // "https://www.googleapis.com/auth/dfatrafficking"
  12091. // ]
  12092. // }
  12093. }
  12094. // method id "dfareporting.accountPermissionGroups.list":
  12095. type AccountPermissionGroupsListCall struct {
  12096. s *Service
  12097. profileId int64
  12098. urlParams_ gensupport.URLParams
  12099. ifNoneMatch_ string
  12100. ctx_ context.Context
  12101. header_ http.Header
  12102. }
  12103. // List: Retrieves the list of account permission groups.
  12104. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  12105. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12106. c.profileId = profileId
  12107. return c
  12108. }
  12109. // Fields allows partial responses to be retrieved. See
  12110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12111. // for more information.
  12112. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  12113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12114. return c
  12115. }
  12116. // IfNoneMatch sets the optional parameter which makes the operation
  12117. // fail if the object's ETag matches the given value. This is useful for
  12118. // getting updates only after the object has changed since the last
  12119. // request. Use googleapi.IsNotModified to check whether the response
  12120. // error from Do is the result of In-None-Match.
  12121. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  12122. c.ifNoneMatch_ = entityTag
  12123. return c
  12124. }
  12125. // Context sets the context to be used in this call's Do method. Any
  12126. // pending HTTP request will be aborted if the provided context is
  12127. // canceled.
  12128. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  12129. c.ctx_ = ctx
  12130. return c
  12131. }
  12132. // Header returns an http.Header that can be modified by the caller to
  12133. // add HTTP headers to the request.
  12134. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  12135. if c.header_ == nil {
  12136. c.header_ = make(http.Header)
  12137. }
  12138. return c.header_
  12139. }
  12140. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  12141. reqHeaders := make(http.Header)
  12142. for k, v := range c.header_ {
  12143. reqHeaders[k] = v
  12144. }
  12145. reqHeaders.Set("User-Agent", c.s.userAgent())
  12146. if c.ifNoneMatch_ != "" {
  12147. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12148. }
  12149. var body io.Reader = nil
  12150. c.urlParams_.Set("alt", alt)
  12151. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  12152. urls += "?" + c.urlParams_.Encode()
  12153. req, _ := http.NewRequest("GET", urls, body)
  12154. req.Header = reqHeaders
  12155. googleapi.Expand(req.URL, map[string]string{
  12156. "profileId": strconv.FormatInt(c.profileId, 10),
  12157. })
  12158. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12159. }
  12160. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  12161. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  12162. // non-nil. Any non-2xx status code is an error. Response headers are in
  12163. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  12164. // (if a response was returned at all) in
  12165. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12166. // whether the returned error was because http.StatusNotModified was
  12167. // returned.
  12168. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  12169. gensupport.SetOptions(c.urlParams_, opts...)
  12170. res, err := c.doRequest("json")
  12171. if res != nil && res.StatusCode == http.StatusNotModified {
  12172. if res.Body != nil {
  12173. res.Body.Close()
  12174. }
  12175. return nil, &googleapi.Error{
  12176. Code: res.StatusCode,
  12177. Header: res.Header,
  12178. }
  12179. }
  12180. if err != nil {
  12181. return nil, err
  12182. }
  12183. defer googleapi.CloseBody(res)
  12184. if err := googleapi.CheckResponse(res); err != nil {
  12185. return nil, err
  12186. }
  12187. ret := &AccountPermissionGroupsListResponse{
  12188. ServerResponse: googleapi.ServerResponse{
  12189. Header: res.Header,
  12190. HTTPStatusCode: res.StatusCode,
  12191. },
  12192. }
  12193. target := &ret
  12194. if err := gensupport.DecodeResponse(target, res); err != nil {
  12195. return nil, err
  12196. }
  12197. return ret, nil
  12198. // {
  12199. // "description": "Retrieves the list of account permission groups.",
  12200. // "httpMethod": "GET",
  12201. // "id": "dfareporting.accountPermissionGroups.list",
  12202. // "parameterOrder": [
  12203. // "profileId"
  12204. // ],
  12205. // "parameters": {
  12206. // "profileId": {
  12207. // "description": "User profile ID associated with this request.",
  12208. // "format": "int64",
  12209. // "location": "path",
  12210. // "required": true,
  12211. // "type": "string"
  12212. // }
  12213. // },
  12214. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  12215. // "response": {
  12216. // "$ref": "AccountPermissionGroupsListResponse"
  12217. // },
  12218. // "scopes": [
  12219. // "https://www.googleapis.com/auth/dfatrafficking"
  12220. // ]
  12221. // }
  12222. }
  12223. // method id "dfareporting.accountPermissions.get":
  12224. type AccountPermissionsGetCall struct {
  12225. s *Service
  12226. profileId int64
  12227. id int64
  12228. urlParams_ gensupport.URLParams
  12229. ifNoneMatch_ string
  12230. ctx_ context.Context
  12231. header_ http.Header
  12232. }
  12233. // Get: Gets one account permission by ID.
  12234. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  12235. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12236. c.profileId = profileId
  12237. c.id = id
  12238. return c
  12239. }
  12240. // Fields allows partial responses to be retrieved. See
  12241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12242. // for more information.
  12243. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  12244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12245. return c
  12246. }
  12247. // IfNoneMatch sets the optional parameter which makes the operation
  12248. // fail if the object's ETag matches the given value. This is useful for
  12249. // getting updates only after the object has changed since the last
  12250. // request. Use googleapi.IsNotModified to check whether the response
  12251. // error from Do is the result of In-None-Match.
  12252. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  12253. c.ifNoneMatch_ = entityTag
  12254. return c
  12255. }
  12256. // Context sets the context to be used in this call's Do method. Any
  12257. // pending HTTP request will be aborted if the provided context is
  12258. // canceled.
  12259. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  12260. c.ctx_ = ctx
  12261. return c
  12262. }
  12263. // Header returns an http.Header that can be modified by the caller to
  12264. // add HTTP headers to the request.
  12265. func (c *AccountPermissionsGetCall) Header() http.Header {
  12266. if c.header_ == nil {
  12267. c.header_ = make(http.Header)
  12268. }
  12269. return c.header_
  12270. }
  12271. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12272. reqHeaders := make(http.Header)
  12273. for k, v := range c.header_ {
  12274. reqHeaders[k] = v
  12275. }
  12276. reqHeaders.Set("User-Agent", c.s.userAgent())
  12277. if c.ifNoneMatch_ != "" {
  12278. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12279. }
  12280. var body io.Reader = nil
  12281. c.urlParams_.Set("alt", alt)
  12282. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  12283. urls += "?" + c.urlParams_.Encode()
  12284. req, _ := http.NewRequest("GET", urls, body)
  12285. req.Header = reqHeaders
  12286. googleapi.Expand(req.URL, map[string]string{
  12287. "profileId": strconv.FormatInt(c.profileId, 10),
  12288. "id": strconv.FormatInt(c.id, 10),
  12289. })
  12290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12291. }
  12292. // Do executes the "dfareporting.accountPermissions.get" call.
  12293. // Exactly one of *AccountPermission or error will be non-nil. Any
  12294. // non-2xx status code is an error. Response headers are in either
  12295. // *AccountPermission.ServerResponse.Header or (if a response was
  12296. // returned at all) in error.(*googleapi.Error).Header. Use
  12297. // googleapi.IsNotModified to check whether the returned error was
  12298. // because http.StatusNotModified was returned.
  12299. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  12300. gensupport.SetOptions(c.urlParams_, opts...)
  12301. res, err := c.doRequest("json")
  12302. if res != nil && res.StatusCode == http.StatusNotModified {
  12303. if res.Body != nil {
  12304. res.Body.Close()
  12305. }
  12306. return nil, &googleapi.Error{
  12307. Code: res.StatusCode,
  12308. Header: res.Header,
  12309. }
  12310. }
  12311. if err != nil {
  12312. return nil, err
  12313. }
  12314. defer googleapi.CloseBody(res)
  12315. if err := googleapi.CheckResponse(res); err != nil {
  12316. return nil, err
  12317. }
  12318. ret := &AccountPermission{
  12319. ServerResponse: googleapi.ServerResponse{
  12320. Header: res.Header,
  12321. HTTPStatusCode: res.StatusCode,
  12322. },
  12323. }
  12324. target := &ret
  12325. if err := gensupport.DecodeResponse(target, res); err != nil {
  12326. return nil, err
  12327. }
  12328. return ret, nil
  12329. // {
  12330. // "description": "Gets one account permission by ID.",
  12331. // "httpMethod": "GET",
  12332. // "id": "dfareporting.accountPermissions.get",
  12333. // "parameterOrder": [
  12334. // "profileId",
  12335. // "id"
  12336. // ],
  12337. // "parameters": {
  12338. // "id": {
  12339. // "description": "Account permission ID.",
  12340. // "format": "int64",
  12341. // "location": "path",
  12342. // "required": true,
  12343. // "type": "string"
  12344. // },
  12345. // "profileId": {
  12346. // "description": "User profile ID associated with this request.",
  12347. // "format": "int64",
  12348. // "location": "path",
  12349. // "required": true,
  12350. // "type": "string"
  12351. // }
  12352. // },
  12353. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  12354. // "response": {
  12355. // "$ref": "AccountPermission"
  12356. // },
  12357. // "scopes": [
  12358. // "https://www.googleapis.com/auth/dfatrafficking"
  12359. // ]
  12360. // }
  12361. }
  12362. // method id "dfareporting.accountPermissions.list":
  12363. type AccountPermissionsListCall struct {
  12364. s *Service
  12365. profileId int64
  12366. urlParams_ gensupport.URLParams
  12367. ifNoneMatch_ string
  12368. ctx_ context.Context
  12369. header_ http.Header
  12370. }
  12371. // List: Retrieves the list of account permissions.
  12372. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12373. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12374. c.profileId = profileId
  12375. return c
  12376. }
  12377. // Fields allows partial responses to be retrieved. See
  12378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12379. // for more information.
  12380. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12382. return c
  12383. }
  12384. // IfNoneMatch sets the optional parameter which makes the operation
  12385. // fail if the object's ETag matches the given value. This is useful for
  12386. // getting updates only after the object has changed since the last
  12387. // request. Use googleapi.IsNotModified to check whether the response
  12388. // error from Do is the result of In-None-Match.
  12389. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12390. c.ifNoneMatch_ = entityTag
  12391. return c
  12392. }
  12393. // Context sets the context to be used in this call's Do method. Any
  12394. // pending HTTP request will be aborted if the provided context is
  12395. // canceled.
  12396. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12397. c.ctx_ = ctx
  12398. return c
  12399. }
  12400. // Header returns an http.Header that can be modified by the caller to
  12401. // add HTTP headers to the request.
  12402. func (c *AccountPermissionsListCall) Header() http.Header {
  12403. if c.header_ == nil {
  12404. c.header_ = make(http.Header)
  12405. }
  12406. return c.header_
  12407. }
  12408. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12409. reqHeaders := make(http.Header)
  12410. for k, v := range c.header_ {
  12411. reqHeaders[k] = v
  12412. }
  12413. reqHeaders.Set("User-Agent", c.s.userAgent())
  12414. if c.ifNoneMatch_ != "" {
  12415. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12416. }
  12417. var body io.Reader = nil
  12418. c.urlParams_.Set("alt", alt)
  12419. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12420. urls += "?" + c.urlParams_.Encode()
  12421. req, _ := http.NewRequest("GET", urls, body)
  12422. req.Header = reqHeaders
  12423. googleapi.Expand(req.URL, map[string]string{
  12424. "profileId": strconv.FormatInt(c.profileId, 10),
  12425. })
  12426. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12427. }
  12428. // Do executes the "dfareporting.accountPermissions.list" call.
  12429. // Exactly one of *AccountPermissionsListResponse or error will be
  12430. // non-nil. Any non-2xx status code is an error. Response headers are in
  12431. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12432. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12433. // googleapi.IsNotModified to check whether the returned error was
  12434. // because http.StatusNotModified was returned.
  12435. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12436. gensupport.SetOptions(c.urlParams_, opts...)
  12437. res, err := c.doRequest("json")
  12438. if res != nil && res.StatusCode == http.StatusNotModified {
  12439. if res.Body != nil {
  12440. res.Body.Close()
  12441. }
  12442. return nil, &googleapi.Error{
  12443. Code: res.StatusCode,
  12444. Header: res.Header,
  12445. }
  12446. }
  12447. if err != nil {
  12448. return nil, err
  12449. }
  12450. defer googleapi.CloseBody(res)
  12451. if err := googleapi.CheckResponse(res); err != nil {
  12452. return nil, err
  12453. }
  12454. ret := &AccountPermissionsListResponse{
  12455. ServerResponse: googleapi.ServerResponse{
  12456. Header: res.Header,
  12457. HTTPStatusCode: res.StatusCode,
  12458. },
  12459. }
  12460. target := &ret
  12461. if err := gensupport.DecodeResponse(target, res); err != nil {
  12462. return nil, err
  12463. }
  12464. return ret, nil
  12465. // {
  12466. // "description": "Retrieves the list of account permissions.",
  12467. // "httpMethod": "GET",
  12468. // "id": "dfareporting.accountPermissions.list",
  12469. // "parameterOrder": [
  12470. // "profileId"
  12471. // ],
  12472. // "parameters": {
  12473. // "profileId": {
  12474. // "description": "User profile ID associated with this request.",
  12475. // "format": "int64",
  12476. // "location": "path",
  12477. // "required": true,
  12478. // "type": "string"
  12479. // }
  12480. // },
  12481. // "path": "userprofiles/{profileId}/accountPermissions",
  12482. // "response": {
  12483. // "$ref": "AccountPermissionsListResponse"
  12484. // },
  12485. // "scopes": [
  12486. // "https://www.googleapis.com/auth/dfatrafficking"
  12487. // ]
  12488. // }
  12489. }
  12490. // method id "dfareporting.accountUserProfiles.get":
  12491. type AccountUserProfilesGetCall struct {
  12492. s *Service
  12493. profileId int64
  12494. id int64
  12495. urlParams_ gensupport.URLParams
  12496. ifNoneMatch_ string
  12497. ctx_ context.Context
  12498. header_ http.Header
  12499. }
  12500. // Get: Gets one account user profile by ID.
  12501. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12502. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12503. c.profileId = profileId
  12504. c.id = id
  12505. return c
  12506. }
  12507. // Fields allows partial responses to be retrieved. See
  12508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12509. // for more information.
  12510. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12512. return c
  12513. }
  12514. // IfNoneMatch sets the optional parameter which makes the operation
  12515. // fail if the object's ETag matches the given value. This is useful for
  12516. // getting updates only after the object has changed since the last
  12517. // request. Use googleapi.IsNotModified to check whether the response
  12518. // error from Do is the result of In-None-Match.
  12519. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12520. c.ifNoneMatch_ = entityTag
  12521. return c
  12522. }
  12523. // Context sets the context to be used in this call's Do method. Any
  12524. // pending HTTP request will be aborted if the provided context is
  12525. // canceled.
  12526. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12527. c.ctx_ = ctx
  12528. return c
  12529. }
  12530. // Header returns an http.Header that can be modified by the caller to
  12531. // add HTTP headers to the request.
  12532. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12533. if c.header_ == nil {
  12534. c.header_ = make(http.Header)
  12535. }
  12536. return c.header_
  12537. }
  12538. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12539. reqHeaders := make(http.Header)
  12540. for k, v := range c.header_ {
  12541. reqHeaders[k] = v
  12542. }
  12543. reqHeaders.Set("User-Agent", c.s.userAgent())
  12544. if c.ifNoneMatch_ != "" {
  12545. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12546. }
  12547. var body io.Reader = nil
  12548. c.urlParams_.Set("alt", alt)
  12549. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12550. urls += "?" + c.urlParams_.Encode()
  12551. req, _ := http.NewRequest("GET", urls, body)
  12552. req.Header = reqHeaders
  12553. googleapi.Expand(req.URL, map[string]string{
  12554. "profileId": strconv.FormatInt(c.profileId, 10),
  12555. "id": strconv.FormatInt(c.id, 10),
  12556. })
  12557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12558. }
  12559. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12560. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12561. // non-2xx status code is an error. Response headers are in either
  12562. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12563. // returned at all) in error.(*googleapi.Error).Header. Use
  12564. // googleapi.IsNotModified to check whether the returned error was
  12565. // because http.StatusNotModified was returned.
  12566. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12567. gensupport.SetOptions(c.urlParams_, opts...)
  12568. res, err := c.doRequest("json")
  12569. if res != nil && res.StatusCode == http.StatusNotModified {
  12570. if res.Body != nil {
  12571. res.Body.Close()
  12572. }
  12573. return nil, &googleapi.Error{
  12574. Code: res.StatusCode,
  12575. Header: res.Header,
  12576. }
  12577. }
  12578. if err != nil {
  12579. return nil, err
  12580. }
  12581. defer googleapi.CloseBody(res)
  12582. if err := googleapi.CheckResponse(res); err != nil {
  12583. return nil, err
  12584. }
  12585. ret := &AccountUserProfile{
  12586. ServerResponse: googleapi.ServerResponse{
  12587. Header: res.Header,
  12588. HTTPStatusCode: res.StatusCode,
  12589. },
  12590. }
  12591. target := &ret
  12592. if err := gensupport.DecodeResponse(target, res); err != nil {
  12593. return nil, err
  12594. }
  12595. return ret, nil
  12596. // {
  12597. // "description": "Gets one account user profile by ID.",
  12598. // "httpMethod": "GET",
  12599. // "id": "dfareporting.accountUserProfiles.get",
  12600. // "parameterOrder": [
  12601. // "profileId",
  12602. // "id"
  12603. // ],
  12604. // "parameters": {
  12605. // "id": {
  12606. // "description": "User profile ID.",
  12607. // "format": "int64",
  12608. // "location": "path",
  12609. // "required": true,
  12610. // "type": "string"
  12611. // },
  12612. // "profileId": {
  12613. // "description": "User profile ID associated with this request.",
  12614. // "format": "int64",
  12615. // "location": "path",
  12616. // "required": true,
  12617. // "type": "string"
  12618. // }
  12619. // },
  12620. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12621. // "response": {
  12622. // "$ref": "AccountUserProfile"
  12623. // },
  12624. // "scopes": [
  12625. // "https://www.googleapis.com/auth/dfatrafficking"
  12626. // ]
  12627. // }
  12628. }
  12629. // method id "dfareporting.accountUserProfiles.insert":
  12630. type AccountUserProfilesInsertCall struct {
  12631. s *Service
  12632. profileId int64
  12633. accountuserprofile *AccountUserProfile
  12634. urlParams_ gensupport.URLParams
  12635. ctx_ context.Context
  12636. header_ http.Header
  12637. }
  12638. // Insert: Inserts a new account user profile.
  12639. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12640. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12641. c.profileId = profileId
  12642. c.accountuserprofile = accountuserprofile
  12643. return c
  12644. }
  12645. // Fields allows partial responses to be retrieved. See
  12646. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12647. // for more information.
  12648. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12649. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12650. return c
  12651. }
  12652. // Context sets the context to be used in this call's Do method. Any
  12653. // pending HTTP request will be aborted if the provided context is
  12654. // canceled.
  12655. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12656. c.ctx_ = ctx
  12657. return c
  12658. }
  12659. // Header returns an http.Header that can be modified by the caller to
  12660. // add HTTP headers to the request.
  12661. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12662. if c.header_ == nil {
  12663. c.header_ = make(http.Header)
  12664. }
  12665. return c.header_
  12666. }
  12667. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12668. reqHeaders := make(http.Header)
  12669. for k, v := range c.header_ {
  12670. reqHeaders[k] = v
  12671. }
  12672. reqHeaders.Set("User-Agent", c.s.userAgent())
  12673. var body io.Reader = nil
  12674. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12675. if err != nil {
  12676. return nil, err
  12677. }
  12678. reqHeaders.Set("Content-Type", "application/json")
  12679. c.urlParams_.Set("alt", alt)
  12680. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12681. urls += "?" + c.urlParams_.Encode()
  12682. req, _ := http.NewRequest("POST", urls, body)
  12683. req.Header = reqHeaders
  12684. googleapi.Expand(req.URL, map[string]string{
  12685. "profileId": strconv.FormatInt(c.profileId, 10),
  12686. })
  12687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12688. }
  12689. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12690. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12691. // non-2xx status code is an error. Response headers are in either
  12692. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12693. // returned at all) in error.(*googleapi.Error).Header. Use
  12694. // googleapi.IsNotModified to check whether the returned error was
  12695. // because http.StatusNotModified was returned.
  12696. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12697. gensupport.SetOptions(c.urlParams_, opts...)
  12698. res, err := c.doRequest("json")
  12699. if res != nil && res.StatusCode == http.StatusNotModified {
  12700. if res.Body != nil {
  12701. res.Body.Close()
  12702. }
  12703. return nil, &googleapi.Error{
  12704. Code: res.StatusCode,
  12705. Header: res.Header,
  12706. }
  12707. }
  12708. if err != nil {
  12709. return nil, err
  12710. }
  12711. defer googleapi.CloseBody(res)
  12712. if err := googleapi.CheckResponse(res); err != nil {
  12713. return nil, err
  12714. }
  12715. ret := &AccountUserProfile{
  12716. ServerResponse: googleapi.ServerResponse{
  12717. Header: res.Header,
  12718. HTTPStatusCode: res.StatusCode,
  12719. },
  12720. }
  12721. target := &ret
  12722. if err := gensupport.DecodeResponse(target, res); err != nil {
  12723. return nil, err
  12724. }
  12725. return ret, nil
  12726. // {
  12727. // "description": "Inserts a new account user profile.",
  12728. // "httpMethod": "POST",
  12729. // "id": "dfareporting.accountUserProfiles.insert",
  12730. // "parameterOrder": [
  12731. // "profileId"
  12732. // ],
  12733. // "parameters": {
  12734. // "profileId": {
  12735. // "description": "User profile ID associated with this request.",
  12736. // "format": "int64",
  12737. // "location": "path",
  12738. // "required": true,
  12739. // "type": "string"
  12740. // }
  12741. // },
  12742. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12743. // "request": {
  12744. // "$ref": "AccountUserProfile"
  12745. // },
  12746. // "response": {
  12747. // "$ref": "AccountUserProfile"
  12748. // },
  12749. // "scopes": [
  12750. // "https://www.googleapis.com/auth/dfatrafficking"
  12751. // ]
  12752. // }
  12753. }
  12754. // method id "dfareporting.accountUserProfiles.list":
  12755. type AccountUserProfilesListCall struct {
  12756. s *Service
  12757. profileId int64
  12758. urlParams_ gensupport.URLParams
  12759. ifNoneMatch_ string
  12760. ctx_ context.Context
  12761. header_ http.Header
  12762. }
  12763. // List: Retrieves a list of account user profiles, possibly filtered.
  12764. // This method supports paging.
  12765. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12766. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12767. c.profileId = profileId
  12768. return c
  12769. }
  12770. // Active sets the optional parameter "active": Select only active user
  12771. // profiles.
  12772. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12773. c.urlParams_.Set("active", fmt.Sprint(active))
  12774. return c
  12775. }
  12776. // Ids sets the optional parameter "ids": Select only user profiles with
  12777. // these IDs.
  12778. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12779. var ids_ []string
  12780. for _, v := range ids {
  12781. ids_ = append(ids_, fmt.Sprint(v))
  12782. }
  12783. c.urlParams_.SetMulti("ids", ids_)
  12784. return c
  12785. }
  12786. // MaxResults sets the optional parameter "maxResults": Maximum number
  12787. // of results to return.
  12788. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12789. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12790. return c
  12791. }
  12792. // PageToken sets the optional parameter "pageToken": Value of the
  12793. // nextPageToken from the previous result page.
  12794. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12795. c.urlParams_.Set("pageToken", pageToken)
  12796. return c
  12797. }
  12798. // SearchString sets the optional parameter "searchString": Allows
  12799. // searching for objects by name, ID or email. Wildcards (*) are
  12800. // allowed. For example, "user profile*2015" will return objects with
  12801. // names like "user profile June 2015", "user profile April 2015", or
  12802. // simply "user profile 2015". Most of the searches also add wildcards
  12803. // implicitly at the start and the end of the search string. For
  12804. // example, a search string of "user profile" will match objects with
  12805. // name "my user profile", "user profile 2015", or simply "user
  12806. // profile".
  12807. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12808. c.urlParams_.Set("searchString", searchString)
  12809. return c
  12810. }
  12811. // SortField sets the optional parameter "sortField": Field by which to
  12812. // sort the list.
  12813. //
  12814. // Possible values:
  12815. // "ID" (default)
  12816. // "NAME"
  12817. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12818. c.urlParams_.Set("sortField", sortField)
  12819. return c
  12820. }
  12821. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12822. // results.
  12823. //
  12824. // Possible values:
  12825. // "ASCENDING" (default)
  12826. // "DESCENDING"
  12827. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12828. c.urlParams_.Set("sortOrder", sortOrder)
  12829. return c
  12830. }
  12831. // SubaccountId sets the optional parameter "subaccountId": Select only
  12832. // user profiles with the specified subaccount ID.
  12833. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12834. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12835. return c
  12836. }
  12837. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12838. // profiles with the specified user role ID.
  12839. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12840. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12841. return c
  12842. }
  12843. // Fields allows partial responses to be retrieved. See
  12844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12845. // for more information.
  12846. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12848. return c
  12849. }
  12850. // IfNoneMatch sets the optional parameter which makes the operation
  12851. // fail if the object's ETag matches the given value. This is useful for
  12852. // getting updates only after the object has changed since the last
  12853. // request. Use googleapi.IsNotModified to check whether the response
  12854. // error from Do is the result of In-None-Match.
  12855. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12856. c.ifNoneMatch_ = entityTag
  12857. return c
  12858. }
  12859. // Context sets the context to be used in this call's Do method. Any
  12860. // pending HTTP request will be aborted if the provided context is
  12861. // canceled.
  12862. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12863. c.ctx_ = ctx
  12864. return c
  12865. }
  12866. // Header returns an http.Header that can be modified by the caller to
  12867. // add HTTP headers to the request.
  12868. func (c *AccountUserProfilesListCall) Header() http.Header {
  12869. if c.header_ == nil {
  12870. c.header_ = make(http.Header)
  12871. }
  12872. return c.header_
  12873. }
  12874. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12875. reqHeaders := make(http.Header)
  12876. for k, v := range c.header_ {
  12877. reqHeaders[k] = v
  12878. }
  12879. reqHeaders.Set("User-Agent", c.s.userAgent())
  12880. if c.ifNoneMatch_ != "" {
  12881. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12882. }
  12883. var body io.Reader = nil
  12884. c.urlParams_.Set("alt", alt)
  12885. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12886. urls += "?" + c.urlParams_.Encode()
  12887. req, _ := http.NewRequest("GET", urls, body)
  12888. req.Header = reqHeaders
  12889. googleapi.Expand(req.URL, map[string]string{
  12890. "profileId": strconv.FormatInt(c.profileId, 10),
  12891. })
  12892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12893. }
  12894. // Do executes the "dfareporting.accountUserProfiles.list" call.
  12895. // Exactly one of *AccountUserProfilesListResponse or error will be
  12896. // non-nil. Any non-2xx status code is an error. Response headers are in
  12897. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  12898. // a response was returned at all) in error.(*googleapi.Error).Header.
  12899. // Use googleapi.IsNotModified to check whether the returned error was
  12900. // because http.StatusNotModified was returned.
  12901. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  12902. gensupport.SetOptions(c.urlParams_, opts...)
  12903. res, err := c.doRequest("json")
  12904. if res != nil && res.StatusCode == http.StatusNotModified {
  12905. if res.Body != nil {
  12906. res.Body.Close()
  12907. }
  12908. return nil, &googleapi.Error{
  12909. Code: res.StatusCode,
  12910. Header: res.Header,
  12911. }
  12912. }
  12913. if err != nil {
  12914. return nil, err
  12915. }
  12916. defer googleapi.CloseBody(res)
  12917. if err := googleapi.CheckResponse(res); err != nil {
  12918. return nil, err
  12919. }
  12920. ret := &AccountUserProfilesListResponse{
  12921. ServerResponse: googleapi.ServerResponse{
  12922. Header: res.Header,
  12923. HTTPStatusCode: res.StatusCode,
  12924. },
  12925. }
  12926. target := &ret
  12927. if err := gensupport.DecodeResponse(target, res); err != nil {
  12928. return nil, err
  12929. }
  12930. return ret, nil
  12931. // {
  12932. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  12933. // "httpMethod": "GET",
  12934. // "id": "dfareporting.accountUserProfiles.list",
  12935. // "parameterOrder": [
  12936. // "profileId"
  12937. // ],
  12938. // "parameters": {
  12939. // "active": {
  12940. // "description": "Select only active user profiles.",
  12941. // "location": "query",
  12942. // "type": "boolean"
  12943. // },
  12944. // "ids": {
  12945. // "description": "Select only user profiles with these IDs.",
  12946. // "format": "int64",
  12947. // "location": "query",
  12948. // "repeated": true,
  12949. // "type": "string"
  12950. // },
  12951. // "maxResults": {
  12952. // "default": "1000",
  12953. // "description": "Maximum number of results to return.",
  12954. // "format": "int32",
  12955. // "location": "query",
  12956. // "maximum": "1000",
  12957. // "minimum": "0",
  12958. // "type": "integer"
  12959. // },
  12960. // "pageToken": {
  12961. // "description": "Value of the nextPageToken from the previous result page.",
  12962. // "location": "query",
  12963. // "type": "string"
  12964. // },
  12965. // "profileId": {
  12966. // "description": "User profile ID associated with this request.",
  12967. // "format": "int64",
  12968. // "location": "path",
  12969. // "required": true,
  12970. // "type": "string"
  12971. // },
  12972. // "searchString": {
  12973. // "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\".",
  12974. // "location": "query",
  12975. // "type": "string"
  12976. // },
  12977. // "sortField": {
  12978. // "default": "ID",
  12979. // "description": "Field by which to sort the list.",
  12980. // "enum": [
  12981. // "ID",
  12982. // "NAME"
  12983. // ],
  12984. // "enumDescriptions": [
  12985. // "",
  12986. // ""
  12987. // ],
  12988. // "location": "query",
  12989. // "type": "string"
  12990. // },
  12991. // "sortOrder": {
  12992. // "default": "ASCENDING",
  12993. // "description": "Order of sorted results.",
  12994. // "enum": [
  12995. // "ASCENDING",
  12996. // "DESCENDING"
  12997. // ],
  12998. // "enumDescriptions": [
  12999. // "",
  13000. // ""
  13001. // ],
  13002. // "location": "query",
  13003. // "type": "string"
  13004. // },
  13005. // "subaccountId": {
  13006. // "description": "Select only user profiles with the specified subaccount ID.",
  13007. // "format": "int64",
  13008. // "location": "query",
  13009. // "type": "string"
  13010. // },
  13011. // "userRoleId": {
  13012. // "description": "Select only user profiles with the specified user role ID.",
  13013. // "format": "int64",
  13014. // "location": "query",
  13015. // "type": "string"
  13016. // }
  13017. // },
  13018. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13019. // "response": {
  13020. // "$ref": "AccountUserProfilesListResponse"
  13021. // },
  13022. // "scopes": [
  13023. // "https://www.googleapis.com/auth/dfatrafficking"
  13024. // ]
  13025. // }
  13026. }
  13027. // Pages invokes f for each page of results.
  13028. // A non-nil error returned from f will halt the iteration.
  13029. // The provided context supersedes any context provided to the Context method.
  13030. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  13031. c.ctx_ = ctx
  13032. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13033. for {
  13034. x, err := c.Do()
  13035. if err != nil {
  13036. return err
  13037. }
  13038. if err := f(x); err != nil {
  13039. return err
  13040. }
  13041. if x.NextPageToken == "" {
  13042. return nil
  13043. }
  13044. c.PageToken(x.NextPageToken)
  13045. }
  13046. }
  13047. // method id "dfareporting.accountUserProfiles.patch":
  13048. type AccountUserProfilesPatchCall struct {
  13049. s *Service
  13050. profileId int64
  13051. accountuserprofile *AccountUserProfile
  13052. urlParams_ gensupport.URLParams
  13053. ctx_ context.Context
  13054. header_ http.Header
  13055. }
  13056. // Patch: Updates an existing account user profile. This method supports
  13057. // patch semantics.
  13058. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  13059. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13060. c.profileId = profileId
  13061. c.urlParams_.Set("id", fmt.Sprint(id))
  13062. c.accountuserprofile = accountuserprofile
  13063. return c
  13064. }
  13065. // Fields allows partial responses to be retrieved. See
  13066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13067. // for more information.
  13068. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  13069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13070. return c
  13071. }
  13072. // Context sets the context to be used in this call's Do method. Any
  13073. // pending HTTP request will be aborted if the provided context is
  13074. // canceled.
  13075. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  13076. c.ctx_ = ctx
  13077. return c
  13078. }
  13079. // Header returns an http.Header that can be modified by the caller to
  13080. // add HTTP headers to the request.
  13081. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  13082. if c.header_ == nil {
  13083. c.header_ = make(http.Header)
  13084. }
  13085. return c.header_
  13086. }
  13087. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  13088. reqHeaders := make(http.Header)
  13089. for k, v := range c.header_ {
  13090. reqHeaders[k] = v
  13091. }
  13092. reqHeaders.Set("User-Agent", c.s.userAgent())
  13093. var body io.Reader = nil
  13094. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13095. if err != nil {
  13096. return nil, err
  13097. }
  13098. reqHeaders.Set("Content-Type", "application/json")
  13099. c.urlParams_.Set("alt", alt)
  13100. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13101. urls += "?" + c.urlParams_.Encode()
  13102. req, _ := http.NewRequest("PATCH", urls, body)
  13103. req.Header = reqHeaders
  13104. googleapi.Expand(req.URL, map[string]string{
  13105. "profileId": strconv.FormatInt(c.profileId, 10),
  13106. })
  13107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13108. }
  13109. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  13110. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13111. // non-2xx status code is an error. Response headers are in either
  13112. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13113. // returned at all) in error.(*googleapi.Error).Header. Use
  13114. // googleapi.IsNotModified to check whether the returned error was
  13115. // because http.StatusNotModified was returned.
  13116. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13117. gensupport.SetOptions(c.urlParams_, opts...)
  13118. res, err := c.doRequest("json")
  13119. if res != nil && res.StatusCode == http.StatusNotModified {
  13120. if res.Body != nil {
  13121. res.Body.Close()
  13122. }
  13123. return nil, &googleapi.Error{
  13124. Code: res.StatusCode,
  13125. Header: res.Header,
  13126. }
  13127. }
  13128. if err != nil {
  13129. return nil, err
  13130. }
  13131. defer googleapi.CloseBody(res)
  13132. if err := googleapi.CheckResponse(res); err != nil {
  13133. return nil, err
  13134. }
  13135. ret := &AccountUserProfile{
  13136. ServerResponse: googleapi.ServerResponse{
  13137. Header: res.Header,
  13138. HTTPStatusCode: res.StatusCode,
  13139. },
  13140. }
  13141. target := &ret
  13142. if err := gensupport.DecodeResponse(target, res); err != nil {
  13143. return nil, err
  13144. }
  13145. return ret, nil
  13146. // {
  13147. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  13148. // "httpMethod": "PATCH",
  13149. // "id": "dfareporting.accountUserProfiles.patch",
  13150. // "parameterOrder": [
  13151. // "profileId",
  13152. // "id"
  13153. // ],
  13154. // "parameters": {
  13155. // "id": {
  13156. // "description": "User profile ID.",
  13157. // "format": "int64",
  13158. // "location": "query",
  13159. // "required": true,
  13160. // "type": "string"
  13161. // },
  13162. // "profileId": {
  13163. // "description": "User profile ID associated with this request.",
  13164. // "format": "int64",
  13165. // "location": "path",
  13166. // "required": true,
  13167. // "type": "string"
  13168. // }
  13169. // },
  13170. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13171. // "request": {
  13172. // "$ref": "AccountUserProfile"
  13173. // },
  13174. // "response": {
  13175. // "$ref": "AccountUserProfile"
  13176. // },
  13177. // "scopes": [
  13178. // "https://www.googleapis.com/auth/dfatrafficking"
  13179. // ]
  13180. // }
  13181. }
  13182. // method id "dfareporting.accountUserProfiles.update":
  13183. type AccountUserProfilesUpdateCall struct {
  13184. s *Service
  13185. profileId int64
  13186. accountuserprofile *AccountUserProfile
  13187. urlParams_ gensupport.URLParams
  13188. ctx_ context.Context
  13189. header_ http.Header
  13190. }
  13191. // Update: Updates an existing account user profile.
  13192. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  13193. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13194. c.profileId = profileId
  13195. c.accountuserprofile = accountuserprofile
  13196. return c
  13197. }
  13198. // Fields allows partial responses to be retrieved. See
  13199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13200. // for more information.
  13201. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  13202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13203. return c
  13204. }
  13205. // Context sets the context to be used in this call's Do method. Any
  13206. // pending HTTP request will be aborted if the provided context is
  13207. // canceled.
  13208. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  13209. c.ctx_ = ctx
  13210. return c
  13211. }
  13212. // Header returns an http.Header that can be modified by the caller to
  13213. // add HTTP headers to the request.
  13214. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  13215. if c.header_ == nil {
  13216. c.header_ = make(http.Header)
  13217. }
  13218. return c.header_
  13219. }
  13220. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13221. reqHeaders := make(http.Header)
  13222. for k, v := range c.header_ {
  13223. reqHeaders[k] = v
  13224. }
  13225. reqHeaders.Set("User-Agent", c.s.userAgent())
  13226. var body io.Reader = nil
  13227. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13228. if err != nil {
  13229. return nil, err
  13230. }
  13231. reqHeaders.Set("Content-Type", "application/json")
  13232. c.urlParams_.Set("alt", alt)
  13233. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13234. urls += "?" + c.urlParams_.Encode()
  13235. req, _ := http.NewRequest("PUT", urls, body)
  13236. req.Header = reqHeaders
  13237. googleapi.Expand(req.URL, map[string]string{
  13238. "profileId": strconv.FormatInt(c.profileId, 10),
  13239. })
  13240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13241. }
  13242. // Do executes the "dfareporting.accountUserProfiles.update" call.
  13243. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13244. // non-2xx status code is an error. Response headers are in either
  13245. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13246. // returned at all) in error.(*googleapi.Error).Header. Use
  13247. // googleapi.IsNotModified to check whether the returned error was
  13248. // because http.StatusNotModified was returned.
  13249. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13250. gensupport.SetOptions(c.urlParams_, opts...)
  13251. res, err := c.doRequest("json")
  13252. if res != nil && res.StatusCode == http.StatusNotModified {
  13253. if res.Body != nil {
  13254. res.Body.Close()
  13255. }
  13256. return nil, &googleapi.Error{
  13257. Code: res.StatusCode,
  13258. Header: res.Header,
  13259. }
  13260. }
  13261. if err != nil {
  13262. return nil, err
  13263. }
  13264. defer googleapi.CloseBody(res)
  13265. if err := googleapi.CheckResponse(res); err != nil {
  13266. return nil, err
  13267. }
  13268. ret := &AccountUserProfile{
  13269. ServerResponse: googleapi.ServerResponse{
  13270. Header: res.Header,
  13271. HTTPStatusCode: res.StatusCode,
  13272. },
  13273. }
  13274. target := &ret
  13275. if err := gensupport.DecodeResponse(target, res); err != nil {
  13276. return nil, err
  13277. }
  13278. return ret, nil
  13279. // {
  13280. // "description": "Updates an existing account user profile.",
  13281. // "httpMethod": "PUT",
  13282. // "id": "dfareporting.accountUserProfiles.update",
  13283. // "parameterOrder": [
  13284. // "profileId"
  13285. // ],
  13286. // "parameters": {
  13287. // "profileId": {
  13288. // "description": "User profile ID associated with this request.",
  13289. // "format": "int64",
  13290. // "location": "path",
  13291. // "required": true,
  13292. // "type": "string"
  13293. // }
  13294. // },
  13295. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13296. // "request": {
  13297. // "$ref": "AccountUserProfile"
  13298. // },
  13299. // "response": {
  13300. // "$ref": "AccountUserProfile"
  13301. // },
  13302. // "scopes": [
  13303. // "https://www.googleapis.com/auth/dfatrafficking"
  13304. // ]
  13305. // }
  13306. }
  13307. // method id "dfareporting.accounts.get":
  13308. type AccountsGetCall struct {
  13309. s *Service
  13310. profileId int64
  13311. id int64
  13312. urlParams_ gensupport.URLParams
  13313. ifNoneMatch_ string
  13314. ctx_ context.Context
  13315. header_ http.Header
  13316. }
  13317. // Get: Gets one account by ID.
  13318. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  13319. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13320. c.profileId = profileId
  13321. c.id = id
  13322. return c
  13323. }
  13324. // Fields allows partial responses to be retrieved. See
  13325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13326. // for more information.
  13327. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  13328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13329. return c
  13330. }
  13331. // IfNoneMatch sets the optional parameter which makes the operation
  13332. // fail if the object's ETag matches the given value. This is useful for
  13333. // getting updates only after the object has changed since the last
  13334. // request. Use googleapi.IsNotModified to check whether the response
  13335. // error from Do is the result of In-None-Match.
  13336. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  13337. c.ifNoneMatch_ = entityTag
  13338. return c
  13339. }
  13340. // Context sets the context to be used in this call's Do method. Any
  13341. // pending HTTP request will be aborted if the provided context is
  13342. // canceled.
  13343. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  13344. c.ctx_ = ctx
  13345. return c
  13346. }
  13347. // Header returns an http.Header that can be modified by the caller to
  13348. // add HTTP headers to the request.
  13349. func (c *AccountsGetCall) Header() http.Header {
  13350. if c.header_ == nil {
  13351. c.header_ = make(http.Header)
  13352. }
  13353. return c.header_
  13354. }
  13355. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  13356. reqHeaders := make(http.Header)
  13357. for k, v := range c.header_ {
  13358. reqHeaders[k] = v
  13359. }
  13360. reqHeaders.Set("User-Agent", c.s.userAgent())
  13361. if c.ifNoneMatch_ != "" {
  13362. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13363. }
  13364. var body io.Reader = nil
  13365. c.urlParams_.Set("alt", alt)
  13366. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13367. urls += "?" + c.urlParams_.Encode()
  13368. req, _ := http.NewRequest("GET", urls, body)
  13369. req.Header = reqHeaders
  13370. googleapi.Expand(req.URL, map[string]string{
  13371. "profileId": strconv.FormatInt(c.profileId, 10),
  13372. "id": strconv.FormatInt(c.id, 10),
  13373. })
  13374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13375. }
  13376. // Do executes the "dfareporting.accounts.get" call.
  13377. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13378. // code is an error. Response headers are in either
  13379. // *Account.ServerResponse.Header or (if a response was returned at all)
  13380. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13381. // check whether the returned error was because http.StatusNotModified
  13382. // was returned.
  13383. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13384. gensupport.SetOptions(c.urlParams_, opts...)
  13385. res, err := c.doRequest("json")
  13386. if res != nil && res.StatusCode == http.StatusNotModified {
  13387. if res.Body != nil {
  13388. res.Body.Close()
  13389. }
  13390. return nil, &googleapi.Error{
  13391. Code: res.StatusCode,
  13392. Header: res.Header,
  13393. }
  13394. }
  13395. if err != nil {
  13396. return nil, err
  13397. }
  13398. defer googleapi.CloseBody(res)
  13399. if err := googleapi.CheckResponse(res); err != nil {
  13400. return nil, err
  13401. }
  13402. ret := &Account{
  13403. ServerResponse: googleapi.ServerResponse{
  13404. Header: res.Header,
  13405. HTTPStatusCode: res.StatusCode,
  13406. },
  13407. }
  13408. target := &ret
  13409. if err := gensupport.DecodeResponse(target, res); err != nil {
  13410. return nil, err
  13411. }
  13412. return ret, nil
  13413. // {
  13414. // "description": "Gets one account by ID.",
  13415. // "httpMethod": "GET",
  13416. // "id": "dfareporting.accounts.get",
  13417. // "parameterOrder": [
  13418. // "profileId",
  13419. // "id"
  13420. // ],
  13421. // "parameters": {
  13422. // "id": {
  13423. // "description": "Account ID.",
  13424. // "format": "int64",
  13425. // "location": "path",
  13426. // "required": true,
  13427. // "type": "string"
  13428. // },
  13429. // "profileId": {
  13430. // "description": "User profile ID associated with this request.",
  13431. // "format": "int64",
  13432. // "location": "path",
  13433. // "required": true,
  13434. // "type": "string"
  13435. // }
  13436. // },
  13437. // "path": "userprofiles/{profileId}/accounts/{id}",
  13438. // "response": {
  13439. // "$ref": "Account"
  13440. // },
  13441. // "scopes": [
  13442. // "https://www.googleapis.com/auth/dfatrafficking"
  13443. // ]
  13444. // }
  13445. }
  13446. // method id "dfareporting.accounts.list":
  13447. type AccountsListCall struct {
  13448. s *Service
  13449. profileId int64
  13450. urlParams_ gensupport.URLParams
  13451. ifNoneMatch_ string
  13452. ctx_ context.Context
  13453. header_ http.Header
  13454. }
  13455. // List: Retrieves the list of accounts, possibly filtered. This method
  13456. // supports paging.
  13457. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13458. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13459. c.profileId = profileId
  13460. return c
  13461. }
  13462. // Active sets the optional parameter "active": Select only active
  13463. // accounts. Don't set this field to select both active and non-active
  13464. // accounts.
  13465. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13466. c.urlParams_.Set("active", fmt.Sprint(active))
  13467. return c
  13468. }
  13469. // Ids sets the optional parameter "ids": Select only accounts with
  13470. // these IDs.
  13471. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13472. var ids_ []string
  13473. for _, v := range ids {
  13474. ids_ = append(ids_, fmt.Sprint(v))
  13475. }
  13476. c.urlParams_.SetMulti("ids", ids_)
  13477. return c
  13478. }
  13479. // MaxResults sets the optional parameter "maxResults": Maximum number
  13480. // of results to return.
  13481. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13482. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13483. return c
  13484. }
  13485. // PageToken sets the optional parameter "pageToken": Value of the
  13486. // nextPageToken from the previous result page.
  13487. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13488. c.urlParams_.Set("pageToken", pageToken)
  13489. return c
  13490. }
  13491. // SearchString sets the optional parameter "searchString": Allows
  13492. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13493. // example, "account*2015" will return objects with names like "account
  13494. // June 2015", "account April 2015", or simply "account 2015". Most of
  13495. // the searches also add wildcards implicitly at the start and the end
  13496. // of the search string. For example, a search string of "account" will
  13497. // match objects with name "my account", "account 2015", or simply
  13498. // "account".
  13499. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13500. c.urlParams_.Set("searchString", searchString)
  13501. return c
  13502. }
  13503. // SortField sets the optional parameter "sortField": Field by which to
  13504. // sort the list.
  13505. //
  13506. // Possible values:
  13507. // "ID" (default)
  13508. // "NAME"
  13509. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13510. c.urlParams_.Set("sortField", sortField)
  13511. return c
  13512. }
  13513. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13514. // results.
  13515. //
  13516. // Possible values:
  13517. // "ASCENDING" (default)
  13518. // "DESCENDING"
  13519. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13520. c.urlParams_.Set("sortOrder", sortOrder)
  13521. return c
  13522. }
  13523. // Fields allows partial responses to be retrieved. See
  13524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13525. // for more information.
  13526. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13528. return c
  13529. }
  13530. // IfNoneMatch sets the optional parameter which makes the operation
  13531. // fail if the object's ETag matches the given value. This is useful for
  13532. // getting updates only after the object has changed since the last
  13533. // request. Use googleapi.IsNotModified to check whether the response
  13534. // error from Do is the result of In-None-Match.
  13535. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13536. c.ifNoneMatch_ = entityTag
  13537. return c
  13538. }
  13539. // Context sets the context to be used in this call's Do method. Any
  13540. // pending HTTP request will be aborted if the provided context is
  13541. // canceled.
  13542. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13543. c.ctx_ = ctx
  13544. return c
  13545. }
  13546. // Header returns an http.Header that can be modified by the caller to
  13547. // add HTTP headers to the request.
  13548. func (c *AccountsListCall) Header() http.Header {
  13549. if c.header_ == nil {
  13550. c.header_ = make(http.Header)
  13551. }
  13552. return c.header_
  13553. }
  13554. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13555. reqHeaders := make(http.Header)
  13556. for k, v := range c.header_ {
  13557. reqHeaders[k] = v
  13558. }
  13559. reqHeaders.Set("User-Agent", c.s.userAgent())
  13560. if c.ifNoneMatch_ != "" {
  13561. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13562. }
  13563. var body io.Reader = nil
  13564. c.urlParams_.Set("alt", alt)
  13565. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13566. urls += "?" + c.urlParams_.Encode()
  13567. req, _ := http.NewRequest("GET", urls, body)
  13568. req.Header = reqHeaders
  13569. googleapi.Expand(req.URL, map[string]string{
  13570. "profileId": strconv.FormatInt(c.profileId, 10),
  13571. })
  13572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13573. }
  13574. // Do executes the "dfareporting.accounts.list" call.
  13575. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13576. // non-2xx status code is an error. Response headers are in either
  13577. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13578. // returned at all) in error.(*googleapi.Error).Header. Use
  13579. // googleapi.IsNotModified to check whether the returned error was
  13580. // because http.StatusNotModified was returned.
  13581. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13582. gensupport.SetOptions(c.urlParams_, opts...)
  13583. res, err := c.doRequest("json")
  13584. if res != nil && res.StatusCode == http.StatusNotModified {
  13585. if res.Body != nil {
  13586. res.Body.Close()
  13587. }
  13588. return nil, &googleapi.Error{
  13589. Code: res.StatusCode,
  13590. Header: res.Header,
  13591. }
  13592. }
  13593. if err != nil {
  13594. return nil, err
  13595. }
  13596. defer googleapi.CloseBody(res)
  13597. if err := googleapi.CheckResponse(res); err != nil {
  13598. return nil, err
  13599. }
  13600. ret := &AccountsListResponse{
  13601. ServerResponse: googleapi.ServerResponse{
  13602. Header: res.Header,
  13603. HTTPStatusCode: res.StatusCode,
  13604. },
  13605. }
  13606. target := &ret
  13607. if err := gensupport.DecodeResponse(target, res); err != nil {
  13608. return nil, err
  13609. }
  13610. return ret, nil
  13611. // {
  13612. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13613. // "httpMethod": "GET",
  13614. // "id": "dfareporting.accounts.list",
  13615. // "parameterOrder": [
  13616. // "profileId"
  13617. // ],
  13618. // "parameters": {
  13619. // "active": {
  13620. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13621. // "location": "query",
  13622. // "type": "boolean"
  13623. // },
  13624. // "ids": {
  13625. // "description": "Select only accounts with these IDs.",
  13626. // "format": "int64",
  13627. // "location": "query",
  13628. // "repeated": true,
  13629. // "type": "string"
  13630. // },
  13631. // "maxResults": {
  13632. // "default": "1000",
  13633. // "description": "Maximum number of results to return.",
  13634. // "format": "int32",
  13635. // "location": "query",
  13636. // "maximum": "1000",
  13637. // "minimum": "0",
  13638. // "type": "integer"
  13639. // },
  13640. // "pageToken": {
  13641. // "description": "Value of the nextPageToken from the previous result page.",
  13642. // "location": "query",
  13643. // "type": "string"
  13644. // },
  13645. // "profileId": {
  13646. // "description": "User profile ID associated with this request.",
  13647. // "format": "int64",
  13648. // "location": "path",
  13649. // "required": true,
  13650. // "type": "string"
  13651. // },
  13652. // "searchString": {
  13653. // "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\".",
  13654. // "location": "query",
  13655. // "type": "string"
  13656. // },
  13657. // "sortField": {
  13658. // "default": "ID",
  13659. // "description": "Field by which to sort the list.",
  13660. // "enum": [
  13661. // "ID",
  13662. // "NAME"
  13663. // ],
  13664. // "enumDescriptions": [
  13665. // "",
  13666. // ""
  13667. // ],
  13668. // "location": "query",
  13669. // "type": "string"
  13670. // },
  13671. // "sortOrder": {
  13672. // "default": "ASCENDING",
  13673. // "description": "Order of sorted results.",
  13674. // "enum": [
  13675. // "ASCENDING",
  13676. // "DESCENDING"
  13677. // ],
  13678. // "enumDescriptions": [
  13679. // "",
  13680. // ""
  13681. // ],
  13682. // "location": "query",
  13683. // "type": "string"
  13684. // }
  13685. // },
  13686. // "path": "userprofiles/{profileId}/accounts",
  13687. // "response": {
  13688. // "$ref": "AccountsListResponse"
  13689. // },
  13690. // "scopes": [
  13691. // "https://www.googleapis.com/auth/dfatrafficking"
  13692. // ]
  13693. // }
  13694. }
  13695. // Pages invokes f for each page of results.
  13696. // A non-nil error returned from f will halt the iteration.
  13697. // The provided context supersedes any context provided to the Context method.
  13698. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13699. c.ctx_ = ctx
  13700. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13701. for {
  13702. x, err := c.Do()
  13703. if err != nil {
  13704. return err
  13705. }
  13706. if err := f(x); err != nil {
  13707. return err
  13708. }
  13709. if x.NextPageToken == "" {
  13710. return nil
  13711. }
  13712. c.PageToken(x.NextPageToken)
  13713. }
  13714. }
  13715. // method id "dfareporting.accounts.patch":
  13716. type AccountsPatchCall struct {
  13717. s *Service
  13718. profileId int64
  13719. account *Account
  13720. urlParams_ gensupport.URLParams
  13721. ctx_ context.Context
  13722. header_ http.Header
  13723. }
  13724. // Patch: Updates an existing account. This method supports patch
  13725. // semantics.
  13726. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13727. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13728. c.profileId = profileId
  13729. c.urlParams_.Set("id", fmt.Sprint(id))
  13730. c.account = account
  13731. return c
  13732. }
  13733. // Fields allows partial responses to be retrieved. See
  13734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13735. // for more information.
  13736. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13738. return c
  13739. }
  13740. // Context sets the context to be used in this call's Do method. Any
  13741. // pending HTTP request will be aborted if the provided context is
  13742. // canceled.
  13743. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13744. c.ctx_ = ctx
  13745. return c
  13746. }
  13747. // Header returns an http.Header that can be modified by the caller to
  13748. // add HTTP headers to the request.
  13749. func (c *AccountsPatchCall) Header() http.Header {
  13750. if c.header_ == nil {
  13751. c.header_ = make(http.Header)
  13752. }
  13753. return c.header_
  13754. }
  13755. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13756. reqHeaders := make(http.Header)
  13757. for k, v := range c.header_ {
  13758. reqHeaders[k] = v
  13759. }
  13760. reqHeaders.Set("User-Agent", c.s.userAgent())
  13761. var body io.Reader = nil
  13762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13763. if err != nil {
  13764. return nil, err
  13765. }
  13766. reqHeaders.Set("Content-Type", "application/json")
  13767. c.urlParams_.Set("alt", alt)
  13768. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13769. urls += "?" + c.urlParams_.Encode()
  13770. req, _ := http.NewRequest("PATCH", urls, body)
  13771. req.Header = reqHeaders
  13772. googleapi.Expand(req.URL, map[string]string{
  13773. "profileId": strconv.FormatInt(c.profileId, 10),
  13774. })
  13775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13776. }
  13777. // Do executes the "dfareporting.accounts.patch" call.
  13778. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13779. // code is an error. Response headers are in either
  13780. // *Account.ServerResponse.Header or (if a response was returned at all)
  13781. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13782. // check whether the returned error was because http.StatusNotModified
  13783. // was returned.
  13784. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13785. gensupport.SetOptions(c.urlParams_, opts...)
  13786. res, err := c.doRequest("json")
  13787. if res != nil && res.StatusCode == http.StatusNotModified {
  13788. if res.Body != nil {
  13789. res.Body.Close()
  13790. }
  13791. return nil, &googleapi.Error{
  13792. Code: res.StatusCode,
  13793. Header: res.Header,
  13794. }
  13795. }
  13796. if err != nil {
  13797. return nil, err
  13798. }
  13799. defer googleapi.CloseBody(res)
  13800. if err := googleapi.CheckResponse(res); err != nil {
  13801. return nil, err
  13802. }
  13803. ret := &Account{
  13804. ServerResponse: googleapi.ServerResponse{
  13805. Header: res.Header,
  13806. HTTPStatusCode: res.StatusCode,
  13807. },
  13808. }
  13809. target := &ret
  13810. if err := gensupport.DecodeResponse(target, res); err != nil {
  13811. return nil, err
  13812. }
  13813. return ret, nil
  13814. // {
  13815. // "description": "Updates an existing account. This method supports patch semantics.",
  13816. // "httpMethod": "PATCH",
  13817. // "id": "dfareporting.accounts.patch",
  13818. // "parameterOrder": [
  13819. // "profileId",
  13820. // "id"
  13821. // ],
  13822. // "parameters": {
  13823. // "id": {
  13824. // "description": "Account ID.",
  13825. // "format": "int64",
  13826. // "location": "query",
  13827. // "required": true,
  13828. // "type": "string"
  13829. // },
  13830. // "profileId": {
  13831. // "description": "User profile ID associated with this request.",
  13832. // "format": "int64",
  13833. // "location": "path",
  13834. // "required": true,
  13835. // "type": "string"
  13836. // }
  13837. // },
  13838. // "path": "userprofiles/{profileId}/accounts",
  13839. // "request": {
  13840. // "$ref": "Account"
  13841. // },
  13842. // "response": {
  13843. // "$ref": "Account"
  13844. // },
  13845. // "scopes": [
  13846. // "https://www.googleapis.com/auth/dfatrafficking"
  13847. // ]
  13848. // }
  13849. }
  13850. // method id "dfareporting.accounts.update":
  13851. type AccountsUpdateCall struct {
  13852. s *Service
  13853. profileId int64
  13854. account *Account
  13855. urlParams_ gensupport.URLParams
  13856. ctx_ context.Context
  13857. header_ http.Header
  13858. }
  13859. // Update: Updates an existing account.
  13860. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13861. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13862. c.profileId = profileId
  13863. c.account = account
  13864. return c
  13865. }
  13866. // Fields allows partial responses to be retrieved. See
  13867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13868. // for more information.
  13869. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  13870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13871. return c
  13872. }
  13873. // Context sets the context to be used in this call's Do method. Any
  13874. // pending HTTP request will be aborted if the provided context is
  13875. // canceled.
  13876. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  13877. c.ctx_ = ctx
  13878. return c
  13879. }
  13880. // Header returns an http.Header that can be modified by the caller to
  13881. // add HTTP headers to the request.
  13882. func (c *AccountsUpdateCall) Header() http.Header {
  13883. if c.header_ == nil {
  13884. c.header_ = make(http.Header)
  13885. }
  13886. return c.header_
  13887. }
  13888. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13889. reqHeaders := make(http.Header)
  13890. for k, v := range c.header_ {
  13891. reqHeaders[k] = v
  13892. }
  13893. reqHeaders.Set("User-Agent", c.s.userAgent())
  13894. var body io.Reader = nil
  13895. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13896. if err != nil {
  13897. return nil, err
  13898. }
  13899. reqHeaders.Set("Content-Type", "application/json")
  13900. c.urlParams_.Set("alt", alt)
  13901. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13902. urls += "?" + c.urlParams_.Encode()
  13903. req, _ := http.NewRequest("PUT", urls, body)
  13904. req.Header = reqHeaders
  13905. googleapi.Expand(req.URL, map[string]string{
  13906. "profileId": strconv.FormatInt(c.profileId, 10),
  13907. })
  13908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13909. }
  13910. // Do executes the "dfareporting.accounts.update" call.
  13911. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13912. // code is an error. Response headers are in either
  13913. // *Account.ServerResponse.Header or (if a response was returned at all)
  13914. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13915. // check whether the returned error was because http.StatusNotModified
  13916. // was returned.
  13917. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13918. gensupport.SetOptions(c.urlParams_, opts...)
  13919. res, err := c.doRequest("json")
  13920. if res != nil && res.StatusCode == http.StatusNotModified {
  13921. if res.Body != nil {
  13922. res.Body.Close()
  13923. }
  13924. return nil, &googleapi.Error{
  13925. Code: res.StatusCode,
  13926. Header: res.Header,
  13927. }
  13928. }
  13929. if err != nil {
  13930. return nil, err
  13931. }
  13932. defer googleapi.CloseBody(res)
  13933. if err := googleapi.CheckResponse(res); err != nil {
  13934. return nil, err
  13935. }
  13936. ret := &Account{
  13937. ServerResponse: googleapi.ServerResponse{
  13938. Header: res.Header,
  13939. HTTPStatusCode: res.StatusCode,
  13940. },
  13941. }
  13942. target := &ret
  13943. if err := gensupport.DecodeResponse(target, res); err != nil {
  13944. return nil, err
  13945. }
  13946. return ret, nil
  13947. // {
  13948. // "description": "Updates an existing account.",
  13949. // "httpMethod": "PUT",
  13950. // "id": "dfareporting.accounts.update",
  13951. // "parameterOrder": [
  13952. // "profileId"
  13953. // ],
  13954. // "parameters": {
  13955. // "profileId": {
  13956. // "description": "User profile ID associated with this request.",
  13957. // "format": "int64",
  13958. // "location": "path",
  13959. // "required": true,
  13960. // "type": "string"
  13961. // }
  13962. // },
  13963. // "path": "userprofiles/{profileId}/accounts",
  13964. // "request": {
  13965. // "$ref": "Account"
  13966. // },
  13967. // "response": {
  13968. // "$ref": "Account"
  13969. // },
  13970. // "scopes": [
  13971. // "https://www.googleapis.com/auth/dfatrafficking"
  13972. // ]
  13973. // }
  13974. }
  13975. // method id "dfareporting.ads.get":
  13976. type AdsGetCall struct {
  13977. s *Service
  13978. profileId int64
  13979. id int64
  13980. urlParams_ gensupport.URLParams
  13981. ifNoneMatch_ string
  13982. ctx_ context.Context
  13983. header_ http.Header
  13984. }
  13985. // Get: Gets one ad by ID.
  13986. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  13987. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13988. c.profileId = profileId
  13989. c.id = id
  13990. return c
  13991. }
  13992. // Fields allows partial responses to be retrieved. See
  13993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13994. // for more information.
  13995. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  13996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13997. return c
  13998. }
  13999. // IfNoneMatch sets the optional parameter which makes the operation
  14000. // fail if the object's ETag matches the given value. This is useful for
  14001. // getting updates only after the object has changed since the last
  14002. // request. Use googleapi.IsNotModified to check whether the response
  14003. // error from Do is the result of In-None-Match.
  14004. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  14005. c.ifNoneMatch_ = entityTag
  14006. return c
  14007. }
  14008. // Context sets the context to be used in this call's Do method. Any
  14009. // pending HTTP request will be aborted if the provided context is
  14010. // canceled.
  14011. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  14012. c.ctx_ = ctx
  14013. return c
  14014. }
  14015. // Header returns an http.Header that can be modified by the caller to
  14016. // add HTTP headers to the request.
  14017. func (c *AdsGetCall) Header() http.Header {
  14018. if c.header_ == nil {
  14019. c.header_ = make(http.Header)
  14020. }
  14021. return c.header_
  14022. }
  14023. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  14024. reqHeaders := make(http.Header)
  14025. for k, v := range c.header_ {
  14026. reqHeaders[k] = v
  14027. }
  14028. reqHeaders.Set("User-Agent", c.s.userAgent())
  14029. if c.ifNoneMatch_ != "" {
  14030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14031. }
  14032. var body io.Reader = nil
  14033. c.urlParams_.Set("alt", alt)
  14034. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  14035. urls += "?" + c.urlParams_.Encode()
  14036. req, _ := http.NewRequest("GET", urls, body)
  14037. req.Header = reqHeaders
  14038. googleapi.Expand(req.URL, map[string]string{
  14039. "profileId": strconv.FormatInt(c.profileId, 10),
  14040. "id": strconv.FormatInt(c.id, 10),
  14041. })
  14042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14043. }
  14044. // Do executes the "dfareporting.ads.get" call.
  14045. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14046. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14047. // or (if a response was returned at all) in
  14048. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14049. // whether the returned error was because http.StatusNotModified was
  14050. // returned.
  14051. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14052. gensupport.SetOptions(c.urlParams_, opts...)
  14053. res, err := c.doRequest("json")
  14054. if res != nil && res.StatusCode == http.StatusNotModified {
  14055. if res.Body != nil {
  14056. res.Body.Close()
  14057. }
  14058. return nil, &googleapi.Error{
  14059. Code: res.StatusCode,
  14060. Header: res.Header,
  14061. }
  14062. }
  14063. if err != nil {
  14064. return nil, err
  14065. }
  14066. defer googleapi.CloseBody(res)
  14067. if err := googleapi.CheckResponse(res); err != nil {
  14068. return nil, err
  14069. }
  14070. ret := &Ad{
  14071. ServerResponse: googleapi.ServerResponse{
  14072. Header: res.Header,
  14073. HTTPStatusCode: res.StatusCode,
  14074. },
  14075. }
  14076. target := &ret
  14077. if err := gensupport.DecodeResponse(target, res); err != nil {
  14078. return nil, err
  14079. }
  14080. return ret, nil
  14081. // {
  14082. // "description": "Gets one ad by ID.",
  14083. // "httpMethod": "GET",
  14084. // "id": "dfareporting.ads.get",
  14085. // "parameterOrder": [
  14086. // "profileId",
  14087. // "id"
  14088. // ],
  14089. // "parameters": {
  14090. // "id": {
  14091. // "description": "Ad ID.",
  14092. // "format": "int64",
  14093. // "location": "path",
  14094. // "required": true,
  14095. // "type": "string"
  14096. // },
  14097. // "profileId": {
  14098. // "description": "User profile ID associated with this request.",
  14099. // "format": "int64",
  14100. // "location": "path",
  14101. // "required": true,
  14102. // "type": "string"
  14103. // }
  14104. // },
  14105. // "path": "userprofiles/{profileId}/ads/{id}",
  14106. // "response": {
  14107. // "$ref": "Ad"
  14108. // },
  14109. // "scopes": [
  14110. // "https://www.googleapis.com/auth/dfatrafficking"
  14111. // ]
  14112. // }
  14113. }
  14114. // method id "dfareporting.ads.insert":
  14115. type AdsInsertCall struct {
  14116. s *Service
  14117. profileId int64
  14118. ad *Ad
  14119. urlParams_ gensupport.URLParams
  14120. ctx_ context.Context
  14121. header_ http.Header
  14122. }
  14123. // Insert: Inserts a new ad.
  14124. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  14125. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14126. c.profileId = profileId
  14127. c.ad = ad
  14128. return c
  14129. }
  14130. // Fields allows partial responses to be retrieved. See
  14131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14132. // for more information.
  14133. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  14134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14135. return c
  14136. }
  14137. // Context sets the context to be used in this call's Do method. Any
  14138. // pending HTTP request will be aborted if the provided context is
  14139. // canceled.
  14140. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  14141. c.ctx_ = ctx
  14142. return c
  14143. }
  14144. // Header returns an http.Header that can be modified by the caller to
  14145. // add HTTP headers to the request.
  14146. func (c *AdsInsertCall) Header() http.Header {
  14147. if c.header_ == nil {
  14148. c.header_ = make(http.Header)
  14149. }
  14150. return c.header_
  14151. }
  14152. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  14153. reqHeaders := make(http.Header)
  14154. for k, v := range c.header_ {
  14155. reqHeaders[k] = v
  14156. }
  14157. reqHeaders.Set("User-Agent", c.s.userAgent())
  14158. var body io.Reader = nil
  14159. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14160. if err != nil {
  14161. return nil, err
  14162. }
  14163. reqHeaders.Set("Content-Type", "application/json")
  14164. c.urlParams_.Set("alt", alt)
  14165. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14166. urls += "?" + c.urlParams_.Encode()
  14167. req, _ := http.NewRequest("POST", urls, body)
  14168. req.Header = reqHeaders
  14169. googleapi.Expand(req.URL, map[string]string{
  14170. "profileId": strconv.FormatInt(c.profileId, 10),
  14171. })
  14172. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14173. }
  14174. // Do executes the "dfareporting.ads.insert" call.
  14175. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14176. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14177. // or (if a response was returned at all) in
  14178. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14179. // whether the returned error was because http.StatusNotModified was
  14180. // returned.
  14181. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14182. gensupport.SetOptions(c.urlParams_, opts...)
  14183. res, err := c.doRequest("json")
  14184. if res != nil && res.StatusCode == http.StatusNotModified {
  14185. if res.Body != nil {
  14186. res.Body.Close()
  14187. }
  14188. return nil, &googleapi.Error{
  14189. Code: res.StatusCode,
  14190. Header: res.Header,
  14191. }
  14192. }
  14193. if err != nil {
  14194. return nil, err
  14195. }
  14196. defer googleapi.CloseBody(res)
  14197. if err := googleapi.CheckResponse(res); err != nil {
  14198. return nil, err
  14199. }
  14200. ret := &Ad{
  14201. ServerResponse: googleapi.ServerResponse{
  14202. Header: res.Header,
  14203. HTTPStatusCode: res.StatusCode,
  14204. },
  14205. }
  14206. target := &ret
  14207. if err := gensupport.DecodeResponse(target, res); err != nil {
  14208. return nil, err
  14209. }
  14210. return ret, nil
  14211. // {
  14212. // "description": "Inserts a new ad.",
  14213. // "httpMethod": "POST",
  14214. // "id": "dfareporting.ads.insert",
  14215. // "parameterOrder": [
  14216. // "profileId"
  14217. // ],
  14218. // "parameters": {
  14219. // "profileId": {
  14220. // "description": "User profile ID associated with this request.",
  14221. // "format": "int64",
  14222. // "location": "path",
  14223. // "required": true,
  14224. // "type": "string"
  14225. // }
  14226. // },
  14227. // "path": "userprofiles/{profileId}/ads",
  14228. // "request": {
  14229. // "$ref": "Ad"
  14230. // },
  14231. // "response": {
  14232. // "$ref": "Ad"
  14233. // },
  14234. // "scopes": [
  14235. // "https://www.googleapis.com/auth/dfatrafficking"
  14236. // ]
  14237. // }
  14238. }
  14239. // method id "dfareporting.ads.list":
  14240. type AdsListCall struct {
  14241. s *Service
  14242. profileId int64
  14243. urlParams_ gensupport.URLParams
  14244. ifNoneMatch_ string
  14245. ctx_ context.Context
  14246. header_ http.Header
  14247. }
  14248. // List: Retrieves a list of ads, possibly filtered. This method
  14249. // supports paging.
  14250. func (r *AdsService) List(profileId int64) *AdsListCall {
  14251. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14252. c.profileId = profileId
  14253. return c
  14254. }
  14255. // Active sets the optional parameter "active": Select only active ads.
  14256. func (c *AdsListCall) Active(active bool) *AdsListCall {
  14257. c.urlParams_.Set("active", fmt.Sprint(active))
  14258. return c
  14259. }
  14260. // AdvertiserId sets the optional parameter "advertiserId": Select only
  14261. // ads with this advertiser ID.
  14262. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  14263. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  14264. return c
  14265. }
  14266. // Archived sets the optional parameter "archived": Select only archived
  14267. // ads.
  14268. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  14269. c.urlParams_.Set("archived", fmt.Sprint(archived))
  14270. return c
  14271. }
  14272. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  14273. // Select only ads with these audience segment IDs.
  14274. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  14275. var audienceSegmentIds_ []string
  14276. for _, v := range audienceSegmentIds {
  14277. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  14278. }
  14279. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  14280. return c
  14281. }
  14282. // CampaignIds sets the optional parameter "campaignIds": Select only
  14283. // ads with these campaign IDs.
  14284. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  14285. var campaignIds_ []string
  14286. for _, v := range campaignIds {
  14287. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  14288. }
  14289. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  14290. return c
  14291. }
  14292. // Compatibility sets the optional parameter "compatibility": Select
  14293. // default ads with the specified compatibility. Applicable when type is
  14294. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  14295. // rendering either on desktop or on mobile devices for regular or
  14296. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  14297. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  14298. // in-stream video ads developed with the VAST standard.
  14299. //
  14300. // Possible values:
  14301. // "APP"
  14302. // "APP_INTERSTITIAL"
  14303. // "DISPLAY"
  14304. // "DISPLAY_INTERSTITIAL"
  14305. // "IN_STREAM_AUDIO"
  14306. // "IN_STREAM_VIDEO"
  14307. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  14308. c.urlParams_.Set("compatibility", compatibility)
  14309. return c
  14310. }
  14311. // CreativeIds sets the optional parameter "creativeIds": Select only
  14312. // ads with these creative IDs assigned.
  14313. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  14314. var creativeIds_ []string
  14315. for _, v := range creativeIds {
  14316. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  14317. }
  14318. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  14319. return c
  14320. }
  14321. // CreativeOptimizationConfigurationIds sets the optional parameter
  14322. // "creativeOptimizationConfigurationIds": Select only ads with these
  14323. // creative optimization configuration IDs.
  14324. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  14325. var creativeOptimizationConfigurationIds_ []string
  14326. for _, v := range creativeOptimizationConfigurationIds {
  14327. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  14328. }
  14329. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  14330. return c
  14331. }
  14332. // DynamicClickTracker sets the optional parameter
  14333. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  14334. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  14335. // trackers. If false, select static click trackers. Leave unset to
  14336. // select both.
  14337. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  14338. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  14339. return c
  14340. }
  14341. // Ids sets the optional parameter "ids": Select only ads with these
  14342. // IDs.
  14343. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  14344. var ids_ []string
  14345. for _, v := range ids {
  14346. ids_ = append(ids_, fmt.Sprint(v))
  14347. }
  14348. c.urlParams_.SetMulti("ids", ids_)
  14349. return c
  14350. }
  14351. // LandingPageIds sets the optional parameter "landingPageIds": Select
  14352. // only ads with these landing page IDs.
  14353. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  14354. var landingPageIds_ []string
  14355. for _, v := range landingPageIds {
  14356. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  14357. }
  14358. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  14359. return c
  14360. }
  14361. // MaxResults sets the optional parameter "maxResults": Maximum number
  14362. // of results to return.
  14363. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14364. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14365. return c
  14366. }
  14367. // OverriddenEventTagId sets the optional parameter
  14368. // "overriddenEventTagId": Select only ads with this event tag override
  14369. // ID.
  14370. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14371. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14372. return c
  14373. }
  14374. // PageToken sets the optional parameter "pageToken": Value of the
  14375. // nextPageToken from the previous result page.
  14376. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14377. c.urlParams_.Set("pageToken", pageToken)
  14378. return c
  14379. }
  14380. // PlacementIds sets the optional parameter "placementIds": Select only
  14381. // ads with these placement IDs assigned.
  14382. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14383. var placementIds_ []string
  14384. for _, v := range placementIds {
  14385. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14386. }
  14387. c.urlParams_.SetMulti("placementIds", placementIds_)
  14388. return c
  14389. }
  14390. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14391. // Select only ads whose list targeting expression use these remarketing
  14392. // list IDs.
  14393. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14394. var remarketingListIds_ []string
  14395. for _, v := range remarketingListIds {
  14396. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14397. }
  14398. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14399. return c
  14400. }
  14401. // SearchString sets the optional parameter "searchString": Allows
  14402. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14403. // example, "ad*2015" will return objects with names like "ad June
  14404. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14405. // also add wildcards implicitly at the start and the end of the search
  14406. // string. For example, a search string of "ad" will match objects with
  14407. // name "my ad", "ad 2015", or simply "ad".
  14408. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14409. c.urlParams_.Set("searchString", searchString)
  14410. return c
  14411. }
  14412. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14413. // these size IDs.
  14414. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14415. var sizeIds_ []string
  14416. for _, v := range sizeIds {
  14417. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14418. }
  14419. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14420. return c
  14421. }
  14422. // SortField sets the optional parameter "sortField": Field by which to
  14423. // sort the list.
  14424. //
  14425. // Possible values:
  14426. // "ID" (default)
  14427. // "NAME"
  14428. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14429. c.urlParams_.Set("sortField", sortField)
  14430. return c
  14431. }
  14432. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14433. // results.
  14434. //
  14435. // Possible values:
  14436. // "ASCENDING" (default)
  14437. // "DESCENDING"
  14438. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14439. c.urlParams_.Set("sortOrder", sortOrder)
  14440. return c
  14441. }
  14442. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14443. // ads that are SSL-compliant.
  14444. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14445. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14446. return c
  14447. }
  14448. // SslRequired sets the optional parameter "sslRequired": Select only
  14449. // ads that require SSL.
  14450. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14451. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14452. return c
  14453. }
  14454. // Type sets the optional parameter "type": Select only ads with these
  14455. // types.
  14456. //
  14457. // Possible values:
  14458. // "AD_SERVING_CLICK_TRACKER"
  14459. // "AD_SERVING_DEFAULT_AD"
  14460. // "AD_SERVING_STANDARD_AD"
  14461. // "AD_SERVING_TRACKING"
  14462. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14463. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14464. return c
  14465. }
  14466. // Fields allows partial responses to be retrieved. See
  14467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14468. // for more information.
  14469. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14471. return c
  14472. }
  14473. // IfNoneMatch sets the optional parameter which makes the operation
  14474. // fail if the object's ETag matches the given value. This is useful for
  14475. // getting updates only after the object has changed since the last
  14476. // request. Use googleapi.IsNotModified to check whether the response
  14477. // error from Do is the result of In-None-Match.
  14478. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14479. c.ifNoneMatch_ = entityTag
  14480. return c
  14481. }
  14482. // Context sets the context to be used in this call's Do method. Any
  14483. // pending HTTP request will be aborted if the provided context is
  14484. // canceled.
  14485. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14486. c.ctx_ = ctx
  14487. return c
  14488. }
  14489. // Header returns an http.Header that can be modified by the caller to
  14490. // add HTTP headers to the request.
  14491. func (c *AdsListCall) Header() http.Header {
  14492. if c.header_ == nil {
  14493. c.header_ = make(http.Header)
  14494. }
  14495. return c.header_
  14496. }
  14497. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14498. reqHeaders := make(http.Header)
  14499. for k, v := range c.header_ {
  14500. reqHeaders[k] = v
  14501. }
  14502. reqHeaders.Set("User-Agent", c.s.userAgent())
  14503. if c.ifNoneMatch_ != "" {
  14504. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14505. }
  14506. var body io.Reader = nil
  14507. c.urlParams_.Set("alt", alt)
  14508. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14509. urls += "?" + c.urlParams_.Encode()
  14510. req, _ := http.NewRequest("GET", urls, body)
  14511. req.Header = reqHeaders
  14512. googleapi.Expand(req.URL, map[string]string{
  14513. "profileId": strconv.FormatInt(c.profileId, 10),
  14514. })
  14515. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14516. }
  14517. // Do executes the "dfareporting.ads.list" call.
  14518. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14519. // status code is an error. Response headers are in either
  14520. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14521. // at all) in error.(*googleapi.Error).Header. Use
  14522. // googleapi.IsNotModified to check whether the returned error was
  14523. // because http.StatusNotModified was returned.
  14524. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14525. gensupport.SetOptions(c.urlParams_, opts...)
  14526. res, err := c.doRequest("json")
  14527. if res != nil && res.StatusCode == http.StatusNotModified {
  14528. if res.Body != nil {
  14529. res.Body.Close()
  14530. }
  14531. return nil, &googleapi.Error{
  14532. Code: res.StatusCode,
  14533. Header: res.Header,
  14534. }
  14535. }
  14536. if err != nil {
  14537. return nil, err
  14538. }
  14539. defer googleapi.CloseBody(res)
  14540. if err := googleapi.CheckResponse(res); err != nil {
  14541. return nil, err
  14542. }
  14543. ret := &AdsListResponse{
  14544. ServerResponse: googleapi.ServerResponse{
  14545. Header: res.Header,
  14546. HTTPStatusCode: res.StatusCode,
  14547. },
  14548. }
  14549. target := &ret
  14550. if err := gensupport.DecodeResponse(target, res); err != nil {
  14551. return nil, err
  14552. }
  14553. return ret, nil
  14554. // {
  14555. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14556. // "httpMethod": "GET",
  14557. // "id": "dfareporting.ads.list",
  14558. // "parameterOrder": [
  14559. // "profileId"
  14560. // ],
  14561. // "parameters": {
  14562. // "active": {
  14563. // "description": "Select only active ads.",
  14564. // "location": "query",
  14565. // "type": "boolean"
  14566. // },
  14567. // "advertiserId": {
  14568. // "description": "Select only ads with this advertiser ID.",
  14569. // "format": "int64",
  14570. // "location": "query",
  14571. // "type": "string"
  14572. // },
  14573. // "archived": {
  14574. // "description": "Select only archived ads.",
  14575. // "location": "query",
  14576. // "type": "boolean"
  14577. // },
  14578. // "audienceSegmentIds": {
  14579. // "description": "Select only ads with these audience segment IDs.",
  14580. // "format": "int64",
  14581. // "location": "query",
  14582. // "repeated": true,
  14583. // "type": "string"
  14584. // },
  14585. // "campaignIds": {
  14586. // "description": "Select only ads with these campaign IDs.",
  14587. // "format": "int64",
  14588. // "location": "query",
  14589. // "repeated": true,
  14590. // "type": "string"
  14591. // },
  14592. // "compatibility": {
  14593. // "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.",
  14594. // "enum": [
  14595. // "APP",
  14596. // "APP_INTERSTITIAL",
  14597. // "DISPLAY",
  14598. // "DISPLAY_INTERSTITIAL",
  14599. // "IN_STREAM_AUDIO",
  14600. // "IN_STREAM_VIDEO"
  14601. // ],
  14602. // "enumDescriptions": [
  14603. // "",
  14604. // "",
  14605. // "",
  14606. // "",
  14607. // "",
  14608. // ""
  14609. // ],
  14610. // "location": "query",
  14611. // "type": "string"
  14612. // },
  14613. // "creativeIds": {
  14614. // "description": "Select only ads with these creative IDs assigned.",
  14615. // "format": "int64",
  14616. // "location": "query",
  14617. // "repeated": true,
  14618. // "type": "string"
  14619. // },
  14620. // "creativeOptimizationConfigurationIds": {
  14621. // "description": "Select only ads with these creative optimization configuration IDs.",
  14622. // "format": "int64",
  14623. // "location": "query",
  14624. // "repeated": true,
  14625. // "type": "string"
  14626. // },
  14627. // "dynamicClickTracker": {
  14628. // "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.",
  14629. // "location": "query",
  14630. // "type": "boolean"
  14631. // },
  14632. // "ids": {
  14633. // "description": "Select only ads with these IDs.",
  14634. // "format": "int64",
  14635. // "location": "query",
  14636. // "repeated": true,
  14637. // "type": "string"
  14638. // },
  14639. // "landingPageIds": {
  14640. // "description": "Select only ads with these landing page IDs.",
  14641. // "format": "int64",
  14642. // "location": "query",
  14643. // "repeated": true,
  14644. // "type": "string"
  14645. // },
  14646. // "maxResults": {
  14647. // "default": "1000",
  14648. // "description": "Maximum number of results to return.",
  14649. // "format": "int32",
  14650. // "location": "query",
  14651. // "maximum": "1000",
  14652. // "minimum": "0",
  14653. // "type": "integer"
  14654. // },
  14655. // "overriddenEventTagId": {
  14656. // "description": "Select only ads with this event tag override ID.",
  14657. // "format": "int64",
  14658. // "location": "query",
  14659. // "type": "string"
  14660. // },
  14661. // "pageToken": {
  14662. // "description": "Value of the nextPageToken from the previous result page.",
  14663. // "location": "query",
  14664. // "type": "string"
  14665. // },
  14666. // "placementIds": {
  14667. // "description": "Select only ads with these placement IDs assigned.",
  14668. // "format": "int64",
  14669. // "location": "query",
  14670. // "repeated": true,
  14671. // "type": "string"
  14672. // },
  14673. // "profileId": {
  14674. // "description": "User profile ID associated with this request.",
  14675. // "format": "int64",
  14676. // "location": "path",
  14677. // "required": true,
  14678. // "type": "string"
  14679. // },
  14680. // "remarketingListIds": {
  14681. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14682. // "format": "int64",
  14683. // "location": "query",
  14684. // "repeated": true,
  14685. // "type": "string"
  14686. // },
  14687. // "searchString": {
  14688. // "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\".",
  14689. // "location": "query",
  14690. // "type": "string"
  14691. // },
  14692. // "sizeIds": {
  14693. // "description": "Select only ads with these size IDs.",
  14694. // "format": "int64",
  14695. // "location": "query",
  14696. // "repeated": true,
  14697. // "type": "string"
  14698. // },
  14699. // "sortField": {
  14700. // "default": "ID",
  14701. // "description": "Field by which to sort the list.",
  14702. // "enum": [
  14703. // "ID",
  14704. // "NAME"
  14705. // ],
  14706. // "enumDescriptions": [
  14707. // "",
  14708. // ""
  14709. // ],
  14710. // "location": "query",
  14711. // "type": "string"
  14712. // },
  14713. // "sortOrder": {
  14714. // "default": "ASCENDING",
  14715. // "description": "Order of sorted results.",
  14716. // "enum": [
  14717. // "ASCENDING",
  14718. // "DESCENDING"
  14719. // ],
  14720. // "enumDescriptions": [
  14721. // "",
  14722. // ""
  14723. // ],
  14724. // "location": "query",
  14725. // "type": "string"
  14726. // },
  14727. // "sslCompliant": {
  14728. // "description": "Select only ads that are SSL-compliant.",
  14729. // "location": "query",
  14730. // "type": "boolean"
  14731. // },
  14732. // "sslRequired": {
  14733. // "description": "Select only ads that require SSL.",
  14734. // "location": "query",
  14735. // "type": "boolean"
  14736. // },
  14737. // "type": {
  14738. // "description": "Select only ads with these types.",
  14739. // "enum": [
  14740. // "AD_SERVING_CLICK_TRACKER",
  14741. // "AD_SERVING_DEFAULT_AD",
  14742. // "AD_SERVING_STANDARD_AD",
  14743. // "AD_SERVING_TRACKING"
  14744. // ],
  14745. // "enumDescriptions": [
  14746. // "",
  14747. // "",
  14748. // "",
  14749. // ""
  14750. // ],
  14751. // "location": "query",
  14752. // "repeated": true,
  14753. // "type": "string"
  14754. // }
  14755. // },
  14756. // "path": "userprofiles/{profileId}/ads",
  14757. // "response": {
  14758. // "$ref": "AdsListResponse"
  14759. // },
  14760. // "scopes": [
  14761. // "https://www.googleapis.com/auth/dfatrafficking"
  14762. // ]
  14763. // }
  14764. }
  14765. // Pages invokes f for each page of results.
  14766. // A non-nil error returned from f will halt the iteration.
  14767. // The provided context supersedes any context provided to the Context method.
  14768. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14769. c.ctx_ = ctx
  14770. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14771. for {
  14772. x, err := c.Do()
  14773. if err != nil {
  14774. return err
  14775. }
  14776. if err := f(x); err != nil {
  14777. return err
  14778. }
  14779. if x.NextPageToken == "" {
  14780. return nil
  14781. }
  14782. c.PageToken(x.NextPageToken)
  14783. }
  14784. }
  14785. // method id "dfareporting.ads.patch":
  14786. type AdsPatchCall struct {
  14787. s *Service
  14788. profileId int64
  14789. ad *Ad
  14790. urlParams_ gensupport.URLParams
  14791. ctx_ context.Context
  14792. header_ http.Header
  14793. }
  14794. // Patch: Updates an existing ad. This method supports patch semantics.
  14795. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14796. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14797. c.profileId = profileId
  14798. c.urlParams_.Set("id", fmt.Sprint(id))
  14799. c.ad = ad
  14800. return c
  14801. }
  14802. // Fields allows partial responses to be retrieved. See
  14803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14804. // for more information.
  14805. func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  14806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14807. return c
  14808. }
  14809. // Context sets the context to be used in this call's Do method. Any
  14810. // pending HTTP request will be aborted if the provided context is
  14811. // canceled.
  14812. func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  14813. c.ctx_ = ctx
  14814. return c
  14815. }
  14816. // Header returns an http.Header that can be modified by the caller to
  14817. // add HTTP headers to the request.
  14818. func (c *AdsPatchCall) Header() http.Header {
  14819. if c.header_ == nil {
  14820. c.header_ = make(http.Header)
  14821. }
  14822. return c.header_
  14823. }
  14824. func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) {
  14825. reqHeaders := make(http.Header)
  14826. for k, v := range c.header_ {
  14827. reqHeaders[k] = v
  14828. }
  14829. reqHeaders.Set("User-Agent", c.s.userAgent())
  14830. var body io.Reader = nil
  14831. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14832. if err != nil {
  14833. return nil, err
  14834. }
  14835. reqHeaders.Set("Content-Type", "application/json")
  14836. c.urlParams_.Set("alt", alt)
  14837. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14838. urls += "?" + c.urlParams_.Encode()
  14839. req, _ := http.NewRequest("PATCH", urls, body)
  14840. req.Header = reqHeaders
  14841. googleapi.Expand(req.URL, map[string]string{
  14842. "profileId": strconv.FormatInt(c.profileId, 10),
  14843. })
  14844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14845. }
  14846. // Do executes the "dfareporting.ads.patch" call.
  14847. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14848. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14849. // or (if a response was returned at all) in
  14850. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14851. // whether the returned error was because http.StatusNotModified was
  14852. // returned.
  14853. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14854. gensupport.SetOptions(c.urlParams_, opts...)
  14855. res, err := c.doRequest("json")
  14856. if res != nil && res.StatusCode == http.StatusNotModified {
  14857. if res.Body != nil {
  14858. res.Body.Close()
  14859. }
  14860. return nil, &googleapi.Error{
  14861. Code: res.StatusCode,
  14862. Header: res.Header,
  14863. }
  14864. }
  14865. if err != nil {
  14866. return nil, err
  14867. }
  14868. defer googleapi.CloseBody(res)
  14869. if err := googleapi.CheckResponse(res); err != nil {
  14870. return nil, err
  14871. }
  14872. ret := &Ad{
  14873. ServerResponse: googleapi.ServerResponse{
  14874. Header: res.Header,
  14875. HTTPStatusCode: res.StatusCode,
  14876. },
  14877. }
  14878. target := &ret
  14879. if err := gensupport.DecodeResponse(target, res); err != nil {
  14880. return nil, err
  14881. }
  14882. return ret, nil
  14883. // {
  14884. // "description": "Updates an existing ad. This method supports patch semantics.",
  14885. // "httpMethod": "PATCH",
  14886. // "id": "dfareporting.ads.patch",
  14887. // "parameterOrder": [
  14888. // "profileId",
  14889. // "id"
  14890. // ],
  14891. // "parameters": {
  14892. // "id": {
  14893. // "description": "Ad ID.",
  14894. // "format": "int64",
  14895. // "location": "query",
  14896. // "required": true,
  14897. // "type": "string"
  14898. // },
  14899. // "profileId": {
  14900. // "description": "User profile ID associated with this request.",
  14901. // "format": "int64",
  14902. // "location": "path",
  14903. // "required": true,
  14904. // "type": "string"
  14905. // }
  14906. // },
  14907. // "path": "userprofiles/{profileId}/ads",
  14908. // "request": {
  14909. // "$ref": "Ad"
  14910. // },
  14911. // "response": {
  14912. // "$ref": "Ad"
  14913. // },
  14914. // "scopes": [
  14915. // "https://www.googleapis.com/auth/dfatrafficking"
  14916. // ]
  14917. // }
  14918. }
  14919. // method id "dfareporting.ads.update":
  14920. type AdsUpdateCall struct {
  14921. s *Service
  14922. profileId int64
  14923. ad *Ad
  14924. urlParams_ gensupport.URLParams
  14925. ctx_ context.Context
  14926. header_ http.Header
  14927. }
  14928. // Update: Updates an existing ad.
  14929. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  14930. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14931. c.profileId = profileId
  14932. c.ad = ad
  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 *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  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 *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  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 *AdsUpdateCall) Header() http.Header {
  14952. if c.header_ == nil {
  14953. c.header_ = make(http.Header)
  14954. }
  14955. return c.header_
  14956. }
  14957. func (c *AdsUpdateCall) 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.ad)
  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}/ads")
  14971. urls += "?" + c.urlParams_.Encode()
  14972. req, _ := http.NewRequest("PUT", 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.ads.update" call.
  14980. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14981. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14982. // or (if a response was returned at all) in
  14983. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14984. // whether the returned error was because http.StatusNotModified was
  14985. // returned.
  14986. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14987. gensupport.SetOptions(c.urlParams_, opts...)
  14988. res, err := c.doRequest("json")
  14989. if res != nil && res.StatusCode == http.StatusNotModified {
  14990. if res.Body != nil {
  14991. res.Body.Close()
  14992. }
  14993. return nil, &googleapi.Error{
  14994. Code: res.StatusCode,
  14995. Header: res.Header,
  14996. }
  14997. }
  14998. if err != nil {
  14999. return nil, err
  15000. }
  15001. defer googleapi.CloseBody(res)
  15002. if err := googleapi.CheckResponse(res); err != nil {
  15003. return nil, err
  15004. }
  15005. ret := &Ad{
  15006. ServerResponse: googleapi.ServerResponse{
  15007. Header: res.Header,
  15008. HTTPStatusCode: res.StatusCode,
  15009. },
  15010. }
  15011. target := &ret
  15012. if err := gensupport.DecodeResponse(target, res); err != nil {
  15013. return nil, err
  15014. }
  15015. return ret, nil
  15016. // {
  15017. // "description": "Updates an existing ad.",
  15018. // "httpMethod": "PUT",
  15019. // "id": "dfareporting.ads.update",
  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}/ads",
  15033. // "request": {
  15034. // "$ref": "Ad"
  15035. // },
  15036. // "response": {
  15037. // "$ref": "Ad"
  15038. // },
  15039. // "scopes": [
  15040. // "https://www.googleapis.com/auth/dfatrafficking"
  15041. // ]
  15042. // }
  15043. }
  15044. // method id "dfareporting.advertiserGroups.delete":
  15045. type AdvertiserGroupsDeleteCall struct {
  15046. s *Service
  15047. profileId int64
  15048. id int64
  15049. urlParams_ gensupport.URLParams
  15050. ctx_ context.Context
  15051. header_ http.Header
  15052. }
  15053. // Delete: Deletes an existing advertiser group.
  15054. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  15055. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15056. c.profileId = profileId
  15057. c.id = id
  15058. return c
  15059. }
  15060. // Fields allows partial responses to be retrieved. See
  15061. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15062. // for more information.
  15063. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  15064. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15065. return c
  15066. }
  15067. // Context sets the context to be used in this call's Do method. Any
  15068. // pending HTTP request will be aborted if the provided context is
  15069. // canceled.
  15070. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  15071. c.ctx_ = ctx
  15072. return c
  15073. }
  15074. // Header returns an http.Header that can be modified by the caller to
  15075. // add HTTP headers to the request.
  15076. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  15077. if c.header_ == nil {
  15078. c.header_ = make(http.Header)
  15079. }
  15080. return c.header_
  15081. }
  15082. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15083. reqHeaders := make(http.Header)
  15084. for k, v := range c.header_ {
  15085. reqHeaders[k] = v
  15086. }
  15087. reqHeaders.Set("User-Agent", c.s.userAgent())
  15088. var body io.Reader = nil
  15089. c.urlParams_.Set("alt", alt)
  15090. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15091. urls += "?" + c.urlParams_.Encode()
  15092. req, _ := http.NewRequest("DELETE", urls, body)
  15093. req.Header = reqHeaders
  15094. googleapi.Expand(req.URL, map[string]string{
  15095. "profileId": strconv.FormatInt(c.profileId, 10),
  15096. "id": strconv.FormatInt(c.id, 10),
  15097. })
  15098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15099. }
  15100. // Do executes the "dfareporting.advertiserGroups.delete" call.
  15101. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15102. gensupport.SetOptions(c.urlParams_, opts...)
  15103. res, err := c.doRequest("json")
  15104. if err != nil {
  15105. return err
  15106. }
  15107. defer googleapi.CloseBody(res)
  15108. if err := googleapi.CheckResponse(res); err != nil {
  15109. return err
  15110. }
  15111. return nil
  15112. // {
  15113. // "description": "Deletes an existing advertiser group.",
  15114. // "httpMethod": "DELETE",
  15115. // "id": "dfareporting.advertiserGroups.delete",
  15116. // "parameterOrder": [
  15117. // "profileId",
  15118. // "id"
  15119. // ],
  15120. // "parameters": {
  15121. // "id": {
  15122. // "description": "Advertiser group ID.",
  15123. // "format": "int64",
  15124. // "location": "path",
  15125. // "required": true,
  15126. // "type": "string"
  15127. // },
  15128. // "profileId": {
  15129. // "description": "User profile ID associated with this request.",
  15130. // "format": "int64",
  15131. // "location": "path",
  15132. // "required": true,
  15133. // "type": "string"
  15134. // }
  15135. // },
  15136. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15137. // "scopes": [
  15138. // "https://www.googleapis.com/auth/dfatrafficking"
  15139. // ]
  15140. // }
  15141. }
  15142. // method id "dfareporting.advertiserGroups.get":
  15143. type AdvertiserGroupsGetCall struct {
  15144. s *Service
  15145. profileId int64
  15146. id int64
  15147. urlParams_ gensupport.URLParams
  15148. ifNoneMatch_ string
  15149. ctx_ context.Context
  15150. header_ http.Header
  15151. }
  15152. // Get: Gets one advertiser group by ID.
  15153. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  15154. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15155. c.profileId = profileId
  15156. c.id = id
  15157. return c
  15158. }
  15159. // Fields allows partial responses to be retrieved. See
  15160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15161. // for more information.
  15162. func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  15163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15164. return c
  15165. }
  15166. // IfNoneMatch sets the optional parameter which makes the operation
  15167. // fail if the object's ETag matches the given value. This is useful for
  15168. // getting updates only after the object has changed since the last
  15169. // request. Use googleapi.IsNotModified to check whether the response
  15170. // error from Do is the result of In-None-Match.
  15171. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  15172. c.ifNoneMatch_ = entityTag
  15173. return c
  15174. }
  15175. // Context sets the context to be used in this call's Do method. Any
  15176. // pending HTTP request will be aborted if the provided context is
  15177. // canceled.
  15178. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  15179. c.ctx_ = ctx
  15180. return c
  15181. }
  15182. // Header returns an http.Header that can be modified by the caller to
  15183. // add HTTP headers to the request.
  15184. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  15185. if c.header_ == nil {
  15186. c.header_ = make(http.Header)
  15187. }
  15188. return c.header_
  15189. }
  15190. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  15191. reqHeaders := make(http.Header)
  15192. for k, v := range c.header_ {
  15193. reqHeaders[k] = v
  15194. }
  15195. reqHeaders.Set("User-Agent", c.s.userAgent())
  15196. if c.ifNoneMatch_ != "" {
  15197. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15198. }
  15199. var body io.Reader = nil
  15200. c.urlParams_.Set("alt", alt)
  15201. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15202. urls += "?" + c.urlParams_.Encode()
  15203. req, _ := http.NewRequest("GET", urls, body)
  15204. req.Header = reqHeaders
  15205. googleapi.Expand(req.URL, map[string]string{
  15206. "profileId": strconv.FormatInt(c.profileId, 10),
  15207. "id": strconv.FormatInt(c.id, 10),
  15208. })
  15209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15210. }
  15211. // Do executes the "dfareporting.advertiserGroups.get" call.
  15212. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15213. // status code is an error. Response headers are in either
  15214. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15215. // at all) in error.(*googleapi.Error).Header. Use
  15216. // googleapi.IsNotModified to check whether the returned error was
  15217. // because http.StatusNotModified was returned.
  15218. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15219. gensupport.SetOptions(c.urlParams_, opts...)
  15220. res, err := c.doRequest("json")
  15221. if res != nil && res.StatusCode == http.StatusNotModified {
  15222. if res.Body != nil {
  15223. res.Body.Close()
  15224. }
  15225. return nil, &googleapi.Error{
  15226. Code: res.StatusCode,
  15227. Header: res.Header,
  15228. }
  15229. }
  15230. if err != nil {
  15231. return nil, err
  15232. }
  15233. defer googleapi.CloseBody(res)
  15234. if err := googleapi.CheckResponse(res); err != nil {
  15235. return nil, err
  15236. }
  15237. ret := &AdvertiserGroup{
  15238. ServerResponse: googleapi.ServerResponse{
  15239. Header: res.Header,
  15240. HTTPStatusCode: res.StatusCode,
  15241. },
  15242. }
  15243. target := &ret
  15244. if err := gensupport.DecodeResponse(target, res); err != nil {
  15245. return nil, err
  15246. }
  15247. return ret, nil
  15248. // {
  15249. // "description": "Gets one advertiser group by ID.",
  15250. // "httpMethod": "GET",
  15251. // "id": "dfareporting.advertiserGroups.get",
  15252. // "parameterOrder": [
  15253. // "profileId",
  15254. // "id"
  15255. // ],
  15256. // "parameters": {
  15257. // "id": {
  15258. // "description": "Advertiser group ID.",
  15259. // "format": "int64",
  15260. // "location": "path",
  15261. // "required": true,
  15262. // "type": "string"
  15263. // },
  15264. // "profileId": {
  15265. // "description": "User profile ID associated with this request.",
  15266. // "format": "int64",
  15267. // "location": "path",
  15268. // "required": true,
  15269. // "type": "string"
  15270. // }
  15271. // },
  15272. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15273. // "response": {
  15274. // "$ref": "AdvertiserGroup"
  15275. // },
  15276. // "scopes": [
  15277. // "https://www.googleapis.com/auth/dfatrafficking"
  15278. // ]
  15279. // }
  15280. }
  15281. // method id "dfareporting.advertiserGroups.insert":
  15282. type AdvertiserGroupsInsertCall struct {
  15283. s *Service
  15284. profileId int64
  15285. advertisergroup *AdvertiserGroup
  15286. urlParams_ gensupport.URLParams
  15287. ctx_ context.Context
  15288. header_ http.Header
  15289. }
  15290. // Insert: Inserts a new advertiser group.
  15291. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  15292. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15293. c.profileId = profileId
  15294. c.advertisergroup = advertisergroup
  15295. return c
  15296. }
  15297. // Fields allows partial responses to be retrieved. See
  15298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15299. // for more information.
  15300. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  15301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15302. return c
  15303. }
  15304. // Context sets the context to be used in this call's Do method. Any
  15305. // pending HTTP request will be aborted if the provided context is
  15306. // canceled.
  15307. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  15308. c.ctx_ = ctx
  15309. return c
  15310. }
  15311. // Header returns an http.Header that can be modified by the caller to
  15312. // add HTTP headers to the request.
  15313. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  15314. if c.header_ == nil {
  15315. c.header_ = make(http.Header)
  15316. }
  15317. return c.header_
  15318. }
  15319. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  15320. reqHeaders := make(http.Header)
  15321. for k, v := range c.header_ {
  15322. reqHeaders[k] = v
  15323. }
  15324. reqHeaders.Set("User-Agent", c.s.userAgent())
  15325. var body io.Reader = nil
  15326. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15327. if err != nil {
  15328. return nil, err
  15329. }
  15330. reqHeaders.Set("Content-Type", "application/json")
  15331. c.urlParams_.Set("alt", alt)
  15332. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15333. urls += "?" + c.urlParams_.Encode()
  15334. req, _ := http.NewRequest("POST", urls, body)
  15335. req.Header = reqHeaders
  15336. googleapi.Expand(req.URL, map[string]string{
  15337. "profileId": strconv.FormatInt(c.profileId, 10),
  15338. })
  15339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15340. }
  15341. // Do executes the "dfareporting.advertiserGroups.insert" call.
  15342. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15343. // status code is an error. Response headers are in either
  15344. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15345. // at all) in error.(*googleapi.Error).Header. Use
  15346. // googleapi.IsNotModified to check whether the returned error was
  15347. // because http.StatusNotModified was returned.
  15348. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15349. gensupport.SetOptions(c.urlParams_, opts...)
  15350. res, err := c.doRequest("json")
  15351. if res != nil && res.StatusCode == http.StatusNotModified {
  15352. if res.Body != nil {
  15353. res.Body.Close()
  15354. }
  15355. return nil, &googleapi.Error{
  15356. Code: res.StatusCode,
  15357. Header: res.Header,
  15358. }
  15359. }
  15360. if err != nil {
  15361. return nil, err
  15362. }
  15363. defer googleapi.CloseBody(res)
  15364. if err := googleapi.CheckResponse(res); err != nil {
  15365. return nil, err
  15366. }
  15367. ret := &AdvertiserGroup{
  15368. ServerResponse: googleapi.ServerResponse{
  15369. Header: res.Header,
  15370. HTTPStatusCode: res.StatusCode,
  15371. },
  15372. }
  15373. target := &ret
  15374. if err := gensupport.DecodeResponse(target, res); err != nil {
  15375. return nil, err
  15376. }
  15377. return ret, nil
  15378. // {
  15379. // "description": "Inserts a new advertiser group.",
  15380. // "httpMethod": "POST",
  15381. // "id": "dfareporting.advertiserGroups.insert",
  15382. // "parameterOrder": [
  15383. // "profileId"
  15384. // ],
  15385. // "parameters": {
  15386. // "profileId": {
  15387. // "description": "User profile ID associated with this request.",
  15388. // "format": "int64",
  15389. // "location": "path",
  15390. // "required": true,
  15391. // "type": "string"
  15392. // }
  15393. // },
  15394. // "path": "userprofiles/{profileId}/advertiserGroups",
  15395. // "request": {
  15396. // "$ref": "AdvertiserGroup"
  15397. // },
  15398. // "response": {
  15399. // "$ref": "AdvertiserGroup"
  15400. // },
  15401. // "scopes": [
  15402. // "https://www.googleapis.com/auth/dfatrafficking"
  15403. // ]
  15404. // }
  15405. }
  15406. // method id "dfareporting.advertiserGroups.list":
  15407. type AdvertiserGroupsListCall struct {
  15408. s *Service
  15409. profileId int64
  15410. urlParams_ gensupport.URLParams
  15411. ifNoneMatch_ string
  15412. ctx_ context.Context
  15413. header_ http.Header
  15414. }
  15415. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15416. // method supports paging.
  15417. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15418. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15419. c.profileId = profileId
  15420. return c
  15421. }
  15422. // Ids sets the optional parameter "ids": Select only advertiser groups
  15423. // with these IDs.
  15424. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15425. var ids_ []string
  15426. for _, v := range ids {
  15427. ids_ = append(ids_, fmt.Sprint(v))
  15428. }
  15429. c.urlParams_.SetMulti("ids", ids_)
  15430. return c
  15431. }
  15432. // MaxResults sets the optional parameter "maxResults": Maximum number
  15433. // of results to return.
  15434. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15435. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15436. return c
  15437. }
  15438. // PageToken sets the optional parameter "pageToken": Value of the
  15439. // nextPageToken from the previous result page.
  15440. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15441. c.urlParams_.Set("pageToken", pageToken)
  15442. return c
  15443. }
  15444. // SearchString sets the optional parameter "searchString": Allows
  15445. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15446. // example, "advertiser*2015" will return objects with names like
  15447. // "advertiser group June 2015", "advertiser group April 2015", or
  15448. // simply "advertiser group 2015". Most of the searches also add
  15449. // wildcards implicitly at the start and the end of the search string.
  15450. // For example, a search string of "advertisergroup" will match objects
  15451. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15452. // "advertisergroup".
  15453. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15454. c.urlParams_.Set("searchString", searchString)
  15455. return c
  15456. }
  15457. // SortField sets the optional parameter "sortField": Field by which to
  15458. // sort the list.
  15459. //
  15460. // Possible values:
  15461. // "ID" (default)
  15462. // "NAME"
  15463. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15464. c.urlParams_.Set("sortField", sortField)
  15465. return c
  15466. }
  15467. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15468. // results.
  15469. //
  15470. // Possible values:
  15471. // "ASCENDING" (default)
  15472. // "DESCENDING"
  15473. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15474. c.urlParams_.Set("sortOrder", sortOrder)
  15475. return c
  15476. }
  15477. // Fields allows partial responses to be retrieved. See
  15478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15479. // for more information.
  15480. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15482. return c
  15483. }
  15484. // IfNoneMatch sets the optional parameter which makes the operation
  15485. // fail if the object's ETag matches the given value. This is useful for
  15486. // getting updates only after the object has changed since the last
  15487. // request. Use googleapi.IsNotModified to check whether the response
  15488. // error from Do is the result of In-None-Match.
  15489. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15490. c.ifNoneMatch_ = entityTag
  15491. return c
  15492. }
  15493. // Context sets the context to be used in this call's Do method. Any
  15494. // pending HTTP request will be aborted if the provided context is
  15495. // canceled.
  15496. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15497. c.ctx_ = ctx
  15498. return c
  15499. }
  15500. // Header returns an http.Header that can be modified by the caller to
  15501. // add HTTP headers to the request.
  15502. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15503. if c.header_ == nil {
  15504. c.header_ = make(http.Header)
  15505. }
  15506. return c.header_
  15507. }
  15508. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15509. reqHeaders := make(http.Header)
  15510. for k, v := range c.header_ {
  15511. reqHeaders[k] = v
  15512. }
  15513. reqHeaders.Set("User-Agent", c.s.userAgent())
  15514. if c.ifNoneMatch_ != "" {
  15515. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15516. }
  15517. var body io.Reader = nil
  15518. c.urlParams_.Set("alt", alt)
  15519. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15520. urls += "?" + c.urlParams_.Encode()
  15521. req, _ := http.NewRequest("GET", urls, body)
  15522. req.Header = reqHeaders
  15523. googleapi.Expand(req.URL, map[string]string{
  15524. "profileId": strconv.FormatInt(c.profileId, 10),
  15525. })
  15526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15527. }
  15528. // Do executes the "dfareporting.advertiserGroups.list" call.
  15529. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15530. // non-nil. Any non-2xx status code is an error. Response headers are in
  15531. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15532. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15533. // googleapi.IsNotModified to check whether the returned error was
  15534. // because http.StatusNotModified was returned.
  15535. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15536. gensupport.SetOptions(c.urlParams_, opts...)
  15537. res, err := c.doRequest("json")
  15538. if res != nil && res.StatusCode == http.StatusNotModified {
  15539. if res.Body != nil {
  15540. res.Body.Close()
  15541. }
  15542. return nil, &googleapi.Error{
  15543. Code: res.StatusCode,
  15544. Header: res.Header,
  15545. }
  15546. }
  15547. if err != nil {
  15548. return nil, err
  15549. }
  15550. defer googleapi.CloseBody(res)
  15551. if err := googleapi.CheckResponse(res); err != nil {
  15552. return nil, err
  15553. }
  15554. ret := &AdvertiserGroupsListResponse{
  15555. ServerResponse: googleapi.ServerResponse{
  15556. Header: res.Header,
  15557. HTTPStatusCode: res.StatusCode,
  15558. },
  15559. }
  15560. target := &ret
  15561. if err := gensupport.DecodeResponse(target, res); err != nil {
  15562. return nil, err
  15563. }
  15564. return ret, nil
  15565. // {
  15566. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15567. // "httpMethod": "GET",
  15568. // "id": "dfareporting.advertiserGroups.list",
  15569. // "parameterOrder": [
  15570. // "profileId"
  15571. // ],
  15572. // "parameters": {
  15573. // "ids": {
  15574. // "description": "Select only advertiser groups with these IDs.",
  15575. // "format": "int64",
  15576. // "location": "query",
  15577. // "repeated": true,
  15578. // "type": "string"
  15579. // },
  15580. // "maxResults": {
  15581. // "default": "1000",
  15582. // "description": "Maximum number of results to return.",
  15583. // "format": "int32",
  15584. // "location": "query",
  15585. // "maximum": "1000",
  15586. // "minimum": "0",
  15587. // "type": "integer"
  15588. // },
  15589. // "pageToken": {
  15590. // "description": "Value of the nextPageToken from the previous result page.",
  15591. // "location": "query",
  15592. // "type": "string"
  15593. // },
  15594. // "profileId": {
  15595. // "description": "User profile ID associated with this request.",
  15596. // "format": "int64",
  15597. // "location": "path",
  15598. // "required": true,
  15599. // "type": "string"
  15600. // },
  15601. // "searchString": {
  15602. // "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\".",
  15603. // "location": "query",
  15604. // "type": "string"
  15605. // },
  15606. // "sortField": {
  15607. // "default": "ID",
  15608. // "description": "Field by which to sort the list.",
  15609. // "enum": [
  15610. // "ID",
  15611. // "NAME"
  15612. // ],
  15613. // "enumDescriptions": [
  15614. // "",
  15615. // ""
  15616. // ],
  15617. // "location": "query",
  15618. // "type": "string"
  15619. // },
  15620. // "sortOrder": {
  15621. // "default": "ASCENDING",
  15622. // "description": "Order of sorted results.",
  15623. // "enum": [
  15624. // "ASCENDING",
  15625. // "DESCENDING"
  15626. // ],
  15627. // "enumDescriptions": [
  15628. // "",
  15629. // ""
  15630. // ],
  15631. // "location": "query",
  15632. // "type": "string"
  15633. // }
  15634. // },
  15635. // "path": "userprofiles/{profileId}/advertiserGroups",
  15636. // "response": {
  15637. // "$ref": "AdvertiserGroupsListResponse"
  15638. // },
  15639. // "scopes": [
  15640. // "https://www.googleapis.com/auth/dfatrafficking"
  15641. // ]
  15642. // }
  15643. }
  15644. // Pages invokes f for each page of results.
  15645. // A non-nil error returned from f will halt the iteration.
  15646. // The provided context supersedes any context provided to the Context method.
  15647. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15648. c.ctx_ = ctx
  15649. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15650. for {
  15651. x, err := c.Do()
  15652. if err != nil {
  15653. return err
  15654. }
  15655. if err := f(x); err != nil {
  15656. return err
  15657. }
  15658. if x.NextPageToken == "" {
  15659. return nil
  15660. }
  15661. c.PageToken(x.NextPageToken)
  15662. }
  15663. }
  15664. // method id "dfareporting.advertiserGroups.patch":
  15665. type AdvertiserGroupsPatchCall struct {
  15666. s *Service
  15667. profileId int64
  15668. advertisergroup *AdvertiserGroup
  15669. urlParams_ gensupport.URLParams
  15670. ctx_ context.Context
  15671. header_ http.Header
  15672. }
  15673. // Patch: Updates an existing advertiser group. This method supports
  15674. // patch semantics.
  15675. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15676. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15677. c.profileId = profileId
  15678. c.urlParams_.Set("id", fmt.Sprint(id))
  15679. c.advertisergroup = advertisergroup
  15680. return c
  15681. }
  15682. // Fields allows partial responses to be retrieved. See
  15683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15684. // for more information.
  15685. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15687. return c
  15688. }
  15689. // Context sets the context to be used in this call's Do method. Any
  15690. // pending HTTP request will be aborted if the provided context is
  15691. // canceled.
  15692. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15693. c.ctx_ = ctx
  15694. return c
  15695. }
  15696. // Header returns an http.Header that can be modified by the caller to
  15697. // add HTTP headers to the request.
  15698. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15699. if c.header_ == nil {
  15700. c.header_ = make(http.Header)
  15701. }
  15702. return c.header_
  15703. }
  15704. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15705. reqHeaders := make(http.Header)
  15706. for k, v := range c.header_ {
  15707. reqHeaders[k] = v
  15708. }
  15709. reqHeaders.Set("User-Agent", c.s.userAgent())
  15710. var body io.Reader = nil
  15711. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15712. if err != nil {
  15713. return nil, err
  15714. }
  15715. reqHeaders.Set("Content-Type", "application/json")
  15716. c.urlParams_.Set("alt", alt)
  15717. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15718. urls += "?" + c.urlParams_.Encode()
  15719. req, _ := http.NewRequest("PATCH", urls, body)
  15720. req.Header = reqHeaders
  15721. googleapi.Expand(req.URL, map[string]string{
  15722. "profileId": strconv.FormatInt(c.profileId, 10),
  15723. })
  15724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15725. }
  15726. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15727. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15728. // status code is an error. Response headers are in either
  15729. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15730. // at all) in error.(*googleapi.Error).Header. Use
  15731. // googleapi.IsNotModified to check whether the returned error was
  15732. // because http.StatusNotModified was returned.
  15733. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15734. gensupport.SetOptions(c.urlParams_, opts...)
  15735. res, err := c.doRequest("json")
  15736. if res != nil && res.StatusCode == http.StatusNotModified {
  15737. if res.Body != nil {
  15738. res.Body.Close()
  15739. }
  15740. return nil, &googleapi.Error{
  15741. Code: res.StatusCode,
  15742. Header: res.Header,
  15743. }
  15744. }
  15745. if err != nil {
  15746. return nil, err
  15747. }
  15748. defer googleapi.CloseBody(res)
  15749. if err := googleapi.CheckResponse(res); err != nil {
  15750. return nil, err
  15751. }
  15752. ret := &AdvertiserGroup{
  15753. ServerResponse: googleapi.ServerResponse{
  15754. Header: res.Header,
  15755. HTTPStatusCode: res.StatusCode,
  15756. },
  15757. }
  15758. target := &ret
  15759. if err := gensupport.DecodeResponse(target, res); err != nil {
  15760. return nil, err
  15761. }
  15762. return ret, nil
  15763. // {
  15764. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15765. // "httpMethod": "PATCH",
  15766. // "id": "dfareporting.advertiserGroups.patch",
  15767. // "parameterOrder": [
  15768. // "profileId",
  15769. // "id"
  15770. // ],
  15771. // "parameters": {
  15772. // "id": {
  15773. // "description": "Advertiser group ID.",
  15774. // "format": "int64",
  15775. // "location": "query",
  15776. // "required": true,
  15777. // "type": "string"
  15778. // },
  15779. // "profileId": {
  15780. // "description": "User profile ID associated with this request.",
  15781. // "format": "int64",
  15782. // "location": "path",
  15783. // "required": true,
  15784. // "type": "string"
  15785. // }
  15786. // },
  15787. // "path": "userprofiles/{profileId}/advertiserGroups",
  15788. // "request": {
  15789. // "$ref": "AdvertiserGroup"
  15790. // },
  15791. // "response": {
  15792. // "$ref": "AdvertiserGroup"
  15793. // },
  15794. // "scopes": [
  15795. // "https://www.googleapis.com/auth/dfatrafficking"
  15796. // ]
  15797. // }
  15798. }
  15799. // method id "dfareporting.advertiserGroups.update":
  15800. type AdvertiserGroupsUpdateCall struct {
  15801. s *Service
  15802. profileId int64
  15803. advertisergroup *AdvertiserGroup
  15804. urlParams_ gensupport.URLParams
  15805. ctx_ context.Context
  15806. header_ http.Header
  15807. }
  15808. // Update: Updates an existing advertiser group.
  15809. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15810. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15811. c.profileId = profileId
  15812. c.advertisergroup = advertisergroup
  15813. return c
  15814. }
  15815. // Fields allows partial responses to be retrieved. See
  15816. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15817. // for more information.
  15818. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15819. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15820. return c
  15821. }
  15822. // Context sets the context to be used in this call's Do method. Any
  15823. // pending HTTP request will be aborted if the provided context is
  15824. // canceled.
  15825. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  15826. c.ctx_ = ctx
  15827. return c
  15828. }
  15829. // Header returns an http.Header that can be modified by the caller to
  15830. // add HTTP headers to the request.
  15831. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  15832. if c.header_ == nil {
  15833. c.header_ = make(http.Header)
  15834. }
  15835. return c.header_
  15836. }
  15837. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15838. reqHeaders := make(http.Header)
  15839. for k, v := range c.header_ {
  15840. reqHeaders[k] = v
  15841. }
  15842. reqHeaders.Set("User-Agent", c.s.userAgent())
  15843. var body io.Reader = nil
  15844. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15845. if err != nil {
  15846. return nil, err
  15847. }
  15848. reqHeaders.Set("Content-Type", "application/json")
  15849. c.urlParams_.Set("alt", alt)
  15850. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15851. urls += "?" + c.urlParams_.Encode()
  15852. req, _ := http.NewRequest("PUT", urls, body)
  15853. req.Header = reqHeaders
  15854. googleapi.Expand(req.URL, map[string]string{
  15855. "profileId": strconv.FormatInt(c.profileId, 10),
  15856. })
  15857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15858. }
  15859. // Do executes the "dfareporting.advertiserGroups.update" call.
  15860. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15861. // status code is an error. Response headers are in either
  15862. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15863. // at all) in error.(*googleapi.Error).Header. Use
  15864. // googleapi.IsNotModified to check whether the returned error was
  15865. // because http.StatusNotModified was returned.
  15866. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15867. gensupport.SetOptions(c.urlParams_, opts...)
  15868. res, err := c.doRequest("json")
  15869. if res != nil && res.StatusCode == http.StatusNotModified {
  15870. if res.Body != nil {
  15871. res.Body.Close()
  15872. }
  15873. return nil, &googleapi.Error{
  15874. Code: res.StatusCode,
  15875. Header: res.Header,
  15876. }
  15877. }
  15878. if err != nil {
  15879. return nil, err
  15880. }
  15881. defer googleapi.CloseBody(res)
  15882. if err := googleapi.CheckResponse(res); err != nil {
  15883. return nil, err
  15884. }
  15885. ret := &AdvertiserGroup{
  15886. ServerResponse: googleapi.ServerResponse{
  15887. Header: res.Header,
  15888. HTTPStatusCode: res.StatusCode,
  15889. },
  15890. }
  15891. target := &ret
  15892. if err := gensupport.DecodeResponse(target, res); err != nil {
  15893. return nil, err
  15894. }
  15895. return ret, nil
  15896. // {
  15897. // "description": "Updates an existing advertiser group.",
  15898. // "httpMethod": "PUT",
  15899. // "id": "dfareporting.advertiserGroups.update",
  15900. // "parameterOrder": [
  15901. // "profileId"
  15902. // ],
  15903. // "parameters": {
  15904. // "profileId": {
  15905. // "description": "User profile ID associated with this request.",
  15906. // "format": "int64",
  15907. // "location": "path",
  15908. // "required": true,
  15909. // "type": "string"
  15910. // }
  15911. // },
  15912. // "path": "userprofiles/{profileId}/advertiserGroups",
  15913. // "request": {
  15914. // "$ref": "AdvertiserGroup"
  15915. // },
  15916. // "response": {
  15917. // "$ref": "AdvertiserGroup"
  15918. // },
  15919. // "scopes": [
  15920. // "https://www.googleapis.com/auth/dfatrafficking"
  15921. // ]
  15922. // }
  15923. }
  15924. // method id "dfareporting.advertiserLandingPages.get":
  15925. type AdvertiserLandingPagesGetCall struct {
  15926. s *Service
  15927. profileId int64
  15928. id int64
  15929. urlParams_ gensupport.URLParams
  15930. ifNoneMatch_ string
  15931. ctx_ context.Context
  15932. header_ http.Header
  15933. }
  15934. // Get: Gets one landing page by ID.
  15935. func (r *AdvertiserLandingPagesService) Get(profileId int64, id int64) *AdvertiserLandingPagesGetCall {
  15936. c := &AdvertiserLandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15937. c.profileId = profileId
  15938. c.id = id
  15939. return c
  15940. }
  15941. // Fields allows partial responses to be retrieved. See
  15942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15943. // for more information.
  15944. func (c *AdvertiserLandingPagesGetCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesGetCall {
  15945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15946. return c
  15947. }
  15948. // IfNoneMatch sets the optional parameter which makes the operation
  15949. // fail if the object's ETag matches the given value. This is useful for
  15950. // getting updates only after the object has changed since the last
  15951. // request. Use googleapi.IsNotModified to check whether the response
  15952. // error from Do is the result of In-None-Match.
  15953. func (c *AdvertiserLandingPagesGetCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesGetCall {
  15954. c.ifNoneMatch_ = entityTag
  15955. return c
  15956. }
  15957. // Context sets the context to be used in this call's Do method. Any
  15958. // pending HTTP request will be aborted if the provided context is
  15959. // canceled.
  15960. func (c *AdvertiserLandingPagesGetCall) Context(ctx context.Context) *AdvertiserLandingPagesGetCall {
  15961. c.ctx_ = ctx
  15962. return c
  15963. }
  15964. // Header returns an http.Header that can be modified by the caller to
  15965. // add HTTP headers to the request.
  15966. func (c *AdvertiserLandingPagesGetCall) Header() http.Header {
  15967. if c.header_ == nil {
  15968. c.header_ = make(http.Header)
  15969. }
  15970. return c.header_
  15971. }
  15972. func (c *AdvertiserLandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  15973. reqHeaders := make(http.Header)
  15974. for k, v := range c.header_ {
  15975. reqHeaders[k] = v
  15976. }
  15977. reqHeaders.Set("User-Agent", c.s.userAgent())
  15978. if c.ifNoneMatch_ != "" {
  15979. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15980. }
  15981. var body io.Reader = nil
  15982. c.urlParams_.Set("alt", alt)
  15983. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages/{id}")
  15984. urls += "?" + c.urlParams_.Encode()
  15985. req, _ := http.NewRequest("GET", urls, body)
  15986. req.Header = reqHeaders
  15987. googleapi.Expand(req.URL, map[string]string{
  15988. "profileId": strconv.FormatInt(c.profileId, 10),
  15989. "id": strconv.FormatInt(c.id, 10),
  15990. })
  15991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15992. }
  15993. // Do executes the "dfareporting.advertiserLandingPages.get" call.
  15994. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  15995. // status code is an error. Response headers are in either
  15996. // *LandingPage.ServerResponse.Header or (if a response was returned at
  15997. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15998. // to check whether the returned error was because
  15999. // http.StatusNotModified was returned.
  16000. func (c *AdvertiserLandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16001. gensupport.SetOptions(c.urlParams_, opts...)
  16002. res, err := c.doRequest("json")
  16003. if res != nil && res.StatusCode == http.StatusNotModified {
  16004. if res.Body != nil {
  16005. res.Body.Close()
  16006. }
  16007. return nil, &googleapi.Error{
  16008. Code: res.StatusCode,
  16009. Header: res.Header,
  16010. }
  16011. }
  16012. if err != nil {
  16013. return nil, err
  16014. }
  16015. defer googleapi.CloseBody(res)
  16016. if err := googleapi.CheckResponse(res); err != nil {
  16017. return nil, err
  16018. }
  16019. ret := &LandingPage{
  16020. ServerResponse: googleapi.ServerResponse{
  16021. Header: res.Header,
  16022. HTTPStatusCode: res.StatusCode,
  16023. },
  16024. }
  16025. target := &ret
  16026. if err := gensupport.DecodeResponse(target, res); err != nil {
  16027. return nil, err
  16028. }
  16029. return ret, nil
  16030. // {
  16031. // "description": "Gets one landing page by ID.",
  16032. // "httpMethod": "GET",
  16033. // "id": "dfareporting.advertiserLandingPages.get",
  16034. // "parameterOrder": [
  16035. // "profileId",
  16036. // "id"
  16037. // ],
  16038. // "parameters": {
  16039. // "id": {
  16040. // "description": "Landing page ID.",
  16041. // "format": "int64",
  16042. // "location": "path",
  16043. // "required": true,
  16044. // "type": "string"
  16045. // },
  16046. // "profileId": {
  16047. // "description": "User profile ID associated with this request.",
  16048. // "format": "int64",
  16049. // "location": "path",
  16050. // "required": true,
  16051. // "type": "string"
  16052. // }
  16053. // },
  16054. // "path": "userprofiles/{profileId}/advertiserLandingPages/{id}",
  16055. // "response": {
  16056. // "$ref": "LandingPage"
  16057. // },
  16058. // "scopes": [
  16059. // "https://www.googleapis.com/auth/dfatrafficking"
  16060. // ]
  16061. // }
  16062. }
  16063. // method id "dfareporting.advertiserLandingPages.insert":
  16064. type AdvertiserLandingPagesInsertCall struct {
  16065. s *Service
  16066. profileId int64
  16067. landingpage *LandingPage
  16068. urlParams_ gensupport.URLParams
  16069. ctx_ context.Context
  16070. header_ http.Header
  16071. }
  16072. // Insert: Inserts a new landing page.
  16073. func (r *AdvertiserLandingPagesService) Insert(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesInsertCall {
  16074. c := &AdvertiserLandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16075. c.profileId = profileId
  16076. c.landingpage = landingpage
  16077. return c
  16078. }
  16079. // Fields allows partial responses to be retrieved. See
  16080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16081. // for more information.
  16082. func (c *AdvertiserLandingPagesInsertCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesInsertCall {
  16083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16084. return c
  16085. }
  16086. // Context sets the context to be used in this call's Do method. Any
  16087. // pending HTTP request will be aborted if the provided context is
  16088. // canceled.
  16089. func (c *AdvertiserLandingPagesInsertCall) Context(ctx context.Context) *AdvertiserLandingPagesInsertCall {
  16090. c.ctx_ = ctx
  16091. return c
  16092. }
  16093. // Header returns an http.Header that can be modified by the caller to
  16094. // add HTTP headers to the request.
  16095. func (c *AdvertiserLandingPagesInsertCall) Header() http.Header {
  16096. if c.header_ == nil {
  16097. c.header_ = make(http.Header)
  16098. }
  16099. return c.header_
  16100. }
  16101. func (c *AdvertiserLandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  16102. reqHeaders := make(http.Header)
  16103. for k, v := range c.header_ {
  16104. reqHeaders[k] = v
  16105. }
  16106. reqHeaders.Set("User-Agent", c.s.userAgent())
  16107. var body io.Reader = nil
  16108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16109. if err != nil {
  16110. return nil, err
  16111. }
  16112. reqHeaders.Set("Content-Type", "application/json")
  16113. c.urlParams_.Set("alt", alt)
  16114. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16115. urls += "?" + c.urlParams_.Encode()
  16116. req, _ := http.NewRequest("POST", urls, body)
  16117. req.Header = reqHeaders
  16118. googleapi.Expand(req.URL, map[string]string{
  16119. "profileId": strconv.FormatInt(c.profileId, 10),
  16120. })
  16121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16122. }
  16123. // Do executes the "dfareporting.advertiserLandingPages.insert" call.
  16124. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16125. // status code is an error. Response headers are in either
  16126. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16127. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16128. // to check whether the returned error was because
  16129. // http.StatusNotModified was returned.
  16130. func (c *AdvertiserLandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16131. gensupport.SetOptions(c.urlParams_, opts...)
  16132. res, err := c.doRequest("json")
  16133. if res != nil && res.StatusCode == http.StatusNotModified {
  16134. if res.Body != nil {
  16135. res.Body.Close()
  16136. }
  16137. return nil, &googleapi.Error{
  16138. Code: res.StatusCode,
  16139. Header: res.Header,
  16140. }
  16141. }
  16142. if err != nil {
  16143. return nil, err
  16144. }
  16145. defer googleapi.CloseBody(res)
  16146. if err := googleapi.CheckResponse(res); err != nil {
  16147. return nil, err
  16148. }
  16149. ret := &LandingPage{
  16150. ServerResponse: googleapi.ServerResponse{
  16151. Header: res.Header,
  16152. HTTPStatusCode: res.StatusCode,
  16153. },
  16154. }
  16155. target := &ret
  16156. if err := gensupport.DecodeResponse(target, res); err != nil {
  16157. return nil, err
  16158. }
  16159. return ret, nil
  16160. // {
  16161. // "description": "Inserts a new landing page.",
  16162. // "httpMethod": "POST",
  16163. // "id": "dfareporting.advertiserLandingPages.insert",
  16164. // "parameterOrder": [
  16165. // "profileId"
  16166. // ],
  16167. // "parameters": {
  16168. // "profileId": {
  16169. // "description": "User profile ID associated with this request.",
  16170. // "format": "int64",
  16171. // "location": "path",
  16172. // "required": true,
  16173. // "type": "string"
  16174. // }
  16175. // },
  16176. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16177. // "request": {
  16178. // "$ref": "LandingPage"
  16179. // },
  16180. // "response": {
  16181. // "$ref": "LandingPage"
  16182. // },
  16183. // "scopes": [
  16184. // "https://www.googleapis.com/auth/dfatrafficking"
  16185. // ]
  16186. // }
  16187. }
  16188. // method id "dfareporting.advertiserLandingPages.list":
  16189. type AdvertiserLandingPagesListCall struct {
  16190. s *Service
  16191. profileId int64
  16192. urlParams_ gensupport.URLParams
  16193. ifNoneMatch_ string
  16194. ctx_ context.Context
  16195. header_ http.Header
  16196. }
  16197. // List: Retrieves a list of landing pages.
  16198. func (r *AdvertiserLandingPagesService) List(profileId int64) *AdvertiserLandingPagesListCall {
  16199. c := &AdvertiserLandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16200. c.profileId = profileId
  16201. return c
  16202. }
  16203. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  16204. // only landing pages that belong to these advertisers.
  16205. func (c *AdvertiserLandingPagesListCall) AdvertiserIds(advertiserIds ...int64) *AdvertiserLandingPagesListCall {
  16206. var advertiserIds_ []string
  16207. for _, v := range advertiserIds {
  16208. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  16209. }
  16210. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  16211. return c
  16212. }
  16213. // Archived sets the optional parameter "archived": Select only archived
  16214. // landing pages. Don't set this field to select both archived and
  16215. // non-archived landing pages.
  16216. func (c *AdvertiserLandingPagesListCall) Archived(archived bool) *AdvertiserLandingPagesListCall {
  16217. c.urlParams_.Set("archived", fmt.Sprint(archived))
  16218. return c
  16219. }
  16220. // Ids sets the optional parameter "ids": Select only landing pages with
  16221. // these IDs.
  16222. func (c *AdvertiserLandingPagesListCall) Ids(ids ...int64) *AdvertiserLandingPagesListCall {
  16223. var ids_ []string
  16224. for _, v := range ids {
  16225. ids_ = append(ids_, fmt.Sprint(v))
  16226. }
  16227. c.urlParams_.SetMulti("ids", ids_)
  16228. return c
  16229. }
  16230. // MaxResults sets the optional parameter "maxResults": Maximum number
  16231. // of results to return.
  16232. func (c *AdvertiserLandingPagesListCall) MaxResults(maxResults int64) *AdvertiserLandingPagesListCall {
  16233. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16234. return c
  16235. }
  16236. // PageToken sets the optional parameter "pageToken": Value of the
  16237. // nextPageToken from the previous result page.
  16238. func (c *AdvertiserLandingPagesListCall) PageToken(pageToken string) *AdvertiserLandingPagesListCall {
  16239. c.urlParams_.Set("pageToken", pageToken)
  16240. return c
  16241. }
  16242. // SearchString sets the optional parameter "searchString": Allows
  16243. // searching for landing pages by name or ID. Wildcards (*) are allowed.
  16244. // For example, "landingpage*2017" will return landing pages with names
  16245. // like "landingpage July 2017", "landingpage March 2017", or simply
  16246. // "landingpage 2017". Most of the searches also add wildcards
  16247. // implicitly at the start and the end of the search string. For
  16248. // example, a search string of "landingpage" will match campaigns with
  16249. // name "my landingpage", "landingpage 2015", or simply "landingpage".
  16250. func (c *AdvertiserLandingPagesListCall) SearchString(searchString string) *AdvertiserLandingPagesListCall {
  16251. c.urlParams_.Set("searchString", searchString)
  16252. return c
  16253. }
  16254. // SortField sets the optional parameter "sortField": Field by which to
  16255. // sort the list.
  16256. //
  16257. // Possible values:
  16258. // "ID" (default)
  16259. // "NAME"
  16260. func (c *AdvertiserLandingPagesListCall) SortField(sortField string) *AdvertiserLandingPagesListCall {
  16261. c.urlParams_.Set("sortField", sortField)
  16262. return c
  16263. }
  16264. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16265. // results.
  16266. //
  16267. // Possible values:
  16268. // "ASCENDING" (default)
  16269. // "DESCENDING"
  16270. func (c *AdvertiserLandingPagesListCall) SortOrder(sortOrder string) *AdvertiserLandingPagesListCall {
  16271. c.urlParams_.Set("sortOrder", sortOrder)
  16272. return c
  16273. }
  16274. // SubaccountId sets the optional parameter "subaccountId": Select only
  16275. // landing pages that belong to this subaccount.
  16276. func (c *AdvertiserLandingPagesListCall) SubaccountId(subaccountId int64) *AdvertiserLandingPagesListCall {
  16277. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  16278. return c
  16279. }
  16280. // Fields allows partial responses to be retrieved. See
  16281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16282. // for more information.
  16283. func (c *AdvertiserLandingPagesListCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesListCall {
  16284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16285. return c
  16286. }
  16287. // IfNoneMatch sets the optional parameter which makes the operation
  16288. // fail if the object's ETag matches the given value. This is useful for
  16289. // getting updates only after the object has changed since the last
  16290. // request. Use googleapi.IsNotModified to check whether the response
  16291. // error from Do is the result of In-None-Match.
  16292. func (c *AdvertiserLandingPagesListCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesListCall {
  16293. c.ifNoneMatch_ = entityTag
  16294. return c
  16295. }
  16296. // Context sets the context to be used in this call's Do method. Any
  16297. // pending HTTP request will be aborted if the provided context is
  16298. // canceled.
  16299. func (c *AdvertiserLandingPagesListCall) Context(ctx context.Context) *AdvertiserLandingPagesListCall {
  16300. c.ctx_ = ctx
  16301. return c
  16302. }
  16303. // Header returns an http.Header that can be modified by the caller to
  16304. // add HTTP headers to the request.
  16305. func (c *AdvertiserLandingPagesListCall) Header() http.Header {
  16306. if c.header_ == nil {
  16307. c.header_ = make(http.Header)
  16308. }
  16309. return c.header_
  16310. }
  16311. func (c *AdvertiserLandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  16312. reqHeaders := make(http.Header)
  16313. for k, v := range c.header_ {
  16314. reqHeaders[k] = v
  16315. }
  16316. reqHeaders.Set("User-Agent", c.s.userAgent())
  16317. if c.ifNoneMatch_ != "" {
  16318. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16319. }
  16320. var body io.Reader = nil
  16321. c.urlParams_.Set("alt", alt)
  16322. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16323. urls += "?" + c.urlParams_.Encode()
  16324. req, _ := http.NewRequest("GET", urls, body)
  16325. req.Header = reqHeaders
  16326. googleapi.Expand(req.URL, map[string]string{
  16327. "profileId": strconv.FormatInt(c.profileId, 10),
  16328. })
  16329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16330. }
  16331. // Do executes the "dfareporting.advertiserLandingPages.list" call.
  16332. // Exactly one of *AdvertiserLandingPagesListResponse or error will be
  16333. // non-nil. Any non-2xx status code is an error. Response headers are in
  16334. // either *AdvertiserLandingPagesListResponse.ServerResponse.Header or
  16335. // (if a response was returned at all) in
  16336. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16337. // whether the returned error was because http.StatusNotModified was
  16338. // returned.
  16339. func (c *AdvertiserLandingPagesListCall) Do(opts ...googleapi.CallOption) (*AdvertiserLandingPagesListResponse, error) {
  16340. gensupport.SetOptions(c.urlParams_, opts...)
  16341. res, err := c.doRequest("json")
  16342. if res != nil && res.StatusCode == http.StatusNotModified {
  16343. if res.Body != nil {
  16344. res.Body.Close()
  16345. }
  16346. return nil, &googleapi.Error{
  16347. Code: res.StatusCode,
  16348. Header: res.Header,
  16349. }
  16350. }
  16351. if err != nil {
  16352. return nil, err
  16353. }
  16354. defer googleapi.CloseBody(res)
  16355. if err := googleapi.CheckResponse(res); err != nil {
  16356. return nil, err
  16357. }
  16358. ret := &AdvertiserLandingPagesListResponse{
  16359. ServerResponse: googleapi.ServerResponse{
  16360. Header: res.Header,
  16361. HTTPStatusCode: res.StatusCode,
  16362. },
  16363. }
  16364. target := &ret
  16365. if err := gensupport.DecodeResponse(target, res); err != nil {
  16366. return nil, err
  16367. }
  16368. return ret, nil
  16369. // {
  16370. // "description": "Retrieves a list of landing pages.",
  16371. // "httpMethod": "GET",
  16372. // "id": "dfareporting.advertiserLandingPages.list",
  16373. // "parameterOrder": [
  16374. // "profileId"
  16375. // ],
  16376. // "parameters": {
  16377. // "advertiserIds": {
  16378. // "description": "Select only landing pages that belong to these advertisers.",
  16379. // "format": "int64",
  16380. // "location": "query",
  16381. // "repeated": true,
  16382. // "type": "string"
  16383. // },
  16384. // "archived": {
  16385. // "description": "Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.",
  16386. // "location": "query",
  16387. // "type": "boolean"
  16388. // },
  16389. // "ids": {
  16390. // "description": "Select only landing pages with these IDs.",
  16391. // "format": "int64",
  16392. // "location": "query",
  16393. // "repeated": true,
  16394. // "type": "string"
  16395. // },
  16396. // "maxResults": {
  16397. // "default": "1000",
  16398. // "description": "Maximum number of results to return.",
  16399. // "format": "int32",
  16400. // "location": "query",
  16401. // "maximum": "1000",
  16402. // "minimum": "0",
  16403. // "type": "integer"
  16404. // },
  16405. // "pageToken": {
  16406. // "description": "Value of the nextPageToken from the previous result page.",
  16407. // "location": "query",
  16408. // "type": "string"
  16409. // },
  16410. // "profileId": {
  16411. // "description": "User profile ID associated with this request.",
  16412. // "format": "int64",
  16413. // "location": "path",
  16414. // "required": true,
  16415. // "type": "string"
  16416. // },
  16417. // "searchString": {
  16418. // "description": "Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, \"landingpage*2017\" will return landing pages with names like \"landingpage July 2017\", \"landingpage March 2017\", or simply \"landingpage 2017\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"landingpage\" will match campaigns with name \"my landingpage\", \"landingpage 2015\", or simply \"landingpage\".",
  16419. // "location": "query",
  16420. // "type": "string"
  16421. // },
  16422. // "sortField": {
  16423. // "default": "ID",
  16424. // "description": "Field by which to sort the list.",
  16425. // "enum": [
  16426. // "ID",
  16427. // "NAME"
  16428. // ],
  16429. // "enumDescriptions": [
  16430. // "",
  16431. // ""
  16432. // ],
  16433. // "location": "query",
  16434. // "type": "string"
  16435. // },
  16436. // "sortOrder": {
  16437. // "default": "ASCENDING",
  16438. // "description": "Order of sorted results.",
  16439. // "enum": [
  16440. // "ASCENDING",
  16441. // "DESCENDING"
  16442. // ],
  16443. // "enumDescriptions": [
  16444. // "",
  16445. // ""
  16446. // ],
  16447. // "location": "query",
  16448. // "type": "string"
  16449. // },
  16450. // "subaccountId": {
  16451. // "description": "Select only landing pages that belong to this subaccount.",
  16452. // "format": "int64",
  16453. // "location": "query",
  16454. // "type": "string"
  16455. // }
  16456. // },
  16457. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16458. // "response": {
  16459. // "$ref": "AdvertiserLandingPagesListResponse"
  16460. // },
  16461. // "scopes": [
  16462. // "https://www.googleapis.com/auth/dfatrafficking"
  16463. // ]
  16464. // }
  16465. }
  16466. // Pages invokes f for each page of results.
  16467. // A non-nil error returned from f will halt the iteration.
  16468. // The provided context supersedes any context provided to the Context method.
  16469. func (c *AdvertiserLandingPagesListCall) Pages(ctx context.Context, f func(*AdvertiserLandingPagesListResponse) error) error {
  16470. c.ctx_ = ctx
  16471. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16472. for {
  16473. x, err := c.Do()
  16474. if err != nil {
  16475. return err
  16476. }
  16477. if err := f(x); err != nil {
  16478. return err
  16479. }
  16480. if x.NextPageToken == "" {
  16481. return nil
  16482. }
  16483. c.PageToken(x.NextPageToken)
  16484. }
  16485. }
  16486. // method id "dfareporting.advertiserLandingPages.patch":
  16487. type AdvertiserLandingPagesPatchCall struct {
  16488. s *Service
  16489. profileId int64
  16490. landingpage *LandingPage
  16491. urlParams_ gensupport.URLParams
  16492. ctx_ context.Context
  16493. header_ http.Header
  16494. }
  16495. // Patch: Updates an existing landing page. This method supports patch
  16496. // semantics.
  16497. func (r *AdvertiserLandingPagesService) Patch(profileId int64, id int64, landingpage *LandingPage) *AdvertiserLandingPagesPatchCall {
  16498. c := &AdvertiserLandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16499. c.profileId = profileId
  16500. c.urlParams_.Set("id", fmt.Sprint(id))
  16501. c.landingpage = landingpage
  16502. return c
  16503. }
  16504. // Fields allows partial responses to be retrieved. See
  16505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16506. // for more information.
  16507. func (c *AdvertiserLandingPagesPatchCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesPatchCall {
  16508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16509. return c
  16510. }
  16511. // Context sets the context to be used in this call's Do method. Any
  16512. // pending HTTP request will be aborted if the provided context is
  16513. // canceled.
  16514. func (c *AdvertiserLandingPagesPatchCall) Context(ctx context.Context) *AdvertiserLandingPagesPatchCall {
  16515. c.ctx_ = ctx
  16516. return c
  16517. }
  16518. // Header returns an http.Header that can be modified by the caller to
  16519. // add HTTP headers to the request.
  16520. func (c *AdvertiserLandingPagesPatchCall) Header() http.Header {
  16521. if c.header_ == nil {
  16522. c.header_ = make(http.Header)
  16523. }
  16524. return c.header_
  16525. }
  16526. func (c *AdvertiserLandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  16527. reqHeaders := make(http.Header)
  16528. for k, v := range c.header_ {
  16529. reqHeaders[k] = v
  16530. }
  16531. reqHeaders.Set("User-Agent", c.s.userAgent())
  16532. var body io.Reader = nil
  16533. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16534. if err != nil {
  16535. return nil, err
  16536. }
  16537. reqHeaders.Set("Content-Type", "application/json")
  16538. c.urlParams_.Set("alt", alt)
  16539. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16540. urls += "?" + c.urlParams_.Encode()
  16541. req, _ := http.NewRequest("PATCH", urls, body)
  16542. req.Header = reqHeaders
  16543. googleapi.Expand(req.URL, map[string]string{
  16544. "profileId": strconv.FormatInt(c.profileId, 10),
  16545. })
  16546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16547. }
  16548. // Do executes the "dfareporting.advertiserLandingPages.patch" call.
  16549. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16550. // status code is an error. Response headers are in either
  16551. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16553. // to check whether the returned error was because
  16554. // http.StatusNotModified was returned.
  16555. func (c *AdvertiserLandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16556. gensupport.SetOptions(c.urlParams_, opts...)
  16557. res, err := c.doRequest("json")
  16558. if res != nil && res.StatusCode == http.StatusNotModified {
  16559. if res.Body != nil {
  16560. res.Body.Close()
  16561. }
  16562. return nil, &googleapi.Error{
  16563. Code: res.StatusCode,
  16564. Header: res.Header,
  16565. }
  16566. }
  16567. if err != nil {
  16568. return nil, err
  16569. }
  16570. defer googleapi.CloseBody(res)
  16571. if err := googleapi.CheckResponse(res); err != nil {
  16572. return nil, err
  16573. }
  16574. ret := &LandingPage{
  16575. ServerResponse: googleapi.ServerResponse{
  16576. Header: res.Header,
  16577. HTTPStatusCode: res.StatusCode,
  16578. },
  16579. }
  16580. target := &ret
  16581. if err := gensupport.DecodeResponse(target, res); err != nil {
  16582. return nil, err
  16583. }
  16584. return ret, nil
  16585. // {
  16586. // "description": "Updates an existing landing page. This method supports patch semantics.",
  16587. // "httpMethod": "PATCH",
  16588. // "id": "dfareporting.advertiserLandingPages.patch",
  16589. // "parameterOrder": [
  16590. // "profileId",
  16591. // "id"
  16592. // ],
  16593. // "parameters": {
  16594. // "id": {
  16595. // "description": "Landing page ID.",
  16596. // "format": "int64",
  16597. // "location": "query",
  16598. // "required": true,
  16599. // "type": "string"
  16600. // },
  16601. // "profileId": {
  16602. // "description": "User profile ID associated with this request.",
  16603. // "format": "int64",
  16604. // "location": "path",
  16605. // "required": true,
  16606. // "type": "string"
  16607. // }
  16608. // },
  16609. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16610. // "request": {
  16611. // "$ref": "LandingPage"
  16612. // },
  16613. // "response": {
  16614. // "$ref": "LandingPage"
  16615. // },
  16616. // "scopes": [
  16617. // "https://www.googleapis.com/auth/dfatrafficking"
  16618. // ]
  16619. // }
  16620. }
  16621. // method id "dfareporting.advertiserLandingPages.update":
  16622. type AdvertiserLandingPagesUpdateCall struct {
  16623. s *Service
  16624. profileId int64
  16625. landingpage *LandingPage
  16626. urlParams_ gensupport.URLParams
  16627. ctx_ context.Context
  16628. header_ http.Header
  16629. }
  16630. // Update: Updates an existing landing page.
  16631. func (r *AdvertiserLandingPagesService) Update(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesUpdateCall {
  16632. c := &AdvertiserLandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16633. c.profileId = profileId
  16634. c.landingpage = landingpage
  16635. return c
  16636. }
  16637. // Fields allows partial responses to be retrieved. See
  16638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16639. // for more information.
  16640. func (c *AdvertiserLandingPagesUpdateCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesUpdateCall {
  16641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16642. return c
  16643. }
  16644. // Context sets the context to be used in this call's Do method. Any
  16645. // pending HTTP request will be aborted if the provided context is
  16646. // canceled.
  16647. func (c *AdvertiserLandingPagesUpdateCall) Context(ctx context.Context) *AdvertiserLandingPagesUpdateCall {
  16648. c.ctx_ = ctx
  16649. return c
  16650. }
  16651. // Header returns an http.Header that can be modified by the caller to
  16652. // add HTTP headers to the request.
  16653. func (c *AdvertiserLandingPagesUpdateCall) Header() http.Header {
  16654. if c.header_ == nil {
  16655. c.header_ = make(http.Header)
  16656. }
  16657. return c.header_
  16658. }
  16659. func (c *AdvertiserLandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16660. reqHeaders := make(http.Header)
  16661. for k, v := range c.header_ {
  16662. reqHeaders[k] = v
  16663. }
  16664. reqHeaders.Set("User-Agent", c.s.userAgent())
  16665. var body io.Reader = nil
  16666. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16667. if err != nil {
  16668. return nil, err
  16669. }
  16670. reqHeaders.Set("Content-Type", "application/json")
  16671. c.urlParams_.Set("alt", alt)
  16672. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16673. urls += "?" + c.urlParams_.Encode()
  16674. req, _ := http.NewRequest("PUT", urls, body)
  16675. req.Header = reqHeaders
  16676. googleapi.Expand(req.URL, map[string]string{
  16677. "profileId": strconv.FormatInt(c.profileId, 10),
  16678. })
  16679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16680. }
  16681. // Do executes the "dfareporting.advertiserLandingPages.update" call.
  16682. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16683. // status code is an error. Response headers are in either
  16684. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16685. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16686. // to check whether the returned error was because
  16687. // http.StatusNotModified was returned.
  16688. func (c *AdvertiserLandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16689. gensupport.SetOptions(c.urlParams_, opts...)
  16690. res, err := c.doRequest("json")
  16691. if res != nil && res.StatusCode == http.StatusNotModified {
  16692. if res.Body != nil {
  16693. res.Body.Close()
  16694. }
  16695. return nil, &googleapi.Error{
  16696. Code: res.StatusCode,
  16697. Header: res.Header,
  16698. }
  16699. }
  16700. if err != nil {
  16701. return nil, err
  16702. }
  16703. defer googleapi.CloseBody(res)
  16704. if err := googleapi.CheckResponse(res); err != nil {
  16705. return nil, err
  16706. }
  16707. ret := &LandingPage{
  16708. ServerResponse: googleapi.ServerResponse{
  16709. Header: res.Header,
  16710. HTTPStatusCode: res.StatusCode,
  16711. },
  16712. }
  16713. target := &ret
  16714. if err := gensupport.DecodeResponse(target, res); err != nil {
  16715. return nil, err
  16716. }
  16717. return ret, nil
  16718. // {
  16719. // "description": "Updates an existing landing page.",
  16720. // "httpMethod": "PUT",
  16721. // "id": "dfareporting.advertiserLandingPages.update",
  16722. // "parameterOrder": [
  16723. // "profileId"
  16724. // ],
  16725. // "parameters": {
  16726. // "profileId": {
  16727. // "description": "User profile ID associated with this request.",
  16728. // "format": "int64",
  16729. // "location": "path",
  16730. // "required": true,
  16731. // "type": "string"
  16732. // }
  16733. // },
  16734. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16735. // "request": {
  16736. // "$ref": "LandingPage"
  16737. // },
  16738. // "response": {
  16739. // "$ref": "LandingPage"
  16740. // },
  16741. // "scopes": [
  16742. // "https://www.googleapis.com/auth/dfatrafficking"
  16743. // ]
  16744. // }
  16745. }
  16746. // method id "dfareporting.advertisers.get":
  16747. type AdvertisersGetCall struct {
  16748. s *Service
  16749. profileId int64
  16750. id int64
  16751. urlParams_ gensupport.URLParams
  16752. ifNoneMatch_ string
  16753. ctx_ context.Context
  16754. header_ http.Header
  16755. }
  16756. // Get: Gets one advertiser by ID.
  16757. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  16758. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16759. c.profileId = profileId
  16760. c.id = id
  16761. return c
  16762. }
  16763. // Fields allows partial responses to be retrieved. See
  16764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16765. // for more information.
  16766. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  16767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16768. return c
  16769. }
  16770. // IfNoneMatch sets the optional parameter which makes the operation
  16771. // fail if the object's ETag matches the given value. This is useful for
  16772. // getting updates only after the object has changed since the last
  16773. // request. Use googleapi.IsNotModified to check whether the response
  16774. // error from Do is the result of In-None-Match.
  16775. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  16776. c.ifNoneMatch_ = entityTag
  16777. return c
  16778. }
  16779. // Context sets the context to be used in this call's Do method. Any
  16780. // pending HTTP request will be aborted if the provided context is
  16781. // canceled.
  16782. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  16783. c.ctx_ = ctx
  16784. return c
  16785. }
  16786. // Header returns an http.Header that can be modified by the caller to
  16787. // add HTTP headers to the request.
  16788. func (c *AdvertisersGetCall) Header() http.Header {
  16789. if c.header_ == nil {
  16790. c.header_ = make(http.Header)
  16791. }
  16792. return c.header_
  16793. }
  16794. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  16795. reqHeaders := make(http.Header)
  16796. for k, v := range c.header_ {
  16797. reqHeaders[k] = v
  16798. }
  16799. reqHeaders.Set("User-Agent", c.s.userAgent())
  16800. if c.ifNoneMatch_ != "" {
  16801. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16802. }
  16803. var body io.Reader = nil
  16804. c.urlParams_.Set("alt", alt)
  16805. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  16806. urls += "?" + c.urlParams_.Encode()
  16807. req, _ := http.NewRequest("GET", urls, body)
  16808. req.Header = reqHeaders
  16809. googleapi.Expand(req.URL, map[string]string{
  16810. "profileId": strconv.FormatInt(c.profileId, 10),
  16811. "id": strconv.FormatInt(c.id, 10),
  16812. })
  16813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16814. }
  16815. // Do executes the "dfareporting.advertisers.get" call.
  16816. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16817. // status code is an error. Response headers are in either
  16818. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16819. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16820. // to check whether the returned error was because
  16821. // http.StatusNotModified was returned.
  16822. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16823. gensupport.SetOptions(c.urlParams_, opts...)
  16824. res, err := c.doRequest("json")
  16825. if res != nil && res.StatusCode == http.StatusNotModified {
  16826. if res.Body != nil {
  16827. res.Body.Close()
  16828. }
  16829. return nil, &googleapi.Error{
  16830. Code: res.StatusCode,
  16831. Header: res.Header,
  16832. }
  16833. }
  16834. if err != nil {
  16835. return nil, err
  16836. }
  16837. defer googleapi.CloseBody(res)
  16838. if err := googleapi.CheckResponse(res); err != nil {
  16839. return nil, err
  16840. }
  16841. ret := &Advertiser{
  16842. ServerResponse: googleapi.ServerResponse{
  16843. Header: res.Header,
  16844. HTTPStatusCode: res.StatusCode,
  16845. },
  16846. }
  16847. target := &ret
  16848. if err := gensupport.DecodeResponse(target, res); err != nil {
  16849. return nil, err
  16850. }
  16851. return ret, nil
  16852. // {
  16853. // "description": "Gets one advertiser by ID.",
  16854. // "httpMethod": "GET",
  16855. // "id": "dfareporting.advertisers.get",
  16856. // "parameterOrder": [
  16857. // "profileId",
  16858. // "id"
  16859. // ],
  16860. // "parameters": {
  16861. // "id": {
  16862. // "description": "Advertiser ID.",
  16863. // "format": "int64",
  16864. // "location": "path",
  16865. // "required": true,
  16866. // "type": "string"
  16867. // },
  16868. // "profileId": {
  16869. // "description": "User profile ID associated with this request.",
  16870. // "format": "int64",
  16871. // "location": "path",
  16872. // "required": true,
  16873. // "type": "string"
  16874. // }
  16875. // },
  16876. // "path": "userprofiles/{profileId}/advertisers/{id}",
  16877. // "response": {
  16878. // "$ref": "Advertiser"
  16879. // },
  16880. // "scopes": [
  16881. // "https://www.googleapis.com/auth/dfatrafficking"
  16882. // ]
  16883. // }
  16884. }
  16885. // method id "dfareporting.advertisers.insert":
  16886. type AdvertisersInsertCall struct {
  16887. s *Service
  16888. profileId int64
  16889. advertiser *Advertiser
  16890. urlParams_ gensupport.URLParams
  16891. ctx_ context.Context
  16892. header_ http.Header
  16893. }
  16894. // Insert: Inserts a new advertiser.
  16895. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  16896. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16897. c.profileId = profileId
  16898. c.advertiser = advertiser
  16899. return c
  16900. }
  16901. // Fields allows partial responses to be retrieved. See
  16902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16903. // for more information.
  16904. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  16905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16906. return c
  16907. }
  16908. // Context sets the context to be used in this call's Do method. Any
  16909. // pending HTTP request will be aborted if the provided context is
  16910. // canceled.
  16911. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  16912. c.ctx_ = ctx
  16913. return c
  16914. }
  16915. // Header returns an http.Header that can be modified by the caller to
  16916. // add HTTP headers to the request.
  16917. func (c *AdvertisersInsertCall) Header() http.Header {
  16918. if c.header_ == nil {
  16919. c.header_ = make(http.Header)
  16920. }
  16921. return c.header_
  16922. }
  16923. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  16924. reqHeaders := make(http.Header)
  16925. for k, v := range c.header_ {
  16926. reqHeaders[k] = v
  16927. }
  16928. reqHeaders.Set("User-Agent", c.s.userAgent())
  16929. var body io.Reader = nil
  16930. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  16931. if err != nil {
  16932. return nil, err
  16933. }
  16934. reqHeaders.Set("Content-Type", "application/json")
  16935. c.urlParams_.Set("alt", alt)
  16936. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  16937. urls += "?" + c.urlParams_.Encode()
  16938. req, _ := http.NewRequest("POST", urls, body)
  16939. req.Header = reqHeaders
  16940. googleapi.Expand(req.URL, map[string]string{
  16941. "profileId": strconv.FormatInt(c.profileId, 10),
  16942. })
  16943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16944. }
  16945. // Do executes the "dfareporting.advertisers.insert" call.
  16946. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16947. // status code is an error. Response headers are in either
  16948. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16949. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16950. // to check whether the returned error was because
  16951. // http.StatusNotModified was returned.
  16952. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16953. gensupport.SetOptions(c.urlParams_, opts...)
  16954. res, err := c.doRequest("json")
  16955. if res != nil && res.StatusCode == http.StatusNotModified {
  16956. if res.Body != nil {
  16957. res.Body.Close()
  16958. }
  16959. return nil, &googleapi.Error{
  16960. Code: res.StatusCode,
  16961. Header: res.Header,
  16962. }
  16963. }
  16964. if err != nil {
  16965. return nil, err
  16966. }
  16967. defer googleapi.CloseBody(res)
  16968. if err := googleapi.CheckResponse(res); err != nil {
  16969. return nil, err
  16970. }
  16971. ret := &Advertiser{
  16972. ServerResponse: googleapi.ServerResponse{
  16973. Header: res.Header,
  16974. HTTPStatusCode: res.StatusCode,
  16975. },
  16976. }
  16977. target := &ret
  16978. if err := gensupport.DecodeResponse(target, res); err != nil {
  16979. return nil, err
  16980. }
  16981. return ret, nil
  16982. // {
  16983. // "description": "Inserts a new advertiser.",
  16984. // "httpMethod": "POST",
  16985. // "id": "dfareporting.advertisers.insert",
  16986. // "parameterOrder": [
  16987. // "profileId"
  16988. // ],
  16989. // "parameters": {
  16990. // "profileId": {
  16991. // "description": "User profile ID associated with this request.",
  16992. // "format": "int64",
  16993. // "location": "path",
  16994. // "required": true,
  16995. // "type": "string"
  16996. // }
  16997. // },
  16998. // "path": "userprofiles/{profileId}/advertisers",
  16999. // "request": {
  17000. // "$ref": "Advertiser"
  17001. // },
  17002. // "response": {
  17003. // "$ref": "Advertiser"
  17004. // },
  17005. // "scopes": [
  17006. // "https://www.googleapis.com/auth/dfatrafficking"
  17007. // ]
  17008. // }
  17009. }
  17010. // method id "dfareporting.advertisers.list":
  17011. type AdvertisersListCall struct {
  17012. s *Service
  17013. profileId int64
  17014. urlParams_ gensupport.URLParams
  17015. ifNoneMatch_ string
  17016. ctx_ context.Context
  17017. header_ http.Header
  17018. }
  17019. // List: Retrieves a list of advertisers, possibly filtered. This method
  17020. // supports paging.
  17021. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  17022. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17023. c.profileId = profileId
  17024. return c
  17025. }
  17026. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  17027. // Select only advertisers with these advertiser group IDs.
  17028. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  17029. var advertiserGroupIds_ []string
  17030. for _, v := range advertiserGroupIds {
  17031. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  17032. }
  17033. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  17034. return c
  17035. }
  17036. // FloodlightConfigurationIds sets the optional parameter
  17037. // "floodlightConfigurationIds": Select only advertisers with these
  17038. // floodlight configuration IDs.
  17039. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  17040. var floodlightConfigurationIds_ []string
  17041. for _, v := range floodlightConfigurationIds {
  17042. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  17043. }
  17044. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  17045. return c
  17046. }
  17047. // Ids sets the optional parameter "ids": Select only advertisers with
  17048. // these IDs.
  17049. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  17050. var ids_ []string
  17051. for _, v := range ids {
  17052. ids_ = append(ids_, fmt.Sprint(v))
  17053. }
  17054. c.urlParams_.SetMulti("ids", ids_)
  17055. return c
  17056. }
  17057. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  17058. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  17059. // do not belong to any advertiser group.
  17060. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  17061. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  17062. return c
  17063. }
  17064. // MaxResults sets the optional parameter "maxResults": Maximum number
  17065. // of results to return.
  17066. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  17067. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17068. return c
  17069. }
  17070. // OnlyParent sets the optional parameter "onlyParent": Select only
  17071. // advertisers which use another advertiser's floodlight configuration.
  17072. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  17073. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  17074. return c
  17075. }
  17076. // PageToken sets the optional parameter "pageToken": Value of the
  17077. // nextPageToken from the previous result page.
  17078. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  17079. c.urlParams_.Set("pageToken", pageToken)
  17080. return c
  17081. }
  17082. // SearchString sets the optional parameter "searchString": Allows
  17083. // searching for objects by name or ID. Wildcards (*) are allowed. For
  17084. // example, "advertiser*2015" will return objects with names like
  17085. // "advertiser June 2015", "advertiser April 2015", or simply
  17086. // "advertiser 2015". Most of the searches also add wildcards implicitly
  17087. // at the start and the end of the search string. For example, a search
  17088. // string of "advertiser" will match objects with name "my advertiser",
  17089. // "advertiser 2015", or simply "advertiser".
  17090. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  17091. c.urlParams_.Set("searchString", searchString)
  17092. return c
  17093. }
  17094. // SortField sets the optional parameter "sortField": Field by which to
  17095. // sort the list.
  17096. //
  17097. // Possible values:
  17098. // "ID" (default)
  17099. // "NAME"
  17100. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  17101. c.urlParams_.Set("sortField", sortField)
  17102. return c
  17103. }
  17104. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17105. // results.
  17106. //
  17107. // Possible values:
  17108. // "ASCENDING" (default)
  17109. // "DESCENDING"
  17110. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  17111. c.urlParams_.Set("sortOrder", sortOrder)
  17112. return c
  17113. }
  17114. // Status sets the optional parameter "status": Select only advertisers
  17115. // with the specified status.
  17116. //
  17117. // Possible values:
  17118. // "APPROVED"
  17119. // "ON_HOLD"
  17120. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  17121. c.urlParams_.Set("status", status)
  17122. return c
  17123. }
  17124. // SubaccountId sets the optional parameter "subaccountId": Select only
  17125. // advertisers with these subaccount IDs.
  17126. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  17127. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  17128. return c
  17129. }
  17130. // Fields allows partial responses to be retrieved. See
  17131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17132. // for more information.
  17133. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  17134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17135. return c
  17136. }
  17137. // IfNoneMatch sets the optional parameter which makes the operation
  17138. // fail if the object's ETag matches the given value. This is useful for
  17139. // getting updates only after the object has changed since the last
  17140. // request. Use googleapi.IsNotModified to check whether the response
  17141. // error from Do is the result of In-None-Match.
  17142. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  17143. c.ifNoneMatch_ = entityTag
  17144. return c
  17145. }
  17146. // Context sets the context to be used in this call's Do method. Any
  17147. // pending HTTP request will be aborted if the provided context is
  17148. // canceled.
  17149. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  17150. c.ctx_ = ctx
  17151. return c
  17152. }
  17153. // Header returns an http.Header that can be modified by the caller to
  17154. // add HTTP headers to the request.
  17155. func (c *AdvertisersListCall) Header() http.Header {
  17156. if c.header_ == nil {
  17157. c.header_ = make(http.Header)
  17158. }
  17159. return c.header_
  17160. }
  17161. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  17162. reqHeaders := make(http.Header)
  17163. for k, v := range c.header_ {
  17164. reqHeaders[k] = v
  17165. }
  17166. reqHeaders.Set("User-Agent", c.s.userAgent())
  17167. if c.ifNoneMatch_ != "" {
  17168. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17169. }
  17170. var body io.Reader = nil
  17171. c.urlParams_.Set("alt", alt)
  17172. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17173. urls += "?" + c.urlParams_.Encode()
  17174. req, _ := http.NewRequest("GET", urls, body)
  17175. req.Header = reqHeaders
  17176. googleapi.Expand(req.URL, map[string]string{
  17177. "profileId": strconv.FormatInt(c.profileId, 10),
  17178. })
  17179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17180. }
  17181. // Do executes the "dfareporting.advertisers.list" call.
  17182. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  17183. // non-2xx status code is an error. Response headers are in either
  17184. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  17185. // returned at all) in error.(*googleapi.Error).Header. Use
  17186. // googleapi.IsNotModified to check whether the returned error was
  17187. // because http.StatusNotModified was returned.
  17188. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  17189. gensupport.SetOptions(c.urlParams_, opts...)
  17190. res, err := c.doRequest("json")
  17191. if res != nil && res.StatusCode == http.StatusNotModified {
  17192. if res.Body != nil {
  17193. res.Body.Close()
  17194. }
  17195. return nil, &googleapi.Error{
  17196. Code: res.StatusCode,
  17197. Header: res.Header,
  17198. }
  17199. }
  17200. if err != nil {
  17201. return nil, err
  17202. }
  17203. defer googleapi.CloseBody(res)
  17204. if err := googleapi.CheckResponse(res); err != nil {
  17205. return nil, err
  17206. }
  17207. ret := &AdvertisersListResponse{
  17208. ServerResponse: googleapi.ServerResponse{
  17209. Header: res.Header,
  17210. HTTPStatusCode: res.StatusCode,
  17211. },
  17212. }
  17213. target := &ret
  17214. if err := gensupport.DecodeResponse(target, res); err != nil {
  17215. return nil, err
  17216. }
  17217. return ret, nil
  17218. // {
  17219. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  17220. // "httpMethod": "GET",
  17221. // "id": "dfareporting.advertisers.list",
  17222. // "parameterOrder": [
  17223. // "profileId"
  17224. // ],
  17225. // "parameters": {
  17226. // "advertiserGroupIds": {
  17227. // "description": "Select only advertisers with these advertiser group IDs.",
  17228. // "format": "int64",
  17229. // "location": "query",
  17230. // "repeated": true,
  17231. // "type": "string"
  17232. // },
  17233. // "floodlightConfigurationIds": {
  17234. // "description": "Select only advertisers with these floodlight configuration IDs.",
  17235. // "format": "int64",
  17236. // "location": "query",
  17237. // "repeated": true,
  17238. // "type": "string"
  17239. // },
  17240. // "ids": {
  17241. // "description": "Select only advertisers with these IDs.",
  17242. // "format": "int64",
  17243. // "location": "query",
  17244. // "repeated": true,
  17245. // "type": "string"
  17246. // },
  17247. // "includeAdvertisersWithoutGroupsOnly": {
  17248. // "description": "Select only advertisers which do not belong to any advertiser group.",
  17249. // "location": "query",
  17250. // "type": "boolean"
  17251. // },
  17252. // "maxResults": {
  17253. // "default": "1000",
  17254. // "description": "Maximum number of results to return.",
  17255. // "format": "int32",
  17256. // "location": "query",
  17257. // "maximum": "1000",
  17258. // "minimum": "0",
  17259. // "type": "integer"
  17260. // },
  17261. // "onlyParent": {
  17262. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  17263. // "location": "query",
  17264. // "type": "boolean"
  17265. // },
  17266. // "pageToken": {
  17267. // "description": "Value of the nextPageToken from the previous result page.",
  17268. // "location": "query",
  17269. // "type": "string"
  17270. // },
  17271. // "profileId": {
  17272. // "description": "User profile ID associated with this request.",
  17273. // "format": "int64",
  17274. // "location": "path",
  17275. // "required": true,
  17276. // "type": "string"
  17277. // },
  17278. // "searchString": {
  17279. // "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\".",
  17280. // "location": "query",
  17281. // "type": "string"
  17282. // },
  17283. // "sortField": {
  17284. // "default": "ID",
  17285. // "description": "Field by which to sort the list.",
  17286. // "enum": [
  17287. // "ID",
  17288. // "NAME"
  17289. // ],
  17290. // "enumDescriptions": [
  17291. // "",
  17292. // ""
  17293. // ],
  17294. // "location": "query",
  17295. // "type": "string"
  17296. // },
  17297. // "sortOrder": {
  17298. // "default": "ASCENDING",
  17299. // "description": "Order of sorted results.",
  17300. // "enum": [
  17301. // "ASCENDING",
  17302. // "DESCENDING"
  17303. // ],
  17304. // "enumDescriptions": [
  17305. // "",
  17306. // ""
  17307. // ],
  17308. // "location": "query",
  17309. // "type": "string"
  17310. // },
  17311. // "status": {
  17312. // "description": "Select only advertisers with the specified status.",
  17313. // "enum": [
  17314. // "APPROVED",
  17315. // "ON_HOLD"
  17316. // ],
  17317. // "enumDescriptions": [
  17318. // "",
  17319. // ""
  17320. // ],
  17321. // "location": "query",
  17322. // "type": "string"
  17323. // },
  17324. // "subaccountId": {
  17325. // "description": "Select only advertisers with these subaccount IDs.",
  17326. // "format": "int64",
  17327. // "location": "query",
  17328. // "type": "string"
  17329. // }
  17330. // },
  17331. // "path": "userprofiles/{profileId}/advertisers",
  17332. // "response": {
  17333. // "$ref": "AdvertisersListResponse"
  17334. // },
  17335. // "scopes": [
  17336. // "https://www.googleapis.com/auth/dfatrafficking"
  17337. // ]
  17338. // }
  17339. }
  17340. // Pages invokes f for each page of results.
  17341. // A non-nil error returned from f will halt the iteration.
  17342. // The provided context supersedes any context provided to the Context method.
  17343. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  17344. c.ctx_ = ctx
  17345. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17346. for {
  17347. x, err := c.Do()
  17348. if err != nil {
  17349. return err
  17350. }
  17351. if err := f(x); err != nil {
  17352. return err
  17353. }
  17354. if x.NextPageToken == "" {
  17355. return nil
  17356. }
  17357. c.PageToken(x.NextPageToken)
  17358. }
  17359. }
  17360. // method id "dfareporting.advertisers.patch":
  17361. type AdvertisersPatchCall struct {
  17362. s *Service
  17363. profileId int64
  17364. advertiser *Advertiser
  17365. urlParams_ gensupport.URLParams
  17366. ctx_ context.Context
  17367. header_ http.Header
  17368. }
  17369. // Patch: Updates an existing advertiser. This method supports patch
  17370. // semantics.
  17371. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  17372. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17373. c.profileId = profileId
  17374. c.urlParams_.Set("id", fmt.Sprint(id))
  17375. c.advertiser = advertiser
  17376. return c
  17377. }
  17378. // Fields allows partial responses to be retrieved. See
  17379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17380. // for more information.
  17381. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  17382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17383. return c
  17384. }
  17385. // Context sets the context to be used in this call's Do method. Any
  17386. // pending HTTP request will be aborted if the provided context is
  17387. // canceled.
  17388. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  17389. c.ctx_ = ctx
  17390. return c
  17391. }
  17392. // Header returns an http.Header that can be modified by the caller to
  17393. // add HTTP headers to the request.
  17394. func (c *AdvertisersPatchCall) Header() http.Header {
  17395. if c.header_ == nil {
  17396. c.header_ = make(http.Header)
  17397. }
  17398. return c.header_
  17399. }
  17400. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  17401. reqHeaders := make(http.Header)
  17402. for k, v := range c.header_ {
  17403. reqHeaders[k] = v
  17404. }
  17405. reqHeaders.Set("User-Agent", c.s.userAgent())
  17406. var body io.Reader = nil
  17407. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17408. if err != nil {
  17409. return nil, err
  17410. }
  17411. reqHeaders.Set("Content-Type", "application/json")
  17412. c.urlParams_.Set("alt", alt)
  17413. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17414. urls += "?" + c.urlParams_.Encode()
  17415. req, _ := http.NewRequest("PATCH", urls, body)
  17416. req.Header = reqHeaders
  17417. googleapi.Expand(req.URL, map[string]string{
  17418. "profileId": strconv.FormatInt(c.profileId, 10),
  17419. })
  17420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17421. }
  17422. // Do executes the "dfareporting.advertisers.patch" call.
  17423. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17424. // status code is an error. Response headers are in either
  17425. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17426. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17427. // to check whether the returned error was because
  17428. // http.StatusNotModified was returned.
  17429. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17430. gensupport.SetOptions(c.urlParams_, opts...)
  17431. res, err := c.doRequest("json")
  17432. if res != nil && res.StatusCode == http.StatusNotModified {
  17433. if res.Body != nil {
  17434. res.Body.Close()
  17435. }
  17436. return nil, &googleapi.Error{
  17437. Code: res.StatusCode,
  17438. Header: res.Header,
  17439. }
  17440. }
  17441. if err != nil {
  17442. return nil, err
  17443. }
  17444. defer googleapi.CloseBody(res)
  17445. if err := googleapi.CheckResponse(res); err != nil {
  17446. return nil, err
  17447. }
  17448. ret := &Advertiser{
  17449. ServerResponse: googleapi.ServerResponse{
  17450. Header: res.Header,
  17451. HTTPStatusCode: res.StatusCode,
  17452. },
  17453. }
  17454. target := &ret
  17455. if err := gensupport.DecodeResponse(target, res); err != nil {
  17456. return nil, err
  17457. }
  17458. return ret, nil
  17459. // {
  17460. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  17461. // "httpMethod": "PATCH",
  17462. // "id": "dfareporting.advertisers.patch",
  17463. // "parameterOrder": [
  17464. // "profileId",
  17465. // "id"
  17466. // ],
  17467. // "parameters": {
  17468. // "id": {
  17469. // "description": "Advertiser ID.",
  17470. // "format": "int64",
  17471. // "location": "query",
  17472. // "required": true,
  17473. // "type": "string"
  17474. // },
  17475. // "profileId": {
  17476. // "description": "User profile ID associated with this request.",
  17477. // "format": "int64",
  17478. // "location": "path",
  17479. // "required": true,
  17480. // "type": "string"
  17481. // }
  17482. // },
  17483. // "path": "userprofiles/{profileId}/advertisers",
  17484. // "request": {
  17485. // "$ref": "Advertiser"
  17486. // },
  17487. // "response": {
  17488. // "$ref": "Advertiser"
  17489. // },
  17490. // "scopes": [
  17491. // "https://www.googleapis.com/auth/dfatrafficking"
  17492. // ]
  17493. // }
  17494. }
  17495. // method id "dfareporting.advertisers.update":
  17496. type AdvertisersUpdateCall struct {
  17497. s *Service
  17498. profileId int64
  17499. advertiser *Advertiser
  17500. urlParams_ gensupport.URLParams
  17501. ctx_ context.Context
  17502. header_ http.Header
  17503. }
  17504. // Update: Updates an existing advertiser.
  17505. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  17506. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17507. c.profileId = profileId
  17508. c.advertiser = advertiser
  17509. return c
  17510. }
  17511. // Fields allows partial responses to be retrieved. See
  17512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17513. // for more information.
  17514. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  17515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17516. return c
  17517. }
  17518. // Context sets the context to be used in this call's Do method. Any
  17519. // pending HTTP request will be aborted if the provided context is
  17520. // canceled.
  17521. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  17522. c.ctx_ = ctx
  17523. return c
  17524. }
  17525. // Header returns an http.Header that can be modified by the caller to
  17526. // add HTTP headers to the request.
  17527. func (c *AdvertisersUpdateCall) Header() http.Header {
  17528. if c.header_ == nil {
  17529. c.header_ = make(http.Header)
  17530. }
  17531. return c.header_
  17532. }
  17533. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  17534. reqHeaders := make(http.Header)
  17535. for k, v := range c.header_ {
  17536. reqHeaders[k] = v
  17537. }
  17538. reqHeaders.Set("User-Agent", c.s.userAgent())
  17539. var body io.Reader = nil
  17540. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17541. if err != nil {
  17542. return nil, err
  17543. }
  17544. reqHeaders.Set("Content-Type", "application/json")
  17545. c.urlParams_.Set("alt", alt)
  17546. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17547. urls += "?" + c.urlParams_.Encode()
  17548. req, _ := http.NewRequest("PUT", urls, body)
  17549. req.Header = reqHeaders
  17550. googleapi.Expand(req.URL, map[string]string{
  17551. "profileId": strconv.FormatInt(c.profileId, 10),
  17552. })
  17553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17554. }
  17555. // Do executes the "dfareporting.advertisers.update" call.
  17556. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17557. // status code is an error. Response headers are in either
  17558. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17559. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17560. // to check whether the returned error was because
  17561. // http.StatusNotModified was returned.
  17562. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17563. gensupport.SetOptions(c.urlParams_, opts...)
  17564. res, err := c.doRequest("json")
  17565. if res != nil && res.StatusCode == http.StatusNotModified {
  17566. if res.Body != nil {
  17567. res.Body.Close()
  17568. }
  17569. return nil, &googleapi.Error{
  17570. Code: res.StatusCode,
  17571. Header: res.Header,
  17572. }
  17573. }
  17574. if err != nil {
  17575. return nil, err
  17576. }
  17577. defer googleapi.CloseBody(res)
  17578. if err := googleapi.CheckResponse(res); err != nil {
  17579. return nil, err
  17580. }
  17581. ret := &Advertiser{
  17582. ServerResponse: googleapi.ServerResponse{
  17583. Header: res.Header,
  17584. HTTPStatusCode: res.StatusCode,
  17585. },
  17586. }
  17587. target := &ret
  17588. if err := gensupport.DecodeResponse(target, res); err != nil {
  17589. return nil, err
  17590. }
  17591. return ret, nil
  17592. // {
  17593. // "description": "Updates an existing advertiser.",
  17594. // "httpMethod": "PUT",
  17595. // "id": "dfareporting.advertisers.update",
  17596. // "parameterOrder": [
  17597. // "profileId"
  17598. // ],
  17599. // "parameters": {
  17600. // "profileId": {
  17601. // "description": "User profile ID associated with this request.",
  17602. // "format": "int64",
  17603. // "location": "path",
  17604. // "required": true,
  17605. // "type": "string"
  17606. // }
  17607. // },
  17608. // "path": "userprofiles/{profileId}/advertisers",
  17609. // "request": {
  17610. // "$ref": "Advertiser"
  17611. // },
  17612. // "response": {
  17613. // "$ref": "Advertiser"
  17614. // },
  17615. // "scopes": [
  17616. // "https://www.googleapis.com/auth/dfatrafficking"
  17617. // ]
  17618. // }
  17619. }
  17620. // method id "dfareporting.browsers.list":
  17621. type BrowsersListCall struct {
  17622. s *Service
  17623. profileId int64
  17624. urlParams_ gensupport.URLParams
  17625. ifNoneMatch_ string
  17626. ctx_ context.Context
  17627. header_ http.Header
  17628. }
  17629. // List: Retrieves a list of browsers.
  17630. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  17631. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17632. c.profileId = profileId
  17633. return c
  17634. }
  17635. // Fields allows partial responses to be retrieved. See
  17636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17637. // for more information.
  17638. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  17639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17640. return c
  17641. }
  17642. // IfNoneMatch sets the optional parameter which makes the operation
  17643. // fail if the object's ETag matches the given value. This is useful for
  17644. // getting updates only after the object has changed since the last
  17645. // request. Use googleapi.IsNotModified to check whether the response
  17646. // error from Do is the result of In-None-Match.
  17647. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  17648. c.ifNoneMatch_ = entityTag
  17649. return c
  17650. }
  17651. // Context sets the context to be used in this call's Do method. Any
  17652. // pending HTTP request will be aborted if the provided context is
  17653. // canceled.
  17654. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  17655. c.ctx_ = ctx
  17656. return c
  17657. }
  17658. // Header returns an http.Header that can be modified by the caller to
  17659. // add HTTP headers to the request.
  17660. func (c *BrowsersListCall) Header() http.Header {
  17661. if c.header_ == nil {
  17662. c.header_ = make(http.Header)
  17663. }
  17664. return c.header_
  17665. }
  17666. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  17667. reqHeaders := make(http.Header)
  17668. for k, v := range c.header_ {
  17669. reqHeaders[k] = v
  17670. }
  17671. reqHeaders.Set("User-Agent", c.s.userAgent())
  17672. if c.ifNoneMatch_ != "" {
  17673. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17674. }
  17675. var body io.Reader = nil
  17676. c.urlParams_.Set("alt", alt)
  17677. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  17678. urls += "?" + c.urlParams_.Encode()
  17679. req, _ := http.NewRequest("GET", urls, body)
  17680. req.Header = reqHeaders
  17681. googleapi.Expand(req.URL, map[string]string{
  17682. "profileId": strconv.FormatInt(c.profileId, 10),
  17683. })
  17684. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17685. }
  17686. // Do executes the "dfareporting.browsers.list" call.
  17687. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  17688. // non-2xx status code is an error. Response headers are in either
  17689. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  17690. // returned at all) in error.(*googleapi.Error).Header. Use
  17691. // googleapi.IsNotModified to check whether the returned error was
  17692. // because http.StatusNotModified was returned.
  17693. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  17694. gensupport.SetOptions(c.urlParams_, opts...)
  17695. res, err := c.doRequest("json")
  17696. if res != nil && res.StatusCode == http.StatusNotModified {
  17697. if res.Body != nil {
  17698. res.Body.Close()
  17699. }
  17700. return nil, &googleapi.Error{
  17701. Code: res.StatusCode,
  17702. Header: res.Header,
  17703. }
  17704. }
  17705. if err != nil {
  17706. return nil, err
  17707. }
  17708. defer googleapi.CloseBody(res)
  17709. if err := googleapi.CheckResponse(res); err != nil {
  17710. return nil, err
  17711. }
  17712. ret := &BrowsersListResponse{
  17713. ServerResponse: googleapi.ServerResponse{
  17714. Header: res.Header,
  17715. HTTPStatusCode: res.StatusCode,
  17716. },
  17717. }
  17718. target := &ret
  17719. if err := gensupport.DecodeResponse(target, res); err != nil {
  17720. return nil, err
  17721. }
  17722. return ret, nil
  17723. // {
  17724. // "description": "Retrieves a list of browsers.",
  17725. // "httpMethod": "GET",
  17726. // "id": "dfareporting.browsers.list",
  17727. // "parameterOrder": [
  17728. // "profileId"
  17729. // ],
  17730. // "parameters": {
  17731. // "profileId": {
  17732. // "description": "User profile ID associated with this request.",
  17733. // "format": "int64",
  17734. // "location": "path",
  17735. // "required": true,
  17736. // "type": "string"
  17737. // }
  17738. // },
  17739. // "path": "userprofiles/{profileId}/browsers",
  17740. // "response": {
  17741. // "$ref": "BrowsersListResponse"
  17742. // },
  17743. // "scopes": [
  17744. // "https://www.googleapis.com/auth/dfatrafficking"
  17745. // ]
  17746. // }
  17747. }
  17748. // method id "dfareporting.campaignCreativeAssociations.insert":
  17749. type CampaignCreativeAssociationsInsertCall struct {
  17750. s *Service
  17751. profileId int64
  17752. campaignId int64
  17753. campaigncreativeassociation *CampaignCreativeAssociation
  17754. urlParams_ gensupport.URLParams
  17755. ctx_ context.Context
  17756. header_ http.Header
  17757. }
  17758. // Insert: Associates a creative with the specified campaign. This
  17759. // method creates a default ad with dimensions matching the creative in
  17760. // the campaign if such a default ad does not exist already.
  17761. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  17762. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17763. c.profileId = profileId
  17764. c.campaignId = campaignId
  17765. c.campaigncreativeassociation = campaigncreativeassociation
  17766. return c
  17767. }
  17768. // Fields allows partial responses to be retrieved. See
  17769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17770. // for more information.
  17771. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  17772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17773. return c
  17774. }
  17775. // Context sets the context to be used in this call's Do method. Any
  17776. // pending HTTP request will be aborted if the provided context is
  17777. // canceled.
  17778. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  17779. c.ctx_ = ctx
  17780. return c
  17781. }
  17782. // Header returns an http.Header that can be modified by the caller to
  17783. // add HTTP headers to the request.
  17784. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  17785. if c.header_ == nil {
  17786. c.header_ = make(http.Header)
  17787. }
  17788. return c.header_
  17789. }
  17790. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  17791. reqHeaders := make(http.Header)
  17792. for k, v := range c.header_ {
  17793. reqHeaders[k] = v
  17794. }
  17795. reqHeaders.Set("User-Agent", c.s.userAgent())
  17796. var body io.Reader = nil
  17797. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  17798. if err != nil {
  17799. return nil, err
  17800. }
  17801. reqHeaders.Set("Content-Type", "application/json")
  17802. c.urlParams_.Set("alt", alt)
  17803. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  17804. urls += "?" + c.urlParams_.Encode()
  17805. req, _ := http.NewRequest("POST", urls, body)
  17806. req.Header = reqHeaders
  17807. googleapi.Expand(req.URL, map[string]string{
  17808. "profileId": strconv.FormatInt(c.profileId, 10),
  17809. "campaignId": strconv.FormatInt(c.campaignId, 10),
  17810. })
  17811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17812. }
  17813. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  17814. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  17815. // Any non-2xx status code is an error. Response headers are in either
  17816. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  17817. // was returned at all) in error.(*googleapi.Error).Header. Use
  17818. // googleapi.IsNotModified to check whether the returned error was
  17819. // because http.StatusNotModified was returned.
  17820. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  17821. gensupport.SetOptions(c.urlParams_, opts...)
  17822. res, err := c.doRequest("json")
  17823. if res != nil && res.StatusCode == http.StatusNotModified {
  17824. if res.Body != nil {
  17825. res.Body.Close()
  17826. }
  17827. return nil, &googleapi.Error{
  17828. Code: res.StatusCode,
  17829. Header: res.Header,
  17830. }
  17831. }
  17832. if err != nil {
  17833. return nil, err
  17834. }
  17835. defer googleapi.CloseBody(res)
  17836. if err := googleapi.CheckResponse(res); err != nil {
  17837. return nil, err
  17838. }
  17839. ret := &CampaignCreativeAssociation{
  17840. ServerResponse: googleapi.ServerResponse{
  17841. Header: res.Header,
  17842. HTTPStatusCode: res.StatusCode,
  17843. },
  17844. }
  17845. target := &ret
  17846. if err := gensupport.DecodeResponse(target, res); err != nil {
  17847. return nil, err
  17848. }
  17849. return ret, nil
  17850. // {
  17851. // "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.",
  17852. // "httpMethod": "POST",
  17853. // "id": "dfareporting.campaignCreativeAssociations.insert",
  17854. // "parameterOrder": [
  17855. // "profileId",
  17856. // "campaignId"
  17857. // ],
  17858. // "parameters": {
  17859. // "campaignId": {
  17860. // "description": "Campaign ID in this association.",
  17861. // "format": "int64",
  17862. // "location": "path",
  17863. // "required": true,
  17864. // "type": "string"
  17865. // },
  17866. // "profileId": {
  17867. // "description": "User profile ID associated with this request.",
  17868. // "format": "int64",
  17869. // "location": "path",
  17870. // "required": true,
  17871. // "type": "string"
  17872. // }
  17873. // },
  17874. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  17875. // "request": {
  17876. // "$ref": "CampaignCreativeAssociation"
  17877. // },
  17878. // "response": {
  17879. // "$ref": "CampaignCreativeAssociation"
  17880. // },
  17881. // "scopes": [
  17882. // "https://www.googleapis.com/auth/dfatrafficking"
  17883. // ]
  17884. // }
  17885. }
  17886. // method id "dfareporting.campaignCreativeAssociations.list":
  17887. type CampaignCreativeAssociationsListCall struct {
  17888. s *Service
  17889. profileId int64
  17890. campaignId int64
  17891. urlParams_ gensupport.URLParams
  17892. ifNoneMatch_ string
  17893. ctx_ context.Context
  17894. header_ http.Header
  17895. }
  17896. // List: Retrieves the list of creative IDs associated with the
  17897. // specified campaign. This method supports paging.
  17898. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  17899. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17900. c.profileId = profileId
  17901. c.campaignId = campaignId
  17902. return c
  17903. }
  17904. // MaxResults sets the optional parameter "maxResults": Maximum number
  17905. // of results to return.
  17906. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  17907. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17908. return c
  17909. }
  17910. // PageToken sets the optional parameter "pageToken": Value of the
  17911. // nextPageToken from the previous result page.
  17912. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  17913. c.urlParams_.Set("pageToken", pageToken)
  17914. return c
  17915. }
  17916. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17917. // results.
  17918. //
  17919. // Possible values:
  17920. // "ASCENDING" (default)
  17921. // "DESCENDING"
  17922. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  17923. c.urlParams_.Set("sortOrder", sortOrder)
  17924. return c
  17925. }
  17926. // Fields allows partial responses to be retrieved. See
  17927. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17928. // for more information.
  17929. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  17930. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17931. return c
  17932. }
  17933. // IfNoneMatch sets the optional parameter which makes the operation
  17934. // fail if the object's ETag matches the given value. This is useful for
  17935. // getting updates only after the object has changed since the last
  17936. // request. Use googleapi.IsNotModified to check whether the response
  17937. // error from Do is the result of In-None-Match.
  17938. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  17939. c.ifNoneMatch_ = entityTag
  17940. return c
  17941. }
  17942. // Context sets the context to be used in this call's Do method. Any
  17943. // pending HTTP request will be aborted if the provided context is
  17944. // canceled.
  17945. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  17946. c.ctx_ = ctx
  17947. return c
  17948. }
  17949. // Header returns an http.Header that can be modified by the caller to
  17950. // add HTTP headers to the request.
  17951. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  17952. if c.header_ == nil {
  17953. c.header_ = make(http.Header)
  17954. }
  17955. return c.header_
  17956. }
  17957. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  17958. reqHeaders := make(http.Header)
  17959. for k, v := range c.header_ {
  17960. reqHeaders[k] = v
  17961. }
  17962. reqHeaders.Set("User-Agent", c.s.userAgent())
  17963. if c.ifNoneMatch_ != "" {
  17964. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17965. }
  17966. var body io.Reader = nil
  17967. c.urlParams_.Set("alt", alt)
  17968. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  17969. urls += "?" + c.urlParams_.Encode()
  17970. req, _ := http.NewRequest("GET", urls, body)
  17971. req.Header = reqHeaders
  17972. googleapi.Expand(req.URL, map[string]string{
  17973. "profileId": strconv.FormatInt(c.profileId, 10),
  17974. "campaignId": strconv.FormatInt(c.campaignId, 10),
  17975. })
  17976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17977. }
  17978. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  17979. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  17980. // will be non-nil. Any non-2xx status code is an error. Response
  17981. // headers are in either
  17982. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  17983. // (if a response was returned at all) in
  17984. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  17985. // whether the returned error was because http.StatusNotModified was
  17986. // returned.
  17987. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  17988. gensupport.SetOptions(c.urlParams_, opts...)
  17989. res, err := c.doRequest("json")
  17990. if res != nil && res.StatusCode == http.StatusNotModified {
  17991. if res.Body != nil {
  17992. res.Body.Close()
  17993. }
  17994. return nil, &googleapi.Error{
  17995. Code: res.StatusCode,
  17996. Header: res.Header,
  17997. }
  17998. }
  17999. if err != nil {
  18000. return nil, err
  18001. }
  18002. defer googleapi.CloseBody(res)
  18003. if err := googleapi.CheckResponse(res); err != nil {
  18004. return nil, err
  18005. }
  18006. ret := &CampaignCreativeAssociationsListResponse{
  18007. ServerResponse: googleapi.ServerResponse{
  18008. Header: res.Header,
  18009. HTTPStatusCode: res.StatusCode,
  18010. },
  18011. }
  18012. target := &ret
  18013. if err := gensupport.DecodeResponse(target, res); err != nil {
  18014. return nil, err
  18015. }
  18016. return ret, nil
  18017. // {
  18018. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  18019. // "httpMethod": "GET",
  18020. // "id": "dfareporting.campaignCreativeAssociations.list",
  18021. // "parameterOrder": [
  18022. // "profileId",
  18023. // "campaignId"
  18024. // ],
  18025. // "parameters": {
  18026. // "campaignId": {
  18027. // "description": "Campaign ID in this association.",
  18028. // "format": "int64",
  18029. // "location": "path",
  18030. // "required": true,
  18031. // "type": "string"
  18032. // },
  18033. // "maxResults": {
  18034. // "default": "1000",
  18035. // "description": "Maximum number of results to return.",
  18036. // "format": "int32",
  18037. // "location": "query",
  18038. // "maximum": "1000",
  18039. // "minimum": "0",
  18040. // "type": "integer"
  18041. // },
  18042. // "pageToken": {
  18043. // "description": "Value of the nextPageToken from the previous result page.",
  18044. // "location": "query",
  18045. // "type": "string"
  18046. // },
  18047. // "profileId": {
  18048. // "description": "User profile ID associated with this request.",
  18049. // "format": "int64",
  18050. // "location": "path",
  18051. // "required": true,
  18052. // "type": "string"
  18053. // },
  18054. // "sortOrder": {
  18055. // "default": "ASCENDING",
  18056. // "description": "Order of sorted results.",
  18057. // "enum": [
  18058. // "ASCENDING",
  18059. // "DESCENDING"
  18060. // ],
  18061. // "enumDescriptions": [
  18062. // "",
  18063. // ""
  18064. // ],
  18065. // "location": "query",
  18066. // "type": "string"
  18067. // }
  18068. // },
  18069. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18070. // "response": {
  18071. // "$ref": "CampaignCreativeAssociationsListResponse"
  18072. // },
  18073. // "scopes": [
  18074. // "https://www.googleapis.com/auth/dfatrafficking"
  18075. // ]
  18076. // }
  18077. }
  18078. // Pages invokes f for each page of results.
  18079. // A non-nil error returned from f will halt the iteration.
  18080. // The provided context supersedes any context provided to the Context method.
  18081. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  18082. c.ctx_ = ctx
  18083. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18084. for {
  18085. x, err := c.Do()
  18086. if err != nil {
  18087. return err
  18088. }
  18089. if err := f(x); err != nil {
  18090. return err
  18091. }
  18092. if x.NextPageToken == "" {
  18093. return nil
  18094. }
  18095. c.PageToken(x.NextPageToken)
  18096. }
  18097. }
  18098. // method id "dfareporting.campaigns.get":
  18099. type CampaignsGetCall struct {
  18100. s *Service
  18101. profileId int64
  18102. id int64
  18103. urlParams_ gensupport.URLParams
  18104. ifNoneMatch_ string
  18105. ctx_ context.Context
  18106. header_ http.Header
  18107. }
  18108. // Get: Gets one campaign by ID.
  18109. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  18110. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18111. c.profileId = profileId
  18112. c.id = id
  18113. return c
  18114. }
  18115. // Fields allows partial responses to be retrieved. See
  18116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18117. // for more information.
  18118. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  18119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18120. return c
  18121. }
  18122. // IfNoneMatch sets the optional parameter which makes the operation
  18123. // fail if the object's ETag matches the given value. This is useful for
  18124. // getting updates only after the object has changed since the last
  18125. // request. Use googleapi.IsNotModified to check whether the response
  18126. // error from Do is the result of In-None-Match.
  18127. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  18128. c.ifNoneMatch_ = entityTag
  18129. return c
  18130. }
  18131. // Context sets the context to be used in this call's Do method. Any
  18132. // pending HTTP request will be aborted if the provided context is
  18133. // canceled.
  18134. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  18135. c.ctx_ = ctx
  18136. return c
  18137. }
  18138. // Header returns an http.Header that can be modified by the caller to
  18139. // add HTTP headers to the request.
  18140. func (c *CampaignsGetCall) Header() http.Header {
  18141. if c.header_ == nil {
  18142. c.header_ = make(http.Header)
  18143. }
  18144. return c.header_
  18145. }
  18146. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  18147. reqHeaders := make(http.Header)
  18148. for k, v := range c.header_ {
  18149. reqHeaders[k] = v
  18150. }
  18151. reqHeaders.Set("User-Agent", c.s.userAgent())
  18152. if c.ifNoneMatch_ != "" {
  18153. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18154. }
  18155. var body io.Reader = nil
  18156. c.urlParams_.Set("alt", alt)
  18157. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  18158. urls += "?" + c.urlParams_.Encode()
  18159. req, _ := http.NewRequest("GET", urls, body)
  18160. req.Header = reqHeaders
  18161. googleapi.Expand(req.URL, map[string]string{
  18162. "profileId": strconv.FormatInt(c.profileId, 10),
  18163. "id": strconv.FormatInt(c.id, 10),
  18164. })
  18165. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18166. }
  18167. // Do executes the "dfareporting.campaigns.get" call.
  18168. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18169. // code is an error. Response headers are in either
  18170. // *Campaign.ServerResponse.Header or (if a response was returned at
  18171. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18172. // to check whether the returned error was because
  18173. // http.StatusNotModified was returned.
  18174. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18175. gensupport.SetOptions(c.urlParams_, opts...)
  18176. res, err := c.doRequest("json")
  18177. if res != nil && res.StatusCode == http.StatusNotModified {
  18178. if res.Body != nil {
  18179. res.Body.Close()
  18180. }
  18181. return nil, &googleapi.Error{
  18182. Code: res.StatusCode,
  18183. Header: res.Header,
  18184. }
  18185. }
  18186. if err != nil {
  18187. return nil, err
  18188. }
  18189. defer googleapi.CloseBody(res)
  18190. if err := googleapi.CheckResponse(res); err != nil {
  18191. return nil, err
  18192. }
  18193. ret := &Campaign{
  18194. ServerResponse: googleapi.ServerResponse{
  18195. Header: res.Header,
  18196. HTTPStatusCode: res.StatusCode,
  18197. },
  18198. }
  18199. target := &ret
  18200. if err := gensupport.DecodeResponse(target, res); err != nil {
  18201. return nil, err
  18202. }
  18203. return ret, nil
  18204. // {
  18205. // "description": "Gets one campaign by ID.",
  18206. // "httpMethod": "GET",
  18207. // "id": "dfareporting.campaigns.get",
  18208. // "parameterOrder": [
  18209. // "profileId",
  18210. // "id"
  18211. // ],
  18212. // "parameters": {
  18213. // "id": {
  18214. // "description": "Campaign ID.",
  18215. // "format": "int64",
  18216. // "location": "path",
  18217. // "required": true,
  18218. // "type": "string"
  18219. // },
  18220. // "profileId": {
  18221. // "description": "User profile ID associated with this request.",
  18222. // "format": "int64",
  18223. // "location": "path",
  18224. // "required": true,
  18225. // "type": "string"
  18226. // }
  18227. // },
  18228. // "path": "userprofiles/{profileId}/campaigns/{id}",
  18229. // "response": {
  18230. // "$ref": "Campaign"
  18231. // },
  18232. // "scopes": [
  18233. // "https://www.googleapis.com/auth/dfatrafficking"
  18234. // ]
  18235. // }
  18236. }
  18237. // method id "dfareporting.campaigns.insert":
  18238. type CampaignsInsertCall struct {
  18239. s *Service
  18240. profileId int64
  18241. campaign *Campaign
  18242. urlParams_ gensupport.URLParams
  18243. ctx_ context.Context
  18244. header_ http.Header
  18245. }
  18246. // Insert: Inserts a new campaign.
  18247. func (r *CampaignsService) Insert(profileId int64, campaign *Campaign) *CampaignsInsertCall {
  18248. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18249. c.profileId = profileId
  18250. c.campaign = campaign
  18251. return c
  18252. }
  18253. // Fields allows partial responses to be retrieved. See
  18254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18255. // for more information.
  18256. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  18257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18258. return c
  18259. }
  18260. // Context sets the context to be used in this call's Do method. Any
  18261. // pending HTTP request will be aborted if the provided context is
  18262. // canceled.
  18263. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  18264. c.ctx_ = ctx
  18265. return c
  18266. }
  18267. // Header returns an http.Header that can be modified by the caller to
  18268. // add HTTP headers to the request.
  18269. func (c *CampaignsInsertCall) Header() http.Header {
  18270. if c.header_ == nil {
  18271. c.header_ = make(http.Header)
  18272. }
  18273. return c.header_
  18274. }
  18275. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  18276. reqHeaders := make(http.Header)
  18277. for k, v := range c.header_ {
  18278. reqHeaders[k] = v
  18279. }
  18280. reqHeaders.Set("User-Agent", c.s.userAgent())
  18281. var body io.Reader = nil
  18282. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18283. if err != nil {
  18284. return nil, err
  18285. }
  18286. reqHeaders.Set("Content-Type", "application/json")
  18287. c.urlParams_.Set("alt", alt)
  18288. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18289. urls += "?" + c.urlParams_.Encode()
  18290. req, _ := http.NewRequest("POST", urls, body)
  18291. req.Header = reqHeaders
  18292. googleapi.Expand(req.URL, map[string]string{
  18293. "profileId": strconv.FormatInt(c.profileId, 10),
  18294. })
  18295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18296. }
  18297. // Do executes the "dfareporting.campaigns.insert" call.
  18298. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18299. // code is an error. Response headers are in either
  18300. // *Campaign.ServerResponse.Header or (if a response was returned at
  18301. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18302. // to check whether the returned error was because
  18303. // http.StatusNotModified was returned.
  18304. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18305. gensupport.SetOptions(c.urlParams_, opts...)
  18306. res, err := c.doRequest("json")
  18307. if res != nil && res.StatusCode == http.StatusNotModified {
  18308. if res.Body != nil {
  18309. res.Body.Close()
  18310. }
  18311. return nil, &googleapi.Error{
  18312. Code: res.StatusCode,
  18313. Header: res.Header,
  18314. }
  18315. }
  18316. if err != nil {
  18317. return nil, err
  18318. }
  18319. defer googleapi.CloseBody(res)
  18320. if err := googleapi.CheckResponse(res); err != nil {
  18321. return nil, err
  18322. }
  18323. ret := &Campaign{
  18324. ServerResponse: googleapi.ServerResponse{
  18325. Header: res.Header,
  18326. HTTPStatusCode: res.StatusCode,
  18327. },
  18328. }
  18329. target := &ret
  18330. if err := gensupport.DecodeResponse(target, res); err != nil {
  18331. return nil, err
  18332. }
  18333. return ret, nil
  18334. // {
  18335. // "description": "Inserts a new campaign.",
  18336. // "httpMethod": "POST",
  18337. // "id": "dfareporting.campaigns.insert",
  18338. // "parameterOrder": [
  18339. // "profileId"
  18340. // ],
  18341. // "parameters": {
  18342. // "profileId": {
  18343. // "description": "User profile ID associated with this request.",
  18344. // "format": "int64",
  18345. // "location": "path",
  18346. // "required": true,
  18347. // "type": "string"
  18348. // }
  18349. // },
  18350. // "path": "userprofiles/{profileId}/campaigns",
  18351. // "request": {
  18352. // "$ref": "Campaign"
  18353. // },
  18354. // "response": {
  18355. // "$ref": "Campaign"
  18356. // },
  18357. // "scopes": [
  18358. // "https://www.googleapis.com/auth/dfatrafficking"
  18359. // ]
  18360. // }
  18361. }
  18362. // method id "dfareporting.campaigns.list":
  18363. type CampaignsListCall struct {
  18364. s *Service
  18365. profileId int64
  18366. urlParams_ gensupport.URLParams
  18367. ifNoneMatch_ string
  18368. ctx_ context.Context
  18369. header_ http.Header
  18370. }
  18371. // List: Retrieves a list of campaigns, possibly filtered. This method
  18372. // supports paging.
  18373. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  18374. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18375. c.profileId = profileId
  18376. return c
  18377. }
  18378. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  18379. // Select only campaigns whose advertisers belong to these advertiser
  18380. // groups.
  18381. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  18382. var advertiserGroupIds_ []string
  18383. for _, v := range advertiserGroupIds {
  18384. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  18385. }
  18386. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  18387. return c
  18388. }
  18389. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  18390. // only campaigns that belong to these advertisers.
  18391. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  18392. var advertiserIds_ []string
  18393. for _, v := range advertiserIds {
  18394. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  18395. }
  18396. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  18397. return c
  18398. }
  18399. // Archived sets the optional parameter "archived": Select only archived
  18400. // campaigns. Don't set this field to select both archived and
  18401. // non-archived campaigns.
  18402. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  18403. c.urlParams_.Set("archived", fmt.Sprint(archived))
  18404. return c
  18405. }
  18406. // AtLeastOneOptimizationActivity sets the optional parameter
  18407. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  18408. // least one optimization activity.
  18409. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  18410. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  18411. return c
  18412. }
  18413. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  18414. // campaigns with these IDs.
  18415. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  18416. var excludedIds_ []string
  18417. for _, v := range excludedIds {
  18418. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  18419. }
  18420. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  18421. return c
  18422. }
  18423. // Ids sets the optional parameter "ids": Select only campaigns with
  18424. // these IDs.
  18425. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  18426. var ids_ []string
  18427. for _, v := range ids {
  18428. ids_ = append(ids_, fmt.Sprint(v))
  18429. }
  18430. c.urlParams_.SetMulti("ids", ids_)
  18431. return c
  18432. }
  18433. // MaxResults sets the optional parameter "maxResults": Maximum number
  18434. // of results to return.
  18435. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  18436. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18437. return c
  18438. }
  18439. // OverriddenEventTagId sets the optional parameter
  18440. // "overriddenEventTagId": Select only campaigns that have overridden
  18441. // this event tag ID.
  18442. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  18443. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  18444. return c
  18445. }
  18446. // PageToken sets the optional parameter "pageToken": Value of the
  18447. // nextPageToken from the previous result page.
  18448. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  18449. c.urlParams_.Set("pageToken", pageToken)
  18450. return c
  18451. }
  18452. // SearchString sets the optional parameter "searchString": Allows
  18453. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  18454. // example, "campaign*2015" will return campaigns with names like
  18455. // "campaign June 2015", "campaign April 2015", or simply "campaign
  18456. // 2015". Most of the searches also add wildcards implicitly at the
  18457. // start and the end of the search string. For example, a search string
  18458. // of "campaign" will match campaigns with name "my campaign", "campaign
  18459. // 2015", or simply "campaign".
  18460. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  18461. c.urlParams_.Set("searchString", searchString)
  18462. return c
  18463. }
  18464. // SortField sets the optional parameter "sortField": Field by which to
  18465. // sort the list.
  18466. //
  18467. // Possible values:
  18468. // "ID" (default)
  18469. // "NAME"
  18470. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  18471. c.urlParams_.Set("sortField", sortField)
  18472. return c
  18473. }
  18474. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18475. // results.
  18476. //
  18477. // Possible values:
  18478. // "ASCENDING" (default)
  18479. // "DESCENDING"
  18480. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  18481. c.urlParams_.Set("sortOrder", sortOrder)
  18482. return c
  18483. }
  18484. // SubaccountId sets the optional parameter "subaccountId": Select only
  18485. // campaigns that belong to this subaccount.
  18486. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  18487. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  18488. return c
  18489. }
  18490. // Fields allows partial responses to be retrieved. See
  18491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18492. // for more information.
  18493. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  18494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18495. return c
  18496. }
  18497. // IfNoneMatch sets the optional parameter which makes the operation
  18498. // fail if the object's ETag matches the given value. This is useful for
  18499. // getting updates only after the object has changed since the last
  18500. // request. Use googleapi.IsNotModified to check whether the response
  18501. // error from Do is the result of In-None-Match.
  18502. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  18503. c.ifNoneMatch_ = entityTag
  18504. return c
  18505. }
  18506. // Context sets the context to be used in this call's Do method. Any
  18507. // pending HTTP request will be aborted if the provided context is
  18508. // canceled.
  18509. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  18510. c.ctx_ = ctx
  18511. return c
  18512. }
  18513. // Header returns an http.Header that can be modified by the caller to
  18514. // add HTTP headers to the request.
  18515. func (c *CampaignsListCall) Header() http.Header {
  18516. if c.header_ == nil {
  18517. c.header_ = make(http.Header)
  18518. }
  18519. return c.header_
  18520. }
  18521. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  18522. reqHeaders := make(http.Header)
  18523. for k, v := range c.header_ {
  18524. reqHeaders[k] = v
  18525. }
  18526. reqHeaders.Set("User-Agent", c.s.userAgent())
  18527. if c.ifNoneMatch_ != "" {
  18528. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18529. }
  18530. var body io.Reader = nil
  18531. c.urlParams_.Set("alt", alt)
  18532. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18533. urls += "?" + c.urlParams_.Encode()
  18534. req, _ := http.NewRequest("GET", urls, body)
  18535. req.Header = reqHeaders
  18536. googleapi.Expand(req.URL, map[string]string{
  18537. "profileId": strconv.FormatInt(c.profileId, 10),
  18538. })
  18539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18540. }
  18541. // Do executes the "dfareporting.campaigns.list" call.
  18542. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  18543. // non-2xx status code is an error. Response headers are in either
  18544. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  18545. // returned at all) in error.(*googleapi.Error).Header. Use
  18546. // googleapi.IsNotModified to check whether the returned error was
  18547. // because http.StatusNotModified was returned.
  18548. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  18549. gensupport.SetOptions(c.urlParams_, opts...)
  18550. res, err := c.doRequest("json")
  18551. if res != nil && res.StatusCode == http.StatusNotModified {
  18552. if res.Body != nil {
  18553. res.Body.Close()
  18554. }
  18555. return nil, &googleapi.Error{
  18556. Code: res.StatusCode,
  18557. Header: res.Header,
  18558. }
  18559. }
  18560. if err != nil {
  18561. return nil, err
  18562. }
  18563. defer googleapi.CloseBody(res)
  18564. if err := googleapi.CheckResponse(res); err != nil {
  18565. return nil, err
  18566. }
  18567. ret := &CampaignsListResponse{
  18568. ServerResponse: googleapi.ServerResponse{
  18569. Header: res.Header,
  18570. HTTPStatusCode: res.StatusCode,
  18571. },
  18572. }
  18573. target := &ret
  18574. if err := gensupport.DecodeResponse(target, res); err != nil {
  18575. return nil, err
  18576. }
  18577. return ret, nil
  18578. // {
  18579. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  18580. // "httpMethod": "GET",
  18581. // "id": "dfareporting.campaigns.list",
  18582. // "parameterOrder": [
  18583. // "profileId"
  18584. // ],
  18585. // "parameters": {
  18586. // "advertiserGroupIds": {
  18587. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  18588. // "format": "int64",
  18589. // "location": "query",
  18590. // "repeated": true,
  18591. // "type": "string"
  18592. // },
  18593. // "advertiserIds": {
  18594. // "description": "Select only campaigns that belong to these advertisers.",
  18595. // "format": "int64",
  18596. // "location": "query",
  18597. // "repeated": true,
  18598. // "type": "string"
  18599. // },
  18600. // "archived": {
  18601. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  18602. // "location": "query",
  18603. // "type": "boolean"
  18604. // },
  18605. // "atLeastOneOptimizationActivity": {
  18606. // "description": "Select only campaigns that have at least one optimization activity.",
  18607. // "location": "query",
  18608. // "type": "boolean"
  18609. // },
  18610. // "excludedIds": {
  18611. // "description": "Exclude campaigns with these IDs.",
  18612. // "format": "int64",
  18613. // "location": "query",
  18614. // "repeated": true,
  18615. // "type": "string"
  18616. // },
  18617. // "ids": {
  18618. // "description": "Select only campaigns with these IDs.",
  18619. // "format": "int64",
  18620. // "location": "query",
  18621. // "repeated": true,
  18622. // "type": "string"
  18623. // },
  18624. // "maxResults": {
  18625. // "default": "1000",
  18626. // "description": "Maximum number of results to return.",
  18627. // "format": "int32",
  18628. // "location": "query",
  18629. // "maximum": "1000",
  18630. // "minimum": "0",
  18631. // "type": "integer"
  18632. // },
  18633. // "overriddenEventTagId": {
  18634. // "description": "Select only campaigns that have overridden this event tag ID.",
  18635. // "format": "int64",
  18636. // "location": "query",
  18637. // "type": "string"
  18638. // },
  18639. // "pageToken": {
  18640. // "description": "Value of the nextPageToken from the previous result page.",
  18641. // "location": "query",
  18642. // "type": "string"
  18643. // },
  18644. // "profileId": {
  18645. // "description": "User profile ID associated with this request.",
  18646. // "format": "int64",
  18647. // "location": "path",
  18648. // "required": true,
  18649. // "type": "string"
  18650. // },
  18651. // "searchString": {
  18652. // "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\".",
  18653. // "location": "query",
  18654. // "type": "string"
  18655. // },
  18656. // "sortField": {
  18657. // "default": "ID",
  18658. // "description": "Field by which to sort the list.",
  18659. // "enum": [
  18660. // "ID",
  18661. // "NAME"
  18662. // ],
  18663. // "enumDescriptions": [
  18664. // "",
  18665. // ""
  18666. // ],
  18667. // "location": "query",
  18668. // "type": "string"
  18669. // },
  18670. // "sortOrder": {
  18671. // "default": "ASCENDING",
  18672. // "description": "Order of sorted results.",
  18673. // "enum": [
  18674. // "ASCENDING",
  18675. // "DESCENDING"
  18676. // ],
  18677. // "enumDescriptions": [
  18678. // "",
  18679. // ""
  18680. // ],
  18681. // "location": "query",
  18682. // "type": "string"
  18683. // },
  18684. // "subaccountId": {
  18685. // "description": "Select only campaigns that belong to this subaccount.",
  18686. // "format": "int64",
  18687. // "location": "query",
  18688. // "type": "string"
  18689. // }
  18690. // },
  18691. // "path": "userprofiles/{profileId}/campaigns",
  18692. // "response": {
  18693. // "$ref": "CampaignsListResponse"
  18694. // },
  18695. // "scopes": [
  18696. // "https://www.googleapis.com/auth/dfatrafficking"
  18697. // ]
  18698. // }
  18699. }
  18700. // Pages invokes f for each page of results.
  18701. // A non-nil error returned from f will halt the iteration.
  18702. // The provided context supersedes any context provided to the Context method.
  18703. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  18704. c.ctx_ = ctx
  18705. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18706. for {
  18707. x, err := c.Do()
  18708. if err != nil {
  18709. return err
  18710. }
  18711. if err := f(x); err != nil {
  18712. return err
  18713. }
  18714. if x.NextPageToken == "" {
  18715. return nil
  18716. }
  18717. c.PageToken(x.NextPageToken)
  18718. }
  18719. }
  18720. // method id "dfareporting.campaigns.patch":
  18721. type CampaignsPatchCall struct {
  18722. s *Service
  18723. profileId int64
  18724. campaign *Campaign
  18725. urlParams_ gensupport.URLParams
  18726. ctx_ context.Context
  18727. header_ http.Header
  18728. }
  18729. // Patch: Updates an existing campaign. This method supports patch
  18730. // semantics.
  18731. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  18732. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18733. c.profileId = profileId
  18734. c.urlParams_.Set("id", fmt.Sprint(id))
  18735. c.campaign = campaign
  18736. return c
  18737. }
  18738. // Fields allows partial responses to be retrieved. See
  18739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18740. // for more information.
  18741. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  18742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18743. return c
  18744. }
  18745. // Context sets the context to be used in this call's Do method. Any
  18746. // pending HTTP request will be aborted if the provided context is
  18747. // canceled.
  18748. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  18749. c.ctx_ = ctx
  18750. return c
  18751. }
  18752. // Header returns an http.Header that can be modified by the caller to
  18753. // add HTTP headers to the request.
  18754. func (c *CampaignsPatchCall) Header() http.Header {
  18755. if c.header_ == nil {
  18756. c.header_ = make(http.Header)
  18757. }
  18758. return c.header_
  18759. }
  18760. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  18761. reqHeaders := make(http.Header)
  18762. for k, v := range c.header_ {
  18763. reqHeaders[k] = v
  18764. }
  18765. reqHeaders.Set("User-Agent", c.s.userAgent())
  18766. var body io.Reader = nil
  18767. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18768. if err != nil {
  18769. return nil, err
  18770. }
  18771. reqHeaders.Set("Content-Type", "application/json")
  18772. c.urlParams_.Set("alt", alt)
  18773. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18774. urls += "?" + c.urlParams_.Encode()
  18775. req, _ := http.NewRequest("PATCH", urls, body)
  18776. req.Header = reqHeaders
  18777. googleapi.Expand(req.URL, map[string]string{
  18778. "profileId": strconv.FormatInt(c.profileId, 10),
  18779. })
  18780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18781. }
  18782. // Do executes the "dfareporting.campaigns.patch" call.
  18783. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18784. // code is an error. Response headers are in either
  18785. // *Campaign.ServerResponse.Header or (if a response was returned at
  18786. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18787. // to check whether the returned error was because
  18788. // http.StatusNotModified was returned.
  18789. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18790. gensupport.SetOptions(c.urlParams_, opts...)
  18791. res, err := c.doRequest("json")
  18792. if res != nil && res.StatusCode == http.StatusNotModified {
  18793. if res.Body != nil {
  18794. res.Body.Close()
  18795. }
  18796. return nil, &googleapi.Error{
  18797. Code: res.StatusCode,
  18798. Header: res.Header,
  18799. }
  18800. }
  18801. if err != nil {
  18802. return nil, err
  18803. }
  18804. defer googleapi.CloseBody(res)
  18805. if err := googleapi.CheckResponse(res); err != nil {
  18806. return nil, err
  18807. }
  18808. ret := &Campaign{
  18809. ServerResponse: googleapi.ServerResponse{
  18810. Header: res.Header,
  18811. HTTPStatusCode: res.StatusCode,
  18812. },
  18813. }
  18814. target := &ret
  18815. if err := gensupport.DecodeResponse(target, res); err != nil {
  18816. return nil, err
  18817. }
  18818. return ret, nil
  18819. // {
  18820. // "description": "Updates an existing campaign. This method supports patch semantics.",
  18821. // "httpMethod": "PATCH",
  18822. // "id": "dfareporting.campaigns.patch",
  18823. // "parameterOrder": [
  18824. // "profileId",
  18825. // "id"
  18826. // ],
  18827. // "parameters": {
  18828. // "id": {
  18829. // "description": "Campaign ID.",
  18830. // "format": "int64",
  18831. // "location": "query",
  18832. // "required": true,
  18833. // "type": "string"
  18834. // },
  18835. // "profileId": {
  18836. // "description": "User profile ID associated with this request.",
  18837. // "format": "int64",
  18838. // "location": "path",
  18839. // "required": true,
  18840. // "type": "string"
  18841. // }
  18842. // },
  18843. // "path": "userprofiles/{profileId}/campaigns",
  18844. // "request": {
  18845. // "$ref": "Campaign"
  18846. // },
  18847. // "response": {
  18848. // "$ref": "Campaign"
  18849. // },
  18850. // "scopes": [
  18851. // "https://www.googleapis.com/auth/dfatrafficking"
  18852. // ]
  18853. // }
  18854. }
  18855. // method id "dfareporting.campaigns.update":
  18856. type CampaignsUpdateCall struct {
  18857. s *Service
  18858. profileId int64
  18859. campaign *Campaign
  18860. urlParams_ gensupport.URLParams
  18861. ctx_ context.Context
  18862. header_ http.Header
  18863. }
  18864. // Update: Updates an existing campaign.
  18865. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  18866. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18867. c.profileId = profileId
  18868. c.campaign = campaign
  18869. return c
  18870. }
  18871. // Fields allows partial responses to be retrieved. See
  18872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18873. // for more information.
  18874. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  18875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18876. return c
  18877. }
  18878. // Context sets the context to be used in this call's Do method. Any
  18879. // pending HTTP request will be aborted if the provided context is
  18880. // canceled.
  18881. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  18882. c.ctx_ = ctx
  18883. return c
  18884. }
  18885. // Header returns an http.Header that can be modified by the caller to
  18886. // add HTTP headers to the request.
  18887. func (c *CampaignsUpdateCall) Header() http.Header {
  18888. if c.header_ == nil {
  18889. c.header_ = make(http.Header)
  18890. }
  18891. return c.header_
  18892. }
  18893. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  18894. reqHeaders := make(http.Header)
  18895. for k, v := range c.header_ {
  18896. reqHeaders[k] = v
  18897. }
  18898. reqHeaders.Set("User-Agent", c.s.userAgent())
  18899. var body io.Reader = nil
  18900. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18901. if err != nil {
  18902. return nil, err
  18903. }
  18904. reqHeaders.Set("Content-Type", "application/json")
  18905. c.urlParams_.Set("alt", alt)
  18906. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18907. urls += "?" + c.urlParams_.Encode()
  18908. req, _ := http.NewRequest("PUT", urls, body)
  18909. req.Header = reqHeaders
  18910. googleapi.Expand(req.URL, map[string]string{
  18911. "profileId": strconv.FormatInt(c.profileId, 10),
  18912. })
  18913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18914. }
  18915. // Do executes the "dfareporting.campaigns.update" call.
  18916. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18917. // code is an error. Response headers are in either
  18918. // *Campaign.ServerResponse.Header or (if a response was returned at
  18919. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18920. // to check whether the returned error was because
  18921. // http.StatusNotModified was returned.
  18922. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18923. gensupport.SetOptions(c.urlParams_, opts...)
  18924. res, err := c.doRequest("json")
  18925. if res != nil && res.StatusCode == http.StatusNotModified {
  18926. if res.Body != nil {
  18927. res.Body.Close()
  18928. }
  18929. return nil, &googleapi.Error{
  18930. Code: res.StatusCode,
  18931. Header: res.Header,
  18932. }
  18933. }
  18934. if err != nil {
  18935. return nil, err
  18936. }
  18937. defer googleapi.CloseBody(res)
  18938. if err := googleapi.CheckResponse(res); err != nil {
  18939. return nil, err
  18940. }
  18941. ret := &Campaign{
  18942. ServerResponse: googleapi.ServerResponse{
  18943. Header: res.Header,
  18944. HTTPStatusCode: res.StatusCode,
  18945. },
  18946. }
  18947. target := &ret
  18948. if err := gensupport.DecodeResponse(target, res); err != nil {
  18949. return nil, err
  18950. }
  18951. return ret, nil
  18952. // {
  18953. // "description": "Updates an existing campaign.",
  18954. // "httpMethod": "PUT",
  18955. // "id": "dfareporting.campaigns.update",
  18956. // "parameterOrder": [
  18957. // "profileId"
  18958. // ],
  18959. // "parameters": {
  18960. // "profileId": {
  18961. // "description": "User profile ID associated with this request.",
  18962. // "format": "int64",
  18963. // "location": "path",
  18964. // "required": true,
  18965. // "type": "string"
  18966. // }
  18967. // },
  18968. // "path": "userprofiles/{profileId}/campaigns",
  18969. // "request": {
  18970. // "$ref": "Campaign"
  18971. // },
  18972. // "response": {
  18973. // "$ref": "Campaign"
  18974. // },
  18975. // "scopes": [
  18976. // "https://www.googleapis.com/auth/dfatrafficking"
  18977. // ]
  18978. // }
  18979. }
  18980. // method id "dfareporting.changeLogs.get":
  18981. type ChangeLogsGetCall struct {
  18982. s *Service
  18983. profileId int64
  18984. id int64
  18985. urlParams_ gensupport.URLParams
  18986. ifNoneMatch_ string
  18987. ctx_ context.Context
  18988. header_ http.Header
  18989. }
  18990. // Get: Gets one change log by ID.
  18991. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  18992. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18993. c.profileId = profileId
  18994. c.id = id
  18995. return c
  18996. }
  18997. // Fields allows partial responses to be retrieved. See
  18998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18999. // for more information.
  19000. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  19001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19002. return c
  19003. }
  19004. // IfNoneMatch sets the optional parameter which makes the operation
  19005. // fail if the object's ETag matches the given value. This is useful for
  19006. // getting updates only after the object has changed since the last
  19007. // request. Use googleapi.IsNotModified to check whether the response
  19008. // error from Do is the result of In-None-Match.
  19009. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  19010. c.ifNoneMatch_ = entityTag
  19011. return c
  19012. }
  19013. // Context sets the context to be used in this call's Do method. Any
  19014. // pending HTTP request will be aborted if the provided context is
  19015. // canceled.
  19016. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  19017. c.ctx_ = ctx
  19018. return c
  19019. }
  19020. // Header returns an http.Header that can be modified by the caller to
  19021. // add HTTP headers to the request.
  19022. func (c *ChangeLogsGetCall) Header() http.Header {
  19023. if c.header_ == nil {
  19024. c.header_ = make(http.Header)
  19025. }
  19026. return c.header_
  19027. }
  19028. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  19029. reqHeaders := make(http.Header)
  19030. for k, v := range c.header_ {
  19031. reqHeaders[k] = v
  19032. }
  19033. reqHeaders.Set("User-Agent", c.s.userAgent())
  19034. if c.ifNoneMatch_ != "" {
  19035. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19036. }
  19037. var body io.Reader = nil
  19038. c.urlParams_.Set("alt", alt)
  19039. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  19040. urls += "?" + c.urlParams_.Encode()
  19041. req, _ := http.NewRequest("GET", urls, body)
  19042. req.Header = reqHeaders
  19043. googleapi.Expand(req.URL, map[string]string{
  19044. "profileId": strconv.FormatInt(c.profileId, 10),
  19045. "id": strconv.FormatInt(c.id, 10),
  19046. })
  19047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19048. }
  19049. // Do executes the "dfareporting.changeLogs.get" call.
  19050. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  19051. // status code is an error. Response headers are in either
  19052. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  19053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19054. // to check whether the returned error was because
  19055. // http.StatusNotModified was returned.
  19056. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  19057. gensupport.SetOptions(c.urlParams_, opts...)
  19058. res, err := c.doRequest("json")
  19059. if res != nil && res.StatusCode == http.StatusNotModified {
  19060. if res.Body != nil {
  19061. res.Body.Close()
  19062. }
  19063. return nil, &googleapi.Error{
  19064. Code: res.StatusCode,
  19065. Header: res.Header,
  19066. }
  19067. }
  19068. if err != nil {
  19069. return nil, err
  19070. }
  19071. defer googleapi.CloseBody(res)
  19072. if err := googleapi.CheckResponse(res); err != nil {
  19073. return nil, err
  19074. }
  19075. ret := &ChangeLog{
  19076. ServerResponse: googleapi.ServerResponse{
  19077. Header: res.Header,
  19078. HTTPStatusCode: res.StatusCode,
  19079. },
  19080. }
  19081. target := &ret
  19082. if err := gensupport.DecodeResponse(target, res); err != nil {
  19083. return nil, err
  19084. }
  19085. return ret, nil
  19086. // {
  19087. // "description": "Gets one change log by ID.",
  19088. // "httpMethod": "GET",
  19089. // "id": "dfareporting.changeLogs.get",
  19090. // "parameterOrder": [
  19091. // "profileId",
  19092. // "id"
  19093. // ],
  19094. // "parameters": {
  19095. // "id": {
  19096. // "description": "Change log ID.",
  19097. // "format": "int64",
  19098. // "location": "path",
  19099. // "required": true,
  19100. // "type": "string"
  19101. // },
  19102. // "profileId": {
  19103. // "description": "User profile ID associated with this request.",
  19104. // "format": "int64",
  19105. // "location": "path",
  19106. // "required": true,
  19107. // "type": "string"
  19108. // }
  19109. // },
  19110. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  19111. // "response": {
  19112. // "$ref": "ChangeLog"
  19113. // },
  19114. // "scopes": [
  19115. // "https://www.googleapis.com/auth/dfatrafficking"
  19116. // ]
  19117. // }
  19118. }
  19119. // method id "dfareporting.changeLogs.list":
  19120. type ChangeLogsListCall struct {
  19121. s *Service
  19122. profileId int64
  19123. urlParams_ gensupport.URLParams
  19124. ifNoneMatch_ string
  19125. ctx_ context.Context
  19126. header_ http.Header
  19127. }
  19128. // List: Retrieves a list of change logs. This method supports paging.
  19129. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  19130. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19131. c.profileId = profileId
  19132. return c
  19133. }
  19134. // Action sets the optional parameter "action": Select only change logs
  19135. // with the specified action.
  19136. //
  19137. // Possible values:
  19138. // "ACTION_ADD"
  19139. // "ACTION_ASSIGN"
  19140. // "ACTION_ASSOCIATE"
  19141. // "ACTION_CREATE"
  19142. // "ACTION_DELETE"
  19143. // "ACTION_DISABLE"
  19144. // "ACTION_EMAIL_TAGS"
  19145. // "ACTION_ENABLE"
  19146. // "ACTION_LINK"
  19147. // "ACTION_MARK_AS_DEFAULT"
  19148. // "ACTION_PUSH"
  19149. // "ACTION_REMOVE"
  19150. // "ACTION_SEND"
  19151. // "ACTION_SHARE"
  19152. // "ACTION_UNASSIGN"
  19153. // "ACTION_UNLINK"
  19154. // "ACTION_UPDATE"
  19155. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  19156. c.urlParams_.Set("action", action)
  19157. return c
  19158. }
  19159. // Ids sets the optional parameter "ids": Select only change logs with
  19160. // these IDs.
  19161. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  19162. var ids_ []string
  19163. for _, v := range ids {
  19164. ids_ = append(ids_, fmt.Sprint(v))
  19165. }
  19166. c.urlParams_.SetMulti("ids", ids_)
  19167. return c
  19168. }
  19169. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  19170. // only change logs whose change time is before the specified
  19171. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  19172. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19173. // America/New York time zone, the format is
  19174. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19175. // the letter T, the hour (24-hour clock system), minute, second, and
  19176. // then the time zone offset.
  19177. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  19178. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  19179. return c
  19180. }
  19181. // MaxResults sets the optional parameter "maxResults": Maximum number
  19182. // of results to return.
  19183. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  19184. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19185. return c
  19186. }
  19187. // MinChangeTime sets the optional parameter "minChangeTime": Select
  19188. // only change logs whose change time is before the specified
  19189. // minChangeTime.The time should be formatted as an RFC3339 date/time
  19190. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19191. // America/New York time zone, the format is
  19192. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19193. // the letter T, the hour (24-hour clock system), minute, second, and
  19194. // then the time zone offset.
  19195. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  19196. c.urlParams_.Set("minChangeTime", minChangeTime)
  19197. return c
  19198. }
  19199. // ObjectIds sets the optional parameter "objectIds": Select only change
  19200. // logs with these object IDs.
  19201. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  19202. var objectIds_ []string
  19203. for _, v := range objectIds {
  19204. objectIds_ = append(objectIds_, fmt.Sprint(v))
  19205. }
  19206. c.urlParams_.SetMulti("objectIds", objectIds_)
  19207. return c
  19208. }
  19209. // ObjectType sets the optional parameter "objectType": Select only
  19210. // change logs with the specified object type.
  19211. //
  19212. // Possible values:
  19213. // "OBJECT_ACCOUNT"
  19214. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  19215. // "OBJECT_AD"
  19216. // "OBJECT_ADVERTISER"
  19217. // "OBJECT_ADVERTISER_GROUP"
  19218. // "OBJECT_BILLING_ACCOUNT_GROUP"
  19219. // "OBJECT_BILLING_FEATURE"
  19220. // "OBJECT_BILLING_MINIMUM_FEE"
  19221. // "OBJECT_BILLING_PROFILE"
  19222. // "OBJECT_CAMPAIGN"
  19223. // "OBJECT_CONTENT_CATEGORY"
  19224. // "OBJECT_CREATIVE"
  19225. // "OBJECT_CREATIVE_ASSET"
  19226. // "OBJECT_CREATIVE_BUNDLE"
  19227. // "OBJECT_CREATIVE_FIELD"
  19228. // "OBJECT_CREATIVE_GROUP"
  19229. // "OBJECT_DFA_SITE"
  19230. // "OBJECT_EVENT_TAG"
  19231. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  19232. // "OBJECT_FLOODLIGHT_ACTVITY"
  19233. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  19234. // "OBJECT_INSTREAM_CREATIVE"
  19235. // "OBJECT_LANDING_PAGE"
  19236. // "OBJECT_MEDIA_ORDER"
  19237. // "OBJECT_PLACEMENT"
  19238. // "OBJECT_PLACEMENT_STRATEGY"
  19239. // "OBJECT_PLAYSTORE_LINK"
  19240. // "OBJECT_PROVIDED_LIST_CLIENT"
  19241. // "OBJECT_RATE_CARD"
  19242. // "OBJECT_REMARKETING_LIST"
  19243. // "OBJECT_RICHMEDIA_CREATIVE"
  19244. // "OBJECT_SD_SITE"
  19245. // "OBJECT_SEARCH_LIFT_STUDY"
  19246. // "OBJECT_SIZE"
  19247. // "OBJECT_SUBACCOUNT"
  19248. // "OBJECT_TARGETING_TEMPLATE"
  19249. // "OBJECT_USER_PROFILE"
  19250. // "OBJECT_USER_PROFILE_FILTER"
  19251. // "OBJECT_USER_ROLE"
  19252. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  19253. c.urlParams_.Set("objectType", objectType)
  19254. return c
  19255. }
  19256. // PageToken sets the optional parameter "pageToken": Value of the
  19257. // nextPageToken from the previous result page.
  19258. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  19259. c.urlParams_.Set("pageToken", pageToken)
  19260. return c
  19261. }
  19262. // SearchString sets the optional parameter "searchString": Select only
  19263. // change logs whose object ID, user name, old or new values match the
  19264. // search string.
  19265. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  19266. c.urlParams_.Set("searchString", searchString)
  19267. return c
  19268. }
  19269. // UserProfileIds sets the optional parameter "userProfileIds": Select
  19270. // only change logs with these user profile IDs.
  19271. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  19272. var userProfileIds_ []string
  19273. for _, v := range userProfileIds {
  19274. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  19275. }
  19276. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  19277. return c
  19278. }
  19279. // Fields allows partial responses to be retrieved. See
  19280. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19281. // for more information.
  19282. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  19283. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19284. return c
  19285. }
  19286. // IfNoneMatch sets the optional parameter which makes the operation
  19287. // fail if the object's ETag matches the given value. This is useful for
  19288. // getting updates only after the object has changed since the last
  19289. // request. Use googleapi.IsNotModified to check whether the response
  19290. // error from Do is the result of In-None-Match.
  19291. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  19292. c.ifNoneMatch_ = entityTag
  19293. return c
  19294. }
  19295. // Context sets the context to be used in this call's Do method. Any
  19296. // pending HTTP request will be aborted if the provided context is
  19297. // canceled.
  19298. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  19299. c.ctx_ = ctx
  19300. return c
  19301. }
  19302. // Header returns an http.Header that can be modified by the caller to
  19303. // add HTTP headers to the request.
  19304. func (c *ChangeLogsListCall) Header() http.Header {
  19305. if c.header_ == nil {
  19306. c.header_ = make(http.Header)
  19307. }
  19308. return c.header_
  19309. }
  19310. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  19311. reqHeaders := make(http.Header)
  19312. for k, v := range c.header_ {
  19313. reqHeaders[k] = v
  19314. }
  19315. reqHeaders.Set("User-Agent", c.s.userAgent())
  19316. if c.ifNoneMatch_ != "" {
  19317. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19318. }
  19319. var body io.Reader = nil
  19320. c.urlParams_.Set("alt", alt)
  19321. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  19322. urls += "?" + c.urlParams_.Encode()
  19323. req, _ := http.NewRequest("GET", urls, body)
  19324. req.Header = reqHeaders
  19325. googleapi.Expand(req.URL, map[string]string{
  19326. "profileId": strconv.FormatInt(c.profileId, 10),
  19327. })
  19328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19329. }
  19330. // Do executes the "dfareporting.changeLogs.list" call.
  19331. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  19332. // non-2xx status code is an error. Response headers are in either
  19333. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  19334. // returned at all) in error.(*googleapi.Error).Header. Use
  19335. // googleapi.IsNotModified to check whether the returned error was
  19336. // because http.StatusNotModified was returned.
  19337. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  19338. gensupport.SetOptions(c.urlParams_, opts...)
  19339. res, err := c.doRequest("json")
  19340. if res != nil && res.StatusCode == http.StatusNotModified {
  19341. if res.Body != nil {
  19342. res.Body.Close()
  19343. }
  19344. return nil, &googleapi.Error{
  19345. Code: res.StatusCode,
  19346. Header: res.Header,
  19347. }
  19348. }
  19349. if err != nil {
  19350. return nil, err
  19351. }
  19352. defer googleapi.CloseBody(res)
  19353. if err := googleapi.CheckResponse(res); err != nil {
  19354. return nil, err
  19355. }
  19356. ret := &ChangeLogsListResponse{
  19357. ServerResponse: googleapi.ServerResponse{
  19358. Header: res.Header,
  19359. HTTPStatusCode: res.StatusCode,
  19360. },
  19361. }
  19362. target := &ret
  19363. if err := gensupport.DecodeResponse(target, res); err != nil {
  19364. return nil, err
  19365. }
  19366. return ret, nil
  19367. // {
  19368. // "description": "Retrieves a list of change logs. This method supports paging.",
  19369. // "httpMethod": "GET",
  19370. // "id": "dfareporting.changeLogs.list",
  19371. // "parameterOrder": [
  19372. // "profileId"
  19373. // ],
  19374. // "parameters": {
  19375. // "action": {
  19376. // "description": "Select only change logs with the specified action.",
  19377. // "enum": [
  19378. // "ACTION_ADD",
  19379. // "ACTION_ASSIGN",
  19380. // "ACTION_ASSOCIATE",
  19381. // "ACTION_CREATE",
  19382. // "ACTION_DELETE",
  19383. // "ACTION_DISABLE",
  19384. // "ACTION_EMAIL_TAGS",
  19385. // "ACTION_ENABLE",
  19386. // "ACTION_LINK",
  19387. // "ACTION_MARK_AS_DEFAULT",
  19388. // "ACTION_PUSH",
  19389. // "ACTION_REMOVE",
  19390. // "ACTION_SEND",
  19391. // "ACTION_SHARE",
  19392. // "ACTION_UNASSIGN",
  19393. // "ACTION_UNLINK",
  19394. // "ACTION_UPDATE"
  19395. // ],
  19396. // "enumDescriptions": [
  19397. // "",
  19398. // "",
  19399. // "",
  19400. // "",
  19401. // "",
  19402. // "",
  19403. // "",
  19404. // "",
  19405. // "",
  19406. // "",
  19407. // "",
  19408. // "",
  19409. // "",
  19410. // "",
  19411. // "",
  19412. // "",
  19413. // ""
  19414. // ],
  19415. // "location": "query",
  19416. // "type": "string"
  19417. // },
  19418. // "ids": {
  19419. // "description": "Select only change logs with these IDs.",
  19420. // "format": "int64",
  19421. // "location": "query",
  19422. // "repeated": true,
  19423. // "type": "string"
  19424. // },
  19425. // "maxChangeTime": {
  19426. // "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.",
  19427. // "location": "query",
  19428. // "type": "string"
  19429. // },
  19430. // "maxResults": {
  19431. // "default": "1000",
  19432. // "description": "Maximum number of results to return.",
  19433. // "format": "int32",
  19434. // "location": "query",
  19435. // "maximum": "1000",
  19436. // "minimum": "0",
  19437. // "type": "integer"
  19438. // },
  19439. // "minChangeTime": {
  19440. // "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.",
  19441. // "location": "query",
  19442. // "type": "string"
  19443. // },
  19444. // "objectIds": {
  19445. // "description": "Select only change logs with these object IDs.",
  19446. // "format": "int64",
  19447. // "location": "query",
  19448. // "repeated": true,
  19449. // "type": "string"
  19450. // },
  19451. // "objectType": {
  19452. // "description": "Select only change logs with the specified object type.",
  19453. // "enum": [
  19454. // "OBJECT_ACCOUNT",
  19455. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  19456. // "OBJECT_AD",
  19457. // "OBJECT_ADVERTISER",
  19458. // "OBJECT_ADVERTISER_GROUP",
  19459. // "OBJECT_BILLING_ACCOUNT_GROUP",
  19460. // "OBJECT_BILLING_FEATURE",
  19461. // "OBJECT_BILLING_MINIMUM_FEE",
  19462. // "OBJECT_BILLING_PROFILE",
  19463. // "OBJECT_CAMPAIGN",
  19464. // "OBJECT_CONTENT_CATEGORY",
  19465. // "OBJECT_CREATIVE",
  19466. // "OBJECT_CREATIVE_ASSET",
  19467. // "OBJECT_CREATIVE_BUNDLE",
  19468. // "OBJECT_CREATIVE_FIELD",
  19469. // "OBJECT_CREATIVE_GROUP",
  19470. // "OBJECT_DFA_SITE",
  19471. // "OBJECT_EVENT_TAG",
  19472. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  19473. // "OBJECT_FLOODLIGHT_ACTVITY",
  19474. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  19475. // "OBJECT_INSTREAM_CREATIVE",
  19476. // "OBJECT_LANDING_PAGE",
  19477. // "OBJECT_MEDIA_ORDER",
  19478. // "OBJECT_PLACEMENT",
  19479. // "OBJECT_PLACEMENT_STRATEGY",
  19480. // "OBJECT_PLAYSTORE_LINK",
  19481. // "OBJECT_PROVIDED_LIST_CLIENT",
  19482. // "OBJECT_RATE_CARD",
  19483. // "OBJECT_REMARKETING_LIST",
  19484. // "OBJECT_RICHMEDIA_CREATIVE",
  19485. // "OBJECT_SD_SITE",
  19486. // "OBJECT_SEARCH_LIFT_STUDY",
  19487. // "OBJECT_SIZE",
  19488. // "OBJECT_SUBACCOUNT",
  19489. // "OBJECT_TARGETING_TEMPLATE",
  19490. // "OBJECT_USER_PROFILE",
  19491. // "OBJECT_USER_PROFILE_FILTER",
  19492. // "OBJECT_USER_ROLE"
  19493. // ],
  19494. // "enumDescriptions": [
  19495. // "",
  19496. // "",
  19497. // "",
  19498. // "",
  19499. // "",
  19500. // "",
  19501. // "",
  19502. // "",
  19503. // "",
  19504. // "",
  19505. // "",
  19506. // "",
  19507. // "",
  19508. // "",
  19509. // "",
  19510. // "",
  19511. // "",
  19512. // "",
  19513. // "",
  19514. // "",
  19515. // "",
  19516. // "",
  19517. // "",
  19518. // "",
  19519. // "",
  19520. // "",
  19521. // "",
  19522. // "",
  19523. // "",
  19524. // "",
  19525. // "",
  19526. // "",
  19527. // "",
  19528. // "",
  19529. // "",
  19530. // "",
  19531. // "",
  19532. // "",
  19533. // ""
  19534. // ],
  19535. // "location": "query",
  19536. // "type": "string"
  19537. // },
  19538. // "pageToken": {
  19539. // "description": "Value of the nextPageToken from the previous result page.",
  19540. // "location": "query",
  19541. // "type": "string"
  19542. // },
  19543. // "profileId": {
  19544. // "description": "User profile ID associated with this request.",
  19545. // "format": "int64",
  19546. // "location": "path",
  19547. // "required": true,
  19548. // "type": "string"
  19549. // },
  19550. // "searchString": {
  19551. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  19552. // "location": "query",
  19553. // "type": "string"
  19554. // },
  19555. // "userProfileIds": {
  19556. // "description": "Select only change logs with these user profile IDs.",
  19557. // "format": "int64",
  19558. // "location": "query",
  19559. // "repeated": true,
  19560. // "type": "string"
  19561. // }
  19562. // },
  19563. // "path": "userprofiles/{profileId}/changeLogs",
  19564. // "response": {
  19565. // "$ref": "ChangeLogsListResponse"
  19566. // },
  19567. // "scopes": [
  19568. // "https://www.googleapis.com/auth/dfatrafficking"
  19569. // ]
  19570. // }
  19571. }
  19572. // Pages invokes f for each page of results.
  19573. // A non-nil error returned from f will halt the iteration.
  19574. // The provided context supersedes any context provided to the Context method.
  19575. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  19576. c.ctx_ = ctx
  19577. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19578. for {
  19579. x, err := c.Do()
  19580. if err != nil {
  19581. return err
  19582. }
  19583. if err := f(x); err != nil {
  19584. return err
  19585. }
  19586. if x.NextPageToken == "" {
  19587. return nil
  19588. }
  19589. c.PageToken(x.NextPageToken)
  19590. }
  19591. }
  19592. // method id "dfareporting.cities.list":
  19593. type CitiesListCall struct {
  19594. s *Service
  19595. profileId int64
  19596. urlParams_ gensupport.URLParams
  19597. ifNoneMatch_ string
  19598. ctx_ context.Context
  19599. header_ http.Header
  19600. }
  19601. // List: Retrieves a list of cities, possibly filtered.
  19602. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  19603. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19604. c.profileId = profileId
  19605. return c
  19606. }
  19607. // CountryDartIds sets the optional parameter "countryDartIds": Select
  19608. // only cities from these countries.
  19609. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  19610. var countryDartIds_ []string
  19611. for _, v := range countryDartIds {
  19612. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  19613. }
  19614. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  19615. return c
  19616. }
  19617. // DartIds sets the optional parameter "dartIds": Select only cities
  19618. // with these DART IDs.
  19619. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  19620. var dartIds_ []string
  19621. for _, v := range dartIds {
  19622. dartIds_ = append(dartIds_, fmt.Sprint(v))
  19623. }
  19624. c.urlParams_.SetMulti("dartIds", dartIds_)
  19625. return c
  19626. }
  19627. // NamePrefix sets the optional parameter "namePrefix": Select only
  19628. // cities with names starting with this prefix.
  19629. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  19630. c.urlParams_.Set("namePrefix", namePrefix)
  19631. return c
  19632. }
  19633. // RegionDartIds sets the optional parameter "regionDartIds": Select
  19634. // only cities from these regions.
  19635. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  19636. var regionDartIds_ []string
  19637. for _, v := range regionDartIds {
  19638. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  19639. }
  19640. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  19641. return c
  19642. }
  19643. // Fields allows partial responses to be retrieved. See
  19644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19645. // for more information.
  19646. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  19647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19648. return c
  19649. }
  19650. // IfNoneMatch sets the optional parameter which makes the operation
  19651. // fail if the object's ETag matches the given value. This is useful for
  19652. // getting updates only after the object has changed since the last
  19653. // request. Use googleapi.IsNotModified to check whether the response
  19654. // error from Do is the result of In-None-Match.
  19655. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  19656. c.ifNoneMatch_ = entityTag
  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 *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  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 *CitiesListCall) Header() http.Header {
  19669. if c.header_ == nil {
  19670. c.header_ = make(http.Header)
  19671. }
  19672. return c.header_
  19673. }
  19674. func (c *CitiesListCall) 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. if c.ifNoneMatch_ != "" {
  19681. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19682. }
  19683. var body io.Reader = nil
  19684. c.urlParams_.Set("alt", alt)
  19685. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  19686. urls += "?" + c.urlParams_.Encode()
  19687. req, _ := http.NewRequest("GET", urls, body)
  19688. req.Header = reqHeaders
  19689. googleapi.Expand(req.URL, map[string]string{
  19690. "profileId": strconv.FormatInt(c.profileId, 10),
  19691. })
  19692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19693. }
  19694. // Do executes the "dfareporting.cities.list" call.
  19695. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  19696. // non-2xx status code is an error. Response headers are in either
  19697. // *CitiesListResponse.ServerResponse.Header or (if a response was
  19698. // returned at all) in error.(*googleapi.Error).Header. Use
  19699. // googleapi.IsNotModified to check whether the returned error was
  19700. // because http.StatusNotModified was returned.
  19701. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  19702. gensupport.SetOptions(c.urlParams_, opts...)
  19703. res, err := c.doRequest("json")
  19704. if res != nil && res.StatusCode == http.StatusNotModified {
  19705. if res.Body != nil {
  19706. res.Body.Close()
  19707. }
  19708. return nil, &googleapi.Error{
  19709. Code: res.StatusCode,
  19710. Header: res.Header,
  19711. }
  19712. }
  19713. if err != nil {
  19714. return nil, err
  19715. }
  19716. defer googleapi.CloseBody(res)
  19717. if err := googleapi.CheckResponse(res); err != nil {
  19718. return nil, err
  19719. }
  19720. ret := &CitiesListResponse{
  19721. ServerResponse: googleapi.ServerResponse{
  19722. Header: res.Header,
  19723. HTTPStatusCode: res.StatusCode,
  19724. },
  19725. }
  19726. target := &ret
  19727. if err := gensupport.DecodeResponse(target, res); err != nil {
  19728. return nil, err
  19729. }
  19730. return ret, nil
  19731. // {
  19732. // "description": "Retrieves a list of cities, possibly filtered.",
  19733. // "httpMethod": "GET",
  19734. // "id": "dfareporting.cities.list",
  19735. // "parameterOrder": [
  19736. // "profileId"
  19737. // ],
  19738. // "parameters": {
  19739. // "countryDartIds": {
  19740. // "description": "Select only cities from these countries.",
  19741. // "format": "int64",
  19742. // "location": "query",
  19743. // "repeated": true,
  19744. // "type": "string"
  19745. // },
  19746. // "dartIds": {
  19747. // "description": "Select only cities with these DART IDs.",
  19748. // "format": "int64",
  19749. // "location": "query",
  19750. // "repeated": true,
  19751. // "type": "string"
  19752. // },
  19753. // "namePrefix": {
  19754. // "description": "Select only cities with names starting with this prefix.",
  19755. // "location": "query",
  19756. // "type": "string"
  19757. // },
  19758. // "profileId": {
  19759. // "description": "User profile ID associated with this request.",
  19760. // "format": "int64",
  19761. // "location": "path",
  19762. // "required": true,
  19763. // "type": "string"
  19764. // },
  19765. // "regionDartIds": {
  19766. // "description": "Select only cities from these regions.",
  19767. // "format": "int64",
  19768. // "location": "query",
  19769. // "repeated": true,
  19770. // "type": "string"
  19771. // }
  19772. // },
  19773. // "path": "userprofiles/{profileId}/cities",
  19774. // "response": {
  19775. // "$ref": "CitiesListResponse"
  19776. // },
  19777. // "scopes": [
  19778. // "https://www.googleapis.com/auth/dfatrafficking"
  19779. // ]
  19780. // }
  19781. }
  19782. // method id "dfareporting.connectionTypes.get":
  19783. type ConnectionTypesGetCall struct {
  19784. s *Service
  19785. profileId int64
  19786. id int64
  19787. urlParams_ gensupport.URLParams
  19788. ifNoneMatch_ string
  19789. ctx_ context.Context
  19790. header_ http.Header
  19791. }
  19792. // Get: Gets one connection type by ID.
  19793. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  19794. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19795. c.profileId = profileId
  19796. c.id = id
  19797. return c
  19798. }
  19799. // Fields allows partial responses to be retrieved. See
  19800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19801. // for more information.
  19802. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  19803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19804. return c
  19805. }
  19806. // IfNoneMatch sets the optional parameter which makes the operation
  19807. // fail if the object's ETag matches the given value. This is useful for
  19808. // getting updates only after the object has changed since the last
  19809. // request. Use googleapi.IsNotModified to check whether the response
  19810. // error from Do is the result of In-None-Match.
  19811. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  19812. c.ifNoneMatch_ = entityTag
  19813. return c
  19814. }
  19815. // Context sets the context to be used in this call's Do method. Any
  19816. // pending HTTP request will be aborted if the provided context is
  19817. // canceled.
  19818. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  19819. c.ctx_ = ctx
  19820. return c
  19821. }
  19822. // Header returns an http.Header that can be modified by the caller to
  19823. // add HTTP headers to the request.
  19824. func (c *ConnectionTypesGetCall) Header() http.Header {
  19825. if c.header_ == nil {
  19826. c.header_ = make(http.Header)
  19827. }
  19828. return c.header_
  19829. }
  19830. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  19831. reqHeaders := make(http.Header)
  19832. for k, v := range c.header_ {
  19833. reqHeaders[k] = v
  19834. }
  19835. reqHeaders.Set("User-Agent", c.s.userAgent())
  19836. if c.ifNoneMatch_ != "" {
  19837. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19838. }
  19839. var body io.Reader = nil
  19840. c.urlParams_.Set("alt", alt)
  19841. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  19842. urls += "?" + c.urlParams_.Encode()
  19843. req, _ := http.NewRequest("GET", urls, body)
  19844. req.Header = reqHeaders
  19845. googleapi.Expand(req.URL, map[string]string{
  19846. "profileId": strconv.FormatInt(c.profileId, 10),
  19847. "id": strconv.FormatInt(c.id, 10),
  19848. })
  19849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19850. }
  19851. // Do executes the "dfareporting.connectionTypes.get" call.
  19852. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  19853. // status code is an error. Response headers are in either
  19854. // *ConnectionType.ServerResponse.Header or (if a response was returned
  19855. // at all) in error.(*googleapi.Error).Header. Use
  19856. // googleapi.IsNotModified to check whether the returned error was
  19857. // because http.StatusNotModified was returned.
  19858. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  19859. gensupport.SetOptions(c.urlParams_, opts...)
  19860. res, err := c.doRequest("json")
  19861. if res != nil && res.StatusCode == http.StatusNotModified {
  19862. if res.Body != nil {
  19863. res.Body.Close()
  19864. }
  19865. return nil, &googleapi.Error{
  19866. Code: res.StatusCode,
  19867. Header: res.Header,
  19868. }
  19869. }
  19870. if err != nil {
  19871. return nil, err
  19872. }
  19873. defer googleapi.CloseBody(res)
  19874. if err := googleapi.CheckResponse(res); err != nil {
  19875. return nil, err
  19876. }
  19877. ret := &ConnectionType{
  19878. ServerResponse: googleapi.ServerResponse{
  19879. Header: res.Header,
  19880. HTTPStatusCode: res.StatusCode,
  19881. },
  19882. }
  19883. target := &ret
  19884. if err := gensupport.DecodeResponse(target, res); err != nil {
  19885. return nil, err
  19886. }
  19887. return ret, nil
  19888. // {
  19889. // "description": "Gets one connection type by ID.",
  19890. // "httpMethod": "GET",
  19891. // "id": "dfareporting.connectionTypes.get",
  19892. // "parameterOrder": [
  19893. // "profileId",
  19894. // "id"
  19895. // ],
  19896. // "parameters": {
  19897. // "id": {
  19898. // "description": "Connection type ID.",
  19899. // "format": "int64",
  19900. // "location": "path",
  19901. // "required": true,
  19902. // "type": "string"
  19903. // },
  19904. // "profileId": {
  19905. // "description": "User profile ID associated with this request.",
  19906. // "format": "int64",
  19907. // "location": "path",
  19908. // "required": true,
  19909. // "type": "string"
  19910. // }
  19911. // },
  19912. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  19913. // "response": {
  19914. // "$ref": "ConnectionType"
  19915. // },
  19916. // "scopes": [
  19917. // "https://www.googleapis.com/auth/dfatrafficking"
  19918. // ]
  19919. // }
  19920. }
  19921. // method id "dfareporting.connectionTypes.list":
  19922. type ConnectionTypesListCall struct {
  19923. s *Service
  19924. profileId int64
  19925. urlParams_ gensupport.URLParams
  19926. ifNoneMatch_ string
  19927. ctx_ context.Context
  19928. header_ http.Header
  19929. }
  19930. // List: Retrieves a list of connection types.
  19931. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  19932. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19933. c.profileId = profileId
  19934. return c
  19935. }
  19936. // Fields allows partial responses to be retrieved. See
  19937. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19938. // for more information.
  19939. func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  19940. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19941. return c
  19942. }
  19943. // IfNoneMatch sets the optional parameter which makes the operation
  19944. // fail if the object's ETag matches the given value. This is useful for
  19945. // getting updates only after the object has changed since the last
  19946. // request. Use googleapi.IsNotModified to check whether the response
  19947. // error from Do is the result of In-None-Match.
  19948. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  19949. c.ifNoneMatch_ = entityTag
  19950. return c
  19951. }
  19952. // Context sets the context to be used in this call's Do method. Any
  19953. // pending HTTP request will be aborted if the provided context is
  19954. // canceled.
  19955. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  19956. c.ctx_ = ctx
  19957. return c
  19958. }
  19959. // Header returns an http.Header that can be modified by the caller to
  19960. // add HTTP headers to the request.
  19961. func (c *ConnectionTypesListCall) Header() http.Header {
  19962. if c.header_ == nil {
  19963. c.header_ = make(http.Header)
  19964. }
  19965. return c.header_
  19966. }
  19967. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  19968. reqHeaders := make(http.Header)
  19969. for k, v := range c.header_ {
  19970. reqHeaders[k] = v
  19971. }
  19972. reqHeaders.Set("User-Agent", c.s.userAgent())
  19973. if c.ifNoneMatch_ != "" {
  19974. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19975. }
  19976. var body io.Reader = nil
  19977. c.urlParams_.Set("alt", alt)
  19978. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  19979. urls += "?" + c.urlParams_.Encode()
  19980. req, _ := http.NewRequest("GET", urls, body)
  19981. req.Header = reqHeaders
  19982. googleapi.Expand(req.URL, map[string]string{
  19983. "profileId": strconv.FormatInt(c.profileId, 10),
  19984. })
  19985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19986. }
  19987. // Do executes the "dfareporting.connectionTypes.list" call.
  19988. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  19989. // Any non-2xx status code is an error. Response headers are in either
  19990. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  19991. // was returned at all) in error.(*googleapi.Error).Header. Use
  19992. // googleapi.IsNotModified to check whether the returned error was
  19993. // because http.StatusNotModified was returned.
  19994. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  19995. gensupport.SetOptions(c.urlParams_, opts...)
  19996. res, err := c.doRequest("json")
  19997. if res != nil && res.StatusCode == http.StatusNotModified {
  19998. if res.Body != nil {
  19999. res.Body.Close()
  20000. }
  20001. return nil, &googleapi.Error{
  20002. Code: res.StatusCode,
  20003. Header: res.Header,
  20004. }
  20005. }
  20006. if err != nil {
  20007. return nil, err
  20008. }
  20009. defer googleapi.CloseBody(res)
  20010. if err := googleapi.CheckResponse(res); err != nil {
  20011. return nil, err
  20012. }
  20013. ret := &ConnectionTypesListResponse{
  20014. ServerResponse: googleapi.ServerResponse{
  20015. Header: res.Header,
  20016. HTTPStatusCode: res.StatusCode,
  20017. },
  20018. }
  20019. target := &ret
  20020. if err := gensupport.DecodeResponse(target, res); err != nil {
  20021. return nil, err
  20022. }
  20023. return ret, nil
  20024. // {
  20025. // "description": "Retrieves a list of connection types.",
  20026. // "httpMethod": "GET",
  20027. // "id": "dfareporting.connectionTypes.list",
  20028. // "parameterOrder": [
  20029. // "profileId"
  20030. // ],
  20031. // "parameters": {
  20032. // "profileId": {
  20033. // "description": "User profile ID associated with this request.",
  20034. // "format": "int64",
  20035. // "location": "path",
  20036. // "required": true,
  20037. // "type": "string"
  20038. // }
  20039. // },
  20040. // "path": "userprofiles/{profileId}/connectionTypes",
  20041. // "response": {
  20042. // "$ref": "ConnectionTypesListResponse"
  20043. // },
  20044. // "scopes": [
  20045. // "https://www.googleapis.com/auth/dfatrafficking"
  20046. // ]
  20047. // }
  20048. }
  20049. // method id "dfareporting.contentCategories.delete":
  20050. type ContentCategoriesDeleteCall struct {
  20051. s *Service
  20052. profileId int64
  20053. id int64
  20054. urlParams_ gensupport.URLParams
  20055. ctx_ context.Context
  20056. header_ http.Header
  20057. }
  20058. // Delete: Deletes an existing content category.
  20059. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  20060. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20061. c.profileId = profileId
  20062. c.id = id
  20063. return c
  20064. }
  20065. // Fields allows partial responses to be retrieved. See
  20066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20067. // for more information.
  20068. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  20069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20070. return c
  20071. }
  20072. // Context sets the context to be used in this call's Do method. Any
  20073. // pending HTTP request will be aborted if the provided context is
  20074. // canceled.
  20075. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  20076. c.ctx_ = ctx
  20077. return c
  20078. }
  20079. // Header returns an http.Header that can be modified by the caller to
  20080. // add HTTP headers to the request.
  20081. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  20082. if c.header_ == nil {
  20083. c.header_ = make(http.Header)
  20084. }
  20085. return c.header_
  20086. }
  20087. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20088. reqHeaders := make(http.Header)
  20089. for k, v := range c.header_ {
  20090. reqHeaders[k] = v
  20091. }
  20092. reqHeaders.Set("User-Agent", c.s.userAgent())
  20093. var body io.Reader = nil
  20094. c.urlParams_.Set("alt", alt)
  20095. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20096. urls += "?" + c.urlParams_.Encode()
  20097. req, _ := http.NewRequest("DELETE", urls, body)
  20098. req.Header = reqHeaders
  20099. googleapi.Expand(req.URL, map[string]string{
  20100. "profileId": strconv.FormatInt(c.profileId, 10),
  20101. "id": strconv.FormatInt(c.id, 10),
  20102. })
  20103. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20104. }
  20105. // Do executes the "dfareporting.contentCategories.delete" call.
  20106. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  20107. gensupport.SetOptions(c.urlParams_, opts...)
  20108. res, err := c.doRequest("json")
  20109. if err != nil {
  20110. return err
  20111. }
  20112. defer googleapi.CloseBody(res)
  20113. if err := googleapi.CheckResponse(res); err != nil {
  20114. return err
  20115. }
  20116. return nil
  20117. // {
  20118. // "description": "Deletes an existing content category.",
  20119. // "httpMethod": "DELETE",
  20120. // "id": "dfareporting.contentCategories.delete",
  20121. // "parameterOrder": [
  20122. // "profileId",
  20123. // "id"
  20124. // ],
  20125. // "parameters": {
  20126. // "id": {
  20127. // "description": "Content category ID.",
  20128. // "format": "int64",
  20129. // "location": "path",
  20130. // "required": true,
  20131. // "type": "string"
  20132. // },
  20133. // "profileId": {
  20134. // "description": "User profile ID associated with this request.",
  20135. // "format": "int64",
  20136. // "location": "path",
  20137. // "required": true,
  20138. // "type": "string"
  20139. // }
  20140. // },
  20141. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20142. // "scopes": [
  20143. // "https://www.googleapis.com/auth/dfatrafficking"
  20144. // ]
  20145. // }
  20146. }
  20147. // method id "dfareporting.contentCategories.get":
  20148. type ContentCategoriesGetCall struct {
  20149. s *Service
  20150. profileId int64
  20151. id int64
  20152. urlParams_ gensupport.URLParams
  20153. ifNoneMatch_ string
  20154. ctx_ context.Context
  20155. header_ http.Header
  20156. }
  20157. // Get: Gets one content category by ID.
  20158. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  20159. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20160. c.profileId = profileId
  20161. c.id = id
  20162. return c
  20163. }
  20164. // Fields allows partial responses to be retrieved. See
  20165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20166. // for more information.
  20167. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  20168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20169. return c
  20170. }
  20171. // IfNoneMatch sets the optional parameter which makes the operation
  20172. // fail if the object's ETag matches the given value. This is useful for
  20173. // getting updates only after the object has changed since the last
  20174. // request. Use googleapi.IsNotModified to check whether the response
  20175. // error from Do is the result of In-None-Match.
  20176. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  20177. c.ifNoneMatch_ = entityTag
  20178. return c
  20179. }
  20180. // Context sets the context to be used in this call's Do method. Any
  20181. // pending HTTP request will be aborted if the provided context is
  20182. // canceled.
  20183. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  20184. c.ctx_ = ctx
  20185. return c
  20186. }
  20187. // Header returns an http.Header that can be modified by the caller to
  20188. // add HTTP headers to the request.
  20189. func (c *ContentCategoriesGetCall) Header() http.Header {
  20190. if c.header_ == nil {
  20191. c.header_ = make(http.Header)
  20192. }
  20193. return c.header_
  20194. }
  20195. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  20196. reqHeaders := make(http.Header)
  20197. for k, v := range c.header_ {
  20198. reqHeaders[k] = v
  20199. }
  20200. reqHeaders.Set("User-Agent", c.s.userAgent())
  20201. if c.ifNoneMatch_ != "" {
  20202. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20203. }
  20204. var body io.Reader = nil
  20205. c.urlParams_.Set("alt", alt)
  20206. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20207. urls += "?" + c.urlParams_.Encode()
  20208. req, _ := http.NewRequest("GET", urls, body)
  20209. req.Header = reqHeaders
  20210. googleapi.Expand(req.URL, map[string]string{
  20211. "profileId": strconv.FormatInt(c.profileId, 10),
  20212. "id": strconv.FormatInt(c.id, 10),
  20213. })
  20214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20215. }
  20216. // Do executes the "dfareporting.contentCategories.get" call.
  20217. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20218. // status code is an error. Response headers are in either
  20219. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20220. // at all) in error.(*googleapi.Error).Header. Use
  20221. // googleapi.IsNotModified to check whether the returned error was
  20222. // because http.StatusNotModified was returned.
  20223. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20224. gensupport.SetOptions(c.urlParams_, opts...)
  20225. res, err := c.doRequest("json")
  20226. if res != nil && res.StatusCode == http.StatusNotModified {
  20227. if res.Body != nil {
  20228. res.Body.Close()
  20229. }
  20230. return nil, &googleapi.Error{
  20231. Code: res.StatusCode,
  20232. Header: res.Header,
  20233. }
  20234. }
  20235. if err != nil {
  20236. return nil, err
  20237. }
  20238. defer googleapi.CloseBody(res)
  20239. if err := googleapi.CheckResponse(res); err != nil {
  20240. return nil, err
  20241. }
  20242. ret := &ContentCategory{
  20243. ServerResponse: googleapi.ServerResponse{
  20244. Header: res.Header,
  20245. HTTPStatusCode: res.StatusCode,
  20246. },
  20247. }
  20248. target := &ret
  20249. if err := gensupport.DecodeResponse(target, res); err != nil {
  20250. return nil, err
  20251. }
  20252. return ret, nil
  20253. // {
  20254. // "description": "Gets one content category by ID.",
  20255. // "httpMethod": "GET",
  20256. // "id": "dfareporting.contentCategories.get",
  20257. // "parameterOrder": [
  20258. // "profileId",
  20259. // "id"
  20260. // ],
  20261. // "parameters": {
  20262. // "id": {
  20263. // "description": "Content category ID.",
  20264. // "format": "int64",
  20265. // "location": "path",
  20266. // "required": true,
  20267. // "type": "string"
  20268. // },
  20269. // "profileId": {
  20270. // "description": "User profile ID associated with this request.",
  20271. // "format": "int64",
  20272. // "location": "path",
  20273. // "required": true,
  20274. // "type": "string"
  20275. // }
  20276. // },
  20277. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20278. // "response": {
  20279. // "$ref": "ContentCategory"
  20280. // },
  20281. // "scopes": [
  20282. // "https://www.googleapis.com/auth/dfatrafficking"
  20283. // ]
  20284. // }
  20285. }
  20286. // method id "dfareporting.contentCategories.insert":
  20287. type ContentCategoriesInsertCall struct {
  20288. s *Service
  20289. profileId int64
  20290. contentcategory *ContentCategory
  20291. urlParams_ gensupport.URLParams
  20292. ctx_ context.Context
  20293. header_ http.Header
  20294. }
  20295. // Insert: Inserts a new content category.
  20296. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  20297. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20298. c.profileId = profileId
  20299. c.contentcategory = contentcategory
  20300. return c
  20301. }
  20302. // Fields allows partial responses to be retrieved. See
  20303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20304. // for more information.
  20305. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  20306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20307. return c
  20308. }
  20309. // Context sets the context to be used in this call's Do method. Any
  20310. // pending HTTP request will be aborted if the provided context is
  20311. // canceled.
  20312. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  20313. c.ctx_ = ctx
  20314. return c
  20315. }
  20316. // Header returns an http.Header that can be modified by the caller to
  20317. // add HTTP headers to the request.
  20318. func (c *ContentCategoriesInsertCall) Header() http.Header {
  20319. if c.header_ == nil {
  20320. c.header_ = make(http.Header)
  20321. }
  20322. return c.header_
  20323. }
  20324. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  20325. reqHeaders := make(http.Header)
  20326. for k, v := range c.header_ {
  20327. reqHeaders[k] = v
  20328. }
  20329. reqHeaders.Set("User-Agent", c.s.userAgent())
  20330. var body io.Reader = nil
  20331. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20332. if err != nil {
  20333. return nil, err
  20334. }
  20335. reqHeaders.Set("Content-Type", "application/json")
  20336. c.urlParams_.Set("alt", alt)
  20337. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20338. urls += "?" + c.urlParams_.Encode()
  20339. req, _ := http.NewRequest("POST", urls, body)
  20340. req.Header = reqHeaders
  20341. googleapi.Expand(req.URL, map[string]string{
  20342. "profileId": strconv.FormatInt(c.profileId, 10),
  20343. })
  20344. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20345. }
  20346. // Do executes the "dfareporting.contentCategories.insert" call.
  20347. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20348. // status code is an error. Response headers are in either
  20349. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20350. // at all) in error.(*googleapi.Error).Header. Use
  20351. // googleapi.IsNotModified to check whether the returned error was
  20352. // because http.StatusNotModified was returned.
  20353. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20354. gensupport.SetOptions(c.urlParams_, opts...)
  20355. res, err := c.doRequest("json")
  20356. if res != nil && res.StatusCode == http.StatusNotModified {
  20357. if res.Body != nil {
  20358. res.Body.Close()
  20359. }
  20360. return nil, &googleapi.Error{
  20361. Code: res.StatusCode,
  20362. Header: res.Header,
  20363. }
  20364. }
  20365. if err != nil {
  20366. return nil, err
  20367. }
  20368. defer googleapi.CloseBody(res)
  20369. if err := googleapi.CheckResponse(res); err != nil {
  20370. return nil, err
  20371. }
  20372. ret := &ContentCategory{
  20373. ServerResponse: googleapi.ServerResponse{
  20374. Header: res.Header,
  20375. HTTPStatusCode: res.StatusCode,
  20376. },
  20377. }
  20378. target := &ret
  20379. if err := gensupport.DecodeResponse(target, res); err != nil {
  20380. return nil, err
  20381. }
  20382. return ret, nil
  20383. // {
  20384. // "description": "Inserts a new content category.",
  20385. // "httpMethod": "POST",
  20386. // "id": "dfareporting.contentCategories.insert",
  20387. // "parameterOrder": [
  20388. // "profileId"
  20389. // ],
  20390. // "parameters": {
  20391. // "profileId": {
  20392. // "description": "User profile ID associated with this request.",
  20393. // "format": "int64",
  20394. // "location": "path",
  20395. // "required": true,
  20396. // "type": "string"
  20397. // }
  20398. // },
  20399. // "path": "userprofiles/{profileId}/contentCategories",
  20400. // "request": {
  20401. // "$ref": "ContentCategory"
  20402. // },
  20403. // "response": {
  20404. // "$ref": "ContentCategory"
  20405. // },
  20406. // "scopes": [
  20407. // "https://www.googleapis.com/auth/dfatrafficking"
  20408. // ]
  20409. // }
  20410. }
  20411. // method id "dfareporting.contentCategories.list":
  20412. type ContentCategoriesListCall struct {
  20413. s *Service
  20414. profileId int64
  20415. urlParams_ gensupport.URLParams
  20416. ifNoneMatch_ string
  20417. ctx_ context.Context
  20418. header_ http.Header
  20419. }
  20420. // List: Retrieves a list of content categories, possibly filtered. This
  20421. // method supports paging.
  20422. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  20423. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20424. c.profileId = profileId
  20425. return c
  20426. }
  20427. // Ids sets the optional parameter "ids": Select only content categories
  20428. // with these IDs.
  20429. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  20430. var ids_ []string
  20431. for _, v := range ids {
  20432. ids_ = append(ids_, fmt.Sprint(v))
  20433. }
  20434. c.urlParams_.SetMulti("ids", ids_)
  20435. return c
  20436. }
  20437. // MaxResults sets the optional parameter "maxResults": Maximum number
  20438. // of results to return.
  20439. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  20440. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20441. return c
  20442. }
  20443. // PageToken sets the optional parameter "pageToken": Value of the
  20444. // nextPageToken from the previous result page.
  20445. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  20446. c.urlParams_.Set("pageToken", pageToken)
  20447. return c
  20448. }
  20449. // SearchString sets the optional parameter "searchString": Allows
  20450. // searching for objects by name or ID. Wildcards (*) are allowed. For
  20451. // example, "contentcategory*2015" will return objects with names like
  20452. // "contentcategory June 2015", "contentcategory April 2015", or simply
  20453. // "contentcategory 2015". Most of the searches also add wildcards
  20454. // implicitly at the start and the end of the search string. For
  20455. // example, a search string of "contentcategory" will match objects with
  20456. // name "my contentcategory", "contentcategory 2015", or simply
  20457. // "contentcategory".
  20458. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  20459. c.urlParams_.Set("searchString", searchString)
  20460. return c
  20461. }
  20462. // SortField sets the optional parameter "sortField": Field by which to
  20463. // sort the list.
  20464. //
  20465. // Possible values:
  20466. // "ID" (default)
  20467. // "NAME"
  20468. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  20469. c.urlParams_.Set("sortField", sortField)
  20470. return c
  20471. }
  20472. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20473. // results.
  20474. //
  20475. // Possible values:
  20476. // "ASCENDING" (default)
  20477. // "DESCENDING"
  20478. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  20479. c.urlParams_.Set("sortOrder", sortOrder)
  20480. return c
  20481. }
  20482. // Fields allows partial responses to be retrieved. See
  20483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20484. // for more information.
  20485. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  20486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20487. return c
  20488. }
  20489. // IfNoneMatch sets the optional parameter which makes the operation
  20490. // fail if the object's ETag matches the given value. This is useful for
  20491. // getting updates only after the object has changed since the last
  20492. // request. Use googleapi.IsNotModified to check whether the response
  20493. // error from Do is the result of In-None-Match.
  20494. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  20495. c.ifNoneMatch_ = entityTag
  20496. return c
  20497. }
  20498. // Context sets the context to be used in this call's Do method. Any
  20499. // pending HTTP request will be aborted if the provided context is
  20500. // canceled.
  20501. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  20502. c.ctx_ = ctx
  20503. return c
  20504. }
  20505. // Header returns an http.Header that can be modified by the caller to
  20506. // add HTTP headers to the request.
  20507. func (c *ContentCategoriesListCall) Header() http.Header {
  20508. if c.header_ == nil {
  20509. c.header_ = make(http.Header)
  20510. }
  20511. return c.header_
  20512. }
  20513. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  20514. reqHeaders := make(http.Header)
  20515. for k, v := range c.header_ {
  20516. reqHeaders[k] = v
  20517. }
  20518. reqHeaders.Set("User-Agent", c.s.userAgent())
  20519. if c.ifNoneMatch_ != "" {
  20520. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20521. }
  20522. var body io.Reader = nil
  20523. c.urlParams_.Set("alt", alt)
  20524. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20525. urls += "?" + c.urlParams_.Encode()
  20526. req, _ := http.NewRequest("GET", urls, body)
  20527. req.Header = reqHeaders
  20528. googleapi.Expand(req.URL, map[string]string{
  20529. "profileId": strconv.FormatInt(c.profileId, 10),
  20530. })
  20531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20532. }
  20533. // Do executes the "dfareporting.contentCategories.list" call.
  20534. // Exactly one of *ContentCategoriesListResponse or error will be
  20535. // non-nil. Any non-2xx status code is an error. Response headers are in
  20536. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  20537. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20538. // googleapi.IsNotModified to check whether the returned error was
  20539. // because http.StatusNotModified was returned.
  20540. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  20541. gensupport.SetOptions(c.urlParams_, opts...)
  20542. res, err := c.doRequest("json")
  20543. if res != nil && res.StatusCode == http.StatusNotModified {
  20544. if res.Body != nil {
  20545. res.Body.Close()
  20546. }
  20547. return nil, &googleapi.Error{
  20548. Code: res.StatusCode,
  20549. Header: res.Header,
  20550. }
  20551. }
  20552. if err != nil {
  20553. return nil, err
  20554. }
  20555. defer googleapi.CloseBody(res)
  20556. if err := googleapi.CheckResponse(res); err != nil {
  20557. return nil, err
  20558. }
  20559. ret := &ContentCategoriesListResponse{
  20560. ServerResponse: googleapi.ServerResponse{
  20561. Header: res.Header,
  20562. HTTPStatusCode: res.StatusCode,
  20563. },
  20564. }
  20565. target := &ret
  20566. if err := gensupport.DecodeResponse(target, res); err != nil {
  20567. return nil, err
  20568. }
  20569. return ret, nil
  20570. // {
  20571. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  20572. // "httpMethod": "GET",
  20573. // "id": "dfareporting.contentCategories.list",
  20574. // "parameterOrder": [
  20575. // "profileId"
  20576. // ],
  20577. // "parameters": {
  20578. // "ids": {
  20579. // "description": "Select only content categories with these IDs.",
  20580. // "format": "int64",
  20581. // "location": "query",
  20582. // "repeated": true,
  20583. // "type": "string"
  20584. // },
  20585. // "maxResults": {
  20586. // "default": "1000",
  20587. // "description": "Maximum number of results to return.",
  20588. // "format": "int32",
  20589. // "location": "query",
  20590. // "maximum": "1000",
  20591. // "minimum": "0",
  20592. // "type": "integer"
  20593. // },
  20594. // "pageToken": {
  20595. // "description": "Value of the nextPageToken from the previous result page.",
  20596. // "location": "query",
  20597. // "type": "string"
  20598. // },
  20599. // "profileId": {
  20600. // "description": "User profile ID associated with this request.",
  20601. // "format": "int64",
  20602. // "location": "path",
  20603. // "required": true,
  20604. // "type": "string"
  20605. // },
  20606. // "searchString": {
  20607. // "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\".",
  20608. // "location": "query",
  20609. // "type": "string"
  20610. // },
  20611. // "sortField": {
  20612. // "default": "ID",
  20613. // "description": "Field by which to sort the list.",
  20614. // "enum": [
  20615. // "ID",
  20616. // "NAME"
  20617. // ],
  20618. // "enumDescriptions": [
  20619. // "",
  20620. // ""
  20621. // ],
  20622. // "location": "query",
  20623. // "type": "string"
  20624. // },
  20625. // "sortOrder": {
  20626. // "default": "ASCENDING",
  20627. // "description": "Order of sorted results.",
  20628. // "enum": [
  20629. // "ASCENDING",
  20630. // "DESCENDING"
  20631. // ],
  20632. // "enumDescriptions": [
  20633. // "",
  20634. // ""
  20635. // ],
  20636. // "location": "query",
  20637. // "type": "string"
  20638. // }
  20639. // },
  20640. // "path": "userprofiles/{profileId}/contentCategories",
  20641. // "response": {
  20642. // "$ref": "ContentCategoriesListResponse"
  20643. // },
  20644. // "scopes": [
  20645. // "https://www.googleapis.com/auth/dfatrafficking"
  20646. // ]
  20647. // }
  20648. }
  20649. // Pages invokes f for each page of results.
  20650. // A non-nil error returned from f will halt the iteration.
  20651. // The provided context supersedes any context provided to the Context method.
  20652. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  20653. c.ctx_ = ctx
  20654. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20655. for {
  20656. x, err := c.Do()
  20657. if err != nil {
  20658. return err
  20659. }
  20660. if err := f(x); err != nil {
  20661. return err
  20662. }
  20663. if x.NextPageToken == "" {
  20664. return nil
  20665. }
  20666. c.PageToken(x.NextPageToken)
  20667. }
  20668. }
  20669. // method id "dfareporting.contentCategories.patch":
  20670. type ContentCategoriesPatchCall struct {
  20671. s *Service
  20672. profileId int64
  20673. contentcategory *ContentCategory
  20674. urlParams_ gensupport.URLParams
  20675. ctx_ context.Context
  20676. header_ http.Header
  20677. }
  20678. // Patch: Updates an existing content category. This method supports
  20679. // patch semantics.
  20680. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  20681. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20682. c.profileId = profileId
  20683. c.urlParams_.Set("id", fmt.Sprint(id))
  20684. c.contentcategory = contentcategory
  20685. return c
  20686. }
  20687. // Fields allows partial responses to be retrieved. See
  20688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20689. // for more information.
  20690. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  20691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20692. return c
  20693. }
  20694. // Context sets the context to be used in this call's Do method. Any
  20695. // pending HTTP request will be aborted if the provided context is
  20696. // canceled.
  20697. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  20698. c.ctx_ = ctx
  20699. return c
  20700. }
  20701. // Header returns an http.Header that can be modified by the caller to
  20702. // add HTTP headers to the request.
  20703. func (c *ContentCategoriesPatchCall) Header() http.Header {
  20704. if c.header_ == nil {
  20705. c.header_ = make(http.Header)
  20706. }
  20707. return c.header_
  20708. }
  20709. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  20710. reqHeaders := make(http.Header)
  20711. for k, v := range c.header_ {
  20712. reqHeaders[k] = v
  20713. }
  20714. reqHeaders.Set("User-Agent", c.s.userAgent())
  20715. var body io.Reader = nil
  20716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20717. if err != nil {
  20718. return nil, err
  20719. }
  20720. reqHeaders.Set("Content-Type", "application/json")
  20721. c.urlParams_.Set("alt", alt)
  20722. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20723. urls += "?" + c.urlParams_.Encode()
  20724. req, _ := http.NewRequest("PATCH", urls, body)
  20725. req.Header = reqHeaders
  20726. googleapi.Expand(req.URL, map[string]string{
  20727. "profileId": strconv.FormatInt(c.profileId, 10),
  20728. })
  20729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20730. }
  20731. // Do executes the "dfareporting.contentCategories.patch" call.
  20732. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20733. // status code is an error. Response headers are in either
  20734. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20735. // at all) in error.(*googleapi.Error).Header. Use
  20736. // googleapi.IsNotModified to check whether the returned error was
  20737. // because http.StatusNotModified was returned.
  20738. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20739. gensupport.SetOptions(c.urlParams_, opts...)
  20740. res, err := c.doRequest("json")
  20741. if res != nil && res.StatusCode == http.StatusNotModified {
  20742. if res.Body != nil {
  20743. res.Body.Close()
  20744. }
  20745. return nil, &googleapi.Error{
  20746. Code: res.StatusCode,
  20747. Header: res.Header,
  20748. }
  20749. }
  20750. if err != nil {
  20751. return nil, err
  20752. }
  20753. defer googleapi.CloseBody(res)
  20754. if err := googleapi.CheckResponse(res); err != nil {
  20755. return nil, err
  20756. }
  20757. ret := &ContentCategory{
  20758. ServerResponse: googleapi.ServerResponse{
  20759. Header: res.Header,
  20760. HTTPStatusCode: res.StatusCode,
  20761. },
  20762. }
  20763. target := &ret
  20764. if err := gensupport.DecodeResponse(target, res); err != nil {
  20765. return nil, err
  20766. }
  20767. return ret, nil
  20768. // {
  20769. // "description": "Updates an existing content category. This method supports patch semantics.",
  20770. // "httpMethod": "PATCH",
  20771. // "id": "dfareporting.contentCategories.patch",
  20772. // "parameterOrder": [
  20773. // "profileId",
  20774. // "id"
  20775. // ],
  20776. // "parameters": {
  20777. // "id": {
  20778. // "description": "Content category ID.",
  20779. // "format": "int64",
  20780. // "location": "query",
  20781. // "required": true,
  20782. // "type": "string"
  20783. // },
  20784. // "profileId": {
  20785. // "description": "User profile ID associated with this request.",
  20786. // "format": "int64",
  20787. // "location": "path",
  20788. // "required": true,
  20789. // "type": "string"
  20790. // }
  20791. // },
  20792. // "path": "userprofiles/{profileId}/contentCategories",
  20793. // "request": {
  20794. // "$ref": "ContentCategory"
  20795. // },
  20796. // "response": {
  20797. // "$ref": "ContentCategory"
  20798. // },
  20799. // "scopes": [
  20800. // "https://www.googleapis.com/auth/dfatrafficking"
  20801. // ]
  20802. // }
  20803. }
  20804. // method id "dfareporting.contentCategories.update":
  20805. type ContentCategoriesUpdateCall struct {
  20806. s *Service
  20807. profileId int64
  20808. contentcategory *ContentCategory
  20809. urlParams_ gensupport.URLParams
  20810. ctx_ context.Context
  20811. header_ http.Header
  20812. }
  20813. // Update: Updates an existing content category.
  20814. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  20815. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20816. c.profileId = profileId
  20817. c.contentcategory = contentcategory
  20818. return c
  20819. }
  20820. // Fields allows partial responses to be retrieved. See
  20821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20822. // for more information.
  20823. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  20824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20825. return c
  20826. }
  20827. // Context sets the context to be used in this call's Do method. Any
  20828. // pending HTTP request will be aborted if the provided context is
  20829. // canceled.
  20830. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  20831. c.ctx_ = ctx
  20832. return c
  20833. }
  20834. // Header returns an http.Header that can be modified by the caller to
  20835. // add HTTP headers to the request.
  20836. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  20837. if c.header_ == nil {
  20838. c.header_ = make(http.Header)
  20839. }
  20840. return c.header_
  20841. }
  20842. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  20843. reqHeaders := make(http.Header)
  20844. for k, v := range c.header_ {
  20845. reqHeaders[k] = v
  20846. }
  20847. reqHeaders.Set("User-Agent", c.s.userAgent())
  20848. var body io.Reader = nil
  20849. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20850. if err != nil {
  20851. return nil, err
  20852. }
  20853. reqHeaders.Set("Content-Type", "application/json")
  20854. c.urlParams_.Set("alt", alt)
  20855. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20856. urls += "?" + c.urlParams_.Encode()
  20857. req, _ := http.NewRequest("PUT", urls, body)
  20858. req.Header = reqHeaders
  20859. googleapi.Expand(req.URL, map[string]string{
  20860. "profileId": strconv.FormatInt(c.profileId, 10),
  20861. })
  20862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20863. }
  20864. // Do executes the "dfareporting.contentCategories.update" call.
  20865. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20866. // status code is an error. Response headers are in either
  20867. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20868. // at all) in error.(*googleapi.Error).Header. Use
  20869. // googleapi.IsNotModified to check whether the returned error was
  20870. // because http.StatusNotModified was returned.
  20871. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20872. gensupport.SetOptions(c.urlParams_, opts...)
  20873. res, err := c.doRequest("json")
  20874. if res != nil && res.StatusCode == http.StatusNotModified {
  20875. if res.Body != nil {
  20876. res.Body.Close()
  20877. }
  20878. return nil, &googleapi.Error{
  20879. Code: res.StatusCode,
  20880. Header: res.Header,
  20881. }
  20882. }
  20883. if err != nil {
  20884. return nil, err
  20885. }
  20886. defer googleapi.CloseBody(res)
  20887. if err := googleapi.CheckResponse(res); err != nil {
  20888. return nil, err
  20889. }
  20890. ret := &ContentCategory{
  20891. ServerResponse: googleapi.ServerResponse{
  20892. Header: res.Header,
  20893. HTTPStatusCode: res.StatusCode,
  20894. },
  20895. }
  20896. target := &ret
  20897. if err := gensupport.DecodeResponse(target, res); err != nil {
  20898. return nil, err
  20899. }
  20900. return ret, nil
  20901. // {
  20902. // "description": "Updates an existing content category.",
  20903. // "httpMethod": "PUT",
  20904. // "id": "dfareporting.contentCategories.update",
  20905. // "parameterOrder": [
  20906. // "profileId"
  20907. // ],
  20908. // "parameters": {
  20909. // "profileId": {
  20910. // "description": "User profile ID associated with this request.",
  20911. // "format": "int64",
  20912. // "location": "path",
  20913. // "required": true,
  20914. // "type": "string"
  20915. // }
  20916. // },
  20917. // "path": "userprofiles/{profileId}/contentCategories",
  20918. // "request": {
  20919. // "$ref": "ContentCategory"
  20920. // },
  20921. // "response": {
  20922. // "$ref": "ContentCategory"
  20923. // },
  20924. // "scopes": [
  20925. // "https://www.googleapis.com/auth/dfatrafficking"
  20926. // ]
  20927. // }
  20928. }
  20929. // method id "dfareporting.conversions.batchinsert":
  20930. type ConversionsBatchinsertCall struct {
  20931. s *Service
  20932. profileId int64
  20933. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  20934. urlParams_ gensupport.URLParams
  20935. ctx_ context.Context
  20936. header_ http.Header
  20937. }
  20938. // Batchinsert: Inserts conversions.
  20939. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  20940. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20941. c.profileId = profileId
  20942. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  20943. return c
  20944. }
  20945. // Fields allows partial responses to be retrieved. See
  20946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20947. // for more information.
  20948. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  20949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20950. return c
  20951. }
  20952. // Context sets the context to be used in this call's Do method. Any
  20953. // pending HTTP request will be aborted if the provided context is
  20954. // canceled.
  20955. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  20956. c.ctx_ = ctx
  20957. return c
  20958. }
  20959. // Header returns an http.Header that can be modified by the caller to
  20960. // add HTTP headers to the request.
  20961. func (c *ConversionsBatchinsertCall) Header() http.Header {
  20962. if c.header_ == nil {
  20963. c.header_ = make(http.Header)
  20964. }
  20965. return c.header_
  20966. }
  20967. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  20968. reqHeaders := make(http.Header)
  20969. for k, v := range c.header_ {
  20970. reqHeaders[k] = v
  20971. }
  20972. reqHeaders.Set("User-Agent", c.s.userAgent())
  20973. var body io.Reader = nil
  20974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  20975. if err != nil {
  20976. return nil, err
  20977. }
  20978. reqHeaders.Set("Content-Type", "application/json")
  20979. c.urlParams_.Set("alt", alt)
  20980. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  20981. urls += "?" + c.urlParams_.Encode()
  20982. req, _ := http.NewRequest("POST", urls, body)
  20983. req.Header = reqHeaders
  20984. googleapi.Expand(req.URL, map[string]string{
  20985. "profileId": strconv.FormatInt(c.profileId, 10),
  20986. })
  20987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20988. }
  20989. // Do executes the "dfareporting.conversions.batchinsert" call.
  20990. // Exactly one of *ConversionsBatchInsertResponse or error will be
  20991. // non-nil. Any non-2xx status code is an error. Response headers are in
  20992. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  20993. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20994. // googleapi.IsNotModified to check whether the returned error was
  20995. // because http.StatusNotModified was returned.
  20996. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  20997. gensupport.SetOptions(c.urlParams_, opts...)
  20998. res, err := c.doRequest("json")
  20999. if res != nil && res.StatusCode == http.StatusNotModified {
  21000. if res.Body != nil {
  21001. res.Body.Close()
  21002. }
  21003. return nil, &googleapi.Error{
  21004. Code: res.StatusCode,
  21005. Header: res.Header,
  21006. }
  21007. }
  21008. if err != nil {
  21009. return nil, err
  21010. }
  21011. defer googleapi.CloseBody(res)
  21012. if err := googleapi.CheckResponse(res); err != nil {
  21013. return nil, err
  21014. }
  21015. ret := &ConversionsBatchInsertResponse{
  21016. ServerResponse: googleapi.ServerResponse{
  21017. Header: res.Header,
  21018. HTTPStatusCode: res.StatusCode,
  21019. },
  21020. }
  21021. target := &ret
  21022. if err := gensupport.DecodeResponse(target, res); err != nil {
  21023. return nil, err
  21024. }
  21025. return ret, nil
  21026. // {
  21027. // "description": "Inserts conversions.",
  21028. // "httpMethod": "POST",
  21029. // "id": "dfareporting.conversions.batchinsert",
  21030. // "parameterOrder": [
  21031. // "profileId"
  21032. // ],
  21033. // "parameters": {
  21034. // "profileId": {
  21035. // "description": "User profile ID associated with this request.",
  21036. // "format": "int64",
  21037. // "location": "path",
  21038. // "required": true,
  21039. // "type": "string"
  21040. // }
  21041. // },
  21042. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  21043. // "request": {
  21044. // "$ref": "ConversionsBatchInsertRequest"
  21045. // },
  21046. // "response": {
  21047. // "$ref": "ConversionsBatchInsertResponse"
  21048. // },
  21049. // "scopes": [
  21050. // "https://www.googleapis.com/auth/ddmconversions"
  21051. // ]
  21052. // }
  21053. }
  21054. // method id "dfareporting.conversions.batchupdate":
  21055. type ConversionsBatchupdateCall struct {
  21056. s *Service
  21057. profileId int64
  21058. conversionsbatchupdaterequest *ConversionsBatchUpdateRequest
  21059. urlParams_ gensupport.URLParams
  21060. ctx_ context.Context
  21061. header_ http.Header
  21062. }
  21063. // Batchupdate: Updates existing conversions.
  21064. func (r *ConversionsService) Batchupdate(profileId int64, conversionsbatchupdaterequest *ConversionsBatchUpdateRequest) *ConversionsBatchupdateCall {
  21065. c := &ConversionsBatchupdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21066. c.profileId = profileId
  21067. c.conversionsbatchupdaterequest = conversionsbatchupdaterequest
  21068. return c
  21069. }
  21070. // Fields allows partial responses to be retrieved. See
  21071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21072. // for more information.
  21073. func (c *ConversionsBatchupdateCall) Fields(s ...googleapi.Field) *ConversionsBatchupdateCall {
  21074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21075. return c
  21076. }
  21077. // Context sets the context to be used in this call's Do method. Any
  21078. // pending HTTP request will be aborted if the provided context is
  21079. // canceled.
  21080. func (c *ConversionsBatchupdateCall) Context(ctx context.Context) *ConversionsBatchupdateCall {
  21081. c.ctx_ = ctx
  21082. return c
  21083. }
  21084. // Header returns an http.Header that can be modified by the caller to
  21085. // add HTTP headers to the request.
  21086. func (c *ConversionsBatchupdateCall) Header() http.Header {
  21087. if c.header_ == nil {
  21088. c.header_ = make(http.Header)
  21089. }
  21090. return c.header_
  21091. }
  21092. func (c *ConversionsBatchupdateCall) doRequest(alt string) (*http.Response, error) {
  21093. reqHeaders := make(http.Header)
  21094. for k, v := range c.header_ {
  21095. reqHeaders[k] = v
  21096. }
  21097. reqHeaders.Set("User-Agent", c.s.userAgent())
  21098. var body io.Reader = nil
  21099. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchupdaterequest)
  21100. if err != nil {
  21101. return nil, err
  21102. }
  21103. reqHeaders.Set("Content-Type", "application/json")
  21104. c.urlParams_.Set("alt", alt)
  21105. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchupdate")
  21106. urls += "?" + c.urlParams_.Encode()
  21107. req, _ := http.NewRequest("POST", urls, body)
  21108. req.Header = reqHeaders
  21109. googleapi.Expand(req.URL, map[string]string{
  21110. "profileId": strconv.FormatInt(c.profileId, 10),
  21111. })
  21112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21113. }
  21114. // Do executes the "dfareporting.conversions.batchupdate" call.
  21115. // Exactly one of *ConversionsBatchUpdateResponse or error will be
  21116. // non-nil. Any non-2xx status code is an error. Response headers are in
  21117. // either *ConversionsBatchUpdateResponse.ServerResponse.Header or (if a
  21118. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21119. // googleapi.IsNotModified to check whether the returned error was
  21120. // because http.StatusNotModified was returned.
  21121. func (c *ConversionsBatchupdateCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchUpdateResponse, error) {
  21122. gensupport.SetOptions(c.urlParams_, opts...)
  21123. res, err := c.doRequest("json")
  21124. if res != nil && res.StatusCode == http.StatusNotModified {
  21125. if res.Body != nil {
  21126. res.Body.Close()
  21127. }
  21128. return nil, &googleapi.Error{
  21129. Code: res.StatusCode,
  21130. Header: res.Header,
  21131. }
  21132. }
  21133. if err != nil {
  21134. return nil, err
  21135. }
  21136. defer googleapi.CloseBody(res)
  21137. if err := googleapi.CheckResponse(res); err != nil {
  21138. return nil, err
  21139. }
  21140. ret := &ConversionsBatchUpdateResponse{
  21141. ServerResponse: googleapi.ServerResponse{
  21142. Header: res.Header,
  21143. HTTPStatusCode: res.StatusCode,
  21144. },
  21145. }
  21146. target := &ret
  21147. if err := gensupport.DecodeResponse(target, res); err != nil {
  21148. return nil, err
  21149. }
  21150. return ret, nil
  21151. // {
  21152. // "description": "Updates existing conversions.",
  21153. // "httpMethod": "POST",
  21154. // "id": "dfareporting.conversions.batchupdate",
  21155. // "parameterOrder": [
  21156. // "profileId"
  21157. // ],
  21158. // "parameters": {
  21159. // "profileId": {
  21160. // "description": "User profile ID associated with this request.",
  21161. // "format": "int64",
  21162. // "location": "path",
  21163. // "required": true,
  21164. // "type": "string"
  21165. // }
  21166. // },
  21167. // "path": "userprofiles/{profileId}/conversions/batchupdate",
  21168. // "request": {
  21169. // "$ref": "ConversionsBatchUpdateRequest"
  21170. // },
  21171. // "response": {
  21172. // "$ref": "ConversionsBatchUpdateResponse"
  21173. // },
  21174. // "scopes": [
  21175. // "https://www.googleapis.com/auth/ddmconversions"
  21176. // ]
  21177. // }
  21178. }
  21179. // method id "dfareporting.countries.get":
  21180. type CountriesGetCall struct {
  21181. s *Service
  21182. profileId int64
  21183. dartId int64
  21184. urlParams_ gensupport.URLParams
  21185. ifNoneMatch_ string
  21186. ctx_ context.Context
  21187. header_ http.Header
  21188. }
  21189. // Get: Gets one country by ID.
  21190. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  21191. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21192. c.profileId = profileId
  21193. c.dartId = dartId
  21194. return c
  21195. }
  21196. // Fields allows partial responses to be retrieved. See
  21197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21198. // for more information.
  21199. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  21200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21201. return c
  21202. }
  21203. // IfNoneMatch sets the optional parameter which makes the operation
  21204. // fail if the object's ETag matches the given value. This is useful for
  21205. // getting updates only after the object has changed since the last
  21206. // request. Use googleapi.IsNotModified to check whether the response
  21207. // error from Do is the result of In-None-Match.
  21208. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  21209. c.ifNoneMatch_ = entityTag
  21210. return c
  21211. }
  21212. // Context sets the context to be used in this call's Do method. Any
  21213. // pending HTTP request will be aborted if the provided context is
  21214. // canceled.
  21215. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  21216. c.ctx_ = ctx
  21217. return c
  21218. }
  21219. // Header returns an http.Header that can be modified by the caller to
  21220. // add HTTP headers to the request.
  21221. func (c *CountriesGetCall) Header() http.Header {
  21222. if c.header_ == nil {
  21223. c.header_ = make(http.Header)
  21224. }
  21225. return c.header_
  21226. }
  21227. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  21228. reqHeaders := make(http.Header)
  21229. for k, v := range c.header_ {
  21230. reqHeaders[k] = v
  21231. }
  21232. reqHeaders.Set("User-Agent", c.s.userAgent())
  21233. if c.ifNoneMatch_ != "" {
  21234. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21235. }
  21236. var body io.Reader = nil
  21237. c.urlParams_.Set("alt", alt)
  21238. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  21239. urls += "?" + c.urlParams_.Encode()
  21240. req, _ := http.NewRequest("GET", urls, body)
  21241. req.Header = reqHeaders
  21242. googleapi.Expand(req.URL, map[string]string{
  21243. "profileId": strconv.FormatInt(c.profileId, 10),
  21244. "dartId": strconv.FormatInt(c.dartId, 10),
  21245. })
  21246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21247. }
  21248. // Do executes the "dfareporting.countries.get" call.
  21249. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  21250. // code is an error. Response headers are in either
  21251. // *Country.ServerResponse.Header or (if a response was returned at all)
  21252. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21253. // check whether the returned error was because http.StatusNotModified
  21254. // was returned.
  21255. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  21256. gensupport.SetOptions(c.urlParams_, opts...)
  21257. res, err := c.doRequest("json")
  21258. if res != nil && res.StatusCode == http.StatusNotModified {
  21259. if res.Body != nil {
  21260. res.Body.Close()
  21261. }
  21262. return nil, &googleapi.Error{
  21263. Code: res.StatusCode,
  21264. Header: res.Header,
  21265. }
  21266. }
  21267. if err != nil {
  21268. return nil, err
  21269. }
  21270. defer googleapi.CloseBody(res)
  21271. if err := googleapi.CheckResponse(res); err != nil {
  21272. return nil, err
  21273. }
  21274. ret := &Country{
  21275. ServerResponse: googleapi.ServerResponse{
  21276. Header: res.Header,
  21277. HTTPStatusCode: res.StatusCode,
  21278. },
  21279. }
  21280. target := &ret
  21281. if err := gensupport.DecodeResponse(target, res); err != nil {
  21282. return nil, err
  21283. }
  21284. return ret, nil
  21285. // {
  21286. // "description": "Gets one country by ID.",
  21287. // "httpMethod": "GET",
  21288. // "id": "dfareporting.countries.get",
  21289. // "parameterOrder": [
  21290. // "profileId",
  21291. // "dartId"
  21292. // ],
  21293. // "parameters": {
  21294. // "dartId": {
  21295. // "description": "Country DART ID.",
  21296. // "format": "int64",
  21297. // "location": "path",
  21298. // "required": true,
  21299. // "type": "string"
  21300. // },
  21301. // "profileId": {
  21302. // "description": "User profile ID associated with this request.",
  21303. // "format": "int64",
  21304. // "location": "path",
  21305. // "required": true,
  21306. // "type": "string"
  21307. // }
  21308. // },
  21309. // "path": "userprofiles/{profileId}/countries/{dartId}",
  21310. // "response": {
  21311. // "$ref": "Country"
  21312. // },
  21313. // "scopes": [
  21314. // "https://www.googleapis.com/auth/dfatrafficking"
  21315. // ]
  21316. // }
  21317. }
  21318. // method id "dfareporting.countries.list":
  21319. type CountriesListCall struct {
  21320. s *Service
  21321. profileId int64
  21322. urlParams_ gensupport.URLParams
  21323. ifNoneMatch_ string
  21324. ctx_ context.Context
  21325. header_ http.Header
  21326. }
  21327. // List: Retrieves a list of countries.
  21328. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  21329. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21330. c.profileId = profileId
  21331. return c
  21332. }
  21333. // Fields allows partial responses to be retrieved. See
  21334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21335. // for more information.
  21336. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  21337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21338. return c
  21339. }
  21340. // IfNoneMatch sets the optional parameter which makes the operation
  21341. // fail if the object's ETag matches the given value. This is useful for
  21342. // getting updates only after the object has changed since the last
  21343. // request. Use googleapi.IsNotModified to check whether the response
  21344. // error from Do is the result of In-None-Match.
  21345. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  21346. c.ifNoneMatch_ = entityTag
  21347. return c
  21348. }
  21349. // Context sets the context to be used in this call's Do method. Any
  21350. // pending HTTP request will be aborted if the provided context is
  21351. // canceled.
  21352. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  21353. c.ctx_ = ctx
  21354. return c
  21355. }
  21356. // Header returns an http.Header that can be modified by the caller to
  21357. // add HTTP headers to the request.
  21358. func (c *CountriesListCall) Header() http.Header {
  21359. if c.header_ == nil {
  21360. c.header_ = make(http.Header)
  21361. }
  21362. return c.header_
  21363. }
  21364. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  21365. reqHeaders := make(http.Header)
  21366. for k, v := range c.header_ {
  21367. reqHeaders[k] = v
  21368. }
  21369. reqHeaders.Set("User-Agent", c.s.userAgent())
  21370. if c.ifNoneMatch_ != "" {
  21371. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21372. }
  21373. var body io.Reader = nil
  21374. c.urlParams_.Set("alt", alt)
  21375. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  21376. urls += "?" + c.urlParams_.Encode()
  21377. req, _ := http.NewRequest("GET", urls, body)
  21378. req.Header = reqHeaders
  21379. googleapi.Expand(req.URL, map[string]string{
  21380. "profileId": strconv.FormatInt(c.profileId, 10),
  21381. })
  21382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21383. }
  21384. // Do executes the "dfareporting.countries.list" call.
  21385. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  21386. // non-2xx status code is an error. Response headers are in either
  21387. // *CountriesListResponse.ServerResponse.Header or (if a response was
  21388. // returned at all) in error.(*googleapi.Error).Header. Use
  21389. // googleapi.IsNotModified to check whether the returned error was
  21390. // because http.StatusNotModified was returned.
  21391. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  21392. gensupport.SetOptions(c.urlParams_, opts...)
  21393. res, err := c.doRequest("json")
  21394. if res != nil && res.StatusCode == http.StatusNotModified {
  21395. if res.Body != nil {
  21396. res.Body.Close()
  21397. }
  21398. return nil, &googleapi.Error{
  21399. Code: res.StatusCode,
  21400. Header: res.Header,
  21401. }
  21402. }
  21403. if err != nil {
  21404. return nil, err
  21405. }
  21406. defer googleapi.CloseBody(res)
  21407. if err := googleapi.CheckResponse(res); err != nil {
  21408. return nil, err
  21409. }
  21410. ret := &CountriesListResponse{
  21411. ServerResponse: googleapi.ServerResponse{
  21412. Header: res.Header,
  21413. HTTPStatusCode: res.StatusCode,
  21414. },
  21415. }
  21416. target := &ret
  21417. if err := gensupport.DecodeResponse(target, res); err != nil {
  21418. return nil, err
  21419. }
  21420. return ret, nil
  21421. // {
  21422. // "description": "Retrieves a list of countries.",
  21423. // "httpMethod": "GET",
  21424. // "id": "dfareporting.countries.list",
  21425. // "parameterOrder": [
  21426. // "profileId"
  21427. // ],
  21428. // "parameters": {
  21429. // "profileId": {
  21430. // "description": "User profile ID associated with this request.",
  21431. // "format": "int64",
  21432. // "location": "path",
  21433. // "required": true,
  21434. // "type": "string"
  21435. // }
  21436. // },
  21437. // "path": "userprofiles/{profileId}/countries",
  21438. // "response": {
  21439. // "$ref": "CountriesListResponse"
  21440. // },
  21441. // "scopes": [
  21442. // "https://www.googleapis.com/auth/dfatrafficking"
  21443. // ]
  21444. // }
  21445. }
  21446. // method id "dfareporting.creativeAssets.insert":
  21447. type CreativeAssetsInsertCall struct {
  21448. s *Service
  21449. profileId int64
  21450. advertiserId int64
  21451. creativeassetmetadata *CreativeAssetMetadata
  21452. urlParams_ gensupport.URLParams
  21453. mediaInfo_ *gensupport.MediaInfo
  21454. ctx_ context.Context
  21455. header_ http.Header
  21456. }
  21457. // Insert: Inserts a new creative asset.
  21458. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  21459. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21460. c.profileId = profileId
  21461. c.advertiserId = advertiserId
  21462. c.creativeassetmetadata = creativeassetmetadata
  21463. return c
  21464. }
  21465. // Media specifies the media to upload in one or more chunks. The chunk
  21466. // size may be controlled by supplying a MediaOption generated by
  21467. // googleapi.ChunkSize. The chunk size defaults to
  21468. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  21469. // upload request will be determined by sniffing the contents of r,
  21470. // unless a MediaOption generated by googleapi.ContentType is
  21471. // supplied.
  21472. // At most one of Media and ResumableMedia may be set.
  21473. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  21474. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  21475. return c
  21476. }
  21477. // ResumableMedia specifies the media to upload in chunks and can be
  21478. // canceled with ctx.
  21479. //
  21480. // Deprecated: use Media instead.
  21481. //
  21482. // At most one of Media and ResumableMedia may be set. mediaType
  21483. // identifies the MIME media type of the upload, such as "image/png". If
  21484. // mediaType is "", it will be auto-detected. The provided ctx will
  21485. // supersede any context previously provided to the Context method.
  21486. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  21487. c.ctx_ = ctx
  21488. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  21489. return c
  21490. }
  21491. // ProgressUpdater provides a callback function that will be called
  21492. // after every chunk. It should be a low-latency function in order to
  21493. // not slow down the upload operation. This should only be called when
  21494. // using ResumableMedia (as opposed to Media).
  21495. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  21496. c.mediaInfo_.SetProgressUpdater(pu)
  21497. return c
  21498. }
  21499. // Fields allows partial responses to be retrieved. See
  21500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21501. // for more information.
  21502. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  21503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21504. return c
  21505. }
  21506. // Context sets the context to be used in this call's Do method. Any
  21507. // pending HTTP request will be aborted if the provided context is
  21508. // canceled.
  21509. // This context will supersede any context previously provided to the
  21510. // ResumableMedia method.
  21511. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  21512. c.ctx_ = ctx
  21513. return c
  21514. }
  21515. // Header returns an http.Header that can be modified by the caller to
  21516. // add HTTP headers to the request.
  21517. func (c *CreativeAssetsInsertCall) Header() http.Header {
  21518. if c.header_ == nil {
  21519. c.header_ = make(http.Header)
  21520. }
  21521. return c.header_
  21522. }
  21523. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  21524. reqHeaders := make(http.Header)
  21525. for k, v := range c.header_ {
  21526. reqHeaders[k] = v
  21527. }
  21528. reqHeaders.Set("User-Agent", c.s.userAgent())
  21529. var body io.Reader = nil
  21530. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  21531. if err != nil {
  21532. return nil, err
  21533. }
  21534. reqHeaders.Set("Content-Type", "application/json")
  21535. c.urlParams_.Set("alt", alt)
  21536. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  21537. if c.mediaInfo_ != nil {
  21538. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  21539. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  21540. }
  21541. if body == nil {
  21542. body = new(bytes.Buffer)
  21543. reqHeaders.Set("Content-Type", "application/json")
  21544. }
  21545. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  21546. defer cleanup()
  21547. urls += "?" + c.urlParams_.Encode()
  21548. req, _ := http.NewRequest("POST", urls, body)
  21549. req.Header = reqHeaders
  21550. gensupport.SetGetBody(req, getBody)
  21551. googleapi.Expand(req.URL, map[string]string{
  21552. "profileId": strconv.FormatInt(c.profileId, 10),
  21553. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  21554. })
  21555. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21556. }
  21557. // Do executes the "dfareporting.creativeAssets.insert" call.
  21558. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  21559. // non-2xx status code is an error. Response headers are in either
  21560. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  21561. // returned at all) in error.(*googleapi.Error).Header. Use
  21562. // googleapi.IsNotModified to check whether the returned error was
  21563. // because http.StatusNotModified was returned.
  21564. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  21565. gensupport.SetOptions(c.urlParams_, opts...)
  21566. res, err := c.doRequest("json")
  21567. if res != nil && res.StatusCode == http.StatusNotModified {
  21568. if res.Body != nil {
  21569. res.Body.Close()
  21570. }
  21571. return nil, &googleapi.Error{
  21572. Code: res.StatusCode,
  21573. Header: res.Header,
  21574. }
  21575. }
  21576. if err != nil {
  21577. return nil, err
  21578. }
  21579. defer googleapi.CloseBody(res)
  21580. if err := googleapi.CheckResponse(res); err != nil {
  21581. return nil, err
  21582. }
  21583. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  21584. if rx != nil {
  21585. rx.Client = c.s.client
  21586. rx.UserAgent = c.s.userAgent()
  21587. ctx := c.ctx_
  21588. if ctx == nil {
  21589. ctx = context.TODO()
  21590. }
  21591. res, err = rx.Upload(ctx)
  21592. if err != nil {
  21593. return nil, err
  21594. }
  21595. defer res.Body.Close()
  21596. if err := googleapi.CheckResponse(res); err != nil {
  21597. return nil, err
  21598. }
  21599. }
  21600. ret := &CreativeAssetMetadata{
  21601. ServerResponse: googleapi.ServerResponse{
  21602. Header: res.Header,
  21603. HTTPStatusCode: res.StatusCode,
  21604. },
  21605. }
  21606. target := &ret
  21607. if err := gensupport.DecodeResponse(target, res); err != nil {
  21608. return nil, err
  21609. }
  21610. return ret, nil
  21611. // {
  21612. // "description": "Inserts a new creative asset.",
  21613. // "httpMethod": "POST",
  21614. // "id": "dfareporting.creativeAssets.insert",
  21615. // "mediaUpload": {
  21616. // "accept": [
  21617. // "*/*"
  21618. // ],
  21619. // "maxSize": "1024MB",
  21620. // "protocols": {
  21621. // "resumable": {
  21622. // "multipart": true,
  21623. // "path": "/resumable/upload/dfareporting/v3.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21624. // },
  21625. // "simple": {
  21626. // "multipart": true,
  21627. // "path": "/upload/dfareporting/v3.1/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21628. // }
  21629. // }
  21630. // },
  21631. // "parameterOrder": [
  21632. // "profileId",
  21633. // "advertiserId"
  21634. // ],
  21635. // "parameters": {
  21636. // "advertiserId": {
  21637. // "description": "Advertiser ID of this creative. This is a required field.",
  21638. // "format": "int64",
  21639. // "location": "path",
  21640. // "required": true,
  21641. // "type": "string"
  21642. // },
  21643. // "profileId": {
  21644. // "description": "User profile ID associated with this request.",
  21645. // "format": "int64",
  21646. // "location": "path",
  21647. // "required": true,
  21648. // "type": "string"
  21649. // }
  21650. // },
  21651. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  21652. // "request": {
  21653. // "$ref": "CreativeAssetMetadata"
  21654. // },
  21655. // "response": {
  21656. // "$ref": "CreativeAssetMetadata"
  21657. // },
  21658. // "scopes": [
  21659. // "https://www.googleapis.com/auth/dfatrafficking"
  21660. // ],
  21661. // "supportsMediaUpload": true
  21662. // }
  21663. }
  21664. // method id "dfareporting.creativeFieldValues.delete":
  21665. type CreativeFieldValuesDeleteCall struct {
  21666. s *Service
  21667. profileId int64
  21668. creativeFieldId int64
  21669. id int64
  21670. urlParams_ gensupport.URLParams
  21671. ctx_ context.Context
  21672. header_ http.Header
  21673. }
  21674. // Delete: Deletes an existing creative field value.
  21675. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  21676. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21677. c.profileId = profileId
  21678. c.creativeFieldId = creativeFieldId
  21679. c.id = id
  21680. return c
  21681. }
  21682. // Fields allows partial responses to be retrieved. See
  21683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21684. // for more information.
  21685. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  21686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21687. return c
  21688. }
  21689. // Context sets the context to be used in this call's Do method. Any
  21690. // pending HTTP request will be aborted if the provided context is
  21691. // canceled.
  21692. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  21693. c.ctx_ = ctx
  21694. return c
  21695. }
  21696. // Header returns an http.Header that can be modified by the caller to
  21697. // add HTTP headers to the request.
  21698. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  21699. if c.header_ == nil {
  21700. c.header_ = make(http.Header)
  21701. }
  21702. return c.header_
  21703. }
  21704. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  21705. reqHeaders := make(http.Header)
  21706. for k, v := range c.header_ {
  21707. reqHeaders[k] = v
  21708. }
  21709. reqHeaders.Set("User-Agent", c.s.userAgent())
  21710. var body io.Reader = nil
  21711. c.urlParams_.Set("alt", alt)
  21712. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  21713. urls += "?" + c.urlParams_.Encode()
  21714. req, _ := http.NewRequest("DELETE", urls, body)
  21715. req.Header = reqHeaders
  21716. googleapi.Expand(req.URL, map[string]string{
  21717. "profileId": strconv.FormatInt(c.profileId, 10),
  21718. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21719. "id": strconv.FormatInt(c.id, 10),
  21720. })
  21721. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21722. }
  21723. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  21724. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  21725. gensupport.SetOptions(c.urlParams_, opts...)
  21726. res, err := c.doRequest("json")
  21727. if err != nil {
  21728. return err
  21729. }
  21730. defer googleapi.CloseBody(res)
  21731. if err := googleapi.CheckResponse(res); err != nil {
  21732. return err
  21733. }
  21734. return nil
  21735. // {
  21736. // "description": "Deletes an existing creative field value.",
  21737. // "httpMethod": "DELETE",
  21738. // "id": "dfareporting.creativeFieldValues.delete",
  21739. // "parameterOrder": [
  21740. // "profileId",
  21741. // "creativeFieldId",
  21742. // "id"
  21743. // ],
  21744. // "parameters": {
  21745. // "creativeFieldId": {
  21746. // "description": "Creative field ID for this creative field value.",
  21747. // "format": "int64",
  21748. // "location": "path",
  21749. // "required": true,
  21750. // "type": "string"
  21751. // },
  21752. // "id": {
  21753. // "description": "Creative Field Value ID",
  21754. // "format": "int64",
  21755. // "location": "path",
  21756. // "required": true,
  21757. // "type": "string"
  21758. // },
  21759. // "profileId": {
  21760. // "description": "User profile ID associated with this request.",
  21761. // "format": "int64",
  21762. // "location": "path",
  21763. // "required": true,
  21764. // "type": "string"
  21765. // }
  21766. // },
  21767. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  21768. // "scopes": [
  21769. // "https://www.googleapis.com/auth/dfatrafficking"
  21770. // ]
  21771. // }
  21772. }
  21773. // method id "dfareporting.creativeFieldValues.get":
  21774. type CreativeFieldValuesGetCall struct {
  21775. s *Service
  21776. profileId int64
  21777. creativeFieldId int64
  21778. id int64
  21779. urlParams_ gensupport.URLParams
  21780. ifNoneMatch_ string
  21781. ctx_ context.Context
  21782. header_ http.Header
  21783. }
  21784. // Get: Gets one creative field value by ID.
  21785. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  21786. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21787. c.profileId = profileId
  21788. c.creativeFieldId = creativeFieldId
  21789. c.id = id
  21790. return c
  21791. }
  21792. // Fields allows partial responses to be retrieved. See
  21793. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21794. // for more information.
  21795. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  21796. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21797. return c
  21798. }
  21799. // IfNoneMatch sets the optional parameter which makes the operation
  21800. // fail if the object's ETag matches the given value. This is useful for
  21801. // getting updates only after the object has changed since the last
  21802. // request. Use googleapi.IsNotModified to check whether the response
  21803. // error from Do is the result of In-None-Match.
  21804. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  21805. c.ifNoneMatch_ = entityTag
  21806. return c
  21807. }
  21808. // Context sets the context to be used in this call's Do method. Any
  21809. // pending HTTP request will be aborted if the provided context is
  21810. // canceled.
  21811. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  21812. c.ctx_ = ctx
  21813. return c
  21814. }
  21815. // Header returns an http.Header that can be modified by the caller to
  21816. // add HTTP headers to the request.
  21817. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  21818. if c.header_ == nil {
  21819. c.header_ = make(http.Header)
  21820. }
  21821. return c.header_
  21822. }
  21823. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  21824. reqHeaders := make(http.Header)
  21825. for k, v := range c.header_ {
  21826. reqHeaders[k] = v
  21827. }
  21828. reqHeaders.Set("User-Agent", c.s.userAgent())
  21829. if c.ifNoneMatch_ != "" {
  21830. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21831. }
  21832. var body io.Reader = nil
  21833. c.urlParams_.Set("alt", alt)
  21834. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  21835. urls += "?" + c.urlParams_.Encode()
  21836. req, _ := http.NewRequest("GET", urls, body)
  21837. req.Header = reqHeaders
  21838. googleapi.Expand(req.URL, map[string]string{
  21839. "profileId": strconv.FormatInt(c.profileId, 10),
  21840. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21841. "id": strconv.FormatInt(c.id, 10),
  21842. })
  21843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21844. }
  21845. // Do executes the "dfareporting.creativeFieldValues.get" call.
  21846. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21847. // non-2xx status code is an error. Response headers are in either
  21848. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21849. // returned at all) in error.(*googleapi.Error).Header. Use
  21850. // googleapi.IsNotModified to check whether the returned error was
  21851. // because http.StatusNotModified was returned.
  21852. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21853. gensupport.SetOptions(c.urlParams_, opts...)
  21854. res, err := c.doRequest("json")
  21855. if res != nil && res.StatusCode == http.StatusNotModified {
  21856. if res.Body != nil {
  21857. res.Body.Close()
  21858. }
  21859. return nil, &googleapi.Error{
  21860. Code: res.StatusCode,
  21861. Header: res.Header,
  21862. }
  21863. }
  21864. if err != nil {
  21865. return nil, err
  21866. }
  21867. defer googleapi.CloseBody(res)
  21868. if err := googleapi.CheckResponse(res); err != nil {
  21869. return nil, err
  21870. }
  21871. ret := &CreativeFieldValue{
  21872. ServerResponse: googleapi.ServerResponse{
  21873. Header: res.Header,
  21874. HTTPStatusCode: res.StatusCode,
  21875. },
  21876. }
  21877. target := &ret
  21878. if err := gensupport.DecodeResponse(target, res); err != nil {
  21879. return nil, err
  21880. }
  21881. return ret, nil
  21882. // {
  21883. // "description": "Gets one creative field value by ID.",
  21884. // "httpMethod": "GET",
  21885. // "id": "dfareporting.creativeFieldValues.get",
  21886. // "parameterOrder": [
  21887. // "profileId",
  21888. // "creativeFieldId",
  21889. // "id"
  21890. // ],
  21891. // "parameters": {
  21892. // "creativeFieldId": {
  21893. // "description": "Creative field ID for this creative field value.",
  21894. // "format": "int64",
  21895. // "location": "path",
  21896. // "required": true,
  21897. // "type": "string"
  21898. // },
  21899. // "id": {
  21900. // "description": "Creative Field Value ID",
  21901. // "format": "int64",
  21902. // "location": "path",
  21903. // "required": true,
  21904. // "type": "string"
  21905. // },
  21906. // "profileId": {
  21907. // "description": "User profile ID associated with this request.",
  21908. // "format": "int64",
  21909. // "location": "path",
  21910. // "required": true,
  21911. // "type": "string"
  21912. // }
  21913. // },
  21914. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  21915. // "response": {
  21916. // "$ref": "CreativeFieldValue"
  21917. // },
  21918. // "scopes": [
  21919. // "https://www.googleapis.com/auth/dfatrafficking"
  21920. // ]
  21921. // }
  21922. }
  21923. // method id "dfareporting.creativeFieldValues.insert":
  21924. type CreativeFieldValuesInsertCall struct {
  21925. s *Service
  21926. profileId int64
  21927. creativeFieldId int64
  21928. creativefieldvalue *CreativeFieldValue
  21929. urlParams_ gensupport.URLParams
  21930. ctx_ context.Context
  21931. header_ http.Header
  21932. }
  21933. // Insert: Inserts a new creative field value.
  21934. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  21935. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21936. c.profileId = profileId
  21937. c.creativeFieldId = creativeFieldId
  21938. c.creativefieldvalue = creativefieldvalue
  21939. return c
  21940. }
  21941. // Fields allows partial responses to be retrieved. See
  21942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21943. // for more information.
  21944. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  21945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21946. return c
  21947. }
  21948. // Context sets the context to be used in this call's Do method. Any
  21949. // pending HTTP request will be aborted if the provided context is
  21950. // canceled.
  21951. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  21952. c.ctx_ = ctx
  21953. return c
  21954. }
  21955. // Header returns an http.Header that can be modified by the caller to
  21956. // add HTTP headers to the request.
  21957. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  21958. if c.header_ == nil {
  21959. c.header_ = make(http.Header)
  21960. }
  21961. return c.header_
  21962. }
  21963. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  21964. reqHeaders := make(http.Header)
  21965. for k, v := range c.header_ {
  21966. reqHeaders[k] = v
  21967. }
  21968. reqHeaders.Set("User-Agent", c.s.userAgent())
  21969. var body io.Reader = nil
  21970. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  21971. if err != nil {
  21972. return nil, err
  21973. }
  21974. reqHeaders.Set("Content-Type", "application/json")
  21975. c.urlParams_.Set("alt", alt)
  21976. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  21977. urls += "?" + c.urlParams_.Encode()
  21978. req, _ := http.NewRequest("POST", urls, body)
  21979. req.Header = reqHeaders
  21980. googleapi.Expand(req.URL, map[string]string{
  21981. "profileId": strconv.FormatInt(c.profileId, 10),
  21982. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21983. })
  21984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21985. }
  21986. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  21987. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21988. // non-2xx status code is an error. Response headers are in either
  21989. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21990. // returned at all) in error.(*googleapi.Error).Header. Use
  21991. // googleapi.IsNotModified to check whether the returned error was
  21992. // because http.StatusNotModified was returned.
  21993. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21994. gensupport.SetOptions(c.urlParams_, opts...)
  21995. res, err := c.doRequest("json")
  21996. if res != nil && res.StatusCode == http.StatusNotModified {
  21997. if res.Body != nil {
  21998. res.Body.Close()
  21999. }
  22000. return nil, &googleapi.Error{
  22001. Code: res.StatusCode,
  22002. Header: res.Header,
  22003. }
  22004. }
  22005. if err != nil {
  22006. return nil, err
  22007. }
  22008. defer googleapi.CloseBody(res)
  22009. if err := googleapi.CheckResponse(res); err != nil {
  22010. return nil, err
  22011. }
  22012. ret := &CreativeFieldValue{
  22013. ServerResponse: googleapi.ServerResponse{
  22014. Header: res.Header,
  22015. HTTPStatusCode: res.StatusCode,
  22016. },
  22017. }
  22018. target := &ret
  22019. if err := gensupport.DecodeResponse(target, res); err != nil {
  22020. return nil, err
  22021. }
  22022. return ret, nil
  22023. // {
  22024. // "description": "Inserts a new creative field value.",
  22025. // "httpMethod": "POST",
  22026. // "id": "dfareporting.creativeFieldValues.insert",
  22027. // "parameterOrder": [
  22028. // "profileId",
  22029. // "creativeFieldId"
  22030. // ],
  22031. // "parameters": {
  22032. // "creativeFieldId": {
  22033. // "description": "Creative field ID for this creative field value.",
  22034. // "format": "int64",
  22035. // "location": "path",
  22036. // "required": true,
  22037. // "type": "string"
  22038. // },
  22039. // "profileId": {
  22040. // "description": "User profile ID associated with this request.",
  22041. // "format": "int64",
  22042. // "location": "path",
  22043. // "required": true,
  22044. // "type": "string"
  22045. // }
  22046. // },
  22047. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22048. // "request": {
  22049. // "$ref": "CreativeFieldValue"
  22050. // },
  22051. // "response": {
  22052. // "$ref": "CreativeFieldValue"
  22053. // },
  22054. // "scopes": [
  22055. // "https://www.googleapis.com/auth/dfatrafficking"
  22056. // ]
  22057. // }
  22058. }
  22059. // method id "dfareporting.creativeFieldValues.list":
  22060. type CreativeFieldValuesListCall struct {
  22061. s *Service
  22062. profileId int64
  22063. creativeFieldId int64
  22064. urlParams_ gensupport.URLParams
  22065. ifNoneMatch_ string
  22066. ctx_ context.Context
  22067. header_ http.Header
  22068. }
  22069. // List: Retrieves a list of creative field values, possibly filtered.
  22070. // This method supports paging.
  22071. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  22072. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22073. c.profileId = profileId
  22074. c.creativeFieldId = creativeFieldId
  22075. return c
  22076. }
  22077. // Ids sets the optional parameter "ids": Select only creative field
  22078. // values with these IDs.
  22079. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  22080. var ids_ []string
  22081. for _, v := range ids {
  22082. ids_ = append(ids_, fmt.Sprint(v))
  22083. }
  22084. c.urlParams_.SetMulti("ids", ids_)
  22085. return c
  22086. }
  22087. // MaxResults sets the optional parameter "maxResults": Maximum number
  22088. // of results to return.
  22089. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  22090. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22091. return c
  22092. }
  22093. // PageToken sets the optional parameter "pageToken": Value of the
  22094. // nextPageToken from the previous result page.
  22095. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  22096. c.urlParams_.Set("pageToken", pageToken)
  22097. return c
  22098. }
  22099. // SearchString sets the optional parameter "searchString": Allows
  22100. // searching for creative field values by their values. Wildcards (e.g.
  22101. // *) are not allowed.
  22102. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  22103. c.urlParams_.Set("searchString", searchString)
  22104. return c
  22105. }
  22106. // SortField sets the optional parameter "sortField": Field by which to
  22107. // sort the list.
  22108. //
  22109. // Possible values:
  22110. // "ID" (default)
  22111. // "VALUE"
  22112. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  22113. c.urlParams_.Set("sortField", sortField)
  22114. return c
  22115. }
  22116. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22117. // results.
  22118. //
  22119. // Possible values:
  22120. // "ASCENDING" (default)
  22121. // "DESCENDING"
  22122. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  22123. c.urlParams_.Set("sortOrder", sortOrder)
  22124. return c
  22125. }
  22126. // Fields allows partial responses to be retrieved. See
  22127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22128. // for more information.
  22129. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  22130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22131. return c
  22132. }
  22133. // IfNoneMatch sets the optional parameter which makes the operation
  22134. // fail if the object's ETag matches the given value. This is useful for
  22135. // getting updates only after the object has changed since the last
  22136. // request. Use googleapi.IsNotModified to check whether the response
  22137. // error from Do is the result of In-None-Match.
  22138. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  22139. c.ifNoneMatch_ = entityTag
  22140. return c
  22141. }
  22142. // Context sets the context to be used in this call's Do method. Any
  22143. // pending HTTP request will be aborted if the provided context is
  22144. // canceled.
  22145. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  22146. c.ctx_ = ctx
  22147. return c
  22148. }
  22149. // Header returns an http.Header that can be modified by the caller to
  22150. // add HTTP headers to the request.
  22151. func (c *CreativeFieldValuesListCall) Header() http.Header {
  22152. if c.header_ == nil {
  22153. c.header_ = make(http.Header)
  22154. }
  22155. return c.header_
  22156. }
  22157. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  22158. reqHeaders := make(http.Header)
  22159. for k, v := range c.header_ {
  22160. reqHeaders[k] = v
  22161. }
  22162. reqHeaders.Set("User-Agent", c.s.userAgent())
  22163. if c.ifNoneMatch_ != "" {
  22164. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22165. }
  22166. var body io.Reader = nil
  22167. c.urlParams_.Set("alt", alt)
  22168. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22169. urls += "?" + c.urlParams_.Encode()
  22170. req, _ := http.NewRequest("GET", urls, body)
  22171. req.Header = reqHeaders
  22172. googleapi.Expand(req.URL, map[string]string{
  22173. "profileId": strconv.FormatInt(c.profileId, 10),
  22174. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22175. })
  22176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22177. }
  22178. // Do executes the "dfareporting.creativeFieldValues.list" call.
  22179. // Exactly one of *CreativeFieldValuesListResponse or error will be
  22180. // non-nil. Any non-2xx status code is an error. Response headers are in
  22181. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  22182. // a response was returned at all) in error.(*googleapi.Error).Header.
  22183. // Use googleapi.IsNotModified to check whether the returned error was
  22184. // because http.StatusNotModified was returned.
  22185. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  22186. gensupport.SetOptions(c.urlParams_, opts...)
  22187. res, err := c.doRequest("json")
  22188. if res != nil && res.StatusCode == http.StatusNotModified {
  22189. if res.Body != nil {
  22190. res.Body.Close()
  22191. }
  22192. return nil, &googleapi.Error{
  22193. Code: res.StatusCode,
  22194. Header: res.Header,
  22195. }
  22196. }
  22197. if err != nil {
  22198. return nil, err
  22199. }
  22200. defer googleapi.CloseBody(res)
  22201. if err := googleapi.CheckResponse(res); err != nil {
  22202. return nil, err
  22203. }
  22204. ret := &CreativeFieldValuesListResponse{
  22205. ServerResponse: googleapi.ServerResponse{
  22206. Header: res.Header,
  22207. HTTPStatusCode: res.StatusCode,
  22208. },
  22209. }
  22210. target := &ret
  22211. if err := gensupport.DecodeResponse(target, res); err != nil {
  22212. return nil, err
  22213. }
  22214. return ret, nil
  22215. // {
  22216. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  22217. // "httpMethod": "GET",
  22218. // "id": "dfareporting.creativeFieldValues.list",
  22219. // "parameterOrder": [
  22220. // "profileId",
  22221. // "creativeFieldId"
  22222. // ],
  22223. // "parameters": {
  22224. // "creativeFieldId": {
  22225. // "description": "Creative field ID for this creative field value.",
  22226. // "format": "int64",
  22227. // "location": "path",
  22228. // "required": true,
  22229. // "type": "string"
  22230. // },
  22231. // "ids": {
  22232. // "description": "Select only creative field values with these IDs.",
  22233. // "format": "int64",
  22234. // "location": "query",
  22235. // "repeated": true,
  22236. // "type": "string"
  22237. // },
  22238. // "maxResults": {
  22239. // "default": "1000",
  22240. // "description": "Maximum number of results to return.",
  22241. // "format": "int32",
  22242. // "location": "query",
  22243. // "maximum": "1000",
  22244. // "minimum": "0",
  22245. // "type": "integer"
  22246. // },
  22247. // "pageToken": {
  22248. // "description": "Value of the nextPageToken from the previous result page.",
  22249. // "location": "query",
  22250. // "type": "string"
  22251. // },
  22252. // "profileId": {
  22253. // "description": "User profile ID associated with this request.",
  22254. // "format": "int64",
  22255. // "location": "path",
  22256. // "required": true,
  22257. // "type": "string"
  22258. // },
  22259. // "searchString": {
  22260. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  22261. // "location": "query",
  22262. // "type": "string"
  22263. // },
  22264. // "sortField": {
  22265. // "default": "ID",
  22266. // "description": "Field by which to sort the list.",
  22267. // "enum": [
  22268. // "ID",
  22269. // "VALUE"
  22270. // ],
  22271. // "enumDescriptions": [
  22272. // "",
  22273. // ""
  22274. // ],
  22275. // "location": "query",
  22276. // "type": "string"
  22277. // },
  22278. // "sortOrder": {
  22279. // "default": "ASCENDING",
  22280. // "description": "Order of sorted results.",
  22281. // "enum": [
  22282. // "ASCENDING",
  22283. // "DESCENDING"
  22284. // ],
  22285. // "enumDescriptions": [
  22286. // "",
  22287. // ""
  22288. // ],
  22289. // "location": "query",
  22290. // "type": "string"
  22291. // }
  22292. // },
  22293. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22294. // "response": {
  22295. // "$ref": "CreativeFieldValuesListResponse"
  22296. // },
  22297. // "scopes": [
  22298. // "https://www.googleapis.com/auth/dfatrafficking"
  22299. // ]
  22300. // }
  22301. }
  22302. // Pages invokes f for each page of results.
  22303. // A non-nil error returned from f will halt the iteration.
  22304. // The provided context supersedes any context provided to the Context method.
  22305. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  22306. c.ctx_ = ctx
  22307. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22308. for {
  22309. x, err := c.Do()
  22310. if err != nil {
  22311. return err
  22312. }
  22313. if err := f(x); err != nil {
  22314. return err
  22315. }
  22316. if x.NextPageToken == "" {
  22317. return nil
  22318. }
  22319. c.PageToken(x.NextPageToken)
  22320. }
  22321. }
  22322. // method id "dfareporting.creativeFieldValues.patch":
  22323. type CreativeFieldValuesPatchCall struct {
  22324. s *Service
  22325. profileId int64
  22326. creativeFieldId int64
  22327. creativefieldvalue *CreativeFieldValue
  22328. urlParams_ gensupport.URLParams
  22329. ctx_ context.Context
  22330. header_ http.Header
  22331. }
  22332. // Patch: Updates an existing creative field value. This method supports
  22333. // patch semantics.
  22334. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  22335. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22336. c.profileId = profileId
  22337. c.creativeFieldId = creativeFieldId
  22338. c.urlParams_.Set("id", fmt.Sprint(id))
  22339. c.creativefieldvalue = creativefieldvalue
  22340. return c
  22341. }
  22342. // Fields allows partial responses to be retrieved. See
  22343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22344. // for more information.
  22345. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  22346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22347. return c
  22348. }
  22349. // Context sets the context to be used in this call's Do method. Any
  22350. // pending HTTP request will be aborted if the provided context is
  22351. // canceled.
  22352. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  22353. c.ctx_ = ctx
  22354. return c
  22355. }
  22356. // Header returns an http.Header that can be modified by the caller to
  22357. // add HTTP headers to the request.
  22358. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  22359. if c.header_ == nil {
  22360. c.header_ = make(http.Header)
  22361. }
  22362. return c.header_
  22363. }
  22364. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  22365. reqHeaders := make(http.Header)
  22366. for k, v := range c.header_ {
  22367. reqHeaders[k] = v
  22368. }
  22369. reqHeaders.Set("User-Agent", c.s.userAgent())
  22370. var body io.Reader = nil
  22371. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22372. if err != nil {
  22373. return nil, err
  22374. }
  22375. reqHeaders.Set("Content-Type", "application/json")
  22376. c.urlParams_.Set("alt", alt)
  22377. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22378. urls += "?" + c.urlParams_.Encode()
  22379. req, _ := http.NewRequest("PATCH", urls, body)
  22380. req.Header = reqHeaders
  22381. googleapi.Expand(req.URL, map[string]string{
  22382. "profileId": strconv.FormatInt(c.profileId, 10),
  22383. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22384. })
  22385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22386. }
  22387. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  22388. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22389. // non-2xx status code is an error. Response headers are in either
  22390. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22391. // returned at all) in error.(*googleapi.Error).Header. Use
  22392. // googleapi.IsNotModified to check whether the returned error was
  22393. // because http.StatusNotModified was returned.
  22394. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22395. gensupport.SetOptions(c.urlParams_, opts...)
  22396. res, err := c.doRequest("json")
  22397. if res != nil && res.StatusCode == http.StatusNotModified {
  22398. if res.Body != nil {
  22399. res.Body.Close()
  22400. }
  22401. return nil, &googleapi.Error{
  22402. Code: res.StatusCode,
  22403. Header: res.Header,
  22404. }
  22405. }
  22406. if err != nil {
  22407. return nil, err
  22408. }
  22409. defer googleapi.CloseBody(res)
  22410. if err := googleapi.CheckResponse(res); err != nil {
  22411. return nil, err
  22412. }
  22413. ret := &CreativeFieldValue{
  22414. ServerResponse: googleapi.ServerResponse{
  22415. Header: res.Header,
  22416. HTTPStatusCode: res.StatusCode,
  22417. },
  22418. }
  22419. target := &ret
  22420. if err := gensupport.DecodeResponse(target, res); err != nil {
  22421. return nil, err
  22422. }
  22423. return ret, nil
  22424. // {
  22425. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  22426. // "httpMethod": "PATCH",
  22427. // "id": "dfareporting.creativeFieldValues.patch",
  22428. // "parameterOrder": [
  22429. // "profileId",
  22430. // "creativeFieldId",
  22431. // "id"
  22432. // ],
  22433. // "parameters": {
  22434. // "creativeFieldId": {
  22435. // "description": "Creative field ID for this creative field value.",
  22436. // "format": "int64",
  22437. // "location": "path",
  22438. // "required": true,
  22439. // "type": "string"
  22440. // },
  22441. // "id": {
  22442. // "description": "Creative Field Value ID",
  22443. // "format": "int64",
  22444. // "location": "query",
  22445. // "required": true,
  22446. // "type": "string"
  22447. // },
  22448. // "profileId": {
  22449. // "description": "User profile ID associated with this request.",
  22450. // "format": "int64",
  22451. // "location": "path",
  22452. // "required": true,
  22453. // "type": "string"
  22454. // }
  22455. // },
  22456. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22457. // "request": {
  22458. // "$ref": "CreativeFieldValue"
  22459. // },
  22460. // "response": {
  22461. // "$ref": "CreativeFieldValue"
  22462. // },
  22463. // "scopes": [
  22464. // "https://www.googleapis.com/auth/dfatrafficking"
  22465. // ]
  22466. // }
  22467. }
  22468. // method id "dfareporting.creativeFieldValues.update":
  22469. type CreativeFieldValuesUpdateCall struct {
  22470. s *Service
  22471. profileId int64
  22472. creativeFieldId int64
  22473. creativefieldvalue *CreativeFieldValue
  22474. urlParams_ gensupport.URLParams
  22475. ctx_ context.Context
  22476. header_ http.Header
  22477. }
  22478. // Update: Updates an existing creative field value.
  22479. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  22480. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22481. c.profileId = profileId
  22482. c.creativeFieldId = creativeFieldId
  22483. c.creativefieldvalue = creativefieldvalue
  22484. return c
  22485. }
  22486. // Fields allows partial responses to be retrieved. See
  22487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22488. // for more information.
  22489. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  22490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22491. return c
  22492. }
  22493. // Context sets the context to be used in this call's Do method. Any
  22494. // pending HTTP request will be aborted if the provided context is
  22495. // canceled.
  22496. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  22497. c.ctx_ = ctx
  22498. return c
  22499. }
  22500. // Header returns an http.Header that can be modified by the caller to
  22501. // add HTTP headers to the request.
  22502. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  22503. if c.header_ == nil {
  22504. c.header_ = make(http.Header)
  22505. }
  22506. return c.header_
  22507. }
  22508. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  22509. reqHeaders := make(http.Header)
  22510. for k, v := range c.header_ {
  22511. reqHeaders[k] = v
  22512. }
  22513. reqHeaders.Set("User-Agent", c.s.userAgent())
  22514. var body io.Reader = nil
  22515. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22516. if err != nil {
  22517. return nil, err
  22518. }
  22519. reqHeaders.Set("Content-Type", "application/json")
  22520. c.urlParams_.Set("alt", alt)
  22521. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22522. urls += "?" + c.urlParams_.Encode()
  22523. req, _ := http.NewRequest("PUT", urls, body)
  22524. req.Header = reqHeaders
  22525. googleapi.Expand(req.URL, map[string]string{
  22526. "profileId": strconv.FormatInt(c.profileId, 10),
  22527. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22528. })
  22529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22530. }
  22531. // Do executes the "dfareporting.creativeFieldValues.update" call.
  22532. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22533. // non-2xx status code is an error. Response headers are in either
  22534. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22535. // returned at all) in error.(*googleapi.Error).Header. Use
  22536. // googleapi.IsNotModified to check whether the returned error was
  22537. // because http.StatusNotModified was returned.
  22538. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22539. gensupport.SetOptions(c.urlParams_, opts...)
  22540. res, err := c.doRequest("json")
  22541. if res != nil && res.StatusCode == http.StatusNotModified {
  22542. if res.Body != nil {
  22543. res.Body.Close()
  22544. }
  22545. return nil, &googleapi.Error{
  22546. Code: res.StatusCode,
  22547. Header: res.Header,
  22548. }
  22549. }
  22550. if err != nil {
  22551. return nil, err
  22552. }
  22553. defer googleapi.CloseBody(res)
  22554. if err := googleapi.CheckResponse(res); err != nil {
  22555. return nil, err
  22556. }
  22557. ret := &CreativeFieldValue{
  22558. ServerResponse: googleapi.ServerResponse{
  22559. Header: res.Header,
  22560. HTTPStatusCode: res.StatusCode,
  22561. },
  22562. }
  22563. target := &ret
  22564. if err := gensupport.DecodeResponse(target, res); err != nil {
  22565. return nil, err
  22566. }
  22567. return ret, nil
  22568. // {
  22569. // "description": "Updates an existing creative field value.",
  22570. // "httpMethod": "PUT",
  22571. // "id": "dfareporting.creativeFieldValues.update",
  22572. // "parameterOrder": [
  22573. // "profileId",
  22574. // "creativeFieldId"
  22575. // ],
  22576. // "parameters": {
  22577. // "creativeFieldId": {
  22578. // "description": "Creative field ID for this creative field value.",
  22579. // "format": "int64",
  22580. // "location": "path",
  22581. // "required": true,
  22582. // "type": "string"
  22583. // },
  22584. // "profileId": {
  22585. // "description": "User profile ID associated with this request.",
  22586. // "format": "int64",
  22587. // "location": "path",
  22588. // "required": true,
  22589. // "type": "string"
  22590. // }
  22591. // },
  22592. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22593. // "request": {
  22594. // "$ref": "CreativeFieldValue"
  22595. // },
  22596. // "response": {
  22597. // "$ref": "CreativeFieldValue"
  22598. // },
  22599. // "scopes": [
  22600. // "https://www.googleapis.com/auth/dfatrafficking"
  22601. // ]
  22602. // }
  22603. }
  22604. // method id "dfareporting.creativeFields.delete":
  22605. type CreativeFieldsDeleteCall struct {
  22606. s *Service
  22607. profileId int64
  22608. id int64
  22609. urlParams_ gensupport.URLParams
  22610. ctx_ context.Context
  22611. header_ http.Header
  22612. }
  22613. // Delete: Deletes an existing creative field.
  22614. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  22615. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22616. c.profileId = profileId
  22617. c.id = id
  22618. return c
  22619. }
  22620. // Fields allows partial responses to be retrieved. See
  22621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22622. // for more information.
  22623. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  22624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22625. return c
  22626. }
  22627. // Context sets the context to be used in this call's Do method. Any
  22628. // pending HTTP request will be aborted if the provided context is
  22629. // canceled.
  22630. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  22631. c.ctx_ = ctx
  22632. return c
  22633. }
  22634. // Header returns an http.Header that can be modified by the caller to
  22635. // add HTTP headers to the request.
  22636. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  22637. if c.header_ == nil {
  22638. c.header_ = make(http.Header)
  22639. }
  22640. return c.header_
  22641. }
  22642. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  22643. reqHeaders := make(http.Header)
  22644. for k, v := range c.header_ {
  22645. reqHeaders[k] = v
  22646. }
  22647. reqHeaders.Set("User-Agent", c.s.userAgent())
  22648. var body io.Reader = nil
  22649. c.urlParams_.Set("alt", alt)
  22650. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22651. urls += "?" + c.urlParams_.Encode()
  22652. req, _ := http.NewRequest("DELETE", urls, body)
  22653. req.Header = reqHeaders
  22654. googleapi.Expand(req.URL, map[string]string{
  22655. "profileId": strconv.FormatInt(c.profileId, 10),
  22656. "id": strconv.FormatInt(c.id, 10),
  22657. })
  22658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22659. }
  22660. // Do executes the "dfareporting.creativeFields.delete" call.
  22661. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  22662. gensupport.SetOptions(c.urlParams_, opts...)
  22663. res, err := c.doRequest("json")
  22664. if err != nil {
  22665. return err
  22666. }
  22667. defer googleapi.CloseBody(res)
  22668. if err := googleapi.CheckResponse(res); err != nil {
  22669. return err
  22670. }
  22671. return nil
  22672. // {
  22673. // "description": "Deletes an existing creative field.",
  22674. // "httpMethod": "DELETE",
  22675. // "id": "dfareporting.creativeFields.delete",
  22676. // "parameterOrder": [
  22677. // "profileId",
  22678. // "id"
  22679. // ],
  22680. // "parameters": {
  22681. // "id": {
  22682. // "description": "Creative Field ID",
  22683. // "format": "int64",
  22684. // "location": "path",
  22685. // "required": true,
  22686. // "type": "string"
  22687. // },
  22688. // "profileId": {
  22689. // "description": "User profile ID associated with this request.",
  22690. // "format": "int64",
  22691. // "location": "path",
  22692. // "required": true,
  22693. // "type": "string"
  22694. // }
  22695. // },
  22696. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  22697. // "scopes": [
  22698. // "https://www.googleapis.com/auth/dfatrafficking"
  22699. // ]
  22700. // }
  22701. }
  22702. // method id "dfareporting.creativeFields.get":
  22703. type CreativeFieldsGetCall struct {
  22704. s *Service
  22705. profileId int64
  22706. id int64
  22707. urlParams_ gensupport.URLParams
  22708. ifNoneMatch_ string
  22709. ctx_ context.Context
  22710. header_ http.Header
  22711. }
  22712. // Get: Gets one creative field by ID.
  22713. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  22714. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22715. c.profileId = profileId
  22716. c.id = id
  22717. return c
  22718. }
  22719. // Fields allows partial responses to be retrieved. See
  22720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22721. // for more information.
  22722. func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  22723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22724. return c
  22725. }
  22726. // IfNoneMatch sets the optional parameter which makes the operation
  22727. // fail if the object's ETag matches the given value. This is useful for
  22728. // getting updates only after the object has changed since the last
  22729. // request. Use googleapi.IsNotModified to check whether the response
  22730. // error from Do is the result of In-None-Match.
  22731. func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  22732. c.ifNoneMatch_ = entityTag
  22733. return c
  22734. }
  22735. // Context sets the context to be used in this call's Do method. Any
  22736. // pending HTTP request will be aborted if the provided context is
  22737. // canceled.
  22738. func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  22739. c.ctx_ = ctx
  22740. return c
  22741. }
  22742. // Header returns an http.Header that can be modified by the caller to
  22743. // add HTTP headers to the request.
  22744. func (c *CreativeFieldsGetCall) Header() http.Header {
  22745. if c.header_ == nil {
  22746. c.header_ = make(http.Header)
  22747. }
  22748. return c.header_
  22749. }
  22750. func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  22751. reqHeaders := make(http.Header)
  22752. for k, v := range c.header_ {
  22753. reqHeaders[k] = v
  22754. }
  22755. reqHeaders.Set("User-Agent", c.s.userAgent())
  22756. if c.ifNoneMatch_ != "" {
  22757. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22758. }
  22759. var body io.Reader = nil
  22760. c.urlParams_.Set("alt", alt)
  22761. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22762. urls += "?" + c.urlParams_.Encode()
  22763. req, _ := http.NewRequest("GET", urls, body)
  22764. req.Header = reqHeaders
  22765. googleapi.Expand(req.URL, map[string]string{
  22766. "profileId": strconv.FormatInt(c.profileId, 10),
  22767. "id": strconv.FormatInt(c.id, 10),
  22768. })
  22769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22770. }
  22771. // Do executes the "dfareporting.creativeFields.get" call.
  22772. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22773. // status code is an error. Response headers are in either
  22774. // *CreativeField.ServerResponse.Header or (if a response was returned
  22775. // at all) in error.(*googleapi.Error).Header. Use
  22776. // googleapi.IsNotModified to check whether the returned error was
  22777. // because http.StatusNotModified was returned.
  22778. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22779. gensupport.SetOptions(c.urlParams_, opts...)
  22780. res, err := c.doRequest("json")
  22781. if res != nil && res.StatusCode == http.StatusNotModified {
  22782. if res.Body != nil {
  22783. res.Body.Close()
  22784. }
  22785. return nil, &googleapi.Error{
  22786. Code: res.StatusCode,
  22787. Header: res.Header,
  22788. }
  22789. }
  22790. if err != nil {
  22791. return nil, err
  22792. }
  22793. defer googleapi.CloseBody(res)
  22794. if err := googleapi.CheckResponse(res); err != nil {
  22795. return nil, err
  22796. }
  22797. ret := &CreativeField{
  22798. ServerResponse: googleapi.ServerResponse{
  22799. Header: res.Header,
  22800. HTTPStatusCode: res.StatusCode,
  22801. },
  22802. }
  22803. target := &ret
  22804. if err := gensupport.DecodeResponse(target, res); err != nil {
  22805. return nil, err
  22806. }
  22807. return ret, nil
  22808. // {
  22809. // "description": "Gets one creative field by ID.",
  22810. // "httpMethod": "GET",
  22811. // "id": "dfareporting.creativeFields.get",
  22812. // "parameterOrder": [
  22813. // "profileId",
  22814. // "id"
  22815. // ],
  22816. // "parameters": {
  22817. // "id": {
  22818. // "description": "Creative Field ID",
  22819. // "format": "int64",
  22820. // "location": "path",
  22821. // "required": true,
  22822. // "type": "string"
  22823. // },
  22824. // "profileId": {
  22825. // "description": "User profile ID associated with this request.",
  22826. // "format": "int64",
  22827. // "location": "path",
  22828. // "required": true,
  22829. // "type": "string"
  22830. // }
  22831. // },
  22832. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  22833. // "response": {
  22834. // "$ref": "CreativeField"
  22835. // },
  22836. // "scopes": [
  22837. // "https://www.googleapis.com/auth/dfatrafficking"
  22838. // ]
  22839. // }
  22840. }
  22841. // method id "dfareporting.creativeFields.insert":
  22842. type CreativeFieldsInsertCall struct {
  22843. s *Service
  22844. profileId int64
  22845. creativefield *CreativeField
  22846. urlParams_ gensupport.URLParams
  22847. ctx_ context.Context
  22848. header_ http.Header
  22849. }
  22850. // Insert: Inserts a new creative field.
  22851. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  22852. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22853. c.profileId = profileId
  22854. c.creativefield = creativefield
  22855. return c
  22856. }
  22857. // Fields allows partial responses to be retrieved. See
  22858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22859. // for more information.
  22860. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  22861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22862. return c
  22863. }
  22864. // Context sets the context to be used in this call's Do method. Any
  22865. // pending HTTP request will be aborted if the provided context is
  22866. // canceled.
  22867. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  22868. c.ctx_ = ctx
  22869. return c
  22870. }
  22871. // Header returns an http.Header that can be modified by the caller to
  22872. // add HTTP headers to the request.
  22873. func (c *CreativeFieldsInsertCall) Header() http.Header {
  22874. if c.header_ == nil {
  22875. c.header_ = make(http.Header)
  22876. }
  22877. return c.header_
  22878. }
  22879. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  22880. reqHeaders := make(http.Header)
  22881. for k, v := range c.header_ {
  22882. reqHeaders[k] = v
  22883. }
  22884. reqHeaders.Set("User-Agent", c.s.userAgent())
  22885. var body io.Reader = nil
  22886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  22887. if err != nil {
  22888. return nil, err
  22889. }
  22890. reqHeaders.Set("Content-Type", "application/json")
  22891. c.urlParams_.Set("alt", alt)
  22892. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  22893. urls += "?" + c.urlParams_.Encode()
  22894. req, _ := http.NewRequest("POST", urls, body)
  22895. req.Header = reqHeaders
  22896. googleapi.Expand(req.URL, map[string]string{
  22897. "profileId": strconv.FormatInt(c.profileId, 10),
  22898. })
  22899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22900. }
  22901. // Do executes the "dfareporting.creativeFields.insert" call.
  22902. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22903. // status code is an error. Response headers are in either
  22904. // *CreativeField.ServerResponse.Header or (if a response was returned
  22905. // at all) in error.(*googleapi.Error).Header. Use
  22906. // googleapi.IsNotModified to check whether the returned error was
  22907. // because http.StatusNotModified was returned.
  22908. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22909. gensupport.SetOptions(c.urlParams_, opts...)
  22910. res, err := c.doRequest("json")
  22911. if res != nil && res.StatusCode == http.StatusNotModified {
  22912. if res.Body != nil {
  22913. res.Body.Close()
  22914. }
  22915. return nil, &googleapi.Error{
  22916. Code: res.StatusCode,
  22917. Header: res.Header,
  22918. }
  22919. }
  22920. if err != nil {
  22921. return nil, err
  22922. }
  22923. defer googleapi.CloseBody(res)
  22924. if err := googleapi.CheckResponse(res); err != nil {
  22925. return nil, err
  22926. }
  22927. ret := &CreativeField{
  22928. ServerResponse: googleapi.ServerResponse{
  22929. Header: res.Header,
  22930. HTTPStatusCode: res.StatusCode,
  22931. },
  22932. }
  22933. target := &ret
  22934. if err := gensupport.DecodeResponse(target, res); err != nil {
  22935. return nil, err
  22936. }
  22937. return ret, nil
  22938. // {
  22939. // "description": "Inserts a new creative field.",
  22940. // "httpMethod": "POST",
  22941. // "id": "dfareporting.creativeFields.insert",
  22942. // "parameterOrder": [
  22943. // "profileId"
  22944. // ],
  22945. // "parameters": {
  22946. // "profileId": {
  22947. // "description": "User profile ID associated with this request.",
  22948. // "format": "int64",
  22949. // "location": "path",
  22950. // "required": true,
  22951. // "type": "string"
  22952. // }
  22953. // },
  22954. // "path": "userprofiles/{profileId}/creativeFields",
  22955. // "request": {
  22956. // "$ref": "CreativeField"
  22957. // },
  22958. // "response": {
  22959. // "$ref": "CreativeField"
  22960. // },
  22961. // "scopes": [
  22962. // "https://www.googleapis.com/auth/dfatrafficking"
  22963. // ]
  22964. // }
  22965. }
  22966. // method id "dfareporting.creativeFields.list":
  22967. type CreativeFieldsListCall struct {
  22968. s *Service
  22969. profileId int64
  22970. urlParams_ gensupport.URLParams
  22971. ifNoneMatch_ string
  22972. ctx_ context.Context
  22973. header_ http.Header
  22974. }
  22975. // List: Retrieves a list of creative fields, possibly filtered. This
  22976. // method supports paging.
  22977. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  22978. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22979. c.profileId = profileId
  22980. return c
  22981. }
  22982. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  22983. // only creative fields that belong to these advertisers.
  22984. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  22985. var advertiserIds_ []string
  22986. for _, v := range advertiserIds {
  22987. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  22988. }
  22989. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  22990. return c
  22991. }
  22992. // Ids sets the optional parameter "ids": Select only creative fields
  22993. // with these IDs.
  22994. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  22995. var ids_ []string
  22996. for _, v := range ids {
  22997. ids_ = append(ids_, fmt.Sprint(v))
  22998. }
  22999. c.urlParams_.SetMulti("ids", ids_)
  23000. return c
  23001. }
  23002. // MaxResults sets the optional parameter "maxResults": Maximum number
  23003. // of results to return.
  23004. func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  23005. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23006. return c
  23007. }
  23008. // PageToken sets the optional parameter "pageToken": Value of the
  23009. // nextPageToken from the previous result page.
  23010. func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  23011. c.urlParams_.Set("pageToken", pageToken)
  23012. return c
  23013. }
  23014. // SearchString sets the optional parameter "searchString": Allows
  23015. // searching for creative fields by name or ID. Wildcards (*) are
  23016. // allowed. For example, "creativefield*2015" will return creative
  23017. // fields with names like "creativefield June 2015", "creativefield
  23018. // April 2015", or simply "creativefield 2015". Most of the searches
  23019. // also add wild-cards implicitly at the start and the end of the search
  23020. // string. For example, a search string of "creativefield" will match
  23021. // creative fields with the name "my creativefield", "creativefield
  23022. // 2015", or simply "creativefield".
  23023. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  23024. c.urlParams_.Set("searchString", searchString)
  23025. return c
  23026. }
  23027. // SortField sets the optional parameter "sortField": Field by which to
  23028. // sort the list.
  23029. //
  23030. // Possible values:
  23031. // "ID" (default)
  23032. // "NAME"
  23033. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  23034. c.urlParams_.Set("sortField", sortField)
  23035. return c
  23036. }
  23037. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23038. // results.
  23039. //
  23040. // Possible values:
  23041. // "ASCENDING" (default)
  23042. // "DESCENDING"
  23043. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  23044. c.urlParams_.Set("sortOrder", sortOrder)
  23045. return c
  23046. }
  23047. // Fields allows partial responses to be retrieved. See
  23048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23049. // for more information.
  23050. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  23051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23052. return c
  23053. }
  23054. // IfNoneMatch sets the optional parameter which makes the operation
  23055. // fail if the object's ETag matches the given value. This is useful for
  23056. // getting updates only after the object has changed since the last
  23057. // request. Use googleapi.IsNotModified to check whether the response
  23058. // error from Do is the result of In-None-Match.
  23059. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  23060. c.ifNoneMatch_ = entityTag
  23061. return c
  23062. }
  23063. // Context sets the context to be used in this call's Do method. Any
  23064. // pending HTTP request will be aborted if the provided context is
  23065. // canceled.
  23066. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  23067. c.ctx_ = ctx
  23068. return c
  23069. }
  23070. // Header returns an http.Header that can be modified by the caller to
  23071. // add HTTP headers to the request.
  23072. func (c *CreativeFieldsListCall) Header() http.Header {
  23073. if c.header_ == nil {
  23074. c.header_ = make(http.Header)
  23075. }
  23076. return c.header_
  23077. }
  23078. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  23079. reqHeaders := make(http.Header)
  23080. for k, v := range c.header_ {
  23081. reqHeaders[k] = v
  23082. }
  23083. reqHeaders.Set("User-Agent", c.s.userAgent())
  23084. if c.ifNoneMatch_ != "" {
  23085. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23086. }
  23087. var body io.Reader = nil
  23088. c.urlParams_.Set("alt", alt)
  23089. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23090. urls += "?" + c.urlParams_.Encode()
  23091. req, _ := http.NewRequest("GET", urls, body)
  23092. req.Header = reqHeaders
  23093. googleapi.Expand(req.URL, map[string]string{
  23094. "profileId": strconv.FormatInt(c.profileId, 10),
  23095. })
  23096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23097. }
  23098. // Do executes the "dfareporting.creativeFields.list" call.
  23099. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  23100. // Any non-2xx status code is an error. Response headers are in either
  23101. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  23102. // was returned at all) in error.(*googleapi.Error).Header. Use
  23103. // googleapi.IsNotModified to check whether the returned error was
  23104. // because http.StatusNotModified was returned.
  23105. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  23106. gensupport.SetOptions(c.urlParams_, opts...)
  23107. res, err := c.doRequest("json")
  23108. if res != nil && res.StatusCode == http.StatusNotModified {
  23109. if res.Body != nil {
  23110. res.Body.Close()
  23111. }
  23112. return nil, &googleapi.Error{
  23113. Code: res.StatusCode,
  23114. Header: res.Header,
  23115. }
  23116. }
  23117. if err != nil {
  23118. return nil, err
  23119. }
  23120. defer googleapi.CloseBody(res)
  23121. if err := googleapi.CheckResponse(res); err != nil {
  23122. return nil, err
  23123. }
  23124. ret := &CreativeFieldsListResponse{
  23125. ServerResponse: googleapi.ServerResponse{
  23126. Header: res.Header,
  23127. HTTPStatusCode: res.StatusCode,
  23128. },
  23129. }
  23130. target := &ret
  23131. if err := gensupport.DecodeResponse(target, res); err != nil {
  23132. return nil, err
  23133. }
  23134. return ret, nil
  23135. // {
  23136. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  23137. // "httpMethod": "GET",
  23138. // "id": "dfareporting.creativeFields.list",
  23139. // "parameterOrder": [
  23140. // "profileId"
  23141. // ],
  23142. // "parameters": {
  23143. // "advertiserIds": {
  23144. // "description": "Select only creative fields that belong to these advertisers.",
  23145. // "format": "int64",
  23146. // "location": "query",
  23147. // "repeated": true,
  23148. // "type": "string"
  23149. // },
  23150. // "ids": {
  23151. // "description": "Select only creative fields with these IDs.",
  23152. // "format": "int64",
  23153. // "location": "query",
  23154. // "repeated": true,
  23155. // "type": "string"
  23156. // },
  23157. // "maxResults": {
  23158. // "default": "1000",
  23159. // "description": "Maximum number of results to return.",
  23160. // "format": "int32",
  23161. // "location": "query",
  23162. // "maximum": "1000",
  23163. // "minimum": "0",
  23164. // "type": "integer"
  23165. // },
  23166. // "pageToken": {
  23167. // "description": "Value of the nextPageToken from the previous result page.",
  23168. // "location": "query",
  23169. // "type": "string"
  23170. // },
  23171. // "profileId": {
  23172. // "description": "User profile ID associated with this request.",
  23173. // "format": "int64",
  23174. // "location": "path",
  23175. // "required": true,
  23176. // "type": "string"
  23177. // },
  23178. // "searchString": {
  23179. // "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\".",
  23180. // "location": "query",
  23181. // "type": "string"
  23182. // },
  23183. // "sortField": {
  23184. // "default": "ID",
  23185. // "description": "Field by which to sort the list.",
  23186. // "enum": [
  23187. // "ID",
  23188. // "NAME"
  23189. // ],
  23190. // "enumDescriptions": [
  23191. // "",
  23192. // ""
  23193. // ],
  23194. // "location": "query",
  23195. // "type": "string"
  23196. // },
  23197. // "sortOrder": {
  23198. // "default": "ASCENDING",
  23199. // "description": "Order of sorted results.",
  23200. // "enum": [
  23201. // "ASCENDING",
  23202. // "DESCENDING"
  23203. // ],
  23204. // "enumDescriptions": [
  23205. // "",
  23206. // ""
  23207. // ],
  23208. // "location": "query",
  23209. // "type": "string"
  23210. // }
  23211. // },
  23212. // "path": "userprofiles/{profileId}/creativeFields",
  23213. // "response": {
  23214. // "$ref": "CreativeFieldsListResponse"
  23215. // },
  23216. // "scopes": [
  23217. // "https://www.googleapis.com/auth/dfatrafficking"
  23218. // ]
  23219. // }
  23220. }
  23221. // Pages invokes f for each page of results.
  23222. // A non-nil error returned from f will halt the iteration.
  23223. // The provided context supersedes any context provided to the Context method.
  23224. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  23225. c.ctx_ = ctx
  23226. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23227. for {
  23228. x, err := c.Do()
  23229. if err != nil {
  23230. return err
  23231. }
  23232. if err := f(x); err != nil {
  23233. return err
  23234. }
  23235. if x.NextPageToken == "" {
  23236. return nil
  23237. }
  23238. c.PageToken(x.NextPageToken)
  23239. }
  23240. }
  23241. // method id "dfareporting.creativeFields.patch":
  23242. type CreativeFieldsPatchCall struct {
  23243. s *Service
  23244. profileId int64
  23245. creativefield *CreativeField
  23246. urlParams_ gensupport.URLParams
  23247. ctx_ context.Context
  23248. header_ http.Header
  23249. }
  23250. // Patch: Updates an existing creative field. This method supports patch
  23251. // semantics.
  23252. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  23253. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23254. c.profileId = profileId
  23255. c.urlParams_.Set("id", fmt.Sprint(id))
  23256. c.creativefield = creativefield
  23257. return c
  23258. }
  23259. // Fields allows partial responses to be retrieved. See
  23260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23261. // for more information.
  23262. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  23263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23264. return c
  23265. }
  23266. // Context sets the context to be used in this call's Do method. Any
  23267. // pending HTTP request will be aborted if the provided context is
  23268. // canceled.
  23269. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  23270. c.ctx_ = ctx
  23271. return c
  23272. }
  23273. // Header returns an http.Header that can be modified by the caller to
  23274. // add HTTP headers to the request.
  23275. func (c *CreativeFieldsPatchCall) Header() http.Header {
  23276. if c.header_ == nil {
  23277. c.header_ = make(http.Header)
  23278. }
  23279. return c.header_
  23280. }
  23281. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  23282. reqHeaders := make(http.Header)
  23283. for k, v := range c.header_ {
  23284. reqHeaders[k] = v
  23285. }
  23286. reqHeaders.Set("User-Agent", c.s.userAgent())
  23287. var body io.Reader = nil
  23288. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23289. if err != nil {
  23290. return nil, err
  23291. }
  23292. reqHeaders.Set("Content-Type", "application/json")
  23293. c.urlParams_.Set("alt", alt)
  23294. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23295. urls += "?" + c.urlParams_.Encode()
  23296. req, _ := http.NewRequest("PATCH", urls, body)
  23297. req.Header = reqHeaders
  23298. googleapi.Expand(req.URL, map[string]string{
  23299. "profileId": strconv.FormatInt(c.profileId, 10),
  23300. })
  23301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23302. }
  23303. // Do executes the "dfareporting.creativeFields.patch" call.
  23304. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23305. // status code is an error. Response headers are in either
  23306. // *CreativeField.ServerResponse.Header or (if a response was returned
  23307. // at all) in error.(*googleapi.Error).Header. Use
  23308. // googleapi.IsNotModified to check whether the returned error was
  23309. // because http.StatusNotModified was returned.
  23310. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23311. gensupport.SetOptions(c.urlParams_, opts...)
  23312. res, err := c.doRequest("json")
  23313. if res != nil && res.StatusCode == http.StatusNotModified {
  23314. if res.Body != nil {
  23315. res.Body.Close()
  23316. }
  23317. return nil, &googleapi.Error{
  23318. Code: res.StatusCode,
  23319. Header: res.Header,
  23320. }
  23321. }
  23322. if err != nil {
  23323. return nil, err
  23324. }
  23325. defer googleapi.CloseBody(res)
  23326. if err := googleapi.CheckResponse(res); err != nil {
  23327. return nil, err
  23328. }
  23329. ret := &CreativeField{
  23330. ServerResponse: googleapi.ServerResponse{
  23331. Header: res.Header,
  23332. HTTPStatusCode: res.StatusCode,
  23333. },
  23334. }
  23335. target := &ret
  23336. if err := gensupport.DecodeResponse(target, res); err != nil {
  23337. return nil, err
  23338. }
  23339. return ret, nil
  23340. // {
  23341. // "description": "Updates an existing creative field. This method supports patch semantics.",
  23342. // "httpMethod": "PATCH",
  23343. // "id": "dfareporting.creativeFields.patch",
  23344. // "parameterOrder": [
  23345. // "profileId",
  23346. // "id"
  23347. // ],
  23348. // "parameters": {
  23349. // "id": {
  23350. // "description": "Creative Field ID",
  23351. // "format": "int64",
  23352. // "location": "query",
  23353. // "required": true,
  23354. // "type": "string"
  23355. // },
  23356. // "profileId": {
  23357. // "description": "User profile ID associated with this request.",
  23358. // "format": "int64",
  23359. // "location": "path",
  23360. // "required": true,
  23361. // "type": "string"
  23362. // }
  23363. // },
  23364. // "path": "userprofiles/{profileId}/creativeFields",
  23365. // "request": {
  23366. // "$ref": "CreativeField"
  23367. // },
  23368. // "response": {
  23369. // "$ref": "CreativeField"
  23370. // },
  23371. // "scopes": [
  23372. // "https://www.googleapis.com/auth/dfatrafficking"
  23373. // ]
  23374. // }
  23375. }
  23376. // method id "dfareporting.creativeFields.update":
  23377. type CreativeFieldsUpdateCall struct {
  23378. s *Service
  23379. profileId int64
  23380. creativefield *CreativeField
  23381. urlParams_ gensupport.URLParams
  23382. ctx_ context.Context
  23383. header_ http.Header
  23384. }
  23385. // Update: Updates an existing creative field.
  23386. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  23387. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23388. c.profileId = profileId
  23389. c.creativefield = creativefield
  23390. return c
  23391. }
  23392. // Fields allows partial responses to be retrieved. See
  23393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23394. // for more information.
  23395. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  23396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23397. return c
  23398. }
  23399. // Context sets the context to be used in this call's Do method. Any
  23400. // pending HTTP request will be aborted if the provided context is
  23401. // canceled.
  23402. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  23403. c.ctx_ = ctx
  23404. return c
  23405. }
  23406. // Header returns an http.Header that can be modified by the caller to
  23407. // add HTTP headers to the request.
  23408. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  23409. if c.header_ == nil {
  23410. c.header_ = make(http.Header)
  23411. }
  23412. return c.header_
  23413. }
  23414. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  23415. reqHeaders := make(http.Header)
  23416. for k, v := range c.header_ {
  23417. reqHeaders[k] = v
  23418. }
  23419. reqHeaders.Set("User-Agent", c.s.userAgent())
  23420. var body io.Reader = nil
  23421. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23422. if err != nil {
  23423. return nil, err
  23424. }
  23425. reqHeaders.Set("Content-Type", "application/json")
  23426. c.urlParams_.Set("alt", alt)
  23427. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23428. urls += "?" + c.urlParams_.Encode()
  23429. req, _ := http.NewRequest("PUT", urls, body)
  23430. req.Header = reqHeaders
  23431. googleapi.Expand(req.URL, map[string]string{
  23432. "profileId": strconv.FormatInt(c.profileId, 10),
  23433. })
  23434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23435. }
  23436. // Do executes the "dfareporting.creativeFields.update" call.
  23437. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23438. // status code is an error. Response headers are in either
  23439. // *CreativeField.ServerResponse.Header or (if a response was returned
  23440. // at all) in error.(*googleapi.Error).Header. Use
  23441. // googleapi.IsNotModified to check whether the returned error was
  23442. // because http.StatusNotModified was returned.
  23443. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23444. gensupport.SetOptions(c.urlParams_, opts...)
  23445. res, err := c.doRequest("json")
  23446. if res != nil && res.StatusCode == http.StatusNotModified {
  23447. if res.Body != nil {
  23448. res.Body.Close()
  23449. }
  23450. return nil, &googleapi.Error{
  23451. Code: res.StatusCode,
  23452. Header: res.Header,
  23453. }
  23454. }
  23455. if err != nil {
  23456. return nil, err
  23457. }
  23458. defer googleapi.CloseBody(res)
  23459. if err := googleapi.CheckResponse(res); err != nil {
  23460. return nil, err
  23461. }
  23462. ret := &CreativeField{
  23463. ServerResponse: googleapi.ServerResponse{
  23464. Header: res.Header,
  23465. HTTPStatusCode: res.StatusCode,
  23466. },
  23467. }
  23468. target := &ret
  23469. if err := gensupport.DecodeResponse(target, res); err != nil {
  23470. return nil, err
  23471. }
  23472. return ret, nil
  23473. // {
  23474. // "description": "Updates an existing creative field.",
  23475. // "httpMethod": "PUT",
  23476. // "id": "dfareporting.creativeFields.update",
  23477. // "parameterOrder": [
  23478. // "profileId"
  23479. // ],
  23480. // "parameters": {
  23481. // "profileId": {
  23482. // "description": "User profile ID associated with this request.",
  23483. // "format": "int64",
  23484. // "location": "path",
  23485. // "required": true,
  23486. // "type": "string"
  23487. // }
  23488. // },
  23489. // "path": "userprofiles/{profileId}/creativeFields",
  23490. // "request": {
  23491. // "$ref": "CreativeField"
  23492. // },
  23493. // "response": {
  23494. // "$ref": "CreativeField"
  23495. // },
  23496. // "scopes": [
  23497. // "https://www.googleapis.com/auth/dfatrafficking"
  23498. // ]
  23499. // }
  23500. }
  23501. // method id "dfareporting.creativeGroups.get":
  23502. type CreativeGroupsGetCall struct {
  23503. s *Service
  23504. profileId int64
  23505. id int64
  23506. urlParams_ gensupport.URLParams
  23507. ifNoneMatch_ string
  23508. ctx_ context.Context
  23509. header_ http.Header
  23510. }
  23511. // Get: Gets one creative group by ID.
  23512. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  23513. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23514. c.profileId = profileId
  23515. c.id = id
  23516. return c
  23517. }
  23518. // Fields allows partial responses to be retrieved. See
  23519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23520. // for more information.
  23521. func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  23522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23523. return c
  23524. }
  23525. // IfNoneMatch sets the optional parameter which makes the operation
  23526. // fail if the object's ETag matches the given value. This is useful for
  23527. // getting updates only after the object has changed since the last
  23528. // request. Use googleapi.IsNotModified to check whether the response
  23529. // error from Do is the result of In-None-Match.
  23530. func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  23531. c.ifNoneMatch_ = entityTag
  23532. return c
  23533. }
  23534. // Context sets the context to be used in this call's Do method. Any
  23535. // pending HTTP request will be aborted if the provided context is
  23536. // canceled.
  23537. func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  23538. c.ctx_ = ctx
  23539. return c
  23540. }
  23541. // Header returns an http.Header that can be modified by the caller to
  23542. // add HTTP headers to the request.
  23543. func (c *CreativeGroupsGetCall) Header() http.Header {
  23544. if c.header_ == nil {
  23545. c.header_ = make(http.Header)
  23546. }
  23547. return c.header_
  23548. }
  23549. func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  23550. reqHeaders := make(http.Header)
  23551. for k, v := range c.header_ {
  23552. reqHeaders[k] = v
  23553. }
  23554. reqHeaders.Set("User-Agent", c.s.userAgent())
  23555. if c.ifNoneMatch_ != "" {
  23556. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23557. }
  23558. var body io.Reader = nil
  23559. c.urlParams_.Set("alt", alt)
  23560. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  23561. urls += "?" + c.urlParams_.Encode()
  23562. req, _ := http.NewRequest("GET", urls, body)
  23563. req.Header = reqHeaders
  23564. googleapi.Expand(req.URL, map[string]string{
  23565. "profileId": strconv.FormatInt(c.profileId, 10),
  23566. "id": strconv.FormatInt(c.id, 10),
  23567. })
  23568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23569. }
  23570. // Do executes the "dfareporting.creativeGroups.get" call.
  23571. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23572. // status code is an error. Response headers are in either
  23573. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23574. // at all) in error.(*googleapi.Error).Header. Use
  23575. // googleapi.IsNotModified to check whether the returned error was
  23576. // because http.StatusNotModified was returned.
  23577. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23578. gensupport.SetOptions(c.urlParams_, opts...)
  23579. res, err := c.doRequest("json")
  23580. if res != nil && res.StatusCode == http.StatusNotModified {
  23581. if res.Body != nil {
  23582. res.Body.Close()
  23583. }
  23584. return nil, &googleapi.Error{
  23585. Code: res.StatusCode,
  23586. Header: res.Header,
  23587. }
  23588. }
  23589. if err != nil {
  23590. return nil, err
  23591. }
  23592. defer googleapi.CloseBody(res)
  23593. if err := googleapi.CheckResponse(res); err != nil {
  23594. return nil, err
  23595. }
  23596. ret := &CreativeGroup{
  23597. ServerResponse: googleapi.ServerResponse{
  23598. Header: res.Header,
  23599. HTTPStatusCode: res.StatusCode,
  23600. },
  23601. }
  23602. target := &ret
  23603. if err := gensupport.DecodeResponse(target, res); err != nil {
  23604. return nil, err
  23605. }
  23606. return ret, nil
  23607. // {
  23608. // "description": "Gets one creative group by ID.",
  23609. // "httpMethod": "GET",
  23610. // "id": "dfareporting.creativeGroups.get",
  23611. // "parameterOrder": [
  23612. // "profileId",
  23613. // "id"
  23614. // ],
  23615. // "parameters": {
  23616. // "id": {
  23617. // "description": "Creative group ID.",
  23618. // "format": "int64",
  23619. // "location": "path",
  23620. // "required": true,
  23621. // "type": "string"
  23622. // },
  23623. // "profileId": {
  23624. // "description": "User profile ID associated with this request.",
  23625. // "format": "int64",
  23626. // "location": "path",
  23627. // "required": true,
  23628. // "type": "string"
  23629. // }
  23630. // },
  23631. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  23632. // "response": {
  23633. // "$ref": "CreativeGroup"
  23634. // },
  23635. // "scopes": [
  23636. // "https://www.googleapis.com/auth/dfatrafficking"
  23637. // ]
  23638. // }
  23639. }
  23640. // method id "dfareporting.creativeGroups.insert":
  23641. type CreativeGroupsInsertCall struct {
  23642. s *Service
  23643. profileId int64
  23644. creativegroup *CreativeGroup
  23645. urlParams_ gensupport.URLParams
  23646. ctx_ context.Context
  23647. header_ http.Header
  23648. }
  23649. // Insert: Inserts a new creative group.
  23650. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  23651. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23652. c.profileId = profileId
  23653. c.creativegroup = creativegroup
  23654. return c
  23655. }
  23656. // Fields allows partial responses to be retrieved. See
  23657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23658. // for more information.
  23659. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  23660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23661. return c
  23662. }
  23663. // Context sets the context to be used in this call's Do method. Any
  23664. // pending HTTP request will be aborted if the provided context is
  23665. // canceled.
  23666. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  23667. c.ctx_ = ctx
  23668. return c
  23669. }
  23670. // Header returns an http.Header that can be modified by the caller to
  23671. // add HTTP headers to the request.
  23672. func (c *CreativeGroupsInsertCall) Header() http.Header {
  23673. if c.header_ == nil {
  23674. c.header_ = make(http.Header)
  23675. }
  23676. return c.header_
  23677. }
  23678. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  23679. reqHeaders := make(http.Header)
  23680. for k, v := range c.header_ {
  23681. reqHeaders[k] = v
  23682. }
  23683. reqHeaders.Set("User-Agent", c.s.userAgent())
  23684. var body io.Reader = nil
  23685. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  23686. if err != nil {
  23687. return nil, err
  23688. }
  23689. reqHeaders.Set("Content-Type", "application/json")
  23690. c.urlParams_.Set("alt", alt)
  23691. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  23692. urls += "?" + c.urlParams_.Encode()
  23693. req, _ := http.NewRequest("POST", urls, body)
  23694. req.Header = reqHeaders
  23695. googleapi.Expand(req.URL, map[string]string{
  23696. "profileId": strconv.FormatInt(c.profileId, 10),
  23697. })
  23698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23699. }
  23700. // Do executes the "dfareporting.creativeGroups.insert" call.
  23701. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23702. // status code is an error. Response headers are in either
  23703. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23704. // at all) in error.(*googleapi.Error).Header. Use
  23705. // googleapi.IsNotModified to check whether the returned error was
  23706. // because http.StatusNotModified was returned.
  23707. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23708. gensupport.SetOptions(c.urlParams_, opts...)
  23709. res, err := c.doRequest("json")
  23710. if res != nil && res.StatusCode == http.StatusNotModified {
  23711. if res.Body != nil {
  23712. res.Body.Close()
  23713. }
  23714. return nil, &googleapi.Error{
  23715. Code: res.StatusCode,
  23716. Header: res.Header,
  23717. }
  23718. }
  23719. if err != nil {
  23720. return nil, err
  23721. }
  23722. defer googleapi.CloseBody(res)
  23723. if err := googleapi.CheckResponse(res); err != nil {
  23724. return nil, err
  23725. }
  23726. ret := &CreativeGroup{
  23727. ServerResponse: googleapi.ServerResponse{
  23728. Header: res.Header,
  23729. HTTPStatusCode: res.StatusCode,
  23730. },
  23731. }
  23732. target := &ret
  23733. if err := gensupport.DecodeResponse(target, res); err != nil {
  23734. return nil, err
  23735. }
  23736. return ret, nil
  23737. // {
  23738. // "description": "Inserts a new creative group.",
  23739. // "httpMethod": "POST",
  23740. // "id": "dfareporting.creativeGroups.insert",
  23741. // "parameterOrder": [
  23742. // "profileId"
  23743. // ],
  23744. // "parameters": {
  23745. // "profileId": {
  23746. // "description": "User profile ID associated with this request.",
  23747. // "format": "int64",
  23748. // "location": "path",
  23749. // "required": true,
  23750. // "type": "string"
  23751. // }
  23752. // },
  23753. // "path": "userprofiles/{profileId}/creativeGroups",
  23754. // "request": {
  23755. // "$ref": "CreativeGroup"
  23756. // },
  23757. // "response": {
  23758. // "$ref": "CreativeGroup"
  23759. // },
  23760. // "scopes": [
  23761. // "https://www.googleapis.com/auth/dfatrafficking"
  23762. // ]
  23763. // }
  23764. }
  23765. // method id "dfareporting.creativeGroups.list":
  23766. type CreativeGroupsListCall struct {
  23767. s *Service
  23768. profileId int64
  23769. urlParams_ gensupport.URLParams
  23770. ifNoneMatch_ string
  23771. ctx_ context.Context
  23772. header_ http.Header
  23773. }
  23774. // List: Retrieves a list of creative groups, possibly filtered. This
  23775. // method supports paging.
  23776. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  23777. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23778. c.profileId = profileId
  23779. return c
  23780. }
  23781. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  23782. // only creative groups that belong to these advertisers.
  23783. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  23784. var advertiserIds_ []string
  23785. for _, v := range advertiserIds {
  23786. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  23787. }
  23788. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  23789. return c
  23790. }
  23791. // GroupNumber sets the optional parameter "groupNumber": Select only
  23792. // creative groups that belong to this subgroup.
  23793. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  23794. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  23795. return c
  23796. }
  23797. // Ids sets the optional parameter "ids": Select only creative groups
  23798. // with these IDs.
  23799. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  23800. var ids_ []string
  23801. for _, v := range ids {
  23802. ids_ = append(ids_, fmt.Sprint(v))
  23803. }
  23804. c.urlParams_.SetMulti("ids", ids_)
  23805. return c
  23806. }
  23807. // MaxResults sets the optional parameter "maxResults": Maximum number
  23808. // of results to return.
  23809. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  23810. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23811. return c
  23812. }
  23813. // PageToken sets the optional parameter "pageToken": Value of the
  23814. // nextPageToken from the previous result page.
  23815. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  23816. c.urlParams_.Set("pageToken", pageToken)
  23817. return c
  23818. }
  23819. // SearchString sets the optional parameter "searchString": Allows
  23820. // searching for creative groups by name or ID. Wildcards (*) are
  23821. // allowed. For example, "creativegroup*2015" will return creative
  23822. // groups with names like "creativegroup June 2015", "creativegroup
  23823. // April 2015", or simply "creativegroup 2015". Most of the searches
  23824. // also add wild-cards implicitly at the start and the end of the search
  23825. // string. For example, a search string of "creativegroup" will match
  23826. // creative groups with the name "my creativegroup", "creativegroup
  23827. // 2015", or simply "creativegroup".
  23828. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  23829. c.urlParams_.Set("searchString", searchString)
  23830. return c
  23831. }
  23832. // SortField sets the optional parameter "sortField": Field by which to
  23833. // sort the list.
  23834. //
  23835. // Possible values:
  23836. // "ID" (default)
  23837. // "NAME"
  23838. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  23839. c.urlParams_.Set("sortField", sortField)
  23840. return c
  23841. }
  23842. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23843. // results.
  23844. //
  23845. // Possible values:
  23846. // "ASCENDING" (default)
  23847. // "DESCENDING"
  23848. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  23849. c.urlParams_.Set("sortOrder", sortOrder)
  23850. return c
  23851. }
  23852. // Fields allows partial responses to be retrieved. See
  23853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23854. // for more information.
  23855. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  23856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23857. return c
  23858. }
  23859. // IfNoneMatch sets the optional parameter which makes the operation
  23860. // fail if the object's ETag matches the given value. This is useful for
  23861. // getting updates only after the object has changed since the last
  23862. // request. Use googleapi.IsNotModified to check whether the response
  23863. // error from Do is the result of In-None-Match.
  23864. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  23865. c.ifNoneMatch_ = entityTag
  23866. return c
  23867. }
  23868. // Context sets the context to be used in this call's Do method. Any
  23869. // pending HTTP request will be aborted if the provided context is
  23870. // canceled.
  23871. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  23872. c.ctx_ = ctx
  23873. return c
  23874. }
  23875. // Header returns an http.Header that can be modified by the caller to
  23876. // add HTTP headers to the request.
  23877. func (c *CreativeGroupsListCall) Header() http.Header {
  23878. if c.header_ == nil {
  23879. c.header_ = make(http.Header)
  23880. }
  23881. return c.header_
  23882. }
  23883. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  23884. reqHeaders := make(http.Header)
  23885. for k, v := range c.header_ {
  23886. reqHeaders[k] = v
  23887. }
  23888. reqHeaders.Set("User-Agent", c.s.userAgent())
  23889. if c.ifNoneMatch_ != "" {
  23890. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23891. }
  23892. var body io.Reader = nil
  23893. c.urlParams_.Set("alt", alt)
  23894. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  23895. urls += "?" + c.urlParams_.Encode()
  23896. req, _ := http.NewRequest("GET", urls, body)
  23897. req.Header = reqHeaders
  23898. googleapi.Expand(req.URL, map[string]string{
  23899. "profileId": strconv.FormatInt(c.profileId, 10),
  23900. })
  23901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23902. }
  23903. // Do executes the "dfareporting.creativeGroups.list" call.
  23904. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  23905. // Any non-2xx status code is an error. Response headers are in either
  23906. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  23907. // was returned at all) in error.(*googleapi.Error).Header. Use
  23908. // googleapi.IsNotModified to check whether the returned error was
  23909. // because http.StatusNotModified was returned.
  23910. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  23911. gensupport.SetOptions(c.urlParams_, opts...)
  23912. res, err := c.doRequest("json")
  23913. if res != nil && res.StatusCode == http.StatusNotModified {
  23914. if res.Body != nil {
  23915. res.Body.Close()
  23916. }
  23917. return nil, &googleapi.Error{
  23918. Code: res.StatusCode,
  23919. Header: res.Header,
  23920. }
  23921. }
  23922. if err != nil {
  23923. return nil, err
  23924. }
  23925. defer googleapi.CloseBody(res)
  23926. if err := googleapi.CheckResponse(res); err != nil {
  23927. return nil, err
  23928. }
  23929. ret := &CreativeGroupsListResponse{
  23930. ServerResponse: googleapi.ServerResponse{
  23931. Header: res.Header,
  23932. HTTPStatusCode: res.StatusCode,
  23933. },
  23934. }
  23935. target := &ret
  23936. if err := gensupport.DecodeResponse(target, res); err != nil {
  23937. return nil, err
  23938. }
  23939. return ret, nil
  23940. // {
  23941. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  23942. // "httpMethod": "GET",
  23943. // "id": "dfareporting.creativeGroups.list",
  23944. // "parameterOrder": [
  23945. // "profileId"
  23946. // ],
  23947. // "parameters": {
  23948. // "advertiserIds": {
  23949. // "description": "Select only creative groups that belong to these advertisers.",
  23950. // "format": "int64",
  23951. // "location": "query",
  23952. // "repeated": true,
  23953. // "type": "string"
  23954. // },
  23955. // "groupNumber": {
  23956. // "description": "Select only creative groups that belong to this subgroup.",
  23957. // "format": "int32",
  23958. // "location": "query",
  23959. // "maximum": "2",
  23960. // "minimum": "1",
  23961. // "type": "integer"
  23962. // },
  23963. // "ids": {
  23964. // "description": "Select only creative groups with these IDs.",
  23965. // "format": "int64",
  23966. // "location": "query",
  23967. // "repeated": true,
  23968. // "type": "string"
  23969. // },
  23970. // "maxResults": {
  23971. // "default": "1000",
  23972. // "description": "Maximum number of results to return.",
  23973. // "format": "int32",
  23974. // "location": "query",
  23975. // "maximum": "1000",
  23976. // "minimum": "0",
  23977. // "type": "integer"
  23978. // },
  23979. // "pageToken": {
  23980. // "description": "Value of the nextPageToken from the previous result page.",
  23981. // "location": "query",
  23982. // "type": "string"
  23983. // },
  23984. // "profileId": {
  23985. // "description": "User profile ID associated with this request.",
  23986. // "format": "int64",
  23987. // "location": "path",
  23988. // "required": true,
  23989. // "type": "string"
  23990. // },
  23991. // "searchString": {
  23992. // "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\".",
  23993. // "location": "query",
  23994. // "type": "string"
  23995. // },
  23996. // "sortField": {
  23997. // "default": "ID",
  23998. // "description": "Field by which to sort the list.",
  23999. // "enum": [
  24000. // "ID",
  24001. // "NAME"
  24002. // ],
  24003. // "enumDescriptions": [
  24004. // "",
  24005. // ""
  24006. // ],
  24007. // "location": "query",
  24008. // "type": "string"
  24009. // },
  24010. // "sortOrder": {
  24011. // "default": "ASCENDING",
  24012. // "description": "Order of sorted results.",
  24013. // "enum": [
  24014. // "ASCENDING",
  24015. // "DESCENDING"
  24016. // ],
  24017. // "enumDescriptions": [
  24018. // "",
  24019. // ""
  24020. // ],
  24021. // "location": "query",
  24022. // "type": "string"
  24023. // }
  24024. // },
  24025. // "path": "userprofiles/{profileId}/creativeGroups",
  24026. // "response": {
  24027. // "$ref": "CreativeGroupsListResponse"
  24028. // },
  24029. // "scopes": [
  24030. // "https://www.googleapis.com/auth/dfatrafficking"
  24031. // ]
  24032. // }
  24033. }
  24034. // Pages invokes f for each page of results.
  24035. // A non-nil error returned from f will halt the iteration.
  24036. // The provided context supersedes any context provided to the Context method.
  24037. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  24038. c.ctx_ = ctx
  24039. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24040. for {
  24041. x, err := c.Do()
  24042. if err != nil {
  24043. return err
  24044. }
  24045. if err := f(x); err != nil {
  24046. return err
  24047. }
  24048. if x.NextPageToken == "" {
  24049. return nil
  24050. }
  24051. c.PageToken(x.NextPageToken)
  24052. }
  24053. }
  24054. // method id "dfareporting.creativeGroups.patch":
  24055. type CreativeGroupsPatchCall struct {
  24056. s *Service
  24057. profileId int64
  24058. creativegroup *CreativeGroup
  24059. urlParams_ gensupport.URLParams
  24060. ctx_ context.Context
  24061. header_ http.Header
  24062. }
  24063. // Patch: Updates an existing creative group. This method supports patch
  24064. // semantics.
  24065. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  24066. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24067. c.profileId = profileId
  24068. c.urlParams_.Set("id", fmt.Sprint(id))
  24069. c.creativegroup = creativegroup
  24070. return c
  24071. }
  24072. // Fields allows partial responses to be retrieved. See
  24073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24074. // for more information.
  24075. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  24076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24077. return c
  24078. }
  24079. // Context sets the context to be used in this call's Do method. Any
  24080. // pending HTTP request will be aborted if the provided context is
  24081. // canceled.
  24082. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  24083. c.ctx_ = ctx
  24084. return c
  24085. }
  24086. // Header returns an http.Header that can be modified by the caller to
  24087. // add HTTP headers to the request.
  24088. func (c *CreativeGroupsPatchCall) Header() http.Header {
  24089. if c.header_ == nil {
  24090. c.header_ = make(http.Header)
  24091. }
  24092. return c.header_
  24093. }
  24094. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  24095. reqHeaders := make(http.Header)
  24096. for k, v := range c.header_ {
  24097. reqHeaders[k] = v
  24098. }
  24099. reqHeaders.Set("User-Agent", c.s.userAgent())
  24100. var body io.Reader = nil
  24101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24102. if err != nil {
  24103. return nil, err
  24104. }
  24105. reqHeaders.Set("Content-Type", "application/json")
  24106. c.urlParams_.Set("alt", alt)
  24107. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24108. urls += "?" + c.urlParams_.Encode()
  24109. req, _ := http.NewRequest("PATCH", urls, body)
  24110. req.Header = reqHeaders
  24111. googleapi.Expand(req.URL, map[string]string{
  24112. "profileId": strconv.FormatInt(c.profileId, 10),
  24113. })
  24114. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24115. }
  24116. // Do executes the "dfareporting.creativeGroups.patch" call.
  24117. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24118. // status code is an error. Response headers are in either
  24119. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24120. // at all) in error.(*googleapi.Error).Header. Use
  24121. // googleapi.IsNotModified to check whether the returned error was
  24122. // because http.StatusNotModified was returned.
  24123. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24124. gensupport.SetOptions(c.urlParams_, opts...)
  24125. res, err := c.doRequest("json")
  24126. if res != nil && res.StatusCode == http.StatusNotModified {
  24127. if res.Body != nil {
  24128. res.Body.Close()
  24129. }
  24130. return nil, &googleapi.Error{
  24131. Code: res.StatusCode,
  24132. Header: res.Header,
  24133. }
  24134. }
  24135. if err != nil {
  24136. return nil, err
  24137. }
  24138. defer googleapi.CloseBody(res)
  24139. if err := googleapi.CheckResponse(res); err != nil {
  24140. return nil, err
  24141. }
  24142. ret := &CreativeGroup{
  24143. ServerResponse: googleapi.ServerResponse{
  24144. Header: res.Header,
  24145. HTTPStatusCode: res.StatusCode,
  24146. },
  24147. }
  24148. target := &ret
  24149. if err := gensupport.DecodeResponse(target, res); err != nil {
  24150. return nil, err
  24151. }
  24152. return ret, nil
  24153. // {
  24154. // "description": "Updates an existing creative group. This method supports patch semantics.",
  24155. // "httpMethod": "PATCH",
  24156. // "id": "dfareporting.creativeGroups.patch",
  24157. // "parameterOrder": [
  24158. // "profileId",
  24159. // "id"
  24160. // ],
  24161. // "parameters": {
  24162. // "id": {
  24163. // "description": "Creative group ID.",
  24164. // "format": "int64",
  24165. // "location": "query",
  24166. // "required": true,
  24167. // "type": "string"
  24168. // },
  24169. // "profileId": {
  24170. // "description": "User profile ID associated with this request.",
  24171. // "format": "int64",
  24172. // "location": "path",
  24173. // "required": true,
  24174. // "type": "string"
  24175. // }
  24176. // },
  24177. // "path": "userprofiles/{profileId}/creativeGroups",
  24178. // "request": {
  24179. // "$ref": "CreativeGroup"
  24180. // },
  24181. // "response": {
  24182. // "$ref": "CreativeGroup"
  24183. // },
  24184. // "scopes": [
  24185. // "https://www.googleapis.com/auth/dfatrafficking"
  24186. // ]
  24187. // }
  24188. }
  24189. // method id "dfareporting.creativeGroups.update":
  24190. type CreativeGroupsUpdateCall struct {
  24191. s *Service
  24192. profileId int64
  24193. creativegroup *CreativeGroup
  24194. urlParams_ gensupport.URLParams
  24195. ctx_ context.Context
  24196. header_ http.Header
  24197. }
  24198. // Update: Updates an existing creative group.
  24199. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  24200. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24201. c.profileId = profileId
  24202. c.creativegroup = creativegroup
  24203. return c
  24204. }
  24205. // Fields allows partial responses to be retrieved. See
  24206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24207. // for more information.
  24208. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  24209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24210. return c
  24211. }
  24212. // Context sets the context to be used in this call's Do method. Any
  24213. // pending HTTP request will be aborted if the provided context is
  24214. // canceled.
  24215. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  24216. c.ctx_ = ctx
  24217. return c
  24218. }
  24219. // Header returns an http.Header that can be modified by the caller to
  24220. // add HTTP headers to the request.
  24221. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  24222. if c.header_ == nil {
  24223. c.header_ = make(http.Header)
  24224. }
  24225. return c.header_
  24226. }
  24227. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  24228. reqHeaders := make(http.Header)
  24229. for k, v := range c.header_ {
  24230. reqHeaders[k] = v
  24231. }
  24232. reqHeaders.Set("User-Agent", c.s.userAgent())
  24233. var body io.Reader = nil
  24234. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24235. if err != nil {
  24236. return nil, err
  24237. }
  24238. reqHeaders.Set("Content-Type", "application/json")
  24239. c.urlParams_.Set("alt", alt)
  24240. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24241. urls += "?" + c.urlParams_.Encode()
  24242. req, _ := http.NewRequest("PUT", urls, body)
  24243. req.Header = reqHeaders
  24244. googleapi.Expand(req.URL, map[string]string{
  24245. "profileId": strconv.FormatInt(c.profileId, 10),
  24246. })
  24247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24248. }
  24249. // Do executes the "dfareporting.creativeGroups.update" call.
  24250. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24251. // status code is an error. Response headers are in either
  24252. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24253. // at all) in error.(*googleapi.Error).Header. Use
  24254. // googleapi.IsNotModified to check whether the returned error was
  24255. // because http.StatusNotModified was returned.
  24256. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24257. gensupport.SetOptions(c.urlParams_, opts...)
  24258. res, err := c.doRequest("json")
  24259. if res != nil && res.StatusCode == http.StatusNotModified {
  24260. if res.Body != nil {
  24261. res.Body.Close()
  24262. }
  24263. return nil, &googleapi.Error{
  24264. Code: res.StatusCode,
  24265. Header: res.Header,
  24266. }
  24267. }
  24268. if err != nil {
  24269. return nil, err
  24270. }
  24271. defer googleapi.CloseBody(res)
  24272. if err := googleapi.CheckResponse(res); err != nil {
  24273. return nil, err
  24274. }
  24275. ret := &CreativeGroup{
  24276. ServerResponse: googleapi.ServerResponse{
  24277. Header: res.Header,
  24278. HTTPStatusCode: res.StatusCode,
  24279. },
  24280. }
  24281. target := &ret
  24282. if err := gensupport.DecodeResponse(target, res); err != nil {
  24283. return nil, err
  24284. }
  24285. return ret, nil
  24286. // {
  24287. // "description": "Updates an existing creative group.",
  24288. // "httpMethod": "PUT",
  24289. // "id": "dfareporting.creativeGroups.update",
  24290. // "parameterOrder": [
  24291. // "profileId"
  24292. // ],
  24293. // "parameters": {
  24294. // "profileId": {
  24295. // "description": "User profile ID associated with this request.",
  24296. // "format": "int64",
  24297. // "location": "path",
  24298. // "required": true,
  24299. // "type": "string"
  24300. // }
  24301. // },
  24302. // "path": "userprofiles/{profileId}/creativeGroups",
  24303. // "request": {
  24304. // "$ref": "CreativeGroup"
  24305. // },
  24306. // "response": {
  24307. // "$ref": "CreativeGroup"
  24308. // },
  24309. // "scopes": [
  24310. // "https://www.googleapis.com/auth/dfatrafficking"
  24311. // ]
  24312. // }
  24313. }
  24314. // method id "dfareporting.creatives.get":
  24315. type CreativesGetCall struct {
  24316. s *Service
  24317. profileId int64
  24318. id int64
  24319. urlParams_ gensupport.URLParams
  24320. ifNoneMatch_ string
  24321. ctx_ context.Context
  24322. header_ http.Header
  24323. }
  24324. // Get: Gets one creative by ID.
  24325. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  24326. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24327. c.profileId = profileId
  24328. c.id = id
  24329. return c
  24330. }
  24331. // Fields allows partial responses to be retrieved. See
  24332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24333. // for more information.
  24334. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  24335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24336. return c
  24337. }
  24338. // IfNoneMatch sets the optional parameter which makes the operation
  24339. // fail if the object's ETag matches the given value. This is useful for
  24340. // getting updates only after the object has changed since the last
  24341. // request. Use googleapi.IsNotModified to check whether the response
  24342. // error from Do is the result of In-None-Match.
  24343. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  24344. c.ifNoneMatch_ = entityTag
  24345. return c
  24346. }
  24347. // Context sets the context to be used in this call's Do method. Any
  24348. // pending HTTP request will be aborted if the provided context is
  24349. // canceled.
  24350. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  24351. c.ctx_ = ctx
  24352. return c
  24353. }
  24354. // Header returns an http.Header that can be modified by the caller to
  24355. // add HTTP headers to the request.
  24356. func (c *CreativesGetCall) Header() http.Header {
  24357. if c.header_ == nil {
  24358. c.header_ = make(http.Header)
  24359. }
  24360. return c.header_
  24361. }
  24362. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  24363. reqHeaders := make(http.Header)
  24364. for k, v := range c.header_ {
  24365. reqHeaders[k] = v
  24366. }
  24367. reqHeaders.Set("User-Agent", c.s.userAgent())
  24368. if c.ifNoneMatch_ != "" {
  24369. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24370. }
  24371. var body io.Reader = nil
  24372. c.urlParams_.Set("alt", alt)
  24373. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  24374. urls += "?" + c.urlParams_.Encode()
  24375. req, _ := http.NewRequest("GET", urls, body)
  24376. req.Header = reqHeaders
  24377. googleapi.Expand(req.URL, map[string]string{
  24378. "profileId": strconv.FormatInt(c.profileId, 10),
  24379. "id": strconv.FormatInt(c.id, 10),
  24380. })
  24381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24382. }
  24383. // Do executes the "dfareporting.creatives.get" call.
  24384. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24385. // code is an error. Response headers are in either
  24386. // *Creative.ServerResponse.Header or (if a response was returned at
  24387. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24388. // to check whether the returned error was because
  24389. // http.StatusNotModified was returned.
  24390. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24391. gensupport.SetOptions(c.urlParams_, opts...)
  24392. res, err := c.doRequest("json")
  24393. if res != nil && res.StatusCode == http.StatusNotModified {
  24394. if res.Body != nil {
  24395. res.Body.Close()
  24396. }
  24397. return nil, &googleapi.Error{
  24398. Code: res.StatusCode,
  24399. Header: res.Header,
  24400. }
  24401. }
  24402. if err != nil {
  24403. return nil, err
  24404. }
  24405. defer googleapi.CloseBody(res)
  24406. if err := googleapi.CheckResponse(res); err != nil {
  24407. return nil, err
  24408. }
  24409. ret := &Creative{
  24410. ServerResponse: googleapi.ServerResponse{
  24411. Header: res.Header,
  24412. HTTPStatusCode: res.StatusCode,
  24413. },
  24414. }
  24415. target := &ret
  24416. if err := gensupport.DecodeResponse(target, res); err != nil {
  24417. return nil, err
  24418. }
  24419. return ret, nil
  24420. // {
  24421. // "description": "Gets one creative by ID.",
  24422. // "httpMethod": "GET",
  24423. // "id": "dfareporting.creatives.get",
  24424. // "parameterOrder": [
  24425. // "profileId",
  24426. // "id"
  24427. // ],
  24428. // "parameters": {
  24429. // "id": {
  24430. // "description": "Creative ID.",
  24431. // "format": "int64",
  24432. // "location": "path",
  24433. // "required": true,
  24434. // "type": "string"
  24435. // },
  24436. // "profileId": {
  24437. // "description": "User profile ID associated with this request.",
  24438. // "format": "int64",
  24439. // "location": "path",
  24440. // "required": true,
  24441. // "type": "string"
  24442. // }
  24443. // },
  24444. // "path": "userprofiles/{profileId}/creatives/{id}",
  24445. // "response": {
  24446. // "$ref": "Creative"
  24447. // },
  24448. // "scopes": [
  24449. // "https://www.googleapis.com/auth/dfatrafficking"
  24450. // ]
  24451. // }
  24452. }
  24453. // method id "dfareporting.creatives.insert":
  24454. type CreativesInsertCall struct {
  24455. s *Service
  24456. profileId int64
  24457. creative *Creative
  24458. urlParams_ gensupport.URLParams
  24459. ctx_ context.Context
  24460. header_ http.Header
  24461. }
  24462. // Insert: Inserts a new creative.
  24463. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  24464. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24465. c.profileId = profileId
  24466. c.creative = creative
  24467. return c
  24468. }
  24469. // Fields allows partial responses to be retrieved. See
  24470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24471. // for more information.
  24472. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  24473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24474. return c
  24475. }
  24476. // Context sets the context to be used in this call's Do method. Any
  24477. // pending HTTP request will be aborted if the provided context is
  24478. // canceled.
  24479. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  24480. c.ctx_ = ctx
  24481. return c
  24482. }
  24483. // Header returns an http.Header that can be modified by the caller to
  24484. // add HTTP headers to the request.
  24485. func (c *CreativesInsertCall) Header() http.Header {
  24486. if c.header_ == nil {
  24487. c.header_ = make(http.Header)
  24488. }
  24489. return c.header_
  24490. }
  24491. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  24492. reqHeaders := make(http.Header)
  24493. for k, v := range c.header_ {
  24494. reqHeaders[k] = v
  24495. }
  24496. reqHeaders.Set("User-Agent", c.s.userAgent())
  24497. var body io.Reader = nil
  24498. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  24499. if err != nil {
  24500. return nil, err
  24501. }
  24502. reqHeaders.Set("Content-Type", "application/json")
  24503. c.urlParams_.Set("alt", alt)
  24504. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24505. urls += "?" + c.urlParams_.Encode()
  24506. req, _ := http.NewRequest("POST", urls, body)
  24507. req.Header = reqHeaders
  24508. googleapi.Expand(req.URL, map[string]string{
  24509. "profileId": strconv.FormatInt(c.profileId, 10),
  24510. })
  24511. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24512. }
  24513. // Do executes the "dfareporting.creatives.insert" call.
  24514. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24515. // code is an error. Response headers are in either
  24516. // *Creative.ServerResponse.Header or (if a response was returned at
  24517. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24518. // to check whether the returned error was because
  24519. // http.StatusNotModified was returned.
  24520. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24521. gensupport.SetOptions(c.urlParams_, opts...)
  24522. res, err := c.doRequest("json")
  24523. if res != nil && res.StatusCode == http.StatusNotModified {
  24524. if res.Body != nil {
  24525. res.Body.Close()
  24526. }
  24527. return nil, &googleapi.Error{
  24528. Code: res.StatusCode,
  24529. Header: res.Header,
  24530. }
  24531. }
  24532. if err != nil {
  24533. return nil, err
  24534. }
  24535. defer googleapi.CloseBody(res)
  24536. if err := googleapi.CheckResponse(res); err != nil {
  24537. return nil, err
  24538. }
  24539. ret := &Creative{
  24540. ServerResponse: googleapi.ServerResponse{
  24541. Header: res.Header,
  24542. HTTPStatusCode: res.StatusCode,
  24543. },
  24544. }
  24545. target := &ret
  24546. if err := gensupport.DecodeResponse(target, res); err != nil {
  24547. return nil, err
  24548. }
  24549. return ret, nil
  24550. // {
  24551. // "description": "Inserts a new creative.",
  24552. // "httpMethod": "POST",
  24553. // "id": "dfareporting.creatives.insert",
  24554. // "parameterOrder": [
  24555. // "profileId"
  24556. // ],
  24557. // "parameters": {
  24558. // "profileId": {
  24559. // "description": "User profile ID associated with this request.",
  24560. // "format": "int64",
  24561. // "location": "path",
  24562. // "required": true,
  24563. // "type": "string"
  24564. // }
  24565. // },
  24566. // "path": "userprofiles/{profileId}/creatives",
  24567. // "request": {
  24568. // "$ref": "Creative"
  24569. // },
  24570. // "response": {
  24571. // "$ref": "Creative"
  24572. // },
  24573. // "scopes": [
  24574. // "https://www.googleapis.com/auth/dfatrafficking"
  24575. // ]
  24576. // }
  24577. }
  24578. // method id "dfareporting.creatives.list":
  24579. type CreativesListCall struct {
  24580. s *Service
  24581. profileId int64
  24582. urlParams_ gensupport.URLParams
  24583. ifNoneMatch_ string
  24584. ctx_ context.Context
  24585. header_ http.Header
  24586. }
  24587. // List: Retrieves a list of creatives, possibly filtered. This method
  24588. // supports paging.
  24589. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  24590. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24591. c.profileId = profileId
  24592. return c
  24593. }
  24594. // Active sets the optional parameter "active": Select only active
  24595. // creatives. Leave blank to select active and inactive creatives.
  24596. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  24597. c.urlParams_.Set("active", fmt.Sprint(active))
  24598. return c
  24599. }
  24600. // AdvertiserId sets the optional parameter "advertiserId": Select only
  24601. // creatives with this advertiser ID.
  24602. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  24603. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  24604. return c
  24605. }
  24606. // Archived sets the optional parameter "archived": Select only archived
  24607. // creatives. Leave blank to select archived and unarchived creatives.
  24608. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  24609. c.urlParams_.Set("archived", fmt.Sprint(archived))
  24610. return c
  24611. }
  24612. // CampaignId sets the optional parameter "campaignId": Select only
  24613. // creatives with this campaign ID.
  24614. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  24615. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  24616. return c
  24617. }
  24618. // CompanionCreativeIds sets the optional parameter
  24619. // "companionCreativeIds": Select only in-stream video creatives with
  24620. // these companion IDs.
  24621. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  24622. var companionCreativeIds_ []string
  24623. for _, v := range companionCreativeIds {
  24624. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  24625. }
  24626. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  24627. return c
  24628. }
  24629. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  24630. // Select only creatives with these creative field IDs.
  24631. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  24632. var creativeFieldIds_ []string
  24633. for _, v := range creativeFieldIds {
  24634. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  24635. }
  24636. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  24637. return c
  24638. }
  24639. // Ids sets the optional parameter "ids": Select only creatives with
  24640. // these IDs.
  24641. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  24642. var ids_ []string
  24643. for _, v := range ids {
  24644. ids_ = append(ids_, fmt.Sprint(v))
  24645. }
  24646. c.urlParams_.SetMulti("ids", ids_)
  24647. return c
  24648. }
  24649. // MaxResults sets the optional parameter "maxResults": Maximum number
  24650. // of results to return.
  24651. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  24652. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24653. return c
  24654. }
  24655. // PageToken sets the optional parameter "pageToken": Value of the
  24656. // nextPageToken from the previous result page.
  24657. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  24658. c.urlParams_.Set("pageToken", pageToken)
  24659. return c
  24660. }
  24661. // RenderingIds sets the optional parameter "renderingIds": Select only
  24662. // creatives with these rendering IDs.
  24663. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  24664. var renderingIds_ []string
  24665. for _, v := range renderingIds {
  24666. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  24667. }
  24668. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  24669. return c
  24670. }
  24671. // SearchString sets the optional parameter "searchString": Allows
  24672. // searching for objects by name or ID. Wildcards (*) are allowed. For
  24673. // example, "creative*2015" will return objects with names like
  24674. // "creative June 2015", "creative April 2015", or simply "creative
  24675. // 2015". Most of the searches also add wildcards implicitly at the
  24676. // start and the end of the search string. For example, a search string
  24677. // of "creative" will match objects with name "my creative", "creative
  24678. // 2015", or simply "creative".
  24679. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  24680. c.urlParams_.Set("searchString", searchString)
  24681. return c
  24682. }
  24683. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  24684. // with these size IDs.
  24685. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  24686. var sizeIds_ []string
  24687. for _, v := range sizeIds {
  24688. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  24689. }
  24690. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  24691. return c
  24692. }
  24693. // SortField sets the optional parameter "sortField": Field by which to
  24694. // sort the list.
  24695. //
  24696. // Possible values:
  24697. // "ID" (default)
  24698. // "NAME"
  24699. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  24700. c.urlParams_.Set("sortField", sortField)
  24701. return c
  24702. }
  24703. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24704. // results.
  24705. //
  24706. // Possible values:
  24707. // "ASCENDING" (default)
  24708. // "DESCENDING"
  24709. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  24710. c.urlParams_.Set("sortOrder", sortOrder)
  24711. return c
  24712. }
  24713. // StudioCreativeId sets the optional parameter "studioCreativeId":
  24714. // Select only creatives corresponding to this Studio creative ID.
  24715. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  24716. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  24717. return c
  24718. }
  24719. // Types sets the optional parameter "types": Select only creatives with
  24720. // these creative types.
  24721. //
  24722. // Possible values:
  24723. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  24724. // "CUSTOM_DISPLAY"
  24725. // "CUSTOM_DISPLAY_INTERSTITIAL"
  24726. // "DISPLAY"
  24727. // "DISPLAY_IMAGE_GALLERY"
  24728. // "DISPLAY_REDIRECT"
  24729. // "FLASH_INPAGE"
  24730. // "HTML5_BANNER"
  24731. // "IMAGE"
  24732. // "INSTREAM_AUDIO"
  24733. // "INSTREAM_VIDEO"
  24734. // "INSTREAM_VIDEO_REDIRECT"
  24735. // "INTERNAL_REDIRECT"
  24736. // "INTERSTITIAL_INTERNAL_REDIRECT"
  24737. // "RICH_MEDIA_DISPLAY_BANNER"
  24738. // "RICH_MEDIA_DISPLAY_EXPANDING"
  24739. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  24740. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  24741. // "RICH_MEDIA_IM_EXPAND"
  24742. // "RICH_MEDIA_INPAGE_FLOATING"
  24743. // "RICH_MEDIA_MOBILE_IN_APP"
  24744. // "RICH_MEDIA_PEEL_DOWN"
  24745. // "TRACKING_TEXT"
  24746. // "VPAID_LINEAR_VIDEO"
  24747. // "VPAID_NON_LINEAR_VIDEO"
  24748. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  24749. c.urlParams_.SetMulti("types", append([]string{}, types...))
  24750. return c
  24751. }
  24752. // Fields allows partial responses to be retrieved. See
  24753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24754. // for more information.
  24755. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  24756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24757. return c
  24758. }
  24759. // IfNoneMatch sets the optional parameter which makes the operation
  24760. // fail if the object's ETag matches the given value. This is useful for
  24761. // getting updates only after the object has changed since the last
  24762. // request. Use googleapi.IsNotModified to check whether the response
  24763. // error from Do is the result of In-None-Match.
  24764. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  24765. c.ifNoneMatch_ = entityTag
  24766. return c
  24767. }
  24768. // Context sets the context to be used in this call's Do method. Any
  24769. // pending HTTP request will be aborted if the provided context is
  24770. // canceled.
  24771. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  24772. c.ctx_ = ctx
  24773. return c
  24774. }
  24775. // Header returns an http.Header that can be modified by the caller to
  24776. // add HTTP headers to the request.
  24777. func (c *CreativesListCall) Header() http.Header {
  24778. if c.header_ == nil {
  24779. c.header_ = make(http.Header)
  24780. }
  24781. return c.header_
  24782. }
  24783. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  24784. reqHeaders := make(http.Header)
  24785. for k, v := range c.header_ {
  24786. reqHeaders[k] = v
  24787. }
  24788. reqHeaders.Set("User-Agent", c.s.userAgent())
  24789. if c.ifNoneMatch_ != "" {
  24790. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24791. }
  24792. var body io.Reader = nil
  24793. c.urlParams_.Set("alt", alt)
  24794. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24795. urls += "?" + c.urlParams_.Encode()
  24796. req, _ := http.NewRequest("GET", urls, body)
  24797. req.Header = reqHeaders
  24798. googleapi.Expand(req.URL, map[string]string{
  24799. "profileId": strconv.FormatInt(c.profileId, 10),
  24800. })
  24801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24802. }
  24803. // Do executes the "dfareporting.creatives.list" call.
  24804. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  24805. // non-2xx status code is an error. Response headers are in either
  24806. // *CreativesListResponse.ServerResponse.Header or (if a response was
  24807. // returned at all) in error.(*googleapi.Error).Header. Use
  24808. // googleapi.IsNotModified to check whether the returned error was
  24809. // because http.StatusNotModified was returned.
  24810. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  24811. gensupport.SetOptions(c.urlParams_, opts...)
  24812. res, err := c.doRequest("json")
  24813. if res != nil && res.StatusCode == http.StatusNotModified {
  24814. if res.Body != nil {
  24815. res.Body.Close()
  24816. }
  24817. return nil, &googleapi.Error{
  24818. Code: res.StatusCode,
  24819. Header: res.Header,
  24820. }
  24821. }
  24822. if err != nil {
  24823. return nil, err
  24824. }
  24825. defer googleapi.CloseBody(res)
  24826. if err := googleapi.CheckResponse(res); err != nil {
  24827. return nil, err
  24828. }
  24829. ret := &CreativesListResponse{
  24830. ServerResponse: googleapi.ServerResponse{
  24831. Header: res.Header,
  24832. HTTPStatusCode: res.StatusCode,
  24833. },
  24834. }
  24835. target := &ret
  24836. if err := gensupport.DecodeResponse(target, res); err != nil {
  24837. return nil, err
  24838. }
  24839. return ret, nil
  24840. // {
  24841. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  24842. // "httpMethod": "GET",
  24843. // "id": "dfareporting.creatives.list",
  24844. // "parameterOrder": [
  24845. // "profileId"
  24846. // ],
  24847. // "parameters": {
  24848. // "active": {
  24849. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  24850. // "location": "query",
  24851. // "type": "boolean"
  24852. // },
  24853. // "advertiserId": {
  24854. // "description": "Select only creatives with this advertiser ID.",
  24855. // "format": "int64",
  24856. // "location": "query",
  24857. // "type": "string"
  24858. // },
  24859. // "archived": {
  24860. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  24861. // "location": "query",
  24862. // "type": "boolean"
  24863. // },
  24864. // "campaignId": {
  24865. // "description": "Select only creatives with this campaign ID.",
  24866. // "format": "int64",
  24867. // "location": "query",
  24868. // "type": "string"
  24869. // },
  24870. // "companionCreativeIds": {
  24871. // "description": "Select only in-stream video creatives with these companion IDs.",
  24872. // "format": "int64",
  24873. // "location": "query",
  24874. // "repeated": true,
  24875. // "type": "string"
  24876. // },
  24877. // "creativeFieldIds": {
  24878. // "description": "Select only creatives with these creative field IDs.",
  24879. // "format": "int64",
  24880. // "location": "query",
  24881. // "repeated": true,
  24882. // "type": "string"
  24883. // },
  24884. // "ids": {
  24885. // "description": "Select only creatives with these IDs.",
  24886. // "format": "int64",
  24887. // "location": "query",
  24888. // "repeated": true,
  24889. // "type": "string"
  24890. // },
  24891. // "maxResults": {
  24892. // "default": "1000",
  24893. // "description": "Maximum number of results to return.",
  24894. // "format": "int32",
  24895. // "location": "query",
  24896. // "maximum": "1000",
  24897. // "minimum": "0",
  24898. // "type": "integer"
  24899. // },
  24900. // "pageToken": {
  24901. // "description": "Value of the nextPageToken from the previous result page.",
  24902. // "location": "query",
  24903. // "type": "string"
  24904. // },
  24905. // "profileId": {
  24906. // "description": "User profile ID associated with this request.",
  24907. // "format": "int64",
  24908. // "location": "path",
  24909. // "required": true,
  24910. // "type": "string"
  24911. // },
  24912. // "renderingIds": {
  24913. // "description": "Select only creatives with these rendering IDs.",
  24914. // "format": "int64",
  24915. // "location": "query",
  24916. // "repeated": true,
  24917. // "type": "string"
  24918. // },
  24919. // "searchString": {
  24920. // "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\".",
  24921. // "location": "query",
  24922. // "type": "string"
  24923. // },
  24924. // "sizeIds": {
  24925. // "description": "Select only creatives with these size IDs.",
  24926. // "format": "int64",
  24927. // "location": "query",
  24928. // "repeated": true,
  24929. // "type": "string"
  24930. // },
  24931. // "sortField": {
  24932. // "default": "ID",
  24933. // "description": "Field by which to sort the list.",
  24934. // "enum": [
  24935. // "ID",
  24936. // "NAME"
  24937. // ],
  24938. // "enumDescriptions": [
  24939. // "",
  24940. // ""
  24941. // ],
  24942. // "location": "query",
  24943. // "type": "string"
  24944. // },
  24945. // "sortOrder": {
  24946. // "default": "ASCENDING",
  24947. // "description": "Order of sorted results.",
  24948. // "enum": [
  24949. // "ASCENDING",
  24950. // "DESCENDING"
  24951. // ],
  24952. // "enumDescriptions": [
  24953. // "",
  24954. // ""
  24955. // ],
  24956. // "location": "query",
  24957. // "type": "string"
  24958. // },
  24959. // "studioCreativeId": {
  24960. // "description": "Select only creatives corresponding to this Studio creative ID.",
  24961. // "format": "int64",
  24962. // "location": "query",
  24963. // "type": "string"
  24964. // },
  24965. // "types": {
  24966. // "description": "Select only creatives with these creative types.",
  24967. // "enum": [
  24968. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  24969. // "CUSTOM_DISPLAY",
  24970. // "CUSTOM_DISPLAY_INTERSTITIAL",
  24971. // "DISPLAY",
  24972. // "DISPLAY_IMAGE_GALLERY",
  24973. // "DISPLAY_REDIRECT",
  24974. // "FLASH_INPAGE",
  24975. // "HTML5_BANNER",
  24976. // "IMAGE",
  24977. // "INSTREAM_AUDIO",
  24978. // "INSTREAM_VIDEO",
  24979. // "INSTREAM_VIDEO_REDIRECT",
  24980. // "INTERNAL_REDIRECT",
  24981. // "INTERSTITIAL_INTERNAL_REDIRECT",
  24982. // "RICH_MEDIA_DISPLAY_BANNER",
  24983. // "RICH_MEDIA_DISPLAY_EXPANDING",
  24984. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  24985. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  24986. // "RICH_MEDIA_IM_EXPAND",
  24987. // "RICH_MEDIA_INPAGE_FLOATING",
  24988. // "RICH_MEDIA_MOBILE_IN_APP",
  24989. // "RICH_MEDIA_PEEL_DOWN",
  24990. // "TRACKING_TEXT",
  24991. // "VPAID_LINEAR_VIDEO",
  24992. // "VPAID_NON_LINEAR_VIDEO"
  24993. // ],
  24994. // "enumDescriptions": [
  24995. // "",
  24996. // "",
  24997. // "",
  24998. // "",
  24999. // "",
  25000. // "",
  25001. // "",
  25002. // "",
  25003. // "",
  25004. // "",
  25005. // "",
  25006. // "",
  25007. // "",
  25008. // "",
  25009. // "",
  25010. // "",
  25011. // "",
  25012. // "",
  25013. // "",
  25014. // "",
  25015. // "",
  25016. // "",
  25017. // "",
  25018. // "",
  25019. // ""
  25020. // ],
  25021. // "location": "query",
  25022. // "repeated": true,
  25023. // "type": "string"
  25024. // }
  25025. // },
  25026. // "path": "userprofiles/{profileId}/creatives",
  25027. // "response": {
  25028. // "$ref": "CreativesListResponse"
  25029. // },
  25030. // "scopes": [
  25031. // "https://www.googleapis.com/auth/dfatrafficking"
  25032. // ]
  25033. // }
  25034. }
  25035. // Pages invokes f for each page of results.
  25036. // A non-nil error returned from f will halt the iteration.
  25037. // The provided context supersedes any context provided to the Context method.
  25038. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  25039. c.ctx_ = ctx
  25040. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25041. for {
  25042. x, err := c.Do()
  25043. if err != nil {
  25044. return err
  25045. }
  25046. if err := f(x); err != nil {
  25047. return err
  25048. }
  25049. if x.NextPageToken == "" {
  25050. return nil
  25051. }
  25052. c.PageToken(x.NextPageToken)
  25053. }
  25054. }
  25055. // method id "dfareporting.creatives.patch":
  25056. type CreativesPatchCall struct {
  25057. s *Service
  25058. profileId int64
  25059. creative *Creative
  25060. urlParams_ gensupport.URLParams
  25061. ctx_ context.Context
  25062. header_ http.Header
  25063. }
  25064. // Patch: Updates an existing creative. This method supports patch
  25065. // semantics.
  25066. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  25067. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25068. c.profileId = profileId
  25069. c.urlParams_.Set("id", fmt.Sprint(id))
  25070. c.creative = creative
  25071. return c
  25072. }
  25073. // Fields allows partial responses to be retrieved. See
  25074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25075. // for more information.
  25076. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  25077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25078. return c
  25079. }
  25080. // Context sets the context to be used in this call's Do method. Any
  25081. // pending HTTP request will be aborted if the provided context is
  25082. // canceled.
  25083. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  25084. c.ctx_ = ctx
  25085. return c
  25086. }
  25087. // Header returns an http.Header that can be modified by the caller to
  25088. // add HTTP headers to the request.
  25089. func (c *CreativesPatchCall) Header() http.Header {
  25090. if c.header_ == nil {
  25091. c.header_ = make(http.Header)
  25092. }
  25093. return c.header_
  25094. }
  25095. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  25096. reqHeaders := make(http.Header)
  25097. for k, v := range c.header_ {
  25098. reqHeaders[k] = v
  25099. }
  25100. reqHeaders.Set("User-Agent", c.s.userAgent())
  25101. var body io.Reader = nil
  25102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25103. if err != nil {
  25104. return nil, err
  25105. }
  25106. reqHeaders.Set("Content-Type", "application/json")
  25107. c.urlParams_.Set("alt", alt)
  25108. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25109. urls += "?" + c.urlParams_.Encode()
  25110. req, _ := http.NewRequest("PATCH", urls, body)
  25111. req.Header = reqHeaders
  25112. googleapi.Expand(req.URL, map[string]string{
  25113. "profileId": strconv.FormatInt(c.profileId, 10),
  25114. })
  25115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25116. }
  25117. // Do executes the "dfareporting.creatives.patch" call.
  25118. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25119. // code is an error. Response headers are in either
  25120. // *Creative.ServerResponse.Header or (if a response was returned at
  25121. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25122. // to check whether the returned error was because
  25123. // http.StatusNotModified was returned.
  25124. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25125. gensupport.SetOptions(c.urlParams_, opts...)
  25126. res, err := c.doRequest("json")
  25127. if res != nil && res.StatusCode == http.StatusNotModified {
  25128. if res.Body != nil {
  25129. res.Body.Close()
  25130. }
  25131. return nil, &googleapi.Error{
  25132. Code: res.StatusCode,
  25133. Header: res.Header,
  25134. }
  25135. }
  25136. if err != nil {
  25137. return nil, err
  25138. }
  25139. defer googleapi.CloseBody(res)
  25140. if err := googleapi.CheckResponse(res); err != nil {
  25141. return nil, err
  25142. }
  25143. ret := &Creative{
  25144. ServerResponse: googleapi.ServerResponse{
  25145. Header: res.Header,
  25146. HTTPStatusCode: res.StatusCode,
  25147. },
  25148. }
  25149. target := &ret
  25150. if err := gensupport.DecodeResponse(target, res); err != nil {
  25151. return nil, err
  25152. }
  25153. return ret, nil
  25154. // {
  25155. // "description": "Updates an existing creative. This method supports patch semantics.",
  25156. // "httpMethod": "PATCH",
  25157. // "id": "dfareporting.creatives.patch",
  25158. // "parameterOrder": [
  25159. // "profileId",
  25160. // "id"
  25161. // ],
  25162. // "parameters": {
  25163. // "id": {
  25164. // "description": "Creative ID.",
  25165. // "format": "int64",
  25166. // "location": "query",
  25167. // "required": true,
  25168. // "type": "string"
  25169. // },
  25170. // "profileId": {
  25171. // "description": "User profile ID associated with this request.",
  25172. // "format": "int64",
  25173. // "location": "path",
  25174. // "required": true,
  25175. // "type": "string"
  25176. // }
  25177. // },
  25178. // "path": "userprofiles/{profileId}/creatives",
  25179. // "request": {
  25180. // "$ref": "Creative"
  25181. // },
  25182. // "response": {
  25183. // "$ref": "Creative"
  25184. // },
  25185. // "scopes": [
  25186. // "https://www.googleapis.com/auth/dfatrafficking"
  25187. // ]
  25188. // }
  25189. }
  25190. // method id "dfareporting.creatives.update":
  25191. type CreativesUpdateCall struct {
  25192. s *Service
  25193. profileId int64
  25194. creative *Creative
  25195. urlParams_ gensupport.URLParams
  25196. ctx_ context.Context
  25197. header_ http.Header
  25198. }
  25199. // Update: Updates an existing creative.
  25200. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  25201. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25202. c.profileId = profileId
  25203. c.creative = creative
  25204. return c
  25205. }
  25206. // Fields allows partial responses to be retrieved. See
  25207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25208. // for more information.
  25209. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  25210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25211. return c
  25212. }
  25213. // Context sets the context to be used in this call's Do method. Any
  25214. // pending HTTP request will be aborted if the provided context is
  25215. // canceled.
  25216. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  25217. c.ctx_ = ctx
  25218. return c
  25219. }
  25220. // Header returns an http.Header that can be modified by the caller to
  25221. // add HTTP headers to the request.
  25222. func (c *CreativesUpdateCall) Header() http.Header {
  25223. if c.header_ == nil {
  25224. c.header_ = make(http.Header)
  25225. }
  25226. return c.header_
  25227. }
  25228. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  25229. reqHeaders := make(http.Header)
  25230. for k, v := range c.header_ {
  25231. reqHeaders[k] = v
  25232. }
  25233. reqHeaders.Set("User-Agent", c.s.userAgent())
  25234. var body io.Reader = nil
  25235. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25236. if err != nil {
  25237. return nil, err
  25238. }
  25239. reqHeaders.Set("Content-Type", "application/json")
  25240. c.urlParams_.Set("alt", alt)
  25241. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25242. urls += "?" + c.urlParams_.Encode()
  25243. req, _ := http.NewRequest("PUT", urls, body)
  25244. req.Header = reqHeaders
  25245. googleapi.Expand(req.URL, map[string]string{
  25246. "profileId": strconv.FormatInt(c.profileId, 10),
  25247. })
  25248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25249. }
  25250. // Do executes the "dfareporting.creatives.update" call.
  25251. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25252. // code is an error. Response headers are in either
  25253. // *Creative.ServerResponse.Header or (if a response was returned at
  25254. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25255. // to check whether the returned error was because
  25256. // http.StatusNotModified was returned.
  25257. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25258. gensupport.SetOptions(c.urlParams_, opts...)
  25259. res, err := c.doRequest("json")
  25260. if res != nil && res.StatusCode == http.StatusNotModified {
  25261. if res.Body != nil {
  25262. res.Body.Close()
  25263. }
  25264. return nil, &googleapi.Error{
  25265. Code: res.StatusCode,
  25266. Header: res.Header,
  25267. }
  25268. }
  25269. if err != nil {
  25270. return nil, err
  25271. }
  25272. defer googleapi.CloseBody(res)
  25273. if err := googleapi.CheckResponse(res); err != nil {
  25274. return nil, err
  25275. }
  25276. ret := &Creative{
  25277. ServerResponse: googleapi.ServerResponse{
  25278. Header: res.Header,
  25279. HTTPStatusCode: res.StatusCode,
  25280. },
  25281. }
  25282. target := &ret
  25283. if err := gensupport.DecodeResponse(target, res); err != nil {
  25284. return nil, err
  25285. }
  25286. return ret, nil
  25287. // {
  25288. // "description": "Updates an existing creative.",
  25289. // "httpMethod": "PUT",
  25290. // "id": "dfareporting.creatives.update",
  25291. // "parameterOrder": [
  25292. // "profileId"
  25293. // ],
  25294. // "parameters": {
  25295. // "profileId": {
  25296. // "description": "User profile ID associated with this request.",
  25297. // "format": "int64",
  25298. // "location": "path",
  25299. // "required": true,
  25300. // "type": "string"
  25301. // }
  25302. // },
  25303. // "path": "userprofiles/{profileId}/creatives",
  25304. // "request": {
  25305. // "$ref": "Creative"
  25306. // },
  25307. // "response": {
  25308. // "$ref": "Creative"
  25309. // },
  25310. // "scopes": [
  25311. // "https://www.googleapis.com/auth/dfatrafficking"
  25312. // ]
  25313. // }
  25314. }
  25315. // method id "dfareporting.dimensionValues.query":
  25316. type DimensionValuesQueryCall struct {
  25317. s *Service
  25318. profileId int64
  25319. dimensionvaluerequest *DimensionValueRequest
  25320. urlParams_ gensupport.URLParams
  25321. ctx_ context.Context
  25322. header_ http.Header
  25323. }
  25324. // Query: Retrieves list of report dimension values for a list of
  25325. // filters.
  25326. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  25327. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25328. c.profileId = profileId
  25329. c.dimensionvaluerequest = dimensionvaluerequest
  25330. return c
  25331. }
  25332. // MaxResults sets the optional parameter "maxResults": Maximum number
  25333. // of results to return.
  25334. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  25335. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25336. return c
  25337. }
  25338. // PageToken sets the optional parameter "pageToken": The value of the
  25339. // nextToken from the previous result page.
  25340. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  25341. c.urlParams_.Set("pageToken", pageToken)
  25342. return c
  25343. }
  25344. // Fields allows partial responses to be retrieved. See
  25345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25346. // for more information.
  25347. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  25348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25349. return c
  25350. }
  25351. // Context sets the context to be used in this call's Do method. Any
  25352. // pending HTTP request will be aborted if the provided context is
  25353. // canceled.
  25354. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  25355. c.ctx_ = ctx
  25356. return c
  25357. }
  25358. // Header returns an http.Header that can be modified by the caller to
  25359. // add HTTP headers to the request.
  25360. func (c *DimensionValuesQueryCall) Header() http.Header {
  25361. if c.header_ == nil {
  25362. c.header_ = make(http.Header)
  25363. }
  25364. return c.header_
  25365. }
  25366. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  25367. reqHeaders := make(http.Header)
  25368. for k, v := range c.header_ {
  25369. reqHeaders[k] = v
  25370. }
  25371. reqHeaders.Set("User-Agent", c.s.userAgent())
  25372. var body io.Reader = nil
  25373. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  25374. if err != nil {
  25375. return nil, err
  25376. }
  25377. reqHeaders.Set("Content-Type", "application/json")
  25378. c.urlParams_.Set("alt", alt)
  25379. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  25380. urls += "?" + c.urlParams_.Encode()
  25381. req, _ := http.NewRequest("POST", urls, body)
  25382. req.Header = reqHeaders
  25383. googleapi.Expand(req.URL, map[string]string{
  25384. "profileId": strconv.FormatInt(c.profileId, 10),
  25385. })
  25386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25387. }
  25388. // Do executes the "dfareporting.dimensionValues.query" call.
  25389. // Exactly one of *DimensionValueList or error will be non-nil. Any
  25390. // non-2xx status code is an error. Response headers are in either
  25391. // *DimensionValueList.ServerResponse.Header or (if a response was
  25392. // returned at all) in error.(*googleapi.Error).Header. Use
  25393. // googleapi.IsNotModified to check whether the returned error was
  25394. // because http.StatusNotModified was returned.
  25395. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  25396. gensupport.SetOptions(c.urlParams_, opts...)
  25397. res, err := c.doRequest("json")
  25398. if res != nil && res.StatusCode == http.StatusNotModified {
  25399. if res.Body != nil {
  25400. res.Body.Close()
  25401. }
  25402. return nil, &googleapi.Error{
  25403. Code: res.StatusCode,
  25404. Header: res.Header,
  25405. }
  25406. }
  25407. if err != nil {
  25408. return nil, err
  25409. }
  25410. defer googleapi.CloseBody(res)
  25411. if err := googleapi.CheckResponse(res); err != nil {
  25412. return nil, err
  25413. }
  25414. ret := &DimensionValueList{
  25415. ServerResponse: googleapi.ServerResponse{
  25416. Header: res.Header,
  25417. HTTPStatusCode: res.StatusCode,
  25418. },
  25419. }
  25420. target := &ret
  25421. if err := gensupport.DecodeResponse(target, res); err != nil {
  25422. return nil, err
  25423. }
  25424. return ret, nil
  25425. // {
  25426. // "description": "Retrieves list of report dimension values for a list of filters.",
  25427. // "httpMethod": "POST",
  25428. // "id": "dfareporting.dimensionValues.query",
  25429. // "parameterOrder": [
  25430. // "profileId"
  25431. // ],
  25432. // "parameters": {
  25433. // "maxResults": {
  25434. // "default": "100",
  25435. // "description": "Maximum number of results to return.",
  25436. // "format": "int32",
  25437. // "location": "query",
  25438. // "maximum": "100",
  25439. // "minimum": "0",
  25440. // "type": "integer"
  25441. // },
  25442. // "pageToken": {
  25443. // "description": "The value of the nextToken from the previous result page.",
  25444. // "location": "query",
  25445. // "type": "string"
  25446. // },
  25447. // "profileId": {
  25448. // "description": "The DFA user profile ID.",
  25449. // "format": "int64",
  25450. // "location": "path",
  25451. // "required": true,
  25452. // "type": "string"
  25453. // }
  25454. // },
  25455. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  25456. // "request": {
  25457. // "$ref": "DimensionValueRequest"
  25458. // },
  25459. // "response": {
  25460. // "$ref": "DimensionValueList"
  25461. // },
  25462. // "scopes": [
  25463. // "https://www.googleapis.com/auth/dfareporting"
  25464. // ]
  25465. // }
  25466. }
  25467. // Pages invokes f for each page of results.
  25468. // A non-nil error returned from f will halt the iteration.
  25469. // The provided context supersedes any context provided to the Context method.
  25470. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  25471. c.ctx_ = ctx
  25472. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25473. for {
  25474. x, err := c.Do()
  25475. if err != nil {
  25476. return err
  25477. }
  25478. if err := f(x); err != nil {
  25479. return err
  25480. }
  25481. if x.NextPageToken == "" {
  25482. return nil
  25483. }
  25484. c.PageToken(x.NextPageToken)
  25485. }
  25486. }
  25487. // method id "dfareporting.directorySiteContacts.get":
  25488. type DirectorySiteContactsGetCall struct {
  25489. s *Service
  25490. profileId int64
  25491. id int64
  25492. urlParams_ gensupport.URLParams
  25493. ifNoneMatch_ string
  25494. ctx_ context.Context
  25495. header_ http.Header
  25496. }
  25497. // Get: Gets one directory site contact by ID.
  25498. func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall {
  25499. c := &DirectorySiteContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25500. c.profileId = profileId
  25501. c.id = id
  25502. return c
  25503. }
  25504. // Fields allows partial responses to be retrieved. See
  25505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25506. // for more information.
  25507. func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall {
  25508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25509. return c
  25510. }
  25511. // IfNoneMatch sets the optional parameter which makes the operation
  25512. // fail if the object's ETag matches the given value. This is useful for
  25513. // getting updates only after the object has changed since the last
  25514. // request. Use googleapi.IsNotModified to check whether the response
  25515. // error from Do is the result of In-None-Match.
  25516. func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall {
  25517. c.ifNoneMatch_ = entityTag
  25518. return c
  25519. }
  25520. // Context sets the context to be used in this call's Do method. Any
  25521. // pending HTTP request will be aborted if the provided context is
  25522. // canceled.
  25523. func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall {
  25524. c.ctx_ = ctx
  25525. return c
  25526. }
  25527. // Header returns an http.Header that can be modified by the caller to
  25528. // add HTTP headers to the request.
  25529. func (c *DirectorySiteContactsGetCall) Header() http.Header {
  25530. if c.header_ == nil {
  25531. c.header_ = make(http.Header)
  25532. }
  25533. return c.header_
  25534. }
  25535. func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) {
  25536. reqHeaders := make(http.Header)
  25537. for k, v := range c.header_ {
  25538. reqHeaders[k] = v
  25539. }
  25540. reqHeaders.Set("User-Agent", c.s.userAgent())
  25541. if c.ifNoneMatch_ != "" {
  25542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25543. }
  25544. var body io.Reader = nil
  25545. c.urlParams_.Set("alt", alt)
  25546. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}")
  25547. urls += "?" + c.urlParams_.Encode()
  25548. req, _ := http.NewRequest("GET", urls, body)
  25549. req.Header = reqHeaders
  25550. googleapi.Expand(req.URL, map[string]string{
  25551. "profileId": strconv.FormatInt(c.profileId, 10),
  25552. "id": strconv.FormatInt(c.id, 10),
  25553. })
  25554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25555. }
  25556. // Do executes the "dfareporting.directorySiteContacts.get" call.
  25557. // Exactly one of *DirectorySiteContact or error will be non-nil. Any
  25558. // non-2xx status code is an error. Response headers are in either
  25559. // *DirectorySiteContact.ServerResponse.Header or (if a response was
  25560. // returned at all) in error.(*googleapi.Error).Header. Use
  25561. // googleapi.IsNotModified to check whether the returned error was
  25562. // because http.StatusNotModified was returned.
  25563. func (c *DirectorySiteContactsGetCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContact, error) {
  25564. gensupport.SetOptions(c.urlParams_, opts...)
  25565. res, err := c.doRequest("json")
  25566. if res != nil && res.StatusCode == http.StatusNotModified {
  25567. if res.Body != nil {
  25568. res.Body.Close()
  25569. }
  25570. return nil, &googleapi.Error{
  25571. Code: res.StatusCode,
  25572. Header: res.Header,
  25573. }
  25574. }
  25575. if err != nil {
  25576. return nil, err
  25577. }
  25578. defer googleapi.CloseBody(res)
  25579. if err := googleapi.CheckResponse(res); err != nil {
  25580. return nil, err
  25581. }
  25582. ret := &DirectorySiteContact{
  25583. ServerResponse: googleapi.ServerResponse{
  25584. Header: res.Header,
  25585. HTTPStatusCode: res.StatusCode,
  25586. },
  25587. }
  25588. target := &ret
  25589. if err := gensupport.DecodeResponse(target, res); err != nil {
  25590. return nil, err
  25591. }
  25592. return ret, nil
  25593. // {
  25594. // "description": "Gets one directory site contact by ID.",
  25595. // "httpMethod": "GET",
  25596. // "id": "dfareporting.directorySiteContacts.get",
  25597. // "parameterOrder": [
  25598. // "profileId",
  25599. // "id"
  25600. // ],
  25601. // "parameters": {
  25602. // "id": {
  25603. // "description": "Directory site contact ID.",
  25604. // "format": "int64",
  25605. // "location": "path",
  25606. // "required": true,
  25607. // "type": "string"
  25608. // },
  25609. // "profileId": {
  25610. // "description": "User profile ID associated with this request.",
  25611. // "format": "int64",
  25612. // "location": "path",
  25613. // "required": true,
  25614. // "type": "string"
  25615. // }
  25616. // },
  25617. // "path": "userprofiles/{profileId}/directorySiteContacts/{id}",
  25618. // "response": {
  25619. // "$ref": "DirectorySiteContact"
  25620. // },
  25621. // "scopes": [
  25622. // "https://www.googleapis.com/auth/dfatrafficking"
  25623. // ]
  25624. // }
  25625. }
  25626. // method id "dfareporting.directorySiteContacts.list":
  25627. type DirectorySiteContactsListCall struct {
  25628. s *Service
  25629. profileId int64
  25630. urlParams_ gensupport.URLParams
  25631. ifNoneMatch_ string
  25632. ctx_ context.Context
  25633. header_ http.Header
  25634. }
  25635. // List: Retrieves a list of directory site contacts, possibly filtered.
  25636. // This method supports paging.
  25637. func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall {
  25638. c := &DirectorySiteContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25639. c.profileId = profileId
  25640. return c
  25641. }
  25642. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  25643. // Select only directory site contacts with these directory site IDs.
  25644. // This is a required field.
  25645. func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds ...int64) *DirectorySiteContactsListCall {
  25646. var directorySiteIds_ []string
  25647. for _, v := range directorySiteIds {
  25648. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  25649. }
  25650. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  25651. return c
  25652. }
  25653. // Ids sets the optional parameter "ids": Select only directory site
  25654. // contacts with these IDs.
  25655. func (c *DirectorySiteContactsListCall) Ids(ids ...int64) *DirectorySiteContactsListCall {
  25656. var ids_ []string
  25657. for _, v := range ids {
  25658. ids_ = append(ids_, fmt.Sprint(v))
  25659. }
  25660. c.urlParams_.SetMulti("ids", ids_)
  25661. return c
  25662. }
  25663. // MaxResults sets the optional parameter "maxResults": Maximum number
  25664. // of results to return.
  25665. func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall {
  25666. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25667. return c
  25668. }
  25669. // PageToken sets the optional parameter "pageToken": Value of the
  25670. // nextPageToken from the previous result page.
  25671. func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall {
  25672. c.urlParams_.Set("pageToken", pageToken)
  25673. return c
  25674. }
  25675. // SearchString sets the optional parameter "searchString": Allows
  25676. // searching for objects by name, ID or email. Wildcards (*) are
  25677. // allowed. For example, "directory site contact*2015" will return
  25678. // objects with names like "directory site contact June 2015",
  25679. // "directory site contact April 2015", or simply "directory site
  25680. // contact 2015". Most of the searches also add wildcards implicitly at
  25681. // the start and the end of the search string. For example, a search
  25682. // string of "directory site contact" will match objects with name "my
  25683. // directory site contact", "directory site contact 2015", or simply
  25684. // "directory site contact".
  25685. func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall {
  25686. c.urlParams_.Set("searchString", searchString)
  25687. return c
  25688. }
  25689. // SortField sets the optional parameter "sortField": Field by which to
  25690. // sort the list.
  25691. //
  25692. // Possible values:
  25693. // "ID" (default)
  25694. // "NAME"
  25695. func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall {
  25696. c.urlParams_.Set("sortField", sortField)
  25697. return c
  25698. }
  25699. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  25700. // results.
  25701. //
  25702. // Possible values:
  25703. // "ASCENDING" (default)
  25704. // "DESCENDING"
  25705. func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall {
  25706. c.urlParams_.Set("sortOrder", sortOrder)
  25707. return c
  25708. }
  25709. // Fields allows partial responses to be retrieved. See
  25710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25711. // for more information.
  25712. func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall {
  25713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25714. return c
  25715. }
  25716. // IfNoneMatch sets the optional parameter which makes the operation
  25717. // fail if the object's ETag matches the given value. This is useful for
  25718. // getting updates only after the object has changed since the last
  25719. // request. Use googleapi.IsNotModified to check whether the response
  25720. // error from Do is the result of In-None-Match.
  25721. func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall {
  25722. c.ifNoneMatch_ = entityTag
  25723. return c
  25724. }
  25725. // Context sets the context to be used in this call's Do method. Any
  25726. // pending HTTP request will be aborted if the provided context is
  25727. // canceled.
  25728. func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall {
  25729. c.ctx_ = ctx
  25730. return c
  25731. }
  25732. // Header returns an http.Header that can be modified by the caller to
  25733. // add HTTP headers to the request.
  25734. func (c *DirectorySiteContactsListCall) Header() http.Header {
  25735. if c.header_ == nil {
  25736. c.header_ = make(http.Header)
  25737. }
  25738. return c.header_
  25739. }
  25740. func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) {
  25741. reqHeaders := make(http.Header)
  25742. for k, v := range c.header_ {
  25743. reqHeaders[k] = v
  25744. }
  25745. reqHeaders.Set("User-Agent", c.s.userAgent())
  25746. if c.ifNoneMatch_ != "" {
  25747. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25748. }
  25749. var body io.Reader = nil
  25750. c.urlParams_.Set("alt", alt)
  25751. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts")
  25752. urls += "?" + c.urlParams_.Encode()
  25753. req, _ := http.NewRequest("GET", urls, body)
  25754. req.Header = reqHeaders
  25755. googleapi.Expand(req.URL, map[string]string{
  25756. "profileId": strconv.FormatInt(c.profileId, 10),
  25757. })
  25758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25759. }
  25760. // Do executes the "dfareporting.directorySiteContacts.list" call.
  25761. // Exactly one of *DirectorySiteContactsListResponse or error will be
  25762. // non-nil. Any non-2xx status code is an error. Response headers are in
  25763. // either *DirectorySiteContactsListResponse.ServerResponse.Header or
  25764. // (if a response was returned at all) in
  25765. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  25766. // whether the returned error was because http.StatusNotModified was
  25767. // returned.
  25768. func (c *DirectorySiteContactsListCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContactsListResponse, error) {
  25769. gensupport.SetOptions(c.urlParams_, opts...)
  25770. res, err := c.doRequest("json")
  25771. if res != nil && res.StatusCode == http.StatusNotModified {
  25772. if res.Body != nil {
  25773. res.Body.Close()
  25774. }
  25775. return nil, &googleapi.Error{
  25776. Code: res.StatusCode,
  25777. Header: res.Header,
  25778. }
  25779. }
  25780. if err != nil {
  25781. return nil, err
  25782. }
  25783. defer googleapi.CloseBody(res)
  25784. if err := googleapi.CheckResponse(res); err != nil {
  25785. return nil, err
  25786. }
  25787. ret := &DirectorySiteContactsListResponse{
  25788. ServerResponse: googleapi.ServerResponse{
  25789. Header: res.Header,
  25790. HTTPStatusCode: res.StatusCode,
  25791. },
  25792. }
  25793. target := &ret
  25794. if err := gensupport.DecodeResponse(target, res); err != nil {
  25795. return nil, err
  25796. }
  25797. return ret, nil
  25798. // {
  25799. // "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.",
  25800. // "httpMethod": "GET",
  25801. // "id": "dfareporting.directorySiteContacts.list",
  25802. // "parameterOrder": [
  25803. // "profileId"
  25804. // ],
  25805. // "parameters": {
  25806. // "directorySiteIds": {
  25807. // "description": "Select only directory site contacts with these directory site IDs. This is a required field.",
  25808. // "format": "int64",
  25809. // "location": "query",
  25810. // "repeated": true,
  25811. // "type": "string"
  25812. // },
  25813. // "ids": {
  25814. // "description": "Select only directory site contacts with these IDs.",
  25815. // "format": "int64",
  25816. // "location": "query",
  25817. // "repeated": true,
  25818. // "type": "string"
  25819. // },
  25820. // "maxResults": {
  25821. // "default": "1000",
  25822. // "description": "Maximum number of results to return.",
  25823. // "format": "int32",
  25824. // "location": "query",
  25825. // "maximum": "1000",
  25826. // "minimum": "0",
  25827. // "type": "integer"
  25828. // },
  25829. // "pageToken": {
  25830. // "description": "Value of the nextPageToken from the previous result page.",
  25831. // "location": "query",
  25832. // "type": "string"
  25833. // },
  25834. // "profileId": {
  25835. // "description": "User profile ID associated with this request.",
  25836. // "format": "int64",
  25837. // "location": "path",
  25838. // "required": true,
  25839. // "type": "string"
  25840. // },
  25841. // "searchString": {
  25842. // "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\".",
  25843. // "location": "query",
  25844. // "type": "string"
  25845. // },
  25846. // "sortField": {
  25847. // "default": "ID",
  25848. // "description": "Field by which to sort the list.",
  25849. // "enum": [
  25850. // "ID",
  25851. // "NAME"
  25852. // ],
  25853. // "enumDescriptions": [
  25854. // "",
  25855. // ""
  25856. // ],
  25857. // "location": "query",
  25858. // "type": "string"
  25859. // },
  25860. // "sortOrder": {
  25861. // "default": "ASCENDING",
  25862. // "description": "Order of sorted results.",
  25863. // "enum": [
  25864. // "ASCENDING",
  25865. // "DESCENDING"
  25866. // ],
  25867. // "enumDescriptions": [
  25868. // "",
  25869. // ""
  25870. // ],
  25871. // "location": "query",
  25872. // "type": "string"
  25873. // }
  25874. // },
  25875. // "path": "userprofiles/{profileId}/directorySiteContacts",
  25876. // "response": {
  25877. // "$ref": "DirectorySiteContactsListResponse"
  25878. // },
  25879. // "scopes": [
  25880. // "https://www.googleapis.com/auth/dfatrafficking"
  25881. // ]
  25882. // }
  25883. }
  25884. // Pages invokes f for each page of results.
  25885. // A non-nil error returned from f will halt the iteration.
  25886. // The provided context supersedes any context provided to the Context method.
  25887. func (c *DirectorySiteContactsListCall) Pages(ctx context.Context, f func(*DirectorySiteContactsListResponse) error) error {
  25888. c.ctx_ = ctx
  25889. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25890. for {
  25891. x, err := c.Do()
  25892. if err != nil {
  25893. return err
  25894. }
  25895. if err := f(x); err != nil {
  25896. return err
  25897. }
  25898. if x.NextPageToken == "" {
  25899. return nil
  25900. }
  25901. c.PageToken(x.NextPageToken)
  25902. }
  25903. }
  25904. // method id "dfareporting.directorySites.get":
  25905. type DirectorySitesGetCall struct {
  25906. s *Service
  25907. profileId int64
  25908. id int64
  25909. urlParams_ gensupport.URLParams
  25910. ifNoneMatch_ string
  25911. ctx_ context.Context
  25912. header_ http.Header
  25913. }
  25914. // Get: Gets one directory site by ID.
  25915. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  25916. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25917. c.profileId = profileId
  25918. c.id = id
  25919. return c
  25920. }
  25921. // Fields allows partial responses to be retrieved. See
  25922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25923. // for more information.
  25924. func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  25925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25926. return c
  25927. }
  25928. // IfNoneMatch sets the optional parameter which makes the operation
  25929. // fail if the object's ETag matches the given value. This is useful for
  25930. // getting updates only after the object has changed since the last
  25931. // request. Use googleapi.IsNotModified to check whether the response
  25932. // error from Do is the result of In-None-Match.
  25933. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  25934. c.ifNoneMatch_ = entityTag
  25935. return c
  25936. }
  25937. // Context sets the context to be used in this call's Do method. Any
  25938. // pending HTTP request will be aborted if the provided context is
  25939. // canceled.
  25940. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  25941. c.ctx_ = ctx
  25942. return c
  25943. }
  25944. // Header returns an http.Header that can be modified by the caller to
  25945. // add HTTP headers to the request.
  25946. func (c *DirectorySitesGetCall) Header() http.Header {
  25947. if c.header_ == nil {
  25948. c.header_ = make(http.Header)
  25949. }
  25950. return c.header_
  25951. }
  25952. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  25953. reqHeaders := make(http.Header)
  25954. for k, v := range c.header_ {
  25955. reqHeaders[k] = v
  25956. }
  25957. reqHeaders.Set("User-Agent", c.s.userAgent())
  25958. if c.ifNoneMatch_ != "" {
  25959. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25960. }
  25961. var body io.Reader = nil
  25962. c.urlParams_.Set("alt", alt)
  25963. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  25964. urls += "?" + c.urlParams_.Encode()
  25965. req, _ := http.NewRequest("GET", urls, body)
  25966. req.Header = reqHeaders
  25967. googleapi.Expand(req.URL, map[string]string{
  25968. "profileId": strconv.FormatInt(c.profileId, 10),
  25969. "id": strconv.FormatInt(c.id, 10),
  25970. })
  25971. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25972. }
  25973. // Do executes the "dfareporting.directorySites.get" call.
  25974. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  25975. // status code is an error. Response headers are in either
  25976. // *DirectorySite.ServerResponse.Header or (if a response was returned
  25977. // at all) in error.(*googleapi.Error).Header. Use
  25978. // googleapi.IsNotModified to check whether the returned error was
  25979. // because http.StatusNotModified was returned.
  25980. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  25981. gensupport.SetOptions(c.urlParams_, opts...)
  25982. res, err := c.doRequest("json")
  25983. if res != nil && res.StatusCode == http.StatusNotModified {
  25984. if res.Body != nil {
  25985. res.Body.Close()
  25986. }
  25987. return nil, &googleapi.Error{
  25988. Code: res.StatusCode,
  25989. Header: res.Header,
  25990. }
  25991. }
  25992. if err != nil {
  25993. return nil, err
  25994. }
  25995. defer googleapi.CloseBody(res)
  25996. if err := googleapi.CheckResponse(res); err != nil {
  25997. return nil, err
  25998. }
  25999. ret := &DirectorySite{
  26000. ServerResponse: googleapi.ServerResponse{
  26001. Header: res.Header,
  26002. HTTPStatusCode: res.StatusCode,
  26003. },
  26004. }
  26005. target := &ret
  26006. if err := gensupport.DecodeResponse(target, res); err != nil {
  26007. return nil, err
  26008. }
  26009. return ret, nil
  26010. // {
  26011. // "description": "Gets one directory site by ID.",
  26012. // "httpMethod": "GET",
  26013. // "id": "dfareporting.directorySites.get",
  26014. // "parameterOrder": [
  26015. // "profileId",
  26016. // "id"
  26017. // ],
  26018. // "parameters": {
  26019. // "id": {
  26020. // "description": "Directory site ID.",
  26021. // "format": "int64",
  26022. // "location": "path",
  26023. // "required": true,
  26024. // "type": "string"
  26025. // },
  26026. // "profileId": {
  26027. // "description": "User profile ID associated with this request.",
  26028. // "format": "int64",
  26029. // "location": "path",
  26030. // "required": true,
  26031. // "type": "string"
  26032. // }
  26033. // },
  26034. // "path": "userprofiles/{profileId}/directorySites/{id}",
  26035. // "response": {
  26036. // "$ref": "DirectorySite"
  26037. // },
  26038. // "scopes": [
  26039. // "https://www.googleapis.com/auth/dfatrafficking"
  26040. // ]
  26041. // }
  26042. }
  26043. // method id "dfareporting.directorySites.insert":
  26044. type DirectorySitesInsertCall struct {
  26045. s *Service
  26046. profileId int64
  26047. directorysite *DirectorySite
  26048. urlParams_ gensupport.URLParams
  26049. ctx_ context.Context
  26050. header_ http.Header
  26051. }
  26052. // Insert: Inserts a new directory site.
  26053. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  26054. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26055. c.profileId = profileId
  26056. c.directorysite = directorysite
  26057. return c
  26058. }
  26059. // Fields allows partial responses to be retrieved. See
  26060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26061. // for more information.
  26062. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  26063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26064. return c
  26065. }
  26066. // Context sets the context to be used in this call's Do method. Any
  26067. // pending HTTP request will be aborted if the provided context is
  26068. // canceled.
  26069. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  26070. c.ctx_ = ctx
  26071. return c
  26072. }
  26073. // Header returns an http.Header that can be modified by the caller to
  26074. // add HTTP headers to the request.
  26075. func (c *DirectorySitesInsertCall) Header() http.Header {
  26076. if c.header_ == nil {
  26077. c.header_ = make(http.Header)
  26078. }
  26079. return c.header_
  26080. }
  26081. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  26082. reqHeaders := make(http.Header)
  26083. for k, v := range c.header_ {
  26084. reqHeaders[k] = v
  26085. }
  26086. reqHeaders.Set("User-Agent", c.s.userAgent())
  26087. var body io.Reader = nil
  26088. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  26089. if err != nil {
  26090. return nil, err
  26091. }
  26092. reqHeaders.Set("Content-Type", "application/json")
  26093. c.urlParams_.Set("alt", alt)
  26094. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26095. urls += "?" + c.urlParams_.Encode()
  26096. req, _ := http.NewRequest("POST", urls, body)
  26097. req.Header = reqHeaders
  26098. googleapi.Expand(req.URL, map[string]string{
  26099. "profileId": strconv.FormatInt(c.profileId, 10),
  26100. })
  26101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26102. }
  26103. // Do executes the "dfareporting.directorySites.insert" call.
  26104. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26105. // status code is an error. Response headers are in either
  26106. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26107. // at all) in error.(*googleapi.Error).Header. Use
  26108. // googleapi.IsNotModified to check whether the returned error was
  26109. // because http.StatusNotModified was returned.
  26110. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26111. gensupport.SetOptions(c.urlParams_, opts...)
  26112. res, err := c.doRequest("json")
  26113. if res != nil && res.StatusCode == http.StatusNotModified {
  26114. if res.Body != nil {
  26115. res.Body.Close()
  26116. }
  26117. return nil, &googleapi.Error{
  26118. Code: res.StatusCode,
  26119. Header: res.Header,
  26120. }
  26121. }
  26122. if err != nil {
  26123. return nil, err
  26124. }
  26125. defer googleapi.CloseBody(res)
  26126. if err := googleapi.CheckResponse(res); err != nil {
  26127. return nil, err
  26128. }
  26129. ret := &DirectorySite{
  26130. ServerResponse: googleapi.ServerResponse{
  26131. Header: res.Header,
  26132. HTTPStatusCode: res.StatusCode,
  26133. },
  26134. }
  26135. target := &ret
  26136. if err := gensupport.DecodeResponse(target, res); err != nil {
  26137. return nil, err
  26138. }
  26139. return ret, nil
  26140. // {
  26141. // "description": "Inserts a new directory site.",
  26142. // "httpMethod": "POST",
  26143. // "id": "dfareporting.directorySites.insert",
  26144. // "parameterOrder": [
  26145. // "profileId"
  26146. // ],
  26147. // "parameters": {
  26148. // "profileId": {
  26149. // "description": "User profile ID associated with this request.",
  26150. // "format": "int64",
  26151. // "location": "path",
  26152. // "required": true,
  26153. // "type": "string"
  26154. // }
  26155. // },
  26156. // "path": "userprofiles/{profileId}/directorySites",
  26157. // "request": {
  26158. // "$ref": "DirectorySite"
  26159. // },
  26160. // "response": {
  26161. // "$ref": "DirectorySite"
  26162. // },
  26163. // "scopes": [
  26164. // "https://www.googleapis.com/auth/dfatrafficking"
  26165. // ]
  26166. // }
  26167. }
  26168. // method id "dfareporting.directorySites.list":
  26169. type DirectorySitesListCall struct {
  26170. s *Service
  26171. profileId int64
  26172. urlParams_ gensupport.URLParams
  26173. ifNoneMatch_ string
  26174. ctx_ context.Context
  26175. header_ http.Header
  26176. }
  26177. // List: Retrieves a list of directory sites, possibly filtered. This
  26178. // method supports paging.
  26179. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  26180. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26181. c.profileId = profileId
  26182. return c
  26183. }
  26184. // AcceptsInStreamVideoPlacements sets the optional parameter
  26185. // "acceptsInStreamVideoPlacements": This search filter is no longer
  26186. // supported and will have no effect on the results returned.
  26187. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  26188. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  26189. return c
  26190. }
  26191. // AcceptsInterstitialPlacements sets the optional parameter
  26192. // "acceptsInterstitialPlacements": This search filter is no longer
  26193. // supported and will have no effect on the results returned.
  26194. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  26195. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  26196. return c
  26197. }
  26198. // AcceptsPublisherPaidPlacements sets the optional parameter
  26199. // "acceptsPublisherPaidPlacements": Select only directory sites that
  26200. // accept publisher paid placements. This field can be left blank.
  26201. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  26202. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  26203. return c
  26204. }
  26205. // Active sets the optional parameter "active": Select only active
  26206. // directory sites. Leave blank to retrieve both active and inactive
  26207. // directory sites.
  26208. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  26209. c.urlParams_.Set("active", fmt.Sprint(active))
  26210. return c
  26211. }
  26212. // CountryId sets the optional parameter "countryId": Select only
  26213. // directory sites with this country ID.
  26214. func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall {
  26215. c.urlParams_.Set("countryId", fmt.Sprint(countryId))
  26216. return c
  26217. }
  26218. // DfpNetworkCode sets the optional parameter "dfpNetworkCode": Select
  26219. // only directory sites with this DFP network code.
  26220. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  26221. c.urlParams_.Set("dfpNetworkCode", dfpNetworkCode)
  26222. return c
  26223. }
  26224. // Ids sets the optional parameter "ids": Select only directory sites
  26225. // with these IDs.
  26226. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  26227. var ids_ []string
  26228. for _, v := range ids {
  26229. ids_ = append(ids_, fmt.Sprint(v))
  26230. }
  26231. c.urlParams_.SetMulti("ids", ids_)
  26232. return c
  26233. }
  26234. // MaxResults sets the optional parameter "maxResults": Maximum number
  26235. // of results to return.
  26236. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  26237. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26238. return c
  26239. }
  26240. // PageToken sets the optional parameter "pageToken": Value of the
  26241. // nextPageToken from the previous result page.
  26242. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  26243. c.urlParams_.Set("pageToken", pageToken)
  26244. return c
  26245. }
  26246. // ParentId sets the optional parameter "parentId": Select only
  26247. // directory sites with this parent ID.
  26248. func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall {
  26249. c.urlParams_.Set("parentId", fmt.Sprint(parentId))
  26250. return c
  26251. }
  26252. // SearchString sets the optional parameter "searchString": Allows
  26253. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  26254. // For example, "directory site*2015" will return objects with names
  26255. // like "directory site June 2015", "directory site April 2015", or
  26256. // simply "directory site 2015". Most of the searches also add wildcards
  26257. // implicitly at the start and the end of the search string. For
  26258. // example, a search string of "directory site" will match objects with
  26259. // name "my directory site", "directory site 2015" or simply, "directory
  26260. // site".
  26261. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  26262. c.urlParams_.Set("searchString", searchString)
  26263. return c
  26264. }
  26265. // SortField sets the optional parameter "sortField": Field by which to
  26266. // sort the list.
  26267. //
  26268. // Possible values:
  26269. // "ID" (default)
  26270. // "NAME"
  26271. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  26272. c.urlParams_.Set("sortField", sortField)
  26273. return c
  26274. }
  26275. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26276. // results.
  26277. //
  26278. // Possible values:
  26279. // "ASCENDING" (default)
  26280. // "DESCENDING"
  26281. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  26282. c.urlParams_.Set("sortOrder", sortOrder)
  26283. return c
  26284. }
  26285. // Fields allows partial responses to be retrieved. See
  26286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26287. // for more information.
  26288. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  26289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26290. return c
  26291. }
  26292. // IfNoneMatch sets the optional parameter which makes the operation
  26293. // fail if the object's ETag matches the given value. This is useful for
  26294. // getting updates only after the object has changed since the last
  26295. // request. Use googleapi.IsNotModified to check whether the response
  26296. // error from Do is the result of In-None-Match.
  26297. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  26298. c.ifNoneMatch_ = entityTag
  26299. return c
  26300. }
  26301. // Context sets the context to be used in this call's Do method. Any
  26302. // pending HTTP request will be aborted if the provided context is
  26303. // canceled.
  26304. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  26305. c.ctx_ = ctx
  26306. return c
  26307. }
  26308. // Header returns an http.Header that can be modified by the caller to
  26309. // add HTTP headers to the request.
  26310. func (c *DirectorySitesListCall) Header() http.Header {
  26311. if c.header_ == nil {
  26312. c.header_ = make(http.Header)
  26313. }
  26314. return c.header_
  26315. }
  26316. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  26317. reqHeaders := make(http.Header)
  26318. for k, v := range c.header_ {
  26319. reqHeaders[k] = v
  26320. }
  26321. reqHeaders.Set("User-Agent", c.s.userAgent())
  26322. if c.ifNoneMatch_ != "" {
  26323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26324. }
  26325. var body io.Reader = nil
  26326. c.urlParams_.Set("alt", alt)
  26327. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26328. urls += "?" + c.urlParams_.Encode()
  26329. req, _ := http.NewRequest("GET", urls, body)
  26330. req.Header = reqHeaders
  26331. googleapi.Expand(req.URL, map[string]string{
  26332. "profileId": strconv.FormatInt(c.profileId, 10),
  26333. })
  26334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26335. }
  26336. // Do executes the "dfareporting.directorySites.list" call.
  26337. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  26338. // Any non-2xx status code is an error. Response headers are in either
  26339. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  26340. // was returned at all) in error.(*googleapi.Error).Header. Use
  26341. // googleapi.IsNotModified to check whether the returned error was
  26342. // because http.StatusNotModified was returned.
  26343. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  26344. gensupport.SetOptions(c.urlParams_, opts...)
  26345. res, err := c.doRequest("json")
  26346. if res != nil && res.StatusCode == http.StatusNotModified {
  26347. if res.Body != nil {
  26348. res.Body.Close()
  26349. }
  26350. return nil, &googleapi.Error{
  26351. Code: res.StatusCode,
  26352. Header: res.Header,
  26353. }
  26354. }
  26355. if err != nil {
  26356. return nil, err
  26357. }
  26358. defer googleapi.CloseBody(res)
  26359. if err := googleapi.CheckResponse(res); err != nil {
  26360. return nil, err
  26361. }
  26362. ret := &DirectorySitesListResponse{
  26363. ServerResponse: googleapi.ServerResponse{
  26364. Header: res.Header,
  26365. HTTPStatusCode: res.StatusCode,
  26366. },
  26367. }
  26368. target := &ret
  26369. if err := gensupport.DecodeResponse(target, res); err != nil {
  26370. return nil, err
  26371. }
  26372. return ret, nil
  26373. // {
  26374. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  26375. // "httpMethod": "GET",
  26376. // "id": "dfareporting.directorySites.list",
  26377. // "parameterOrder": [
  26378. // "profileId"
  26379. // ],
  26380. // "parameters": {
  26381. // "acceptsInStreamVideoPlacements": {
  26382. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26383. // "location": "query",
  26384. // "type": "boolean"
  26385. // },
  26386. // "acceptsInterstitialPlacements": {
  26387. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26388. // "location": "query",
  26389. // "type": "boolean"
  26390. // },
  26391. // "acceptsPublisherPaidPlacements": {
  26392. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  26393. // "location": "query",
  26394. // "type": "boolean"
  26395. // },
  26396. // "active": {
  26397. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  26398. // "location": "query",
  26399. // "type": "boolean"
  26400. // },
  26401. // "countryId": {
  26402. // "description": "Select only directory sites with this country ID.",
  26403. // "format": "int64",
  26404. // "location": "query",
  26405. // "type": "string"
  26406. // },
  26407. // "dfpNetworkCode": {
  26408. // "description": "Select only directory sites with this DFP network code.",
  26409. // "location": "query",
  26410. // "type": "string"
  26411. // },
  26412. // "ids": {
  26413. // "description": "Select only directory sites with these IDs.",
  26414. // "format": "int64",
  26415. // "location": "query",
  26416. // "repeated": true,
  26417. // "type": "string"
  26418. // },
  26419. // "maxResults": {
  26420. // "default": "1000",
  26421. // "description": "Maximum number of results to return.",
  26422. // "format": "int32",
  26423. // "location": "query",
  26424. // "maximum": "1000",
  26425. // "minimum": "0",
  26426. // "type": "integer"
  26427. // },
  26428. // "pageToken": {
  26429. // "description": "Value of the nextPageToken from the previous result page.",
  26430. // "location": "query",
  26431. // "type": "string"
  26432. // },
  26433. // "parentId": {
  26434. // "description": "Select only directory sites with this parent ID.",
  26435. // "format": "int64",
  26436. // "location": "query",
  26437. // "type": "string"
  26438. // },
  26439. // "profileId": {
  26440. // "description": "User profile ID associated with this request.",
  26441. // "format": "int64",
  26442. // "location": "path",
  26443. // "required": true,
  26444. // "type": "string"
  26445. // },
  26446. // "searchString": {
  26447. // "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\".",
  26448. // "location": "query",
  26449. // "type": "string"
  26450. // },
  26451. // "sortField": {
  26452. // "default": "ID",
  26453. // "description": "Field by which to sort the list.",
  26454. // "enum": [
  26455. // "ID",
  26456. // "NAME"
  26457. // ],
  26458. // "enumDescriptions": [
  26459. // "",
  26460. // ""
  26461. // ],
  26462. // "location": "query",
  26463. // "type": "string"
  26464. // },
  26465. // "sortOrder": {
  26466. // "default": "ASCENDING",
  26467. // "description": "Order of sorted results.",
  26468. // "enum": [
  26469. // "ASCENDING",
  26470. // "DESCENDING"
  26471. // ],
  26472. // "enumDescriptions": [
  26473. // "",
  26474. // ""
  26475. // ],
  26476. // "location": "query",
  26477. // "type": "string"
  26478. // }
  26479. // },
  26480. // "path": "userprofiles/{profileId}/directorySites",
  26481. // "response": {
  26482. // "$ref": "DirectorySitesListResponse"
  26483. // },
  26484. // "scopes": [
  26485. // "https://www.googleapis.com/auth/dfatrafficking"
  26486. // ]
  26487. // }
  26488. }
  26489. // Pages invokes f for each page of results.
  26490. // A non-nil error returned from f will halt the iteration.
  26491. // The provided context supersedes any context provided to the Context method.
  26492. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  26493. c.ctx_ = ctx
  26494. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26495. for {
  26496. x, err := c.Do()
  26497. if err != nil {
  26498. return err
  26499. }
  26500. if err := f(x); err != nil {
  26501. return err
  26502. }
  26503. if x.NextPageToken == "" {
  26504. return nil
  26505. }
  26506. c.PageToken(x.NextPageToken)
  26507. }
  26508. }
  26509. // method id "dfareporting.dynamicTargetingKeys.delete":
  26510. type DynamicTargetingKeysDeleteCall struct {
  26511. s *Service
  26512. profileId int64
  26513. objectId int64
  26514. urlParams_ gensupport.URLParams
  26515. ctx_ context.Context
  26516. header_ http.Header
  26517. }
  26518. // Delete: Deletes an existing dynamic targeting key.
  26519. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  26520. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26521. c.profileId = profileId
  26522. c.objectId = objectId
  26523. c.urlParams_.Set("name", name)
  26524. c.urlParams_.Set("objectType", objectType)
  26525. return c
  26526. }
  26527. // Fields allows partial responses to be retrieved. See
  26528. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26529. // for more information.
  26530. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  26531. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26532. return c
  26533. }
  26534. // Context sets the context to be used in this call's Do method. Any
  26535. // pending HTTP request will be aborted if the provided context is
  26536. // canceled.
  26537. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  26538. c.ctx_ = ctx
  26539. return c
  26540. }
  26541. // Header returns an http.Header that can be modified by the caller to
  26542. // add HTTP headers to the request.
  26543. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  26544. if c.header_ == nil {
  26545. c.header_ = make(http.Header)
  26546. }
  26547. return c.header_
  26548. }
  26549. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  26550. reqHeaders := make(http.Header)
  26551. for k, v := range c.header_ {
  26552. reqHeaders[k] = v
  26553. }
  26554. reqHeaders.Set("User-Agent", c.s.userAgent())
  26555. var body io.Reader = nil
  26556. c.urlParams_.Set("alt", alt)
  26557. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  26558. urls += "?" + c.urlParams_.Encode()
  26559. req, _ := http.NewRequest("DELETE", urls, body)
  26560. req.Header = reqHeaders
  26561. googleapi.Expand(req.URL, map[string]string{
  26562. "profileId": strconv.FormatInt(c.profileId, 10),
  26563. "objectId": strconv.FormatInt(c.objectId, 10),
  26564. })
  26565. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26566. }
  26567. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  26568. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  26569. gensupport.SetOptions(c.urlParams_, opts...)
  26570. res, err := c.doRequest("json")
  26571. if err != nil {
  26572. return err
  26573. }
  26574. defer googleapi.CloseBody(res)
  26575. if err := googleapi.CheckResponse(res); err != nil {
  26576. return err
  26577. }
  26578. return nil
  26579. // {
  26580. // "description": "Deletes an existing dynamic targeting key.",
  26581. // "httpMethod": "DELETE",
  26582. // "id": "dfareporting.dynamicTargetingKeys.delete",
  26583. // "parameterOrder": [
  26584. // "profileId",
  26585. // "objectId",
  26586. // "name",
  26587. // "objectType"
  26588. // ],
  26589. // "parameters": {
  26590. // "name": {
  26591. // "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.",
  26592. // "location": "query",
  26593. // "required": true,
  26594. // "type": "string"
  26595. // },
  26596. // "objectId": {
  26597. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  26598. // "format": "int64",
  26599. // "location": "path",
  26600. // "required": true,
  26601. // "type": "string"
  26602. // },
  26603. // "objectType": {
  26604. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  26605. // "enum": [
  26606. // "OBJECT_AD",
  26607. // "OBJECT_ADVERTISER",
  26608. // "OBJECT_CREATIVE",
  26609. // "OBJECT_PLACEMENT"
  26610. // ],
  26611. // "enumDescriptions": [
  26612. // "",
  26613. // "",
  26614. // "",
  26615. // ""
  26616. // ],
  26617. // "location": "query",
  26618. // "required": true,
  26619. // "type": "string"
  26620. // },
  26621. // "profileId": {
  26622. // "description": "User profile ID associated with this request.",
  26623. // "format": "int64",
  26624. // "location": "path",
  26625. // "required": true,
  26626. // "type": "string"
  26627. // }
  26628. // },
  26629. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  26630. // "scopes": [
  26631. // "https://www.googleapis.com/auth/dfatrafficking"
  26632. // ]
  26633. // }
  26634. }
  26635. // method id "dfareporting.dynamicTargetingKeys.insert":
  26636. type DynamicTargetingKeysInsertCall struct {
  26637. s *Service
  26638. profileId int64
  26639. dynamictargetingkey *DynamicTargetingKey
  26640. urlParams_ gensupport.URLParams
  26641. ctx_ context.Context
  26642. header_ http.Header
  26643. }
  26644. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  26645. // the advertiser level before being assigned to the advertiser's ads,
  26646. // creatives, or placements. There is a maximum of 1000 keys per
  26647. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  26648. // creative, or placement.
  26649. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  26650. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26651. c.profileId = profileId
  26652. c.dynamictargetingkey = dynamictargetingkey
  26653. return c
  26654. }
  26655. // Fields allows partial responses to be retrieved. See
  26656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26657. // for more information.
  26658. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  26659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26660. return c
  26661. }
  26662. // Context sets the context to be used in this call's Do method. Any
  26663. // pending HTTP request will be aborted if the provided context is
  26664. // canceled.
  26665. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  26666. c.ctx_ = ctx
  26667. return c
  26668. }
  26669. // Header returns an http.Header that can be modified by the caller to
  26670. // add HTTP headers to the request.
  26671. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  26672. if c.header_ == nil {
  26673. c.header_ = make(http.Header)
  26674. }
  26675. return c.header_
  26676. }
  26677. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  26678. reqHeaders := make(http.Header)
  26679. for k, v := range c.header_ {
  26680. reqHeaders[k] = v
  26681. }
  26682. reqHeaders.Set("User-Agent", c.s.userAgent())
  26683. var body io.Reader = nil
  26684. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  26685. if err != nil {
  26686. return nil, err
  26687. }
  26688. reqHeaders.Set("Content-Type", "application/json")
  26689. c.urlParams_.Set("alt", alt)
  26690. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  26691. urls += "?" + c.urlParams_.Encode()
  26692. req, _ := http.NewRequest("POST", urls, body)
  26693. req.Header = reqHeaders
  26694. googleapi.Expand(req.URL, map[string]string{
  26695. "profileId": strconv.FormatInt(c.profileId, 10),
  26696. })
  26697. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26698. }
  26699. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  26700. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  26701. // non-2xx status code is an error. Response headers are in either
  26702. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  26703. // returned at all) in error.(*googleapi.Error).Header. Use
  26704. // googleapi.IsNotModified to check whether the returned error was
  26705. // because http.StatusNotModified was returned.
  26706. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  26707. gensupport.SetOptions(c.urlParams_, opts...)
  26708. res, err := c.doRequest("json")
  26709. if res != nil && res.StatusCode == http.StatusNotModified {
  26710. if res.Body != nil {
  26711. res.Body.Close()
  26712. }
  26713. return nil, &googleapi.Error{
  26714. Code: res.StatusCode,
  26715. Header: res.Header,
  26716. }
  26717. }
  26718. if err != nil {
  26719. return nil, err
  26720. }
  26721. defer googleapi.CloseBody(res)
  26722. if err := googleapi.CheckResponse(res); err != nil {
  26723. return nil, err
  26724. }
  26725. ret := &DynamicTargetingKey{
  26726. ServerResponse: googleapi.ServerResponse{
  26727. Header: res.Header,
  26728. HTTPStatusCode: res.StatusCode,
  26729. },
  26730. }
  26731. target := &ret
  26732. if err := gensupport.DecodeResponse(target, res); err != nil {
  26733. return nil, err
  26734. }
  26735. return ret, nil
  26736. // {
  26737. // "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.",
  26738. // "httpMethod": "POST",
  26739. // "id": "dfareporting.dynamicTargetingKeys.insert",
  26740. // "parameterOrder": [
  26741. // "profileId"
  26742. // ],
  26743. // "parameters": {
  26744. // "profileId": {
  26745. // "description": "User profile ID associated with this request.",
  26746. // "format": "int64",
  26747. // "location": "path",
  26748. // "required": true,
  26749. // "type": "string"
  26750. // }
  26751. // },
  26752. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  26753. // "request": {
  26754. // "$ref": "DynamicTargetingKey"
  26755. // },
  26756. // "response": {
  26757. // "$ref": "DynamicTargetingKey"
  26758. // },
  26759. // "scopes": [
  26760. // "https://www.googleapis.com/auth/dfatrafficking"
  26761. // ]
  26762. // }
  26763. }
  26764. // method id "dfareporting.dynamicTargetingKeys.list":
  26765. type DynamicTargetingKeysListCall struct {
  26766. s *Service
  26767. profileId int64
  26768. urlParams_ gensupport.URLParams
  26769. ifNoneMatch_ string
  26770. ctx_ context.Context
  26771. header_ http.Header
  26772. }
  26773. // List: Retrieves a list of dynamic targeting keys.
  26774. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  26775. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26776. c.profileId = profileId
  26777. return c
  26778. }
  26779. // AdvertiserId sets the optional parameter "advertiserId": Select only
  26780. // dynamic targeting keys whose object has this advertiser ID.
  26781. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  26782. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  26783. return c
  26784. }
  26785. // Names sets the optional parameter "names": Select only dynamic
  26786. // targeting keys exactly matching these names.
  26787. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  26788. c.urlParams_.SetMulti("names", append([]string{}, names...))
  26789. return c
  26790. }
  26791. // ObjectId sets the optional parameter "objectId": Select only dynamic
  26792. // targeting keys with this object ID.
  26793. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  26794. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  26795. return c
  26796. }
  26797. // ObjectType sets the optional parameter "objectType": Select only
  26798. // dynamic targeting keys with this object type.
  26799. //
  26800. // Possible values:
  26801. // "OBJECT_AD"
  26802. // "OBJECT_ADVERTISER"
  26803. // "OBJECT_CREATIVE"
  26804. // "OBJECT_PLACEMENT"
  26805. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  26806. c.urlParams_.Set("objectType", objectType)
  26807. return c
  26808. }
  26809. // Fields allows partial responses to be retrieved. See
  26810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26811. // for more information.
  26812. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  26813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26814. return c
  26815. }
  26816. // IfNoneMatch sets the optional parameter which makes the operation
  26817. // fail if the object's ETag matches the given value. This is useful for
  26818. // getting updates only after the object has changed since the last
  26819. // request. Use googleapi.IsNotModified to check whether the response
  26820. // error from Do is the result of In-None-Match.
  26821. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  26822. c.ifNoneMatch_ = entityTag
  26823. return c
  26824. }
  26825. // Context sets the context to be used in this call's Do method. Any
  26826. // pending HTTP request will be aborted if the provided context is
  26827. // canceled.
  26828. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  26829. c.ctx_ = ctx
  26830. return c
  26831. }
  26832. // Header returns an http.Header that can be modified by the caller to
  26833. // add HTTP headers to the request.
  26834. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  26835. if c.header_ == nil {
  26836. c.header_ = make(http.Header)
  26837. }
  26838. return c.header_
  26839. }
  26840. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  26841. reqHeaders := make(http.Header)
  26842. for k, v := range c.header_ {
  26843. reqHeaders[k] = v
  26844. }
  26845. reqHeaders.Set("User-Agent", c.s.userAgent())
  26846. if c.ifNoneMatch_ != "" {
  26847. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26848. }
  26849. var body io.Reader = nil
  26850. c.urlParams_.Set("alt", alt)
  26851. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  26852. urls += "?" + c.urlParams_.Encode()
  26853. req, _ := http.NewRequest("GET", urls, body)
  26854. req.Header = reqHeaders
  26855. googleapi.Expand(req.URL, map[string]string{
  26856. "profileId": strconv.FormatInt(c.profileId, 10),
  26857. })
  26858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26859. }
  26860. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  26861. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  26862. // non-nil. Any non-2xx status code is an error. Response headers are in
  26863. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  26864. // a response was returned at all) in error.(*googleapi.Error).Header.
  26865. // Use googleapi.IsNotModified to check whether the returned error was
  26866. // because http.StatusNotModified was returned.
  26867. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  26868. gensupport.SetOptions(c.urlParams_, opts...)
  26869. res, err := c.doRequest("json")
  26870. if res != nil && res.StatusCode == http.StatusNotModified {
  26871. if res.Body != nil {
  26872. res.Body.Close()
  26873. }
  26874. return nil, &googleapi.Error{
  26875. Code: res.StatusCode,
  26876. Header: res.Header,
  26877. }
  26878. }
  26879. if err != nil {
  26880. return nil, err
  26881. }
  26882. defer googleapi.CloseBody(res)
  26883. if err := googleapi.CheckResponse(res); err != nil {
  26884. return nil, err
  26885. }
  26886. ret := &DynamicTargetingKeysListResponse{
  26887. ServerResponse: googleapi.ServerResponse{
  26888. Header: res.Header,
  26889. HTTPStatusCode: res.StatusCode,
  26890. },
  26891. }
  26892. target := &ret
  26893. if err := gensupport.DecodeResponse(target, res); err != nil {
  26894. return nil, err
  26895. }
  26896. return ret, nil
  26897. // {
  26898. // "description": "Retrieves a list of dynamic targeting keys.",
  26899. // "httpMethod": "GET",
  26900. // "id": "dfareporting.dynamicTargetingKeys.list",
  26901. // "parameterOrder": [
  26902. // "profileId"
  26903. // ],
  26904. // "parameters": {
  26905. // "advertiserId": {
  26906. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  26907. // "format": "int64",
  26908. // "location": "query",
  26909. // "type": "string"
  26910. // },
  26911. // "names": {
  26912. // "description": "Select only dynamic targeting keys exactly matching these names.",
  26913. // "location": "query",
  26914. // "repeated": true,
  26915. // "type": "string"
  26916. // },
  26917. // "objectId": {
  26918. // "description": "Select only dynamic targeting keys with this object ID.",
  26919. // "format": "int64",
  26920. // "location": "query",
  26921. // "type": "string"
  26922. // },
  26923. // "objectType": {
  26924. // "description": "Select only dynamic targeting keys with this object type.",
  26925. // "enum": [
  26926. // "OBJECT_AD",
  26927. // "OBJECT_ADVERTISER",
  26928. // "OBJECT_CREATIVE",
  26929. // "OBJECT_PLACEMENT"
  26930. // ],
  26931. // "enumDescriptions": [
  26932. // "",
  26933. // "",
  26934. // "",
  26935. // ""
  26936. // ],
  26937. // "location": "query",
  26938. // "type": "string"
  26939. // },
  26940. // "profileId": {
  26941. // "description": "User profile ID associated with this request.",
  26942. // "format": "int64",
  26943. // "location": "path",
  26944. // "required": true,
  26945. // "type": "string"
  26946. // }
  26947. // },
  26948. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  26949. // "response": {
  26950. // "$ref": "DynamicTargetingKeysListResponse"
  26951. // },
  26952. // "scopes": [
  26953. // "https://www.googleapis.com/auth/dfatrafficking"
  26954. // ]
  26955. // }
  26956. }
  26957. // method id "dfareporting.eventTags.delete":
  26958. type EventTagsDeleteCall struct {
  26959. s *Service
  26960. profileId int64
  26961. id int64
  26962. urlParams_ gensupport.URLParams
  26963. ctx_ context.Context
  26964. header_ http.Header
  26965. }
  26966. // Delete: Deletes an existing event tag.
  26967. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  26968. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26969. c.profileId = profileId
  26970. c.id = id
  26971. return c
  26972. }
  26973. // Fields allows partial responses to be retrieved. See
  26974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26975. // for more information.
  26976. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  26977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26978. return c
  26979. }
  26980. // Context sets the context to be used in this call's Do method. Any
  26981. // pending HTTP request will be aborted if the provided context is
  26982. // canceled.
  26983. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  26984. c.ctx_ = ctx
  26985. return c
  26986. }
  26987. // Header returns an http.Header that can be modified by the caller to
  26988. // add HTTP headers to the request.
  26989. func (c *EventTagsDeleteCall) Header() http.Header {
  26990. if c.header_ == nil {
  26991. c.header_ = make(http.Header)
  26992. }
  26993. return c.header_
  26994. }
  26995. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  26996. reqHeaders := make(http.Header)
  26997. for k, v := range c.header_ {
  26998. reqHeaders[k] = v
  26999. }
  27000. reqHeaders.Set("User-Agent", c.s.userAgent())
  27001. var body io.Reader = nil
  27002. c.urlParams_.Set("alt", alt)
  27003. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27004. urls += "?" + c.urlParams_.Encode()
  27005. req, _ := http.NewRequest("DELETE", urls, body)
  27006. req.Header = reqHeaders
  27007. googleapi.Expand(req.URL, map[string]string{
  27008. "profileId": strconv.FormatInt(c.profileId, 10),
  27009. "id": strconv.FormatInt(c.id, 10),
  27010. })
  27011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27012. }
  27013. // Do executes the "dfareporting.eventTags.delete" call.
  27014. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  27015. gensupport.SetOptions(c.urlParams_, opts...)
  27016. res, err := c.doRequest("json")
  27017. if err != nil {
  27018. return err
  27019. }
  27020. defer googleapi.CloseBody(res)
  27021. if err := googleapi.CheckResponse(res); err != nil {
  27022. return err
  27023. }
  27024. return nil
  27025. // {
  27026. // "description": "Deletes an existing event tag.",
  27027. // "httpMethod": "DELETE",
  27028. // "id": "dfareporting.eventTags.delete",
  27029. // "parameterOrder": [
  27030. // "profileId",
  27031. // "id"
  27032. // ],
  27033. // "parameters": {
  27034. // "id": {
  27035. // "description": "Event tag ID.",
  27036. // "format": "int64",
  27037. // "location": "path",
  27038. // "required": true,
  27039. // "type": "string"
  27040. // },
  27041. // "profileId": {
  27042. // "description": "User profile ID associated with this request.",
  27043. // "format": "int64",
  27044. // "location": "path",
  27045. // "required": true,
  27046. // "type": "string"
  27047. // }
  27048. // },
  27049. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27050. // "scopes": [
  27051. // "https://www.googleapis.com/auth/dfatrafficking"
  27052. // ]
  27053. // }
  27054. }
  27055. // method id "dfareporting.eventTags.get":
  27056. type EventTagsGetCall struct {
  27057. s *Service
  27058. profileId int64
  27059. id int64
  27060. urlParams_ gensupport.URLParams
  27061. ifNoneMatch_ string
  27062. ctx_ context.Context
  27063. header_ http.Header
  27064. }
  27065. // Get: Gets one event tag by ID.
  27066. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  27067. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27068. c.profileId = profileId
  27069. c.id = id
  27070. return c
  27071. }
  27072. // Fields allows partial responses to be retrieved. See
  27073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27074. // for more information.
  27075. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  27076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27077. return c
  27078. }
  27079. // IfNoneMatch sets the optional parameter which makes the operation
  27080. // fail if the object's ETag matches the given value. This is useful for
  27081. // getting updates only after the object has changed since the last
  27082. // request. Use googleapi.IsNotModified to check whether the response
  27083. // error from Do is the result of In-None-Match.
  27084. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  27085. c.ifNoneMatch_ = entityTag
  27086. return c
  27087. }
  27088. // Context sets the context to be used in this call's Do method. Any
  27089. // pending HTTP request will be aborted if the provided context is
  27090. // canceled.
  27091. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  27092. c.ctx_ = ctx
  27093. return c
  27094. }
  27095. // Header returns an http.Header that can be modified by the caller to
  27096. // add HTTP headers to the request.
  27097. func (c *EventTagsGetCall) Header() http.Header {
  27098. if c.header_ == nil {
  27099. c.header_ = make(http.Header)
  27100. }
  27101. return c.header_
  27102. }
  27103. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  27104. reqHeaders := make(http.Header)
  27105. for k, v := range c.header_ {
  27106. reqHeaders[k] = v
  27107. }
  27108. reqHeaders.Set("User-Agent", c.s.userAgent())
  27109. if c.ifNoneMatch_ != "" {
  27110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27111. }
  27112. var body io.Reader = nil
  27113. c.urlParams_.Set("alt", alt)
  27114. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27115. urls += "?" + c.urlParams_.Encode()
  27116. req, _ := http.NewRequest("GET", urls, body)
  27117. req.Header = reqHeaders
  27118. googleapi.Expand(req.URL, map[string]string{
  27119. "profileId": strconv.FormatInt(c.profileId, 10),
  27120. "id": strconv.FormatInt(c.id, 10),
  27121. })
  27122. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27123. }
  27124. // Do executes the "dfareporting.eventTags.get" call.
  27125. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27126. // code is an error. Response headers are in either
  27127. // *EventTag.ServerResponse.Header or (if a response was returned at
  27128. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27129. // to check whether the returned error was because
  27130. // http.StatusNotModified was returned.
  27131. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27132. gensupport.SetOptions(c.urlParams_, opts...)
  27133. res, err := c.doRequest("json")
  27134. if res != nil && res.StatusCode == http.StatusNotModified {
  27135. if res.Body != nil {
  27136. res.Body.Close()
  27137. }
  27138. return nil, &googleapi.Error{
  27139. Code: res.StatusCode,
  27140. Header: res.Header,
  27141. }
  27142. }
  27143. if err != nil {
  27144. return nil, err
  27145. }
  27146. defer googleapi.CloseBody(res)
  27147. if err := googleapi.CheckResponse(res); err != nil {
  27148. return nil, err
  27149. }
  27150. ret := &EventTag{
  27151. ServerResponse: googleapi.ServerResponse{
  27152. Header: res.Header,
  27153. HTTPStatusCode: res.StatusCode,
  27154. },
  27155. }
  27156. target := &ret
  27157. if err := gensupport.DecodeResponse(target, res); err != nil {
  27158. return nil, err
  27159. }
  27160. return ret, nil
  27161. // {
  27162. // "description": "Gets one event tag by ID.",
  27163. // "httpMethod": "GET",
  27164. // "id": "dfareporting.eventTags.get",
  27165. // "parameterOrder": [
  27166. // "profileId",
  27167. // "id"
  27168. // ],
  27169. // "parameters": {
  27170. // "id": {
  27171. // "description": "Event tag ID.",
  27172. // "format": "int64",
  27173. // "location": "path",
  27174. // "required": true,
  27175. // "type": "string"
  27176. // },
  27177. // "profileId": {
  27178. // "description": "User profile ID associated with this request.",
  27179. // "format": "int64",
  27180. // "location": "path",
  27181. // "required": true,
  27182. // "type": "string"
  27183. // }
  27184. // },
  27185. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27186. // "response": {
  27187. // "$ref": "EventTag"
  27188. // },
  27189. // "scopes": [
  27190. // "https://www.googleapis.com/auth/dfatrafficking"
  27191. // ]
  27192. // }
  27193. }
  27194. // method id "dfareporting.eventTags.insert":
  27195. type EventTagsInsertCall struct {
  27196. s *Service
  27197. profileId int64
  27198. eventtag *EventTag
  27199. urlParams_ gensupport.URLParams
  27200. ctx_ context.Context
  27201. header_ http.Header
  27202. }
  27203. // Insert: Inserts a new event tag.
  27204. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  27205. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27206. c.profileId = profileId
  27207. c.eventtag = eventtag
  27208. return c
  27209. }
  27210. // Fields allows partial responses to be retrieved. See
  27211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27212. // for more information.
  27213. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  27214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27215. return c
  27216. }
  27217. // Context sets the context to be used in this call's Do method. Any
  27218. // pending HTTP request will be aborted if the provided context is
  27219. // canceled.
  27220. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  27221. c.ctx_ = ctx
  27222. return c
  27223. }
  27224. // Header returns an http.Header that can be modified by the caller to
  27225. // add HTTP headers to the request.
  27226. func (c *EventTagsInsertCall) Header() http.Header {
  27227. if c.header_ == nil {
  27228. c.header_ = make(http.Header)
  27229. }
  27230. return c.header_
  27231. }
  27232. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  27233. reqHeaders := make(http.Header)
  27234. for k, v := range c.header_ {
  27235. reqHeaders[k] = v
  27236. }
  27237. reqHeaders.Set("User-Agent", c.s.userAgent())
  27238. var body io.Reader = nil
  27239. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27240. if err != nil {
  27241. return nil, err
  27242. }
  27243. reqHeaders.Set("Content-Type", "application/json")
  27244. c.urlParams_.Set("alt", alt)
  27245. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27246. urls += "?" + c.urlParams_.Encode()
  27247. req, _ := http.NewRequest("POST", urls, body)
  27248. req.Header = reqHeaders
  27249. googleapi.Expand(req.URL, map[string]string{
  27250. "profileId": strconv.FormatInt(c.profileId, 10),
  27251. })
  27252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27253. }
  27254. // Do executes the "dfareporting.eventTags.insert" call.
  27255. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27256. // code is an error. Response headers are in either
  27257. // *EventTag.ServerResponse.Header or (if a response was returned at
  27258. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27259. // to check whether the returned error was because
  27260. // http.StatusNotModified was returned.
  27261. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27262. gensupport.SetOptions(c.urlParams_, opts...)
  27263. res, err := c.doRequest("json")
  27264. if res != nil && res.StatusCode == http.StatusNotModified {
  27265. if res.Body != nil {
  27266. res.Body.Close()
  27267. }
  27268. return nil, &googleapi.Error{
  27269. Code: res.StatusCode,
  27270. Header: res.Header,
  27271. }
  27272. }
  27273. if err != nil {
  27274. return nil, err
  27275. }
  27276. defer googleapi.CloseBody(res)
  27277. if err := googleapi.CheckResponse(res); err != nil {
  27278. return nil, err
  27279. }
  27280. ret := &EventTag{
  27281. ServerResponse: googleapi.ServerResponse{
  27282. Header: res.Header,
  27283. HTTPStatusCode: res.StatusCode,
  27284. },
  27285. }
  27286. target := &ret
  27287. if err := gensupport.DecodeResponse(target, res); err != nil {
  27288. return nil, err
  27289. }
  27290. return ret, nil
  27291. // {
  27292. // "description": "Inserts a new event tag.",
  27293. // "httpMethod": "POST",
  27294. // "id": "dfareporting.eventTags.insert",
  27295. // "parameterOrder": [
  27296. // "profileId"
  27297. // ],
  27298. // "parameters": {
  27299. // "profileId": {
  27300. // "description": "User profile ID associated with this request.",
  27301. // "format": "int64",
  27302. // "location": "path",
  27303. // "required": true,
  27304. // "type": "string"
  27305. // }
  27306. // },
  27307. // "path": "userprofiles/{profileId}/eventTags",
  27308. // "request": {
  27309. // "$ref": "EventTag"
  27310. // },
  27311. // "response": {
  27312. // "$ref": "EventTag"
  27313. // },
  27314. // "scopes": [
  27315. // "https://www.googleapis.com/auth/dfatrafficking"
  27316. // ]
  27317. // }
  27318. }
  27319. // method id "dfareporting.eventTags.list":
  27320. type EventTagsListCall struct {
  27321. s *Service
  27322. profileId int64
  27323. urlParams_ gensupport.URLParams
  27324. ifNoneMatch_ string
  27325. ctx_ context.Context
  27326. header_ http.Header
  27327. }
  27328. // List: Retrieves a list of event tags, possibly filtered.
  27329. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  27330. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27331. c.profileId = profileId
  27332. return c
  27333. }
  27334. // AdId sets the optional parameter "adId": Select only event tags that
  27335. // belong to this ad.
  27336. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  27337. c.urlParams_.Set("adId", fmt.Sprint(adId))
  27338. return c
  27339. }
  27340. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27341. // event tags that belong to this advertiser.
  27342. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  27343. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27344. return c
  27345. }
  27346. // CampaignId sets the optional parameter "campaignId": Select only
  27347. // event tags that belong to this campaign.
  27348. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  27349. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  27350. return c
  27351. }
  27352. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  27353. // Examine only the specified campaign or advertiser's event tags for
  27354. // matching selector criteria. When set to false, the parent advertiser
  27355. // and parent campaign of the specified ad or campaign is examined as
  27356. // well. In addition, when set to false, the status field is examined as
  27357. // well, along with the enabledByDefault field. This parameter can not
  27358. // be set to true when adId is specified as ads do not define their own
  27359. // even tags.
  27360. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  27361. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  27362. return c
  27363. }
  27364. // Enabled sets the optional parameter "enabled": Select only enabled
  27365. // event tags. What is considered enabled or disabled depends on the
  27366. // definitionsOnly parameter. When definitionsOnly is set to true, only
  27367. // the specified advertiser or campaign's event tags' enabledByDefault
  27368. // field is examined. When definitionsOnly is set to false, the
  27369. // specified ad or specified campaign's parent advertiser's or parent
  27370. // campaign's event tags' enabledByDefault and status fields are
  27371. // examined as well.
  27372. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  27373. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  27374. return c
  27375. }
  27376. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  27377. // only event tags with the specified event tag types. Event tag types
  27378. // can be used to specify whether to use a third-party pixel, a
  27379. // third-party JavaScript URL, or a third-party click-through URL for
  27380. // either impression or click tracking.
  27381. //
  27382. // Possible values:
  27383. // "CLICK_THROUGH_EVENT_TAG"
  27384. // "IMPRESSION_IMAGE_EVENT_TAG"
  27385. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27386. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  27387. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  27388. return c
  27389. }
  27390. // Ids sets the optional parameter "ids": Select only event tags with
  27391. // these IDs.
  27392. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  27393. var ids_ []string
  27394. for _, v := range ids {
  27395. ids_ = append(ids_, fmt.Sprint(v))
  27396. }
  27397. c.urlParams_.SetMulti("ids", ids_)
  27398. return c
  27399. }
  27400. // SearchString sets the optional parameter "searchString": Allows
  27401. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27402. // example, "eventtag*2015" will return objects with names like
  27403. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  27404. // 2015". Most of the searches also add wildcards implicitly at the
  27405. // start and the end of the search string. For example, a search string
  27406. // of "eventtag" will match objects with name "my eventtag", "eventtag
  27407. // 2015", or simply "eventtag".
  27408. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  27409. c.urlParams_.Set("searchString", searchString)
  27410. return c
  27411. }
  27412. // SortField sets the optional parameter "sortField": Field by which to
  27413. // sort the list.
  27414. //
  27415. // Possible values:
  27416. // "ID" (default)
  27417. // "NAME"
  27418. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  27419. c.urlParams_.Set("sortField", sortField)
  27420. return c
  27421. }
  27422. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27423. // results.
  27424. //
  27425. // Possible values:
  27426. // "ASCENDING" (default)
  27427. // "DESCENDING"
  27428. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  27429. c.urlParams_.Set("sortOrder", sortOrder)
  27430. return c
  27431. }
  27432. // Fields allows partial responses to be retrieved. See
  27433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27434. // for more information.
  27435. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  27436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27437. return c
  27438. }
  27439. // IfNoneMatch sets the optional parameter which makes the operation
  27440. // fail if the object's ETag matches the given value. This is useful for
  27441. // getting updates only after the object has changed since the last
  27442. // request. Use googleapi.IsNotModified to check whether the response
  27443. // error from Do is the result of In-None-Match.
  27444. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  27445. c.ifNoneMatch_ = entityTag
  27446. return c
  27447. }
  27448. // Context sets the context to be used in this call's Do method. Any
  27449. // pending HTTP request will be aborted if the provided context is
  27450. // canceled.
  27451. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  27452. c.ctx_ = ctx
  27453. return c
  27454. }
  27455. // Header returns an http.Header that can be modified by the caller to
  27456. // add HTTP headers to the request.
  27457. func (c *EventTagsListCall) Header() http.Header {
  27458. if c.header_ == nil {
  27459. c.header_ = make(http.Header)
  27460. }
  27461. return c.header_
  27462. }
  27463. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  27464. reqHeaders := make(http.Header)
  27465. for k, v := range c.header_ {
  27466. reqHeaders[k] = v
  27467. }
  27468. reqHeaders.Set("User-Agent", c.s.userAgent())
  27469. if c.ifNoneMatch_ != "" {
  27470. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27471. }
  27472. var body io.Reader = nil
  27473. c.urlParams_.Set("alt", alt)
  27474. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27475. urls += "?" + c.urlParams_.Encode()
  27476. req, _ := http.NewRequest("GET", urls, body)
  27477. req.Header = reqHeaders
  27478. googleapi.Expand(req.URL, map[string]string{
  27479. "profileId": strconv.FormatInt(c.profileId, 10),
  27480. })
  27481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27482. }
  27483. // Do executes the "dfareporting.eventTags.list" call.
  27484. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  27485. // non-2xx status code is an error. Response headers are in either
  27486. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  27487. // returned at all) in error.(*googleapi.Error).Header. Use
  27488. // googleapi.IsNotModified to check whether the returned error was
  27489. // because http.StatusNotModified was returned.
  27490. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  27491. gensupport.SetOptions(c.urlParams_, opts...)
  27492. res, err := c.doRequest("json")
  27493. if res != nil && res.StatusCode == http.StatusNotModified {
  27494. if res.Body != nil {
  27495. res.Body.Close()
  27496. }
  27497. return nil, &googleapi.Error{
  27498. Code: res.StatusCode,
  27499. Header: res.Header,
  27500. }
  27501. }
  27502. if err != nil {
  27503. return nil, err
  27504. }
  27505. defer googleapi.CloseBody(res)
  27506. if err := googleapi.CheckResponse(res); err != nil {
  27507. return nil, err
  27508. }
  27509. ret := &EventTagsListResponse{
  27510. ServerResponse: googleapi.ServerResponse{
  27511. Header: res.Header,
  27512. HTTPStatusCode: res.StatusCode,
  27513. },
  27514. }
  27515. target := &ret
  27516. if err := gensupport.DecodeResponse(target, res); err != nil {
  27517. return nil, err
  27518. }
  27519. return ret, nil
  27520. // {
  27521. // "description": "Retrieves a list of event tags, possibly filtered.",
  27522. // "httpMethod": "GET",
  27523. // "id": "dfareporting.eventTags.list",
  27524. // "parameterOrder": [
  27525. // "profileId"
  27526. // ],
  27527. // "parameters": {
  27528. // "adId": {
  27529. // "description": "Select only event tags that belong to this ad.",
  27530. // "format": "int64",
  27531. // "location": "query",
  27532. // "type": "string"
  27533. // },
  27534. // "advertiserId": {
  27535. // "description": "Select only event tags that belong to this advertiser.",
  27536. // "format": "int64",
  27537. // "location": "query",
  27538. // "type": "string"
  27539. // },
  27540. // "campaignId": {
  27541. // "description": "Select only event tags that belong to this campaign.",
  27542. // "format": "int64",
  27543. // "location": "query",
  27544. // "type": "string"
  27545. // },
  27546. // "definitionsOnly": {
  27547. // "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.",
  27548. // "location": "query",
  27549. // "type": "boolean"
  27550. // },
  27551. // "enabled": {
  27552. // "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.",
  27553. // "location": "query",
  27554. // "type": "boolean"
  27555. // },
  27556. // "eventTagTypes": {
  27557. // "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.",
  27558. // "enum": [
  27559. // "CLICK_THROUGH_EVENT_TAG",
  27560. // "IMPRESSION_IMAGE_EVENT_TAG",
  27561. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27562. // ],
  27563. // "enumDescriptions": [
  27564. // "",
  27565. // "",
  27566. // ""
  27567. // ],
  27568. // "location": "query",
  27569. // "repeated": true,
  27570. // "type": "string"
  27571. // },
  27572. // "ids": {
  27573. // "description": "Select only event tags with these IDs.",
  27574. // "format": "int64",
  27575. // "location": "query",
  27576. // "repeated": true,
  27577. // "type": "string"
  27578. // },
  27579. // "profileId": {
  27580. // "description": "User profile ID associated with this request.",
  27581. // "format": "int64",
  27582. // "location": "path",
  27583. // "required": true,
  27584. // "type": "string"
  27585. // },
  27586. // "searchString": {
  27587. // "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\".",
  27588. // "location": "query",
  27589. // "type": "string"
  27590. // },
  27591. // "sortField": {
  27592. // "default": "ID",
  27593. // "description": "Field by which to sort the list.",
  27594. // "enum": [
  27595. // "ID",
  27596. // "NAME"
  27597. // ],
  27598. // "enumDescriptions": [
  27599. // "",
  27600. // ""
  27601. // ],
  27602. // "location": "query",
  27603. // "type": "string"
  27604. // },
  27605. // "sortOrder": {
  27606. // "default": "ASCENDING",
  27607. // "description": "Order of sorted results.",
  27608. // "enum": [
  27609. // "ASCENDING",
  27610. // "DESCENDING"
  27611. // ],
  27612. // "enumDescriptions": [
  27613. // "",
  27614. // ""
  27615. // ],
  27616. // "location": "query",
  27617. // "type": "string"
  27618. // }
  27619. // },
  27620. // "path": "userprofiles/{profileId}/eventTags",
  27621. // "response": {
  27622. // "$ref": "EventTagsListResponse"
  27623. // },
  27624. // "scopes": [
  27625. // "https://www.googleapis.com/auth/dfatrafficking"
  27626. // ]
  27627. // }
  27628. }
  27629. // method id "dfareporting.eventTags.patch":
  27630. type EventTagsPatchCall struct {
  27631. s *Service
  27632. profileId int64
  27633. eventtag *EventTag
  27634. urlParams_ gensupport.URLParams
  27635. ctx_ context.Context
  27636. header_ http.Header
  27637. }
  27638. // Patch: Updates an existing event tag. This method supports patch
  27639. // semantics.
  27640. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  27641. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27642. c.profileId = profileId
  27643. c.urlParams_.Set("id", fmt.Sprint(id))
  27644. c.eventtag = eventtag
  27645. return c
  27646. }
  27647. // Fields allows partial responses to be retrieved. See
  27648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27649. // for more information.
  27650. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  27651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27652. return c
  27653. }
  27654. // Context sets the context to be used in this call's Do method. Any
  27655. // pending HTTP request will be aborted if the provided context is
  27656. // canceled.
  27657. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  27658. c.ctx_ = ctx
  27659. return c
  27660. }
  27661. // Header returns an http.Header that can be modified by the caller to
  27662. // add HTTP headers to the request.
  27663. func (c *EventTagsPatchCall) Header() http.Header {
  27664. if c.header_ == nil {
  27665. c.header_ = make(http.Header)
  27666. }
  27667. return c.header_
  27668. }
  27669. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  27670. reqHeaders := make(http.Header)
  27671. for k, v := range c.header_ {
  27672. reqHeaders[k] = v
  27673. }
  27674. reqHeaders.Set("User-Agent", c.s.userAgent())
  27675. var body io.Reader = nil
  27676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27677. if err != nil {
  27678. return nil, err
  27679. }
  27680. reqHeaders.Set("Content-Type", "application/json")
  27681. c.urlParams_.Set("alt", alt)
  27682. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27683. urls += "?" + c.urlParams_.Encode()
  27684. req, _ := http.NewRequest("PATCH", urls, body)
  27685. req.Header = reqHeaders
  27686. googleapi.Expand(req.URL, map[string]string{
  27687. "profileId": strconv.FormatInt(c.profileId, 10),
  27688. })
  27689. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27690. }
  27691. // Do executes the "dfareporting.eventTags.patch" call.
  27692. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27693. // code is an error. Response headers are in either
  27694. // *EventTag.ServerResponse.Header or (if a response was returned at
  27695. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27696. // to check whether the returned error was because
  27697. // http.StatusNotModified was returned.
  27698. func (c *EventTagsPatchCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27699. gensupport.SetOptions(c.urlParams_, opts...)
  27700. res, err := c.doRequest("json")
  27701. if res != nil && res.StatusCode == http.StatusNotModified {
  27702. if res.Body != nil {
  27703. res.Body.Close()
  27704. }
  27705. return nil, &googleapi.Error{
  27706. Code: res.StatusCode,
  27707. Header: res.Header,
  27708. }
  27709. }
  27710. if err != nil {
  27711. return nil, err
  27712. }
  27713. defer googleapi.CloseBody(res)
  27714. if err := googleapi.CheckResponse(res); err != nil {
  27715. return nil, err
  27716. }
  27717. ret := &EventTag{
  27718. ServerResponse: googleapi.ServerResponse{
  27719. Header: res.Header,
  27720. HTTPStatusCode: res.StatusCode,
  27721. },
  27722. }
  27723. target := &ret
  27724. if err := gensupport.DecodeResponse(target, res); err != nil {
  27725. return nil, err
  27726. }
  27727. return ret, nil
  27728. // {
  27729. // "description": "Updates an existing event tag. This method supports patch semantics.",
  27730. // "httpMethod": "PATCH",
  27731. // "id": "dfareporting.eventTags.patch",
  27732. // "parameterOrder": [
  27733. // "profileId",
  27734. // "id"
  27735. // ],
  27736. // "parameters": {
  27737. // "id": {
  27738. // "description": "Event tag ID.",
  27739. // "format": "int64",
  27740. // "location": "query",
  27741. // "required": true,
  27742. // "type": "string"
  27743. // },
  27744. // "profileId": {
  27745. // "description": "User profile ID associated with this request.",
  27746. // "format": "int64",
  27747. // "location": "path",
  27748. // "required": true,
  27749. // "type": "string"
  27750. // }
  27751. // },
  27752. // "path": "userprofiles/{profileId}/eventTags",
  27753. // "request": {
  27754. // "$ref": "EventTag"
  27755. // },
  27756. // "response": {
  27757. // "$ref": "EventTag"
  27758. // },
  27759. // "scopes": [
  27760. // "https://www.googleapis.com/auth/dfatrafficking"
  27761. // ]
  27762. // }
  27763. }
  27764. // method id "dfareporting.eventTags.update":
  27765. type EventTagsUpdateCall struct {
  27766. s *Service
  27767. profileId int64
  27768. eventtag *EventTag
  27769. urlParams_ gensupport.URLParams
  27770. ctx_ context.Context
  27771. header_ http.Header
  27772. }
  27773. // Update: Updates an existing event tag.
  27774. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  27775. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27776. c.profileId = profileId
  27777. c.eventtag = eventtag
  27778. return c
  27779. }
  27780. // Fields allows partial responses to be retrieved. See
  27781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27782. // for more information.
  27783. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  27784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27785. return c
  27786. }
  27787. // Context sets the context to be used in this call's Do method. Any
  27788. // pending HTTP request will be aborted if the provided context is
  27789. // canceled.
  27790. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  27791. c.ctx_ = ctx
  27792. return c
  27793. }
  27794. // Header returns an http.Header that can be modified by the caller to
  27795. // add HTTP headers to the request.
  27796. func (c *EventTagsUpdateCall) Header() http.Header {
  27797. if c.header_ == nil {
  27798. c.header_ = make(http.Header)
  27799. }
  27800. return c.header_
  27801. }
  27802. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  27803. reqHeaders := make(http.Header)
  27804. for k, v := range c.header_ {
  27805. reqHeaders[k] = v
  27806. }
  27807. reqHeaders.Set("User-Agent", c.s.userAgent())
  27808. var body io.Reader = nil
  27809. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27810. if err != nil {
  27811. return nil, err
  27812. }
  27813. reqHeaders.Set("Content-Type", "application/json")
  27814. c.urlParams_.Set("alt", alt)
  27815. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27816. urls += "?" + c.urlParams_.Encode()
  27817. req, _ := http.NewRequest("PUT", urls, body)
  27818. req.Header = reqHeaders
  27819. googleapi.Expand(req.URL, map[string]string{
  27820. "profileId": strconv.FormatInt(c.profileId, 10),
  27821. })
  27822. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27823. }
  27824. // Do executes the "dfareporting.eventTags.update" call.
  27825. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27826. // code is an error. Response headers are in either
  27827. // *EventTag.ServerResponse.Header or (if a response was returned at
  27828. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27829. // to check whether the returned error was because
  27830. // http.StatusNotModified was returned.
  27831. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27832. gensupport.SetOptions(c.urlParams_, opts...)
  27833. res, err := c.doRequest("json")
  27834. if res != nil && res.StatusCode == http.StatusNotModified {
  27835. if res.Body != nil {
  27836. res.Body.Close()
  27837. }
  27838. return nil, &googleapi.Error{
  27839. Code: res.StatusCode,
  27840. Header: res.Header,
  27841. }
  27842. }
  27843. if err != nil {
  27844. return nil, err
  27845. }
  27846. defer googleapi.CloseBody(res)
  27847. if err := googleapi.CheckResponse(res); err != nil {
  27848. return nil, err
  27849. }
  27850. ret := &EventTag{
  27851. ServerResponse: googleapi.ServerResponse{
  27852. Header: res.Header,
  27853. HTTPStatusCode: res.StatusCode,
  27854. },
  27855. }
  27856. target := &ret
  27857. if err := gensupport.DecodeResponse(target, res); err != nil {
  27858. return nil, err
  27859. }
  27860. return ret, nil
  27861. // {
  27862. // "description": "Updates an existing event tag.",
  27863. // "httpMethod": "PUT",
  27864. // "id": "dfareporting.eventTags.update",
  27865. // "parameterOrder": [
  27866. // "profileId"
  27867. // ],
  27868. // "parameters": {
  27869. // "profileId": {
  27870. // "description": "User profile ID associated with this request.",
  27871. // "format": "int64",
  27872. // "location": "path",
  27873. // "required": true,
  27874. // "type": "string"
  27875. // }
  27876. // },
  27877. // "path": "userprofiles/{profileId}/eventTags",
  27878. // "request": {
  27879. // "$ref": "EventTag"
  27880. // },
  27881. // "response": {
  27882. // "$ref": "EventTag"
  27883. // },
  27884. // "scopes": [
  27885. // "https://www.googleapis.com/auth/dfatrafficking"
  27886. // ]
  27887. // }
  27888. }
  27889. // method id "dfareporting.files.get":
  27890. type FilesGetCall struct {
  27891. s *Service
  27892. reportId int64
  27893. fileId int64
  27894. urlParams_ gensupport.URLParams
  27895. ifNoneMatch_ string
  27896. ctx_ context.Context
  27897. header_ http.Header
  27898. }
  27899. // Get: Retrieves a report file by its report ID and file ID. This
  27900. // method supports media download.
  27901. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  27902. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27903. c.reportId = reportId
  27904. c.fileId = fileId
  27905. return c
  27906. }
  27907. // Fields allows partial responses to be retrieved. See
  27908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27909. // for more information.
  27910. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  27911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27912. return c
  27913. }
  27914. // IfNoneMatch sets the optional parameter which makes the operation
  27915. // fail if the object's ETag matches the given value. This is useful for
  27916. // getting updates only after the object has changed since the last
  27917. // request. Use googleapi.IsNotModified to check whether the response
  27918. // error from Do is the result of In-None-Match.
  27919. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  27920. c.ifNoneMatch_ = entityTag
  27921. return c
  27922. }
  27923. // Context sets the context to be used in this call's Do and Download
  27924. // methods. Any pending HTTP request will be aborted if the provided
  27925. // context is canceled.
  27926. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  27927. c.ctx_ = ctx
  27928. return c
  27929. }
  27930. // Header returns an http.Header that can be modified by the caller to
  27931. // add HTTP headers to the request.
  27932. func (c *FilesGetCall) Header() http.Header {
  27933. if c.header_ == nil {
  27934. c.header_ = make(http.Header)
  27935. }
  27936. return c.header_
  27937. }
  27938. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  27939. reqHeaders := make(http.Header)
  27940. for k, v := range c.header_ {
  27941. reqHeaders[k] = v
  27942. }
  27943. reqHeaders.Set("User-Agent", c.s.userAgent())
  27944. if c.ifNoneMatch_ != "" {
  27945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27946. }
  27947. var body io.Reader = nil
  27948. c.urlParams_.Set("alt", alt)
  27949. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  27950. urls += "?" + c.urlParams_.Encode()
  27951. req, _ := http.NewRequest("GET", urls, body)
  27952. req.Header = reqHeaders
  27953. googleapi.Expand(req.URL, map[string]string{
  27954. "reportId": strconv.FormatInt(c.reportId, 10),
  27955. "fileId": strconv.FormatInt(c.fileId, 10),
  27956. })
  27957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27958. }
  27959. // Download fetches the API endpoint's "media" value, instead of the normal
  27960. // API response value. If the returned error is nil, the Response is guaranteed to
  27961. // have a 2xx status code. Callers must close the Response.Body as usual.
  27962. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  27963. gensupport.SetOptions(c.urlParams_, opts...)
  27964. res, err := c.doRequest("media")
  27965. if err != nil {
  27966. return nil, err
  27967. }
  27968. if err := googleapi.CheckMediaResponse(res); err != nil {
  27969. res.Body.Close()
  27970. return nil, err
  27971. }
  27972. return res, nil
  27973. }
  27974. // Do executes the "dfareporting.files.get" call.
  27975. // Exactly one of *File or error will be non-nil. Any non-2xx status
  27976. // code is an error. Response headers are in either
  27977. // *File.ServerResponse.Header or (if a response was returned at all) in
  27978. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  27979. // whether the returned error was because http.StatusNotModified was
  27980. // returned.
  27981. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  27982. gensupport.SetOptions(c.urlParams_, opts...)
  27983. res, err := c.doRequest("json")
  27984. if res != nil && res.StatusCode == http.StatusNotModified {
  27985. if res.Body != nil {
  27986. res.Body.Close()
  27987. }
  27988. return nil, &googleapi.Error{
  27989. Code: res.StatusCode,
  27990. Header: res.Header,
  27991. }
  27992. }
  27993. if err != nil {
  27994. return nil, err
  27995. }
  27996. defer googleapi.CloseBody(res)
  27997. if err := googleapi.CheckResponse(res); err != nil {
  27998. return nil, err
  27999. }
  28000. ret := &File{
  28001. ServerResponse: googleapi.ServerResponse{
  28002. Header: res.Header,
  28003. HTTPStatusCode: res.StatusCode,
  28004. },
  28005. }
  28006. target := &ret
  28007. if err := gensupport.DecodeResponse(target, res); err != nil {
  28008. return nil, err
  28009. }
  28010. return ret, nil
  28011. // {
  28012. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  28013. // "httpMethod": "GET",
  28014. // "id": "dfareporting.files.get",
  28015. // "parameterOrder": [
  28016. // "reportId",
  28017. // "fileId"
  28018. // ],
  28019. // "parameters": {
  28020. // "fileId": {
  28021. // "description": "The ID of the report file.",
  28022. // "format": "int64",
  28023. // "location": "path",
  28024. // "required": true,
  28025. // "type": "string"
  28026. // },
  28027. // "reportId": {
  28028. // "description": "The ID of the report.",
  28029. // "format": "int64",
  28030. // "location": "path",
  28031. // "required": true,
  28032. // "type": "string"
  28033. // }
  28034. // },
  28035. // "path": "reports/{reportId}/files/{fileId}",
  28036. // "response": {
  28037. // "$ref": "File"
  28038. // },
  28039. // "scopes": [
  28040. // "https://www.googleapis.com/auth/dfareporting"
  28041. // ],
  28042. // "supportsMediaDownload": true
  28043. // }
  28044. }
  28045. // method id "dfareporting.files.list":
  28046. type FilesListCall struct {
  28047. s *Service
  28048. profileId int64
  28049. urlParams_ gensupport.URLParams
  28050. ifNoneMatch_ string
  28051. ctx_ context.Context
  28052. header_ http.Header
  28053. }
  28054. // List: Lists files for a user profile.
  28055. func (r *FilesService) List(profileId int64) *FilesListCall {
  28056. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28057. c.profileId = profileId
  28058. return c
  28059. }
  28060. // MaxResults sets the optional parameter "maxResults": Maximum number
  28061. // of results to return.
  28062. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  28063. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28064. return c
  28065. }
  28066. // PageToken sets the optional parameter "pageToken": The value of the
  28067. // nextToken from the previous result page.
  28068. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  28069. c.urlParams_.Set("pageToken", pageToken)
  28070. return c
  28071. }
  28072. // Scope sets the optional parameter "scope": The scope that defines
  28073. // which results are returned.
  28074. //
  28075. // Possible values:
  28076. // "ALL" - All files in account.
  28077. // "MINE" (default) - My files.
  28078. // "SHARED_WITH_ME" - Files shared with me.
  28079. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  28080. c.urlParams_.Set("scope", scope)
  28081. return c
  28082. }
  28083. // SortField sets the optional parameter "sortField": The field by which
  28084. // to sort the list.
  28085. //
  28086. // Possible values:
  28087. // "ID" - Sort by file ID.
  28088. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  28089. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  28090. c.urlParams_.Set("sortField", sortField)
  28091. return c
  28092. }
  28093. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28094. // results.
  28095. //
  28096. // Possible values:
  28097. // "ASCENDING" - Ascending order.
  28098. // "DESCENDING" (default) - Descending order.
  28099. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  28100. c.urlParams_.Set("sortOrder", sortOrder)
  28101. return c
  28102. }
  28103. // Fields allows partial responses to be retrieved. See
  28104. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28105. // for more information.
  28106. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  28107. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28108. return c
  28109. }
  28110. // IfNoneMatch sets the optional parameter which makes the operation
  28111. // fail if the object's ETag matches the given value. This is useful for
  28112. // getting updates only after the object has changed since the last
  28113. // request. Use googleapi.IsNotModified to check whether the response
  28114. // error from Do is the result of In-None-Match.
  28115. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  28116. c.ifNoneMatch_ = entityTag
  28117. return c
  28118. }
  28119. // Context sets the context to be used in this call's Do method. Any
  28120. // pending HTTP request will be aborted if the provided context is
  28121. // canceled.
  28122. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  28123. c.ctx_ = ctx
  28124. return c
  28125. }
  28126. // Header returns an http.Header that can be modified by the caller to
  28127. // add HTTP headers to the request.
  28128. func (c *FilesListCall) Header() http.Header {
  28129. if c.header_ == nil {
  28130. c.header_ = make(http.Header)
  28131. }
  28132. return c.header_
  28133. }
  28134. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  28135. reqHeaders := make(http.Header)
  28136. for k, v := range c.header_ {
  28137. reqHeaders[k] = v
  28138. }
  28139. reqHeaders.Set("User-Agent", c.s.userAgent())
  28140. if c.ifNoneMatch_ != "" {
  28141. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28142. }
  28143. var body io.Reader = nil
  28144. c.urlParams_.Set("alt", alt)
  28145. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  28146. urls += "?" + c.urlParams_.Encode()
  28147. req, _ := http.NewRequest("GET", urls, body)
  28148. req.Header = reqHeaders
  28149. googleapi.Expand(req.URL, map[string]string{
  28150. "profileId": strconv.FormatInt(c.profileId, 10),
  28151. })
  28152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28153. }
  28154. // Do executes the "dfareporting.files.list" call.
  28155. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  28156. // code is an error. Response headers are in either
  28157. // *FileList.ServerResponse.Header or (if a response was returned at
  28158. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28159. // to check whether the returned error was because
  28160. // http.StatusNotModified was returned.
  28161. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  28162. gensupport.SetOptions(c.urlParams_, opts...)
  28163. res, err := c.doRequest("json")
  28164. if res != nil && res.StatusCode == http.StatusNotModified {
  28165. if res.Body != nil {
  28166. res.Body.Close()
  28167. }
  28168. return nil, &googleapi.Error{
  28169. Code: res.StatusCode,
  28170. Header: res.Header,
  28171. }
  28172. }
  28173. if err != nil {
  28174. return nil, err
  28175. }
  28176. defer googleapi.CloseBody(res)
  28177. if err := googleapi.CheckResponse(res); err != nil {
  28178. return nil, err
  28179. }
  28180. ret := &FileList{
  28181. ServerResponse: googleapi.ServerResponse{
  28182. Header: res.Header,
  28183. HTTPStatusCode: res.StatusCode,
  28184. },
  28185. }
  28186. target := &ret
  28187. if err := gensupport.DecodeResponse(target, res); err != nil {
  28188. return nil, err
  28189. }
  28190. return ret, nil
  28191. // {
  28192. // "description": "Lists files for a user profile.",
  28193. // "httpMethod": "GET",
  28194. // "id": "dfareporting.files.list",
  28195. // "parameterOrder": [
  28196. // "profileId"
  28197. // ],
  28198. // "parameters": {
  28199. // "maxResults": {
  28200. // "default": "10",
  28201. // "description": "Maximum number of results to return.",
  28202. // "format": "int32",
  28203. // "location": "query",
  28204. // "maximum": "10",
  28205. // "minimum": "0",
  28206. // "type": "integer"
  28207. // },
  28208. // "pageToken": {
  28209. // "description": "The value of the nextToken from the previous result page.",
  28210. // "location": "query",
  28211. // "type": "string"
  28212. // },
  28213. // "profileId": {
  28214. // "description": "The DFA profile ID.",
  28215. // "format": "int64",
  28216. // "location": "path",
  28217. // "required": true,
  28218. // "type": "string"
  28219. // },
  28220. // "scope": {
  28221. // "default": "MINE",
  28222. // "description": "The scope that defines which results are returned.",
  28223. // "enum": [
  28224. // "ALL",
  28225. // "MINE",
  28226. // "SHARED_WITH_ME"
  28227. // ],
  28228. // "enumDescriptions": [
  28229. // "All files in account.",
  28230. // "My files.",
  28231. // "Files shared with me."
  28232. // ],
  28233. // "location": "query",
  28234. // "type": "string"
  28235. // },
  28236. // "sortField": {
  28237. // "default": "LAST_MODIFIED_TIME",
  28238. // "description": "The field by which to sort the list.",
  28239. // "enum": [
  28240. // "ID",
  28241. // "LAST_MODIFIED_TIME"
  28242. // ],
  28243. // "enumDescriptions": [
  28244. // "Sort by file ID.",
  28245. // "Sort by 'lastmodifiedAt' field."
  28246. // ],
  28247. // "location": "query",
  28248. // "type": "string"
  28249. // },
  28250. // "sortOrder": {
  28251. // "default": "DESCENDING",
  28252. // "description": "Order of sorted results.",
  28253. // "enum": [
  28254. // "ASCENDING",
  28255. // "DESCENDING"
  28256. // ],
  28257. // "enumDescriptions": [
  28258. // "Ascending order.",
  28259. // "Descending order."
  28260. // ],
  28261. // "location": "query",
  28262. // "type": "string"
  28263. // }
  28264. // },
  28265. // "path": "userprofiles/{profileId}/files",
  28266. // "response": {
  28267. // "$ref": "FileList"
  28268. // },
  28269. // "scopes": [
  28270. // "https://www.googleapis.com/auth/dfareporting"
  28271. // ]
  28272. // }
  28273. }
  28274. // Pages invokes f for each page of results.
  28275. // A non-nil error returned from f will halt the iteration.
  28276. // The provided context supersedes any context provided to the Context method.
  28277. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  28278. c.ctx_ = ctx
  28279. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28280. for {
  28281. x, err := c.Do()
  28282. if err != nil {
  28283. return err
  28284. }
  28285. if err := f(x); err != nil {
  28286. return err
  28287. }
  28288. if x.NextPageToken == "" {
  28289. return nil
  28290. }
  28291. c.PageToken(x.NextPageToken)
  28292. }
  28293. }
  28294. // method id "dfareporting.floodlightActivities.delete":
  28295. type FloodlightActivitiesDeleteCall struct {
  28296. s *Service
  28297. profileId int64
  28298. id int64
  28299. urlParams_ gensupport.URLParams
  28300. ctx_ context.Context
  28301. header_ http.Header
  28302. }
  28303. // Delete: Deletes an existing floodlight activity.
  28304. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  28305. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28306. c.profileId = profileId
  28307. c.id = id
  28308. return c
  28309. }
  28310. // Fields allows partial responses to be retrieved. See
  28311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28312. // for more information.
  28313. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  28314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28315. return c
  28316. }
  28317. // Context sets the context to be used in this call's Do method. Any
  28318. // pending HTTP request will be aborted if the provided context is
  28319. // canceled.
  28320. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  28321. c.ctx_ = ctx
  28322. return c
  28323. }
  28324. // Header returns an http.Header that can be modified by the caller to
  28325. // add HTTP headers to the request.
  28326. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  28327. if c.header_ == nil {
  28328. c.header_ = make(http.Header)
  28329. }
  28330. return c.header_
  28331. }
  28332. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28333. reqHeaders := make(http.Header)
  28334. for k, v := range c.header_ {
  28335. reqHeaders[k] = v
  28336. }
  28337. reqHeaders.Set("User-Agent", c.s.userAgent())
  28338. var body io.Reader = nil
  28339. c.urlParams_.Set("alt", alt)
  28340. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28341. urls += "?" + c.urlParams_.Encode()
  28342. req, _ := http.NewRequest("DELETE", urls, body)
  28343. req.Header = reqHeaders
  28344. googleapi.Expand(req.URL, map[string]string{
  28345. "profileId": strconv.FormatInt(c.profileId, 10),
  28346. "id": strconv.FormatInt(c.id, 10),
  28347. })
  28348. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28349. }
  28350. // Do executes the "dfareporting.floodlightActivities.delete" call.
  28351. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  28352. gensupport.SetOptions(c.urlParams_, opts...)
  28353. res, err := c.doRequest("json")
  28354. if err != nil {
  28355. return err
  28356. }
  28357. defer googleapi.CloseBody(res)
  28358. if err := googleapi.CheckResponse(res); err != nil {
  28359. return err
  28360. }
  28361. return nil
  28362. // {
  28363. // "description": "Deletes an existing floodlight activity.",
  28364. // "httpMethod": "DELETE",
  28365. // "id": "dfareporting.floodlightActivities.delete",
  28366. // "parameterOrder": [
  28367. // "profileId",
  28368. // "id"
  28369. // ],
  28370. // "parameters": {
  28371. // "id": {
  28372. // "description": "Floodlight activity ID.",
  28373. // "format": "int64",
  28374. // "location": "path",
  28375. // "required": true,
  28376. // "type": "string"
  28377. // },
  28378. // "profileId": {
  28379. // "description": "User profile ID associated with this request.",
  28380. // "format": "int64",
  28381. // "location": "path",
  28382. // "required": true,
  28383. // "type": "string"
  28384. // }
  28385. // },
  28386. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28387. // "scopes": [
  28388. // "https://www.googleapis.com/auth/dfatrafficking"
  28389. // ]
  28390. // }
  28391. }
  28392. // method id "dfareporting.floodlightActivities.generatetag":
  28393. type FloodlightActivitiesGeneratetagCall struct {
  28394. s *Service
  28395. profileId int64
  28396. urlParams_ gensupport.URLParams
  28397. ctx_ context.Context
  28398. header_ http.Header
  28399. }
  28400. // Generatetag: Generates a tag for a floodlight activity.
  28401. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  28402. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28403. c.profileId = profileId
  28404. return c
  28405. }
  28406. // FloodlightActivityId sets the optional parameter
  28407. // "floodlightActivityId": Floodlight activity ID for which we want to
  28408. // generate a tag.
  28409. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  28410. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  28411. return c
  28412. }
  28413. // Fields allows partial responses to be retrieved. See
  28414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28415. // for more information.
  28416. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  28417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28418. return c
  28419. }
  28420. // Context sets the context to be used in this call's Do method. Any
  28421. // pending HTTP request will be aborted if the provided context is
  28422. // canceled.
  28423. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  28424. c.ctx_ = ctx
  28425. return c
  28426. }
  28427. // Header returns an http.Header that can be modified by the caller to
  28428. // add HTTP headers to the request.
  28429. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  28430. if c.header_ == nil {
  28431. c.header_ = make(http.Header)
  28432. }
  28433. return c.header_
  28434. }
  28435. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  28436. reqHeaders := make(http.Header)
  28437. for k, v := range c.header_ {
  28438. reqHeaders[k] = v
  28439. }
  28440. reqHeaders.Set("User-Agent", c.s.userAgent())
  28441. var body io.Reader = nil
  28442. c.urlParams_.Set("alt", alt)
  28443. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  28444. urls += "?" + c.urlParams_.Encode()
  28445. req, _ := http.NewRequest("POST", urls, body)
  28446. req.Header = reqHeaders
  28447. googleapi.Expand(req.URL, map[string]string{
  28448. "profileId": strconv.FormatInt(c.profileId, 10),
  28449. })
  28450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28451. }
  28452. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  28453. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  28454. // be non-nil. Any non-2xx status code is an error. Response headers are
  28455. // in either
  28456. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  28457. // a response was returned at all) in error.(*googleapi.Error).Header.
  28458. // Use googleapi.IsNotModified to check whether the returned error was
  28459. // because http.StatusNotModified was returned.
  28460. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  28461. gensupport.SetOptions(c.urlParams_, opts...)
  28462. res, err := c.doRequest("json")
  28463. if res != nil && res.StatusCode == http.StatusNotModified {
  28464. if res.Body != nil {
  28465. res.Body.Close()
  28466. }
  28467. return nil, &googleapi.Error{
  28468. Code: res.StatusCode,
  28469. Header: res.Header,
  28470. }
  28471. }
  28472. if err != nil {
  28473. return nil, err
  28474. }
  28475. defer googleapi.CloseBody(res)
  28476. if err := googleapi.CheckResponse(res); err != nil {
  28477. return nil, err
  28478. }
  28479. ret := &FloodlightActivitiesGenerateTagResponse{
  28480. ServerResponse: googleapi.ServerResponse{
  28481. Header: res.Header,
  28482. HTTPStatusCode: res.StatusCode,
  28483. },
  28484. }
  28485. target := &ret
  28486. if err := gensupport.DecodeResponse(target, res); err != nil {
  28487. return nil, err
  28488. }
  28489. return ret, nil
  28490. // {
  28491. // "description": "Generates a tag for a floodlight activity.",
  28492. // "httpMethod": "POST",
  28493. // "id": "dfareporting.floodlightActivities.generatetag",
  28494. // "parameterOrder": [
  28495. // "profileId"
  28496. // ],
  28497. // "parameters": {
  28498. // "floodlightActivityId": {
  28499. // "description": "Floodlight activity ID for which we want to generate a tag.",
  28500. // "format": "int64",
  28501. // "location": "query",
  28502. // "type": "string"
  28503. // },
  28504. // "profileId": {
  28505. // "description": "User profile ID associated with this request.",
  28506. // "format": "int64",
  28507. // "location": "path",
  28508. // "required": true,
  28509. // "type": "string"
  28510. // }
  28511. // },
  28512. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  28513. // "response": {
  28514. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  28515. // },
  28516. // "scopes": [
  28517. // "https://www.googleapis.com/auth/dfatrafficking"
  28518. // ]
  28519. // }
  28520. }
  28521. // method id "dfareporting.floodlightActivities.get":
  28522. type FloodlightActivitiesGetCall struct {
  28523. s *Service
  28524. profileId int64
  28525. id int64
  28526. urlParams_ gensupport.URLParams
  28527. ifNoneMatch_ string
  28528. ctx_ context.Context
  28529. header_ http.Header
  28530. }
  28531. // Get: Gets one floodlight activity by ID.
  28532. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  28533. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28534. c.profileId = profileId
  28535. c.id = id
  28536. return c
  28537. }
  28538. // Fields allows partial responses to be retrieved. See
  28539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28540. // for more information.
  28541. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  28542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28543. return c
  28544. }
  28545. // IfNoneMatch sets the optional parameter which makes the operation
  28546. // fail if the object's ETag matches the given value. This is useful for
  28547. // getting updates only after the object has changed since the last
  28548. // request. Use googleapi.IsNotModified to check whether the response
  28549. // error from Do is the result of In-None-Match.
  28550. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  28551. c.ifNoneMatch_ = entityTag
  28552. return c
  28553. }
  28554. // Context sets the context to be used in this call's Do method. Any
  28555. // pending HTTP request will be aborted if the provided context is
  28556. // canceled.
  28557. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  28558. c.ctx_ = ctx
  28559. return c
  28560. }
  28561. // Header returns an http.Header that can be modified by the caller to
  28562. // add HTTP headers to the request.
  28563. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  28564. if c.header_ == nil {
  28565. c.header_ = make(http.Header)
  28566. }
  28567. return c.header_
  28568. }
  28569. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  28570. reqHeaders := make(http.Header)
  28571. for k, v := range c.header_ {
  28572. reqHeaders[k] = v
  28573. }
  28574. reqHeaders.Set("User-Agent", c.s.userAgent())
  28575. if c.ifNoneMatch_ != "" {
  28576. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28577. }
  28578. var body io.Reader = nil
  28579. c.urlParams_.Set("alt", alt)
  28580. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28581. urls += "?" + c.urlParams_.Encode()
  28582. req, _ := http.NewRequest("GET", urls, body)
  28583. req.Header = reqHeaders
  28584. googleapi.Expand(req.URL, map[string]string{
  28585. "profileId": strconv.FormatInt(c.profileId, 10),
  28586. "id": strconv.FormatInt(c.id, 10),
  28587. })
  28588. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28589. }
  28590. // Do executes the "dfareporting.floodlightActivities.get" call.
  28591. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28592. // non-2xx status code is an error. Response headers are in either
  28593. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28594. // returned at all) in error.(*googleapi.Error).Header. Use
  28595. // googleapi.IsNotModified to check whether the returned error was
  28596. // because http.StatusNotModified was returned.
  28597. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28598. gensupport.SetOptions(c.urlParams_, opts...)
  28599. res, err := c.doRequest("json")
  28600. if res != nil && res.StatusCode == http.StatusNotModified {
  28601. if res.Body != nil {
  28602. res.Body.Close()
  28603. }
  28604. return nil, &googleapi.Error{
  28605. Code: res.StatusCode,
  28606. Header: res.Header,
  28607. }
  28608. }
  28609. if err != nil {
  28610. return nil, err
  28611. }
  28612. defer googleapi.CloseBody(res)
  28613. if err := googleapi.CheckResponse(res); err != nil {
  28614. return nil, err
  28615. }
  28616. ret := &FloodlightActivity{
  28617. ServerResponse: googleapi.ServerResponse{
  28618. Header: res.Header,
  28619. HTTPStatusCode: res.StatusCode,
  28620. },
  28621. }
  28622. target := &ret
  28623. if err := gensupport.DecodeResponse(target, res); err != nil {
  28624. return nil, err
  28625. }
  28626. return ret, nil
  28627. // {
  28628. // "description": "Gets one floodlight activity by ID.",
  28629. // "httpMethod": "GET",
  28630. // "id": "dfareporting.floodlightActivities.get",
  28631. // "parameterOrder": [
  28632. // "profileId",
  28633. // "id"
  28634. // ],
  28635. // "parameters": {
  28636. // "id": {
  28637. // "description": "Floodlight activity ID.",
  28638. // "format": "int64",
  28639. // "location": "path",
  28640. // "required": true,
  28641. // "type": "string"
  28642. // },
  28643. // "profileId": {
  28644. // "description": "User profile ID associated with this request.",
  28645. // "format": "int64",
  28646. // "location": "path",
  28647. // "required": true,
  28648. // "type": "string"
  28649. // }
  28650. // },
  28651. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28652. // "response": {
  28653. // "$ref": "FloodlightActivity"
  28654. // },
  28655. // "scopes": [
  28656. // "https://www.googleapis.com/auth/dfatrafficking"
  28657. // ]
  28658. // }
  28659. }
  28660. // method id "dfareporting.floodlightActivities.insert":
  28661. type FloodlightActivitiesInsertCall struct {
  28662. s *Service
  28663. profileId int64
  28664. floodlightactivity *FloodlightActivity
  28665. urlParams_ gensupport.URLParams
  28666. ctx_ context.Context
  28667. header_ http.Header
  28668. }
  28669. // Insert: Inserts a new floodlight activity.
  28670. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  28671. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28672. c.profileId = profileId
  28673. c.floodlightactivity = floodlightactivity
  28674. return c
  28675. }
  28676. // Fields allows partial responses to be retrieved. See
  28677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28678. // for more information.
  28679. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  28680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28681. return c
  28682. }
  28683. // Context sets the context to be used in this call's Do method. Any
  28684. // pending HTTP request will be aborted if the provided context is
  28685. // canceled.
  28686. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  28687. c.ctx_ = ctx
  28688. return c
  28689. }
  28690. // Header returns an http.Header that can be modified by the caller to
  28691. // add HTTP headers to the request.
  28692. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  28693. if c.header_ == nil {
  28694. c.header_ = make(http.Header)
  28695. }
  28696. return c.header_
  28697. }
  28698. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  28699. reqHeaders := make(http.Header)
  28700. for k, v := range c.header_ {
  28701. reqHeaders[k] = v
  28702. }
  28703. reqHeaders.Set("User-Agent", c.s.userAgent())
  28704. var body io.Reader = nil
  28705. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  28706. if err != nil {
  28707. return nil, err
  28708. }
  28709. reqHeaders.Set("Content-Type", "application/json")
  28710. c.urlParams_.Set("alt", alt)
  28711. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28712. urls += "?" + c.urlParams_.Encode()
  28713. req, _ := http.NewRequest("POST", urls, body)
  28714. req.Header = reqHeaders
  28715. googleapi.Expand(req.URL, map[string]string{
  28716. "profileId": strconv.FormatInt(c.profileId, 10),
  28717. })
  28718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28719. }
  28720. // Do executes the "dfareporting.floodlightActivities.insert" call.
  28721. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28722. // non-2xx status code is an error. Response headers are in either
  28723. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28724. // returned at all) in error.(*googleapi.Error).Header. Use
  28725. // googleapi.IsNotModified to check whether the returned error was
  28726. // because http.StatusNotModified was returned.
  28727. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28728. gensupport.SetOptions(c.urlParams_, opts...)
  28729. res, err := c.doRequest("json")
  28730. if res != nil && res.StatusCode == http.StatusNotModified {
  28731. if res.Body != nil {
  28732. res.Body.Close()
  28733. }
  28734. return nil, &googleapi.Error{
  28735. Code: res.StatusCode,
  28736. Header: res.Header,
  28737. }
  28738. }
  28739. if err != nil {
  28740. return nil, err
  28741. }
  28742. defer googleapi.CloseBody(res)
  28743. if err := googleapi.CheckResponse(res); err != nil {
  28744. return nil, err
  28745. }
  28746. ret := &FloodlightActivity{
  28747. ServerResponse: googleapi.ServerResponse{
  28748. Header: res.Header,
  28749. HTTPStatusCode: res.StatusCode,
  28750. },
  28751. }
  28752. target := &ret
  28753. if err := gensupport.DecodeResponse(target, res); err != nil {
  28754. return nil, err
  28755. }
  28756. return ret, nil
  28757. // {
  28758. // "description": "Inserts a new floodlight activity.",
  28759. // "httpMethod": "POST",
  28760. // "id": "dfareporting.floodlightActivities.insert",
  28761. // "parameterOrder": [
  28762. // "profileId"
  28763. // ],
  28764. // "parameters": {
  28765. // "profileId": {
  28766. // "description": "User profile ID associated with this request.",
  28767. // "format": "int64",
  28768. // "location": "path",
  28769. // "required": true,
  28770. // "type": "string"
  28771. // }
  28772. // },
  28773. // "path": "userprofiles/{profileId}/floodlightActivities",
  28774. // "request": {
  28775. // "$ref": "FloodlightActivity"
  28776. // },
  28777. // "response": {
  28778. // "$ref": "FloodlightActivity"
  28779. // },
  28780. // "scopes": [
  28781. // "https://www.googleapis.com/auth/dfatrafficking"
  28782. // ]
  28783. // }
  28784. }
  28785. // method id "dfareporting.floodlightActivities.list":
  28786. type FloodlightActivitiesListCall struct {
  28787. s *Service
  28788. profileId int64
  28789. urlParams_ gensupport.URLParams
  28790. ifNoneMatch_ string
  28791. ctx_ context.Context
  28792. header_ http.Header
  28793. }
  28794. // List: Retrieves a list of floodlight activities, possibly filtered.
  28795. // This method supports paging.
  28796. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  28797. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28798. c.profileId = profileId
  28799. return c
  28800. }
  28801. // AdvertiserId sets the optional parameter "advertiserId": Select only
  28802. // floodlight activities for the specified advertiser ID. Must specify
  28803. // either ids, advertiserId, or floodlightConfigurationId for a
  28804. // non-empty result.
  28805. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  28806. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  28807. return c
  28808. }
  28809. // FloodlightActivityGroupIds sets the optional parameter
  28810. // "floodlightActivityGroupIds": Select only floodlight activities with
  28811. // the specified floodlight activity group IDs.
  28812. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  28813. var floodlightActivityGroupIds_ []string
  28814. for _, v := range floodlightActivityGroupIds {
  28815. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  28816. }
  28817. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  28818. return c
  28819. }
  28820. // FloodlightActivityGroupName sets the optional parameter
  28821. // "floodlightActivityGroupName": Select only floodlight activities with
  28822. // the specified floodlight activity group name.
  28823. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  28824. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  28825. return c
  28826. }
  28827. // FloodlightActivityGroupTagString sets the optional parameter
  28828. // "floodlightActivityGroupTagString": Select only floodlight activities
  28829. // with the specified floodlight activity group tag string.
  28830. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  28831. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  28832. return c
  28833. }
  28834. // FloodlightActivityGroupType sets the optional parameter
  28835. // "floodlightActivityGroupType": Select only floodlight activities with
  28836. // the specified floodlight activity group type.
  28837. //
  28838. // Possible values:
  28839. // "COUNTER"
  28840. // "SALE"
  28841. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  28842. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  28843. return c
  28844. }
  28845. // FloodlightConfigurationId sets the optional parameter
  28846. // "floodlightConfigurationId": Select only floodlight activities for
  28847. // the specified floodlight configuration ID. Must specify either ids,
  28848. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28849. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  28850. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  28851. return c
  28852. }
  28853. // Ids sets the optional parameter "ids": Select only floodlight
  28854. // activities with the specified IDs. Must specify either ids,
  28855. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28856. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  28857. var ids_ []string
  28858. for _, v := range ids {
  28859. ids_ = append(ids_, fmt.Sprint(v))
  28860. }
  28861. c.urlParams_.SetMulti("ids", ids_)
  28862. return c
  28863. }
  28864. // MaxResults sets the optional parameter "maxResults": Maximum number
  28865. // of results to return.
  28866. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  28867. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28868. return c
  28869. }
  28870. // PageToken sets the optional parameter "pageToken": Value of the
  28871. // nextPageToken from the previous result page.
  28872. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  28873. c.urlParams_.Set("pageToken", pageToken)
  28874. return c
  28875. }
  28876. // SearchString sets the optional parameter "searchString": Allows
  28877. // searching for objects by name or ID. Wildcards (*) are allowed. For
  28878. // example, "floodlightactivity*2015" will return objects with names
  28879. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  28880. // or simply "floodlightactivity 2015". Most of the searches also add
  28881. // wildcards implicitly at the start and the end of the search string.
  28882. // For example, a search string of "floodlightactivity" will match
  28883. // objects with name "my floodlightactivity activity",
  28884. // "floodlightactivity 2015", or simply "floodlightactivity".
  28885. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  28886. c.urlParams_.Set("searchString", searchString)
  28887. return c
  28888. }
  28889. // SortField sets the optional parameter "sortField": Field by which to
  28890. // sort the list.
  28891. //
  28892. // Possible values:
  28893. // "ID" (default)
  28894. // "NAME"
  28895. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  28896. c.urlParams_.Set("sortField", sortField)
  28897. return c
  28898. }
  28899. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28900. // results.
  28901. //
  28902. // Possible values:
  28903. // "ASCENDING" (default)
  28904. // "DESCENDING"
  28905. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  28906. c.urlParams_.Set("sortOrder", sortOrder)
  28907. return c
  28908. }
  28909. // TagString sets the optional parameter "tagString": Select only
  28910. // floodlight activities with the specified tag string.
  28911. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  28912. c.urlParams_.Set("tagString", tagString)
  28913. return c
  28914. }
  28915. // Fields allows partial responses to be retrieved. See
  28916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28917. // for more information.
  28918. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  28919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28920. return c
  28921. }
  28922. // IfNoneMatch sets the optional parameter which makes the operation
  28923. // fail if the object's ETag matches the given value. This is useful for
  28924. // getting updates only after the object has changed since the last
  28925. // request. Use googleapi.IsNotModified to check whether the response
  28926. // error from Do is the result of In-None-Match.
  28927. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  28928. c.ifNoneMatch_ = entityTag
  28929. return c
  28930. }
  28931. // Context sets the context to be used in this call's Do method. Any
  28932. // pending HTTP request will be aborted if the provided context is
  28933. // canceled.
  28934. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  28935. c.ctx_ = ctx
  28936. return c
  28937. }
  28938. // Header returns an http.Header that can be modified by the caller to
  28939. // add HTTP headers to the request.
  28940. func (c *FloodlightActivitiesListCall) Header() http.Header {
  28941. if c.header_ == nil {
  28942. c.header_ = make(http.Header)
  28943. }
  28944. return c.header_
  28945. }
  28946. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  28947. reqHeaders := make(http.Header)
  28948. for k, v := range c.header_ {
  28949. reqHeaders[k] = v
  28950. }
  28951. reqHeaders.Set("User-Agent", c.s.userAgent())
  28952. if c.ifNoneMatch_ != "" {
  28953. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28954. }
  28955. var body io.Reader = nil
  28956. c.urlParams_.Set("alt", alt)
  28957. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28958. urls += "?" + c.urlParams_.Encode()
  28959. req, _ := http.NewRequest("GET", urls, body)
  28960. req.Header = reqHeaders
  28961. googleapi.Expand(req.URL, map[string]string{
  28962. "profileId": strconv.FormatInt(c.profileId, 10),
  28963. })
  28964. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28965. }
  28966. // Do executes the "dfareporting.floodlightActivities.list" call.
  28967. // Exactly one of *FloodlightActivitiesListResponse or error will be
  28968. // non-nil. Any non-2xx status code is an error. Response headers are in
  28969. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  28970. // a response was returned at all) in error.(*googleapi.Error).Header.
  28971. // Use googleapi.IsNotModified to check whether the returned error was
  28972. // because http.StatusNotModified was returned.
  28973. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  28974. gensupport.SetOptions(c.urlParams_, opts...)
  28975. res, err := c.doRequest("json")
  28976. if res != nil && res.StatusCode == http.StatusNotModified {
  28977. if res.Body != nil {
  28978. res.Body.Close()
  28979. }
  28980. return nil, &googleapi.Error{
  28981. Code: res.StatusCode,
  28982. Header: res.Header,
  28983. }
  28984. }
  28985. if err != nil {
  28986. return nil, err
  28987. }
  28988. defer googleapi.CloseBody(res)
  28989. if err := googleapi.CheckResponse(res); err != nil {
  28990. return nil, err
  28991. }
  28992. ret := &FloodlightActivitiesListResponse{
  28993. ServerResponse: googleapi.ServerResponse{
  28994. Header: res.Header,
  28995. HTTPStatusCode: res.StatusCode,
  28996. },
  28997. }
  28998. target := &ret
  28999. if err := gensupport.DecodeResponse(target, res); err != nil {
  29000. return nil, err
  29001. }
  29002. return ret, nil
  29003. // {
  29004. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  29005. // "httpMethod": "GET",
  29006. // "id": "dfareporting.floodlightActivities.list",
  29007. // "parameterOrder": [
  29008. // "profileId"
  29009. // ],
  29010. // "parameters": {
  29011. // "advertiserId": {
  29012. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29013. // "format": "int64",
  29014. // "location": "query",
  29015. // "type": "string"
  29016. // },
  29017. // "floodlightActivityGroupIds": {
  29018. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  29019. // "format": "int64",
  29020. // "location": "query",
  29021. // "repeated": true,
  29022. // "type": "string"
  29023. // },
  29024. // "floodlightActivityGroupName": {
  29025. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  29026. // "location": "query",
  29027. // "type": "string"
  29028. // },
  29029. // "floodlightActivityGroupTagString": {
  29030. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  29031. // "location": "query",
  29032. // "type": "string"
  29033. // },
  29034. // "floodlightActivityGroupType": {
  29035. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  29036. // "enum": [
  29037. // "COUNTER",
  29038. // "SALE"
  29039. // ],
  29040. // "enumDescriptions": [
  29041. // "",
  29042. // ""
  29043. // ],
  29044. // "location": "query",
  29045. // "type": "string"
  29046. // },
  29047. // "floodlightConfigurationId": {
  29048. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29049. // "format": "int64",
  29050. // "location": "query",
  29051. // "type": "string"
  29052. // },
  29053. // "ids": {
  29054. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29055. // "format": "int64",
  29056. // "location": "query",
  29057. // "repeated": true,
  29058. // "type": "string"
  29059. // },
  29060. // "maxResults": {
  29061. // "default": "1000",
  29062. // "description": "Maximum number of results to return.",
  29063. // "format": "int32",
  29064. // "location": "query",
  29065. // "maximum": "1000",
  29066. // "minimum": "0",
  29067. // "type": "integer"
  29068. // },
  29069. // "pageToken": {
  29070. // "description": "Value of the nextPageToken from the previous result page.",
  29071. // "location": "query",
  29072. // "type": "string"
  29073. // },
  29074. // "profileId": {
  29075. // "description": "User profile ID associated with this request.",
  29076. // "format": "int64",
  29077. // "location": "path",
  29078. // "required": true,
  29079. // "type": "string"
  29080. // },
  29081. // "searchString": {
  29082. // "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\".",
  29083. // "location": "query",
  29084. // "type": "string"
  29085. // },
  29086. // "sortField": {
  29087. // "default": "ID",
  29088. // "description": "Field by which to sort the list.",
  29089. // "enum": [
  29090. // "ID",
  29091. // "NAME"
  29092. // ],
  29093. // "enumDescriptions": [
  29094. // "",
  29095. // ""
  29096. // ],
  29097. // "location": "query",
  29098. // "type": "string"
  29099. // },
  29100. // "sortOrder": {
  29101. // "default": "ASCENDING",
  29102. // "description": "Order of sorted results.",
  29103. // "enum": [
  29104. // "ASCENDING",
  29105. // "DESCENDING"
  29106. // ],
  29107. // "enumDescriptions": [
  29108. // "",
  29109. // ""
  29110. // ],
  29111. // "location": "query",
  29112. // "type": "string"
  29113. // },
  29114. // "tagString": {
  29115. // "description": "Select only floodlight activities with the specified tag string.",
  29116. // "location": "query",
  29117. // "type": "string"
  29118. // }
  29119. // },
  29120. // "path": "userprofiles/{profileId}/floodlightActivities",
  29121. // "response": {
  29122. // "$ref": "FloodlightActivitiesListResponse"
  29123. // },
  29124. // "scopes": [
  29125. // "https://www.googleapis.com/auth/dfatrafficking"
  29126. // ]
  29127. // }
  29128. }
  29129. // Pages invokes f for each page of results.
  29130. // A non-nil error returned from f will halt the iteration.
  29131. // The provided context supersedes any context provided to the Context method.
  29132. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  29133. c.ctx_ = ctx
  29134. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29135. for {
  29136. x, err := c.Do()
  29137. if err != nil {
  29138. return err
  29139. }
  29140. if err := f(x); err != nil {
  29141. return err
  29142. }
  29143. if x.NextPageToken == "" {
  29144. return nil
  29145. }
  29146. c.PageToken(x.NextPageToken)
  29147. }
  29148. }
  29149. // method id "dfareporting.floodlightActivities.patch":
  29150. type FloodlightActivitiesPatchCall struct {
  29151. s *Service
  29152. profileId int64
  29153. floodlightactivity *FloodlightActivity
  29154. urlParams_ gensupport.URLParams
  29155. ctx_ context.Context
  29156. header_ http.Header
  29157. }
  29158. // Patch: Updates an existing floodlight activity. This method supports
  29159. // patch semantics.
  29160. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  29161. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29162. c.profileId = profileId
  29163. c.urlParams_.Set("id", fmt.Sprint(id))
  29164. c.floodlightactivity = floodlightactivity
  29165. return c
  29166. }
  29167. // Fields allows partial responses to be retrieved. See
  29168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29169. // for more information.
  29170. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  29171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29172. return c
  29173. }
  29174. // Context sets the context to be used in this call's Do method. Any
  29175. // pending HTTP request will be aborted if the provided context is
  29176. // canceled.
  29177. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  29178. c.ctx_ = ctx
  29179. return c
  29180. }
  29181. // Header returns an http.Header that can be modified by the caller to
  29182. // add HTTP headers to the request.
  29183. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  29184. if c.header_ == nil {
  29185. c.header_ = make(http.Header)
  29186. }
  29187. return c.header_
  29188. }
  29189. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  29190. reqHeaders := make(http.Header)
  29191. for k, v := range c.header_ {
  29192. reqHeaders[k] = v
  29193. }
  29194. reqHeaders.Set("User-Agent", c.s.userAgent())
  29195. var body io.Reader = nil
  29196. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29197. if err != nil {
  29198. return nil, err
  29199. }
  29200. reqHeaders.Set("Content-Type", "application/json")
  29201. c.urlParams_.Set("alt", alt)
  29202. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29203. urls += "?" + c.urlParams_.Encode()
  29204. req, _ := http.NewRequest("PATCH", urls, body)
  29205. req.Header = reqHeaders
  29206. googleapi.Expand(req.URL, map[string]string{
  29207. "profileId": strconv.FormatInt(c.profileId, 10),
  29208. })
  29209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29210. }
  29211. // Do executes the "dfareporting.floodlightActivities.patch" call.
  29212. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29213. // non-2xx status code is an error. Response headers are in either
  29214. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29215. // returned at all) in error.(*googleapi.Error).Header. Use
  29216. // googleapi.IsNotModified to check whether the returned error was
  29217. // because http.StatusNotModified was returned.
  29218. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29219. gensupport.SetOptions(c.urlParams_, opts...)
  29220. res, err := c.doRequest("json")
  29221. if res != nil && res.StatusCode == http.StatusNotModified {
  29222. if res.Body != nil {
  29223. res.Body.Close()
  29224. }
  29225. return nil, &googleapi.Error{
  29226. Code: res.StatusCode,
  29227. Header: res.Header,
  29228. }
  29229. }
  29230. if err != nil {
  29231. return nil, err
  29232. }
  29233. defer googleapi.CloseBody(res)
  29234. if err := googleapi.CheckResponse(res); err != nil {
  29235. return nil, err
  29236. }
  29237. ret := &FloodlightActivity{
  29238. ServerResponse: googleapi.ServerResponse{
  29239. Header: res.Header,
  29240. HTTPStatusCode: res.StatusCode,
  29241. },
  29242. }
  29243. target := &ret
  29244. if err := gensupport.DecodeResponse(target, res); err != nil {
  29245. return nil, err
  29246. }
  29247. return ret, nil
  29248. // {
  29249. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  29250. // "httpMethod": "PATCH",
  29251. // "id": "dfareporting.floodlightActivities.patch",
  29252. // "parameterOrder": [
  29253. // "profileId",
  29254. // "id"
  29255. // ],
  29256. // "parameters": {
  29257. // "id": {
  29258. // "description": "Floodlight activity ID.",
  29259. // "format": "int64",
  29260. // "location": "query",
  29261. // "required": true,
  29262. // "type": "string"
  29263. // },
  29264. // "profileId": {
  29265. // "description": "User profile ID associated with this request.",
  29266. // "format": "int64",
  29267. // "location": "path",
  29268. // "required": true,
  29269. // "type": "string"
  29270. // }
  29271. // },
  29272. // "path": "userprofiles/{profileId}/floodlightActivities",
  29273. // "request": {
  29274. // "$ref": "FloodlightActivity"
  29275. // },
  29276. // "response": {
  29277. // "$ref": "FloodlightActivity"
  29278. // },
  29279. // "scopes": [
  29280. // "https://www.googleapis.com/auth/dfatrafficking"
  29281. // ]
  29282. // }
  29283. }
  29284. // method id "dfareporting.floodlightActivities.update":
  29285. type FloodlightActivitiesUpdateCall struct {
  29286. s *Service
  29287. profileId int64
  29288. floodlightactivity *FloodlightActivity
  29289. urlParams_ gensupport.URLParams
  29290. ctx_ context.Context
  29291. header_ http.Header
  29292. }
  29293. // Update: Updates an existing floodlight activity.
  29294. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  29295. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29296. c.profileId = profileId
  29297. c.floodlightactivity = floodlightactivity
  29298. return c
  29299. }
  29300. // Fields allows partial responses to be retrieved. See
  29301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29302. // for more information.
  29303. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  29304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29305. return c
  29306. }
  29307. // Context sets the context to be used in this call's Do method. Any
  29308. // pending HTTP request will be aborted if the provided context is
  29309. // canceled.
  29310. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  29311. c.ctx_ = ctx
  29312. return c
  29313. }
  29314. // Header returns an http.Header that can be modified by the caller to
  29315. // add HTTP headers to the request.
  29316. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  29317. if c.header_ == nil {
  29318. c.header_ = make(http.Header)
  29319. }
  29320. return c.header_
  29321. }
  29322. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  29323. reqHeaders := make(http.Header)
  29324. for k, v := range c.header_ {
  29325. reqHeaders[k] = v
  29326. }
  29327. reqHeaders.Set("User-Agent", c.s.userAgent())
  29328. var body io.Reader = nil
  29329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29330. if err != nil {
  29331. return nil, err
  29332. }
  29333. reqHeaders.Set("Content-Type", "application/json")
  29334. c.urlParams_.Set("alt", alt)
  29335. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29336. urls += "?" + c.urlParams_.Encode()
  29337. req, _ := http.NewRequest("PUT", urls, body)
  29338. req.Header = reqHeaders
  29339. googleapi.Expand(req.URL, map[string]string{
  29340. "profileId": strconv.FormatInt(c.profileId, 10),
  29341. })
  29342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29343. }
  29344. // Do executes the "dfareporting.floodlightActivities.update" call.
  29345. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29346. // non-2xx status code is an error. Response headers are in either
  29347. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29348. // returned at all) in error.(*googleapi.Error).Header. Use
  29349. // googleapi.IsNotModified to check whether the returned error was
  29350. // because http.StatusNotModified was returned.
  29351. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29352. gensupport.SetOptions(c.urlParams_, opts...)
  29353. res, err := c.doRequest("json")
  29354. if res != nil && res.StatusCode == http.StatusNotModified {
  29355. if res.Body != nil {
  29356. res.Body.Close()
  29357. }
  29358. return nil, &googleapi.Error{
  29359. Code: res.StatusCode,
  29360. Header: res.Header,
  29361. }
  29362. }
  29363. if err != nil {
  29364. return nil, err
  29365. }
  29366. defer googleapi.CloseBody(res)
  29367. if err := googleapi.CheckResponse(res); err != nil {
  29368. return nil, err
  29369. }
  29370. ret := &FloodlightActivity{
  29371. ServerResponse: googleapi.ServerResponse{
  29372. Header: res.Header,
  29373. HTTPStatusCode: res.StatusCode,
  29374. },
  29375. }
  29376. target := &ret
  29377. if err := gensupport.DecodeResponse(target, res); err != nil {
  29378. return nil, err
  29379. }
  29380. return ret, nil
  29381. // {
  29382. // "description": "Updates an existing floodlight activity.",
  29383. // "httpMethod": "PUT",
  29384. // "id": "dfareporting.floodlightActivities.update",
  29385. // "parameterOrder": [
  29386. // "profileId"
  29387. // ],
  29388. // "parameters": {
  29389. // "profileId": {
  29390. // "description": "User profile ID associated with this request.",
  29391. // "format": "int64",
  29392. // "location": "path",
  29393. // "required": true,
  29394. // "type": "string"
  29395. // }
  29396. // },
  29397. // "path": "userprofiles/{profileId}/floodlightActivities",
  29398. // "request": {
  29399. // "$ref": "FloodlightActivity"
  29400. // },
  29401. // "response": {
  29402. // "$ref": "FloodlightActivity"
  29403. // },
  29404. // "scopes": [
  29405. // "https://www.googleapis.com/auth/dfatrafficking"
  29406. // ]
  29407. // }
  29408. }
  29409. // method id "dfareporting.floodlightActivityGroups.get":
  29410. type FloodlightActivityGroupsGetCall struct {
  29411. s *Service
  29412. profileId int64
  29413. id int64
  29414. urlParams_ gensupport.URLParams
  29415. ifNoneMatch_ string
  29416. ctx_ context.Context
  29417. header_ http.Header
  29418. }
  29419. // Get: Gets one floodlight activity group by ID.
  29420. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  29421. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29422. c.profileId = profileId
  29423. c.id = id
  29424. return c
  29425. }
  29426. // Fields allows partial responses to be retrieved. See
  29427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29428. // for more information.
  29429. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  29430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29431. return c
  29432. }
  29433. // IfNoneMatch sets the optional parameter which makes the operation
  29434. // fail if the object's ETag matches the given value. This is useful for
  29435. // getting updates only after the object has changed since the last
  29436. // request. Use googleapi.IsNotModified to check whether the response
  29437. // error from Do is the result of In-None-Match.
  29438. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  29439. c.ifNoneMatch_ = entityTag
  29440. return c
  29441. }
  29442. // Context sets the context to be used in this call's Do method. Any
  29443. // pending HTTP request will be aborted if the provided context is
  29444. // canceled.
  29445. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  29446. c.ctx_ = ctx
  29447. return c
  29448. }
  29449. // Header returns an http.Header that can be modified by the caller to
  29450. // add HTTP headers to the request.
  29451. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  29452. if c.header_ == nil {
  29453. c.header_ = make(http.Header)
  29454. }
  29455. return c.header_
  29456. }
  29457. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  29458. reqHeaders := make(http.Header)
  29459. for k, v := range c.header_ {
  29460. reqHeaders[k] = v
  29461. }
  29462. reqHeaders.Set("User-Agent", c.s.userAgent())
  29463. if c.ifNoneMatch_ != "" {
  29464. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29465. }
  29466. var body io.Reader = nil
  29467. c.urlParams_.Set("alt", alt)
  29468. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  29469. urls += "?" + c.urlParams_.Encode()
  29470. req, _ := http.NewRequest("GET", urls, body)
  29471. req.Header = reqHeaders
  29472. googleapi.Expand(req.URL, map[string]string{
  29473. "profileId": strconv.FormatInt(c.profileId, 10),
  29474. "id": strconv.FormatInt(c.id, 10),
  29475. })
  29476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29477. }
  29478. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  29479. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29480. // non-2xx status code is an error. Response headers are in either
  29481. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29482. // returned at all) in error.(*googleapi.Error).Header. Use
  29483. // googleapi.IsNotModified to check whether the returned error was
  29484. // because http.StatusNotModified was returned.
  29485. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29486. gensupport.SetOptions(c.urlParams_, opts...)
  29487. res, err := c.doRequest("json")
  29488. if res != nil && res.StatusCode == http.StatusNotModified {
  29489. if res.Body != nil {
  29490. res.Body.Close()
  29491. }
  29492. return nil, &googleapi.Error{
  29493. Code: res.StatusCode,
  29494. Header: res.Header,
  29495. }
  29496. }
  29497. if err != nil {
  29498. return nil, err
  29499. }
  29500. defer googleapi.CloseBody(res)
  29501. if err := googleapi.CheckResponse(res); err != nil {
  29502. return nil, err
  29503. }
  29504. ret := &FloodlightActivityGroup{
  29505. ServerResponse: googleapi.ServerResponse{
  29506. Header: res.Header,
  29507. HTTPStatusCode: res.StatusCode,
  29508. },
  29509. }
  29510. target := &ret
  29511. if err := gensupport.DecodeResponse(target, res); err != nil {
  29512. return nil, err
  29513. }
  29514. return ret, nil
  29515. // {
  29516. // "description": "Gets one floodlight activity group by ID.",
  29517. // "httpMethod": "GET",
  29518. // "id": "dfareporting.floodlightActivityGroups.get",
  29519. // "parameterOrder": [
  29520. // "profileId",
  29521. // "id"
  29522. // ],
  29523. // "parameters": {
  29524. // "id": {
  29525. // "description": "Floodlight activity Group ID.",
  29526. // "format": "int64",
  29527. // "location": "path",
  29528. // "required": true,
  29529. // "type": "string"
  29530. // },
  29531. // "profileId": {
  29532. // "description": "User profile ID associated with this request.",
  29533. // "format": "int64",
  29534. // "location": "path",
  29535. // "required": true,
  29536. // "type": "string"
  29537. // }
  29538. // },
  29539. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  29540. // "response": {
  29541. // "$ref": "FloodlightActivityGroup"
  29542. // },
  29543. // "scopes": [
  29544. // "https://www.googleapis.com/auth/dfatrafficking"
  29545. // ]
  29546. // }
  29547. }
  29548. // method id "dfareporting.floodlightActivityGroups.insert":
  29549. type FloodlightActivityGroupsInsertCall struct {
  29550. s *Service
  29551. profileId int64
  29552. floodlightactivitygroup *FloodlightActivityGroup
  29553. urlParams_ gensupport.URLParams
  29554. ctx_ context.Context
  29555. header_ http.Header
  29556. }
  29557. // Insert: Inserts a new floodlight activity group.
  29558. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  29559. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29560. c.profileId = profileId
  29561. c.floodlightactivitygroup = floodlightactivitygroup
  29562. return c
  29563. }
  29564. // Fields allows partial responses to be retrieved. See
  29565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29566. // for more information.
  29567. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  29568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29569. return c
  29570. }
  29571. // Context sets the context to be used in this call's Do method. Any
  29572. // pending HTTP request will be aborted if the provided context is
  29573. // canceled.
  29574. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  29575. c.ctx_ = ctx
  29576. return c
  29577. }
  29578. // Header returns an http.Header that can be modified by the caller to
  29579. // add HTTP headers to the request.
  29580. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  29581. if c.header_ == nil {
  29582. c.header_ = make(http.Header)
  29583. }
  29584. return c.header_
  29585. }
  29586. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  29587. reqHeaders := make(http.Header)
  29588. for k, v := range c.header_ {
  29589. reqHeaders[k] = v
  29590. }
  29591. reqHeaders.Set("User-Agent", c.s.userAgent())
  29592. var body io.Reader = nil
  29593. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  29594. if err != nil {
  29595. return nil, err
  29596. }
  29597. reqHeaders.Set("Content-Type", "application/json")
  29598. c.urlParams_.Set("alt", alt)
  29599. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29600. urls += "?" + c.urlParams_.Encode()
  29601. req, _ := http.NewRequest("POST", urls, body)
  29602. req.Header = reqHeaders
  29603. googleapi.Expand(req.URL, map[string]string{
  29604. "profileId": strconv.FormatInt(c.profileId, 10),
  29605. })
  29606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29607. }
  29608. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  29609. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29610. // non-2xx status code is an error. Response headers are in either
  29611. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29612. // returned at all) in error.(*googleapi.Error).Header. Use
  29613. // googleapi.IsNotModified to check whether the returned error was
  29614. // because http.StatusNotModified was returned.
  29615. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29616. gensupport.SetOptions(c.urlParams_, opts...)
  29617. res, err := c.doRequest("json")
  29618. if res != nil && res.StatusCode == http.StatusNotModified {
  29619. if res.Body != nil {
  29620. res.Body.Close()
  29621. }
  29622. return nil, &googleapi.Error{
  29623. Code: res.StatusCode,
  29624. Header: res.Header,
  29625. }
  29626. }
  29627. if err != nil {
  29628. return nil, err
  29629. }
  29630. defer googleapi.CloseBody(res)
  29631. if err := googleapi.CheckResponse(res); err != nil {
  29632. return nil, err
  29633. }
  29634. ret := &FloodlightActivityGroup{
  29635. ServerResponse: googleapi.ServerResponse{
  29636. Header: res.Header,
  29637. HTTPStatusCode: res.StatusCode,
  29638. },
  29639. }
  29640. target := &ret
  29641. if err := gensupport.DecodeResponse(target, res); err != nil {
  29642. return nil, err
  29643. }
  29644. return ret, nil
  29645. // {
  29646. // "description": "Inserts a new floodlight activity group.",
  29647. // "httpMethod": "POST",
  29648. // "id": "dfareporting.floodlightActivityGroups.insert",
  29649. // "parameterOrder": [
  29650. // "profileId"
  29651. // ],
  29652. // "parameters": {
  29653. // "profileId": {
  29654. // "description": "User profile ID associated with this request.",
  29655. // "format": "int64",
  29656. // "location": "path",
  29657. // "required": true,
  29658. // "type": "string"
  29659. // }
  29660. // },
  29661. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  29662. // "request": {
  29663. // "$ref": "FloodlightActivityGroup"
  29664. // },
  29665. // "response": {
  29666. // "$ref": "FloodlightActivityGroup"
  29667. // },
  29668. // "scopes": [
  29669. // "https://www.googleapis.com/auth/dfatrafficking"
  29670. // ]
  29671. // }
  29672. }
  29673. // method id "dfareporting.floodlightActivityGroups.list":
  29674. type FloodlightActivityGroupsListCall struct {
  29675. s *Service
  29676. profileId int64
  29677. urlParams_ gensupport.URLParams
  29678. ifNoneMatch_ string
  29679. ctx_ context.Context
  29680. header_ http.Header
  29681. }
  29682. // List: Retrieves a list of floodlight activity groups, possibly
  29683. // filtered. This method supports paging.
  29684. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  29685. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29686. c.profileId = profileId
  29687. return c
  29688. }
  29689. // AdvertiserId sets the optional parameter "advertiserId": Select only
  29690. // floodlight activity groups with the specified advertiser ID. Must
  29691. // specify either advertiserId or floodlightConfigurationId for a
  29692. // non-empty result.
  29693. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  29694. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  29695. return c
  29696. }
  29697. // FloodlightConfigurationId sets the optional parameter
  29698. // "floodlightConfigurationId": Select only floodlight activity groups
  29699. // with the specified floodlight configuration ID. Must specify either
  29700. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29701. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  29702. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  29703. return c
  29704. }
  29705. // Ids sets the optional parameter "ids": Select only floodlight
  29706. // activity groups with the specified IDs. Must specify either
  29707. // advertiserId or floodlightConfigurationId for a non-empty result.
  29708. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  29709. var ids_ []string
  29710. for _, v := range ids {
  29711. ids_ = append(ids_, fmt.Sprint(v))
  29712. }
  29713. c.urlParams_.SetMulti("ids", ids_)
  29714. return c
  29715. }
  29716. // MaxResults sets the optional parameter "maxResults": Maximum number
  29717. // of results to return.
  29718. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  29719. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29720. return c
  29721. }
  29722. // PageToken sets the optional parameter "pageToken": Value of the
  29723. // nextPageToken from the previous result page.
  29724. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  29725. c.urlParams_.Set("pageToken", pageToken)
  29726. return c
  29727. }
  29728. // SearchString sets the optional parameter "searchString": Allows
  29729. // searching for objects by name or ID. Wildcards (*) are allowed. For
  29730. // example, "floodlightactivitygroup*2015" will return objects with
  29731. // names like "floodlightactivitygroup June 2015",
  29732. // "floodlightactivitygroup April 2015", or simply
  29733. // "floodlightactivitygroup 2015". Most of the searches also add
  29734. // wildcards implicitly at the start and the end of the search string.
  29735. // For example, a search string of "floodlightactivitygroup" will match
  29736. // objects with name "my floodlightactivitygroup activity",
  29737. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  29738. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  29739. c.urlParams_.Set("searchString", searchString)
  29740. return c
  29741. }
  29742. // SortField sets the optional parameter "sortField": Field by which to
  29743. // sort the list.
  29744. //
  29745. // Possible values:
  29746. // "ID" (default)
  29747. // "NAME"
  29748. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  29749. c.urlParams_.Set("sortField", sortField)
  29750. return c
  29751. }
  29752. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29753. // results.
  29754. //
  29755. // Possible values:
  29756. // "ASCENDING" (default)
  29757. // "DESCENDING"
  29758. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  29759. c.urlParams_.Set("sortOrder", sortOrder)
  29760. return c
  29761. }
  29762. // Type sets the optional parameter "type": Select only floodlight
  29763. // activity groups with the specified floodlight activity group type.
  29764. //
  29765. // Possible values:
  29766. // "COUNTER"
  29767. // "SALE"
  29768. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  29769. c.urlParams_.Set("type", type_)
  29770. return c
  29771. }
  29772. // Fields allows partial responses to be retrieved. See
  29773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29774. // for more information.
  29775. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  29776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29777. return c
  29778. }
  29779. // IfNoneMatch sets the optional parameter which makes the operation
  29780. // fail if the object's ETag matches the given value. This is useful for
  29781. // getting updates only after the object has changed since the last
  29782. // request. Use googleapi.IsNotModified to check whether the response
  29783. // error from Do is the result of In-None-Match.
  29784. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  29785. c.ifNoneMatch_ = entityTag
  29786. return c
  29787. }
  29788. // Context sets the context to be used in this call's Do method. Any
  29789. // pending HTTP request will be aborted if the provided context is
  29790. // canceled.
  29791. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  29792. c.ctx_ = ctx
  29793. return c
  29794. }
  29795. // Header returns an http.Header that can be modified by the caller to
  29796. // add HTTP headers to the request.
  29797. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  29798. if c.header_ == nil {
  29799. c.header_ = make(http.Header)
  29800. }
  29801. return c.header_
  29802. }
  29803. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  29804. reqHeaders := make(http.Header)
  29805. for k, v := range c.header_ {
  29806. reqHeaders[k] = v
  29807. }
  29808. reqHeaders.Set("User-Agent", c.s.userAgent())
  29809. if c.ifNoneMatch_ != "" {
  29810. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29811. }
  29812. var body io.Reader = nil
  29813. c.urlParams_.Set("alt", alt)
  29814. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29815. urls += "?" + c.urlParams_.Encode()
  29816. req, _ := http.NewRequest("GET", urls, body)
  29817. req.Header = reqHeaders
  29818. googleapi.Expand(req.URL, map[string]string{
  29819. "profileId": strconv.FormatInt(c.profileId, 10),
  29820. })
  29821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29822. }
  29823. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  29824. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  29825. // non-nil. Any non-2xx status code is an error. Response headers are in
  29826. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  29827. // (if a response was returned at all) in
  29828. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  29829. // whether the returned error was because http.StatusNotModified was
  29830. // returned.
  29831. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  29832. gensupport.SetOptions(c.urlParams_, opts...)
  29833. res, err := c.doRequest("json")
  29834. if res != nil && res.StatusCode == http.StatusNotModified {
  29835. if res.Body != nil {
  29836. res.Body.Close()
  29837. }
  29838. return nil, &googleapi.Error{
  29839. Code: res.StatusCode,
  29840. Header: res.Header,
  29841. }
  29842. }
  29843. if err != nil {
  29844. return nil, err
  29845. }
  29846. defer googleapi.CloseBody(res)
  29847. if err := googleapi.CheckResponse(res); err != nil {
  29848. return nil, err
  29849. }
  29850. ret := &FloodlightActivityGroupsListResponse{
  29851. ServerResponse: googleapi.ServerResponse{
  29852. Header: res.Header,
  29853. HTTPStatusCode: res.StatusCode,
  29854. },
  29855. }
  29856. target := &ret
  29857. if err := gensupport.DecodeResponse(target, res); err != nil {
  29858. return nil, err
  29859. }
  29860. return ret, nil
  29861. // {
  29862. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  29863. // "httpMethod": "GET",
  29864. // "id": "dfareporting.floodlightActivityGroups.list",
  29865. // "parameterOrder": [
  29866. // "profileId"
  29867. // ],
  29868. // "parameters": {
  29869. // "advertiserId": {
  29870. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  29871. // "format": "int64",
  29872. // "location": "query",
  29873. // "type": "string"
  29874. // },
  29875. // "floodlightConfigurationId": {
  29876. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  29877. // "format": "int64",
  29878. // "location": "query",
  29879. // "type": "string"
  29880. // },
  29881. // "ids": {
  29882. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  29883. // "format": "int64",
  29884. // "location": "query",
  29885. // "repeated": true,
  29886. // "type": "string"
  29887. // },
  29888. // "maxResults": {
  29889. // "default": "1000",
  29890. // "description": "Maximum number of results to return.",
  29891. // "format": "int32",
  29892. // "location": "query",
  29893. // "maximum": "1000",
  29894. // "minimum": "0",
  29895. // "type": "integer"
  29896. // },
  29897. // "pageToken": {
  29898. // "description": "Value of the nextPageToken from the previous result page.",
  29899. // "location": "query",
  29900. // "type": "string"
  29901. // },
  29902. // "profileId": {
  29903. // "description": "User profile ID associated with this request.",
  29904. // "format": "int64",
  29905. // "location": "path",
  29906. // "required": true,
  29907. // "type": "string"
  29908. // },
  29909. // "searchString": {
  29910. // "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\".",
  29911. // "location": "query",
  29912. // "type": "string"
  29913. // },
  29914. // "sortField": {
  29915. // "default": "ID",
  29916. // "description": "Field by which to sort the list.",
  29917. // "enum": [
  29918. // "ID",
  29919. // "NAME"
  29920. // ],
  29921. // "enumDescriptions": [
  29922. // "",
  29923. // ""
  29924. // ],
  29925. // "location": "query",
  29926. // "type": "string"
  29927. // },
  29928. // "sortOrder": {
  29929. // "default": "ASCENDING",
  29930. // "description": "Order of sorted results.",
  29931. // "enum": [
  29932. // "ASCENDING",
  29933. // "DESCENDING"
  29934. // ],
  29935. // "enumDescriptions": [
  29936. // "",
  29937. // ""
  29938. // ],
  29939. // "location": "query",
  29940. // "type": "string"
  29941. // },
  29942. // "type": {
  29943. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  29944. // "enum": [
  29945. // "COUNTER",
  29946. // "SALE"
  29947. // ],
  29948. // "enumDescriptions": [
  29949. // "",
  29950. // ""
  29951. // ],
  29952. // "location": "query",
  29953. // "type": "string"
  29954. // }
  29955. // },
  29956. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  29957. // "response": {
  29958. // "$ref": "FloodlightActivityGroupsListResponse"
  29959. // },
  29960. // "scopes": [
  29961. // "https://www.googleapis.com/auth/dfatrafficking"
  29962. // ]
  29963. // }
  29964. }
  29965. // Pages invokes f for each page of results.
  29966. // A non-nil error returned from f will halt the iteration.
  29967. // The provided context supersedes any context provided to the Context method.
  29968. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  29969. c.ctx_ = ctx
  29970. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29971. for {
  29972. x, err := c.Do()
  29973. if err != nil {
  29974. return err
  29975. }
  29976. if err := f(x); err != nil {
  29977. return err
  29978. }
  29979. if x.NextPageToken == "" {
  29980. return nil
  29981. }
  29982. c.PageToken(x.NextPageToken)
  29983. }
  29984. }
  29985. // method id "dfareporting.floodlightActivityGroups.patch":
  29986. type FloodlightActivityGroupsPatchCall struct {
  29987. s *Service
  29988. profileId int64
  29989. floodlightactivitygroup *FloodlightActivityGroup
  29990. urlParams_ gensupport.URLParams
  29991. ctx_ context.Context
  29992. header_ http.Header
  29993. }
  29994. // Patch: Updates an existing floodlight activity group. This method
  29995. // supports patch semantics.
  29996. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  29997. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29998. c.profileId = profileId
  29999. c.urlParams_.Set("id", fmt.Sprint(id))
  30000. c.floodlightactivitygroup = floodlightactivitygroup
  30001. return c
  30002. }
  30003. // Fields allows partial responses to be retrieved. See
  30004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30005. // for more information.
  30006. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  30007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30008. return c
  30009. }
  30010. // Context sets the context to be used in this call's Do method. Any
  30011. // pending HTTP request will be aborted if the provided context is
  30012. // canceled.
  30013. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  30014. c.ctx_ = ctx
  30015. return c
  30016. }
  30017. // Header returns an http.Header that can be modified by the caller to
  30018. // add HTTP headers to the request.
  30019. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  30020. if c.header_ == nil {
  30021. c.header_ = make(http.Header)
  30022. }
  30023. return c.header_
  30024. }
  30025. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  30026. reqHeaders := make(http.Header)
  30027. for k, v := range c.header_ {
  30028. reqHeaders[k] = v
  30029. }
  30030. reqHeaders.Set("User-Agent", c.s.userAgent())
  30031. var body io.Reader = nil
  30032. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30033. if err != nil {
  30034. return nil, err
  30035. }
  30036. reqHeaders.Set("Content-Type", "application/json")
  30037. c.urlParams_.Set("alt", alt)
  30038. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30039. urls += "?" + c.urlParams_.Encode()
  30040. req, _ := http.NewRequest("PATCH", urls, body)
  30041. req.Header = reqHeaders
  30042. googleapi.Expand(req.URL, map[string]string{
  30043. "profileId": strconv.FormatInt(c.profileId, 10),
  30044. })
  30045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30046. }
  30047. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  30048. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30049. // non-2xx status code is an error. Response headers are in either
  30050. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30051. // returned at all) in error.(*googleapi.Error).Header. Use
  30052. // googleapi.IsNotModified to check whether the returned error was
  30053. // because http.StatusNotModified was returned.
  30054. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30055. gensupport.SetOptions(c.urlParams_, opts...)
  30056. res, err := c.doRequest("json")
  30057. if res != nil && res.StatusCode == http.StatusNotModified {
  30058. if res.Body != nil {
  30059. res.Body.Close()
  30060. }
  30061. return nil, &googleapi.Error{
  30062. Code: res.StatusCode,
  30063. Header: res.Header,
  30064. }
  30065. }
  30066. if err != nil {
  30067. return nil, err
  30068. }
  30069. defer googleapi.CloseBody(res)
  30070. if err := googleapi.CheckResponse(res); err != nil {
  30071. return nil, err
  30072. }
  30073. ret := &FloodlightActivityGroup{
  30074. ServerResponse: googleapi.ServerResponse{
  30075. Header: res.Header,
  30076. HTTPStatusCode: res.StatusCode,
  30077. },
  30078. }
  30079. target := &ret
  30080. if err := gensupport.DecodeResponse(target, res); err != nil {
  30081. return nil, err
  30082. }
  30083. return ret, nil
  30084. // {
  30085. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  30086. // "httpMethod": "PATCH",
  30087. // "id": "dfareporting.floodlightActivityGroups.patch",
  30088. // "parameterOrder": [
  30089. // "profileId",
  30090. // "id"
  30091. // ],
  30092. // "parameters": {
  30093. // "id": {
  30094. // "description": "Floodlight activity Group ID.",
  30095. // "format": "int64",
  30096. // "location": "query",
  30097. // "required": true,
  30098. // "type": "string"
  30099. // },
  30100. // "profileId": {
  30101. // "description": "User profile ID associated with this request.",
  30102. // "format": "int64",
  30103. // "location": "path",
  30104. // "required": true,
  30105. // "type": "string"
  30106. // }
  30107. // },
  30108. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30109. // "request": {
  30110. // "$ref": "FloodlightActivityGroup"
  30111. // },
  30112. // "response": {
  30113. // "$ref": "FloodlightActivityGroup"
  30114. // },
  30115. // "scopes": [
  30116. // "https://www.googleapis.com/auth/dfatrafficking"
  30117. // ]
  30118. // }
  30119. }
  30120. // method id "dfareporting.floodlightActivityGroups.update":
  30121. type FloodlightActivityGroupsUpdateCall struct {
  30122. s *Service
  30123. profileId int64
  30124. floodlightactivitygroup *FloodlightActivityGroup
  30125. urlParams_ gensupport.URLParams
  30126. ctx_ context.Context
  30127. header_ http.Header
  30128. }
  30129. // Update: Updates an existing floodlight activity group.
  30130. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  30131. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30132. c.profileId = profileId
  30133. c.floodlightactivitygroup = floodlightactivitygroup
  30134. return c
  30135. }
  30136. // Fields allows partial responses to be retrieved. See
  30137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30138. // for more information.
  30139. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  30140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30141. return c
  30142. }
  30143. // Context sets the context to be used in this call's Do method. Any
  30144. // pending HTTP request will be aborted if the provided context is
  30145. // canceled.
  30146. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  30147. c.ctx_ = ctx
  30148. return c
  30149. }
  30150. // Header returns an http.Header that can be modified by the caller to
  30151. // add HTTP headers to the request.
  30152. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  30153. if c.header_ == nil {
  30154. c.header_ = make(http.Header)
  30155. }
  30156. return c.header_
  30157. }
  30158. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30159. reqHeaders := make(http.Header)
  30160. for k, v := range c.header_ {
  30161. reqHeaders[k] = v
  30162. }
  30163. reqHeaders.Set("User-Agent", c.s.userAgent())
  30164. var body io.Reader = nil
  30165. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30166. if err != nil {
  30167. return nil, err
  30168. }
  30169. reqHeaders.Set("Content-Type", "application/json")
  30170. c.urlParams_.Set("alt", alt)
  30171. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30172. urls += "?" + c.urlParams_.Encode()
  30173. req, _ := http.NewRequest("PUT", urls, body)
  30174. req.Header = reqHeaders
  30175. googleapi.Expand(req.URL, map[string]string{
  30176. "profileId": strconv.FormatInt(c.profileId, 10),
  30177. })
  30178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30179. }
  30180. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  30181. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30182. // non-2xx status code is an error. Response headers are in either
  30183. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30184. // returned at all) in error.(*googleapi.Error).Header. Use
  30185. // googleapi.IsNotModified to check whether the returned error was
  30186. // because http.StatusNotModified was returned.
  30187. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30188. gensupport.SetOptions(c.urlParams_, opts...)
  30189. res, err := c.doRequest("json")
  30190. if res != nil && res.StatusCode == http.StatusNotModified {
  30191. if res.Body != nil {
  30192. res.Body.Close()
  30193. }
  30194. return nil, &googleapi.Error{
  30195. Code: res.StatusCode,
  30196. Header: res.Header,
  30197. }
  30198. }
  30199. if err != nil {
  30200. return nil, err
  30201. }
  30202. defer googleapi.CloseBody(res)
  30203. if err := googleapi.CheckResponse(res); err != nil {
  30204. return nil, err
  30205. }
  30206. ret := &FloodlightActivityGroup{
  30207. ServerResponse: googleapi.ServerResponse{
  30208. Header: res.Header,
  30209. HTTPStatusCode: res.StatusCode,
  30210. },
  30211. }
  30212. target := &ret
  30213. if err := gensupport.DecodeResponse(target, res); err != nil {
  30214. return nil, err
  30215. }
  30216. return ret, nil
  30217. // {
  30218. // "description": "Updates an existing floodlight activity group.",
  30219. // "httpMethod": "PUT",
  30220. // "id": "dfareporting.floodlightActivityGroups.update",
  30221. // "parameterOrder": [
  30222. // "profileId"
  30223. // ],
  30224. // "parameters": {
  30225. // "profileId": {
  30226. // "description": "User profile ID associated with this request.",
  30227. // "format": "int64",
  30228. // "location": "path",
  30229. // "required": true,
  30230. // "type": "string"
  30231. // }
  30232. // },
  30233. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30234. // "request": {
  30235. // "$ref": "FloodlightActivityGroup"
  30236. // },
  30237. // "response": {
  30238. // "$ref": "FloodlightActivityGroup"
  30239. // },
  30240. // "scopes": [
  30241. // "https://www.googleapis.com/auth/dfatrafficking"
  30242. // ]
  30243. // }
  30244. }
  30245. // method id "dfareporting.floodlightConfigurations.get":
  30246. type FloodlightConfigurationsGetCall struct {
  30247. s *Service
  30248. profileId int64
  30249. id int64
  30250. urlParams_ gensupport.URLParams
  30251. ifNoneMatch_ string
  30252. ctx_ context.Context
  30253. header_ http.Header
  30254. }
  30255. // Get: Gets one floodlight configuration by ID.
  30256. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  30257. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30258. c.profileId = profileId
  30259. c.id = id
  30260. return c
  30261. }
  30262. // Fields allows partial responses to be retrieved. See
  30263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30264. // for more information.
  30265. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  30266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30267. return c
  30268. }
  30269. // IfNoneMatch sets the optional parameter which makes the operation
  30270. // fail if the object's ETag matches the given value. This is useful for
  30271. // getting updates only after the object has changed since the last
  30272. // request. Use googleapi.IsNotModified to check whether the response
  30273. // error from Do is the result of In-None-Match.
  30274. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  30275. c.ifNoneMatch_ = entityTag
  30276. return c
  30277. }
  30278. // Context sets the context to be used in this call's Do method. Any
  30279. // pending HTTP request will be aborted if the provided context is
  30280. // canceled.
  30281. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  30282. c.ctx_ = ctx
  30283. return c
  30284. }
  30285. // Header returns an http.Header that can be modified by the caller to
  30286. // add HTTP headers to the request.
  30287. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  30288. if c.header_ == nil {
  30289. c.header_ = make(http.Header)
  30290. }
  30291. return c.header_
  30292. }
  30293. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  30294. reqHeaders := make(http.Header)
  30295. for k, v := range c.header_ {
  30296. reqHeaders[k] = v
  30297. }
  30298. reqHeaders.Set("User-Agent", c.s.userAgent())
  30299. if c.ifNoneMatch_ != "" {
  30300. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30301. }
  30302. var body io.Reader = nil
  30303. c.urlParams_.Set("alt", alt)
  30304. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  30305. urls += "?" + c.urlParams_.Encode()
  30306. req, _ := http.NewRequest("GET", urls, body)
  30307. req.Header = reqHeaders
  30308. googleapi.Expand(req.URL, map[string]string{
  30309. "profileId": strconv.FormatInt(c.profileId, 10),
  30310. "id": strconv.FormatInt(c.id, 10),
  30311. })
  30312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30313. }
  30314. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  30315. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30316. // non-2xx status code is an error. Response headers are in either
  30317. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30318. // returned at all) in error.(*googleapi.Error).Header. Use
  30319. // googleapi.IsNotModified to check whether the returned error was
  30320. // because http.StatusNotModified was returned.
  30321. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30322. gensupport.SetOptions(c.urlParams_, opts...)
  30323. res, err := c.doRequest("json")
  30324. if res != nil && res.StatusCode == http.StatusNotModified {
  30325. if res.Body != nil {
  30326. res.Body.Close()
  30327. }
  30328. return nil, &googleapi.Error{
  30329. Code: res.StatusCode,
  30330. Header: res.Header,
  30331. }
  30332. }
  30333. if err != nil {
  30334. return nil, err
  30335. }
  30336. defer googleapi.CloseBody(res)
  30337. if err := googleapi.CheckResponse(res); err != nil {
  30338. return nil, err
  30339. }
  30340. ret := &FloodlightConfiguration{
  30341. ServerResponse: googleapi.ServerResponse{
  30342. Header: res.Header,
  30343. HTTPStatusCode: res.StatusCode,
  30344. },
  30345. }
  30346. target := &ret
  30347. if err := gensupport.DecodeResponse(target, res); err != nil {
  30348. return nil, err
  30349. }
  30350. return ret, nil
  30351. // {
  30352. // "description": "Gets one floodlight configuration by ID.",
  30353. // "httpMethod": "GET",
  30354. // "id": "dfareporting.floodlightConfigurations.get",
  30355. // "parameterOrder": [
  30356. // "profileId",
  30357. // "id"
  30358. // ],
  30359. // "parameters": {
  30360. // "id": {
  30361. // "description": "Floodlight configuration ID.",
  30362. // "format": "int64",
  30363. // "location": "path",
  30364. // "required": true,
  30365. // "type": "string"
  30366. // },
  30367. // "profileId": {
  30368. // "description": "User profile ID associated with this request.",
  30369. // "format": "int64",
  30370. // "location": "path",
  30371. // "required": true,
  30372. // "type": "string"
  30373. // }
  30374. // },
  30375. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  30376. // "response": {
  30377. // "$ref": "FloodlightConfiguration"
  30378. // },
  30379. // "scopes": [
  30380. // "https://www.googleapis.com/auth/dfatrafficking"
  30381. // ]
  30382. // }
  30383. }
  30384. // method id "dfareporting.floodlightConfigurations.list":
  30385. type FloodlightConfigurationsListCall struct {
  30386. s *Service
  30387. profileId int64
  30388. urlParams_ gensupport.URLParams
  30389. ifNoneMatch_ string
  30390. ctx_ context.Context
  30391. header_ http.Header
  30392. }
  30393. // List: Retrieves a list of floodlight configurations, possibly
  30394. // filtered.
  30395. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  30396. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30397. c.profileId = profileId
  30398. return c
  30399. }
  30400. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  30401. // configurations to retrieve. Required field; otherwise an empty list
  30402. // will be returned.
  30403. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  30404. var ids_ []string
  30405. for _, v := range ids {
  30406. ids_ = append(ids_, fmt.Sprint(v))
  30407. }
  30408. c.urlParams_.SetMulti("ids", ids_)
  30409. return c
  30410. }
  30411. // Fields allows partial responses to be retrieved. See
  30412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30413. // for more information.
  30414. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  30415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30416. return c
  30417. }
  30418. // IfNoneMatch sets the optional parameter which makes the operation
  30419. // fail if the object's ETag matches the given value. This is useful for
  30420. // getting updates only after the object has changed since the last
  30421. // request. Use googleapi.IsNotModified to check whether the response
  30422. // error from Do is the result of In-None-Match.
  30423. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  30424. c.ifNoneMatch_ = entityTag
  30425. return c
  30426. }
  30427. // Context sets the context to be used in this call's Do method. Any
  30428. // pending HTTP request will be aborted if the provided context is
  30429. // canceled.
  30430. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  30431. c.ctx_ = ctx
  30432. return c
  30433. }
  30434. // Header returns an http.Header that can be modified by the caller to
  30435. // add HTTP headers to the request.
  30436. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  30437. if c.header_ == nil {
  30438. c.header_ = make(http.Header)
  30439. }
  30440. return c.header_
  30441. }
  30442. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  30443. reqHeaders := make(http.Header)
  30444. for k, v := range c.header_ {
  30445. reqHeaders[k] = v
  30446. }
  30447. reqHeaders.Set("User-Agent", c.s.userAgent())
  30448. if c.ifNoneMatch_ != "" {
  30449. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30450. }
  30451. var body io.Reader = nil
  30452. c.urlParams_.Set("alt", alt)
  30453. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30454. urls += "?" + c.urlParams_.Encode()
  30455. req, _ := http.NewRequest("GET", urls, body)
  30456. req.Header = reqHeaders
  30457. googleapi.Expand(req.URL, map[string]string{
  30458. "profileId": strconv.FormatInt(c.profileId, 10),
  30459. })
  30460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30461. }
  30462. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  30463. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  30464. // non-nil. Any non-2xx status code is an error. Response headers are in
  30465. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  30466. // (if a response was returned at all) in
  30467. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30468. // whether the returned error was because http.StatusNotModified was
  30469. // returned.
  30470. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  30471. gensupport.SetOptions(c.urlParams_, opts...)
  30472. res, err := c.doRequest("json")
  30473. if res != nil && res.StatusCode == http.StatusNotModified {
  30474. if res.Body != nil {
  30475. res.Body.Close()
  30476. }
  30477. return nil, &googleapi.Error{
  30478. Code: res.StatusCode,
  30479. Header: res.Header,
  30480. }
  30481. }
  30482. if err != nil {
  30483. return nil, err
  30484. }
  30485. defer googleapi.CloseBody(res)
  30486. if err := googleapi.CheckResponse(res); err != nil {
  30487. return nil, err
  30488. }
  30489. ret := &FloodlightConfigurationsListResponse{
  30490. ServerResponse: googleapi.ServerResponse{
  30491. Header: res.Header,
  30492. HTTPStatusCode: res.StatusCode,
  30493. },
  30494. }
  30495. target := &ret
  30496. if err := gensupport.DecodeResponse(target, res); err != nil {
  30497. return nil, err
  30498. }
  30499. return ret, nil
  30500. // {
  30501. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  30502. // "httpMethod": "GET",
  30503. // "id": "dfareporting.floodlightConfigurations.list",
  30504. // "parameterOrder": [
  30505. // "profileId"
  30506. // ],
  30507. // "parameters": {
  30508. // "ids": {
  30509. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  30510. // "format": "int64",
  30511. // "location": "query",
  30512. // "repeated": true,
  30513. // "type": "string"
  30514. // },
  30515. // "profileId": {
  30516. // "description": "User profile ID associated with this request.",
  30517. // "format": "int64",
  30518. // "location": "path",
  30519. // "required": true,
  30520. // "type": "string"
  30521. // }
  30522. // },
  30523. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30524. // "response": {
  30525. // "$ref": "FloodlightConfigurationsListResponse"
  30526. // },
  30527. // "scopes": [
  30528. // "https://www.googleapis.com/auth/dfatrafficking"
  30529. // ]
  30530. // }
  30531. }
  30532. // method id "dfareporting.floodlightConfigurations.patch":
  30533. type FloodlightConfigurationsPatchCall struct {
  30534. s *Service
  30535. profileId int64
  30536. floodlightconfiguration *FloodlightConfiguration
  30537. urlParams_ gensupport.URLParams
  30538. ctx_ context.Context
  30539. header_ http.Header
  30540. }
  30541. // Patch: Updates an existing floodlight configuration. This method
  30542. // supports patch semantics.
  30543. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  30544. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30545. c.profileId = profileId
  30546. c.urlParams_.Set("id", fmt.Sprint(id))
  30547. c.floodlightconfiguration = floodlightconfiguration
  30548. return c
  30549. }
  30550. // Fields allows partial responses to be retrieved. See
  30551. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30552. // for more information.
  30553. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  30554. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30555. return c
  30556. }
  30557. // Context sets the context to be used in this call's Do method. Any
  30558. // pending HTTP request will be aborted if the provided context is
  30559. // canceled.
  30560. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  30561. c.ctx_ = ctx
  30562. return c
  30563. }
  30564. // Header returns an http.Header that can be modified by the caller to
  30565. // add HTTP headers to the request.
  30566. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  30567. if c.header_ == nil {
  30568. c.header_ = make(http.Header)
  30569. }
  30570. return c.header_
  30571. }
  30572. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  30573. reqHeaders := make(http.Header)
  30574. for k, v := range c.header_ {
  30575. reqHeaders[k] = v
  30576. }
  30577. reqHeaders.Set("User-Agent", c.s.userAgent())
  30578. var body io.Reader = nil
  30579. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  30580. if err != nil {
  30581. return nil, err
  30582. }
  30583. reqHeaders.Set("Content-Type", "application/json")
  30584. c.urlParams_.Set("alt", alt)
  30585. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30586. urls += "?" + c.urlParams_.Encode()
  30587. req, _ := http.NewRequest("PATCH", urls, body)
  30588. req.Header = reqHeaders
  30589. googleapi.Expand(req.URL, map[string]string{
  30590. "profileId": strconv.FormatInt(c.profileId, 10),
  30591. })
  30592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30593. }
  30594. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  30595. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30596. // non-2xx status code is an error. Response headers are in either
  30597. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30598. // returned at all) in error.(*googleapi.Error).Header. Use
  30599. // googleapi.IsNotModified to check whether the returned error was
  30600. // because http.StatusNotModified was returned.
  30601. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30602. gensupport.SetOptions(c.urlParams_, opts...)
  30603. res, err := c.doRequest("json")
  30604. if res != nil && res.StatusCode == http.StatusNotModified {
  30605. if res.Body != nil {
  30606. res.Body.Close()
  30607. }
  30608. return nil, &googleapi.Error{
  30609. Code: res.StatusCode,
  30610. Header: res.Header,
  30611. }
  30612. }
  30613. if err != nil {
  30614. return nil, err
  30615. }
  30616. defer googleapi.CloseBody(res)
  30617. if err := googleapi.CheckResponse(res); err != nil {
  30618. return nil, err
  30619. }
  30620. ret := &FloodlightConfiguration{
  30621. ServerResponse: googleapi.ServerResponse{
  30622. Header: res.Header,
  30623. HTTPStatusCode: res.StatusCode,
  30624. },
  30625. }
  30626. target := &ret
  30627. if err := gensupport.DecodeResponse(target, res); err != nil {
  30628. return nil, err
  30629. }
  30630. return ret, nil
  30631. // {
  30632. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  30633. // "httpMethod": "PATCH",
  30634. // "id": "dfareporting.floodlightConfigurations.patch",
  30635. // "parameterOrder": [
  30636. // "profileId",
  30637. // "id"
  30638. // ],
  30639. // "parameters": {
  30640. // "id": {
  30641. // "description": "Floodlight configuration ID.",
  30642. // "format": "int64",
  30643. // "location": "query",
  30644. // "required": true,
  30645. // "type": "string"
  30646. // },
  30647. // "profileId": {
  30648. // "description": "User profile ID associated with this request.",
  30649. // "format": "int64",
  30650. // "location": "path",
  30651. // "required": true,
  30652. // "type": "string"
  30653. // }
  30654. // },
  30655. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30656. // "request": {
  30657. // "$ref": "FloodlightConfiguration"
  30658. // },
  30659. // "response": {
  30660. // "$ref": "FloodlightConfiguration"
  30661. // },
  30662. // "scopes": [
  30663. // "https://www.googleapis.com/auth/dfatrafficking"
  30664. // ]
  30665. // }
  30666. }
  30667. // method id "dfareporting.floodlightConfigurations.update":
  30668. type FloodlightConfigurationsUpdateCall struct {
  30669. s *Service
  30670. profileId int64
  30671. floodlightconfiguration *FloodlightConfiguration
  30672. urlParams_ gensupport.URLParams
  30673. ctx_ context.Context
  30674. header_ http.Header
  30675. }
  30676. // Update: Updates an existing floodlight configuration.
  30677. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  30678. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30679. c.profileId = profileId
  30680. c.floodlightconfiguration = floodlightconfiguration
  30681. return c
  30682. }
  30683. // Fields allows partial responses to be retrieved. See
  30684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30685. // for more information.
  30686. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  30687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30688. return c
  30689. }
  30690. // Context sets the context to be used in this call's Do method. Any
  30691. // pending HTTP request will be aborted if the provided context is
  30692. // canceled.
  30693. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  30694. c.ctx_ = ctx
  30695. return c
  30696. }
  30697. // Header returns an http.Header that can be modified by the caller to
  30698. // add HTTP headers to the request.
  30699. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  30700. if c.header_ == nil {
  30701. c.header_ = make(http.Header)
  30702. }
  30703. return c.header_
  30704. }
  30705. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30706. reqHeaders := make(http.Header)
  30707. for k, v := range c.header_ {
  30708. reqHeaders[k] = v
  30709. }
  30710. reqHeaders.Set("User-Agent", c.s.userAgent())
  30711. var body io.Reader = nil
  30712. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  30713. if err != nil {
  30714. return nil, err
  30715. }
  30716. reqHeaders.Set("Content-Type", "application/json")
  30717. c.urlParams_.Set("alt", alt)
  30718. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30719. urls += "?" + c.urlParams_.Encode()
  30720. req, _ := http.NewRequest("PUT", urls, body)
  30721. req.Header = reqHeaders
  30722. googleapi.Expand(req.URL, map[string]string{
  30723. "profileId": strconv.FormatInt(c.profileId, 10),
  30724. })
  30725. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30726. }
  30727. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  30728. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30729. // non-2xx status code is an error. Response headers are in either
  30730. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30731. // returned at all) in error.(*googleapi.Error).Header. Use
  30732. // googleapi.IsNotModified to check whether the returned error was
  30733. // because http.StatusNotModified was returned.
  30734. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30735. gensupport.SetOptions(c.urlParams_, opts...)
  30736. res, err := c.doRequest("json")
  30737. if res != nil && res.StatusCode == http.StatusNotModified {
  30738. if res.Body != nil {
  30739. res.Body.Close()
  30740. }
  30741. return nil, &googleapi.Error{
  30742. Code: res.StatusCode,
  30743. Header: res.Header,
  30744. }
  30745. }
  30746. if err != nil {
  30747. return nil, err
  30748. }
  30749. defer googleapi.CloseBody(res)
  30750. if err := googleapi.CheckResponse(res); err != nil {
  30751. return nil, err
  30752. }
  30753. ret := &FloodlightConfiguration{
  30754. ServerResponse: googleapi.ServerResponse{
  30755. Header: res.Header,
  30756. HTTPStatusCode: res.StatusCode,
  30757. },
  30758. }
  30759. target := &ret
  30760. if err := gensupport.DecodeResponse(target, res); err != nil {
  30761. return nil, err
  30762. }
  30763. return ret, nil
  30764. // {
  30765. // "description": "Updates an existing floodlight configuration.",
  30766. // "httpMethod": "PUT",
  30767. // "id": "dfareporting.floodlightConfigurations.update",
  30768. // "parameterOrder": [
  30769. // "profileId"
  30770. // ],
  30771. // "parameters": {
  30772. // "profileId": {
  30773. // "description": "User profile ID associated with this request.",
  30774. // "format": "int64",
  30775. // "location": "path",
  30776. // "required": true,
  30777. // "type": "string"
  30778. // }
  30779. // },
  30780. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30781. // "request": {
  30782. // "$ref": "FloodlightConfiguration"
  30783. // },
  30784. // "response": {
  30785. // "$ref": "FloodlightConfiguration"
  30786. // },
  30787. // "scopes": [
  30788. // "https://www.googleapis.com/auth/dfatrafficking"
  30789. // ]
  30790. // }
  30791. }
  30792. // method id "dfareporting.inventoryItems.get":
  30793. type InventoryItemsGetCall struct {
  30794. s *Service
  30795. profileId int64
  30796. projectId int64
  30797. id int64
  30798. urlParams_ gensupport.URLParams
  30799. ifNoneMatch_ string
  30800. ctx_ context.Context
  30801. header_ http.Header
  30802. }
  30803. // Get: Gets one inventory item by ID.
  30804. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  30805. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30806. c.profileId = profileId
  30807. c.projectId = projectId
  30808. c.id = id
  30809. return c
  30810. }
  30811. // Fields allows partial responses to be retrieved. See
  30812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30813. // for more information.
  30814. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  30815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30816. return c
  30817. }
  30818. // IfNoneMatch sets the optional parameter which makes the operation
  30819. // fail if the object's ETag matches the given value. This is useful for
  30820. // getting updates only after the object has changed since the last
  30821. // request. Use googleapi.IsNotModified to check whether the response
  30822. // error from Do is the result of In-None-Match.
  30823. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  30824. c.ifNoneMatch_ = entityTag
  30825. return c
  30826. }
  30827. // Context sets the context to be used in this call's Do method. Any
  30828. // pending HTTP request will be aborted if the provided context is
  30829. // canceled.
  30830. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  30831. c.ctx_ = ctx
  30832. return c
  30833. }
  30834. // Header returns an http.Header that can be modified by the caller to
  30835. // add HTTP headers to the request.
  30836. func (c *InventoryItemsGetCall) Header() http.Header {
  30837. if c.header_ == nil {
  30838. c.header_ = make(http.Header)
  30839. }
  30840. return c.header_
  30841. }
  30842. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  30843. reqHeaders := make(http.Header)
  30844. for k, v := range c.header_ {
  30845. reqHeaders[k] = v
  30846. }
  30847. reqHeaders.Set("User-Agent", c.s.userAgent())
  30848. if c.ifNoneMatch_ != "" {
  30849. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30850. }
  30851. var body io.Reader = nil
  30852. c.urlParams_.Set("alt", alt)
  30853. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  30854. urls += "?" + c.urlParams_.Encode()
  30855. req, _ := http.NewRequest("GET", urls, body)
  30856. req.Header = reqHeaders
  30857. googleapi.Expand(req.URL, map[string]string{
  30858. "profileId": strconv.FormatInt(c.profileId, 10),
  30859. "projectId": strconv.FormatInt(c.projectId, 10),
  30860. "id": strconv.FormatInt(c.id, 10),
  30861. })
  30862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30863. }
  30864. // Do executes the "dfareporting.inventoryItems.get" call.
  30865. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  30866. // status code is an error. Response headers are in either
  30867. // *InventoryItem.ServerResponse.Header or (if a response was returned
  30868. // at all) in error.(*googleapi.Error).Header. Use
  30869. // googleapi.IsNotModified to check whether the returned error was
  30870. // because http.StatusNotModified was returned.
  30871. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  30872. gensupport.SetOptions(c.urlParams_, opts...)
  30873. res, err := c.doRequest("json")
  30874. if res != nil && res.StatusCode == http.StatusNotModified {
  30875. if res.Body != nil {
  30876. res.Body.Close()
  30877. }
  30878. return nil, &googleapi.Error{
  30879. Code: res.StatusCode,
  30880. Header: res.Header,
  30881. }
  30882. }
  30883. if err != nil {
  30884. return nil, err
  30885. }
  30886. defer googleapi.CloseBody(res)
  30887. if err := googleapi.CheckResponse(res); err != nil {
  30888. return nil, err
  30889. }
  30890. ret := &InventoryItem{
  30891. ServerResponse: googleapi.ServerResponse{
  30892. Header: res.Header,
  30893. HTTPStatusCode: res.StatusCode,
  30894. },
  30895. }
  30896. target := &ret
  30897. if err := gensupport.DecodeResponse(target, res); err != nil {
  30898. return nil, err
  30899. }
  30900. return ret, nil
  30901. // {
  30902. // "description": "Gets one inventory item by ID.",
  30903. // "httpMethod": "GET",
  30904. // "id": "dfareporting.inventoryItems.get",
  30905. // "parameterOrder": [
  30906. // "profileId",
  30907. // "projectId",
  30908. // "id"
  30909. // ],
  30910. // "parameters": {
  30911. // "id": {
  30912. // "description": "Inventory item ID.",
  30913. // "format": "int64",
  30914. // "location": "path",
  30915. // "required": true,
  30916. // "type": "string"
  30917. // },
  30918. // "profileId": {
  30919. // "description": "User profile ID associated with this request.",
  30920. // "format": "int64",
  30921. // "location": "path",
  30922. // "required": true,
  30923. // "type": "string"
  30924. // },
  30925. // "projectId": {
  30926. // "description": "Project ID for order documents.",
  30927. // "format": "int64",
  30928. // "location": "path",
  30929. // "required": true,
  30930. // "type": "string"
  30931. // }
  30932. // },
  30933. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  30934. // "response": {
  30935. // "$ref": "InventoryItem"
  30936. // },
  30937. // "scopes": [
  30938. // "https://www.googleapis.com/auth/dfatrafficking"
  30939. // ]
  30940. // }
  30941. }
  30942. // method id "dfareporting.inventoryItems.list":
  30943. type InventoryItemsListCall struct {
  30944. s *Service
  30945. profileId int64
  30946. projectId int64
  30947. urlParams_ gensupport.URLParams
  30948. ifNoneMatch_ string
  30949. ctx_ context.Context
  30950. header_ http.Header
  30951. }
  30952. // List: Retrieves a list of inventory items, possibly filtered. This
  30953. // method supports paging.
  30954. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  30955. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30956. c.profileId = profileId
  30957. c.projectId = projectId
  30958. return c
  30959. }
  30960. // Ids sets the optional parameter "ids": Select only inventory items
  30961. // with these IDs.
  30962. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  30963. var ids_ []string
  30964. for _, v := range ids {
  30965. ids_ = append(ids_, fmt.Sprint(v))
  30966. }
  30967. c.urlParams_.SetMulti("ids", ids_)
  30968. return c
  30969. }
  30970. // InPlan sets the optional parameter "inPlan": Select only inventory
  30971. // items that are in plan.
  30972. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  30973. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  30974. return c
  30975. }
  30976. // MaxResults sets the optional parameter "maxResults": Maximum number
  30977. // of results to return.
  30978. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  30979. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30980. return c
  30981. }
  30982. // OrderId sets the optional parameter "orderId": Select only inventory
  30983. // items that belong to specified orders.
  30984. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  30985. var orderId_ []string
  30986. for _, v := range orderId {
  30987. orderId_ = append(orderId_, fmt.Sprint(v))
  30988. }
  30989. c.urlParams_.SetMulti("orderId", orderId_)
  30990. return c
  30991. }
  30992. // PageToken sets the optional parameter "pageToken": Value of the
  30993. // nextPageToken from the previous result page.
  30994. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  30995. c.urlParams_.Set("pageToken", pageToken)
  30996. return c
  30997. }
  30998. // SiteId sets the optional parameter "siteId": Select only inventory
  30999. // items that are associated with these sites.
  31000. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  31001. var siteId_ []string
  31002. for _, v := range siteId {
  31003. siteId_ = append(siteId_, fmt.Sprint(v))
  31004. }
  31005. c.urlParams_.SetMulti("siteId", siteId_)
  31006. return c
  31007. }
  31008. // SortField sets the optional parameter "sortField": Field by which to
  31009. // sort the list.
  31010. //
  31011. // Possible values:
  31012. // "ID" (default)
  31013. // "NAME"
  31014. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  31015. c.urlParams_.Set("sortField", sortField)
  31016. return c
  31017. }
  31018. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  31019. // results.
  31020. //
  31021. // Possible values:
  31022. // "ASCENDING" (default)
  31023. // "DESCENDING"
  31024. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  31025. c.urlParams_.Set("sortOrder", sortOrder)
  31026. return c
  31027. }
  31028. // Type sets the optional parameter "type": Select only inventory items
  31029. // with this type.
  31030. //
  31031. // Possible values:
  31032. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  31033. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31034. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  31035. c.urlParams_.Set("type", type_)
  31036. return c
  31037. }
  31038. // Fields allows partial responses to be retrieved. See
  31039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31040. // for more information.
  31041. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  31042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31043. return c
  31044. }
  31045. // IfNoneMatch sets the optional parameter which makes the operation
  31046. // fail if the object's ETag matches the given value. This is useful for
  31047. // getting updates only after the object has changed since the last
  31048. // request. Use googleapi.IsNotModified to check whether the response
  31049. // error from Do is the result of In-None-Match.
  31050. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  31051. c.ifNoneMatch_ = entityTag
  31052. return c
  31053. }
  31054. // Context sets the context to be used in this call's Do method. Any
  31055. // pending HTTP request will be aborted if the provided context is
  31056. // canceled.
  31057. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  31058. c.ctx_ = ctx
  31059. return c
  31060. }
  31061. // Header returns an http.Header that can be modified by the caller to
  31062. // add HTTP headers to the request.
  31063. func (c *InventoryItemsListCall) Header() http.Header {
  31064. if c.header_ == nil {
  31065. c.header_ = make(http.Header)
  31066. }
  31067. return c.header_
  31068. }
  31069. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  31070. reqHeaders := make(http.Header)
  31071. for k, v := range c.header_ {
  31072. reqHeaders[k] = v
  31073. }
  31074. reqHeaders.Set("User-Agent", c.s.userAgent())
  31075. if c.ifNoneMatch_ != "" {
  31076. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31077. }
  31078. var body io.Reader = nil
  31079. c.urlParams_.Set("alt", alt)
  31080. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  31081. urls += "?" + c.urlParams_.Encode()
  31082. req, _ := http.NewRequest("GET", urls, body)
  31083. req.Header = reqHeaders
  31084. googleapi.Expand(req.URL, map[string]string{
  31085. "profileId": strconv.FormatInt(c.profileId, 10),
  31086. "projectId": strconv.FormatInt(c.projectId, 10),
  31087. })
  31088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31089. }
  31090. // Do executes the "dfareporting.inventoryItems.list" call.
  31091. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  31092. // Any non-2xx status code is an error. Response headers are in either
  31093. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  31094. // was returned at all) in error.(*googleapi.Error).Header. Use
  31095. // googleapi.IsNotModified to check whether the returned error was
  31096. // because http.StatusNotModified was returned.
  31097. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  31098. gensupport.SetOptions(c.urlParams_, opts...)
  31099. res, err := c.doRequest("json")
  31100. if res != nil && res.StatusCode == http.StatusNotModified {
  31101. if res.Body != nil {
  31102. res.Body.Close()
  31103. }
  31104. return nil, &googleapi.Error{
  31105. Code: res.StatusCode,
  31106. Header: res.Header,
  31107. }
  31108. }
  31109. if err != nil {
  31110. return nil, err
  31111. }
  31112. defer googleapi.CloseBody(res)
  31113. if err := googleapi.CheckResponse(res); err != nil {
  31114. return nil, err
  31115. }
  31116. ret := &InventoryItemsListResponse{
  31117. ServerResponse: googleapi.ServerResponse{
  31118. Header: res.Header,
  31119. HTTPStatusCode: res.StatusCode,
  31120. },
  31121. }
  31122. target := &ret
  31123. if err := gensupport.DecodeResponse(target, res); err != nil {
  31124. return nil, err
  31125. }
  31126. return ret, nil
  31127. // {
  31128. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  31129. // "httpMethod": "GET",
  31130. // "id": "dfareporting.inventoryItems.list",
  31131. // "parameterOrder": [
  31132. // "profileId",
  31133. // "projectId"
  31134. // ],
  31135. // "parameters": {
  31136. // "ids": {
  31137. // "description": "Select only inventory items with these IDs.",
  31138. // "format": "int64",
  31139. // "location": "query",
  31140. // "repeated": true,
  31141. // "type": "string"
  31142. // },
  31143. // "inPlan": {
  31144. // "description": "Select only inventory items that are in plan.",
  31145. // "location": "query",
  31146. // "type": "boolean"
  31147. // },
  31148. // "maxResults": {
  31149. // "default": "1000",
  31150. // "description": "Maximum number of results to return.",
  31151. // "format": "int32",
  31152. // "location": "query",
  31153. // "maximum": "1000",
  31154. // "minimum": "0",
  31155. // "type": "integer"
  31156. // },
  31157. // "orderId": {
  31158. // "description": "Select only inventory items that belong to specified orders.",
  31159. // "format": "int64",
  31160. // "location": "query",
  31161. // "repeated": true,
  31162. // "type": "string"
  31163. // },
  31164. // "pageToken": {
  31165. // "description": "Value of the nextPageToken from the previous result page.",
  31166. // "location": "query",
  31167. // "type": "string"
  31168. // },
  31169. // "profileId": {
  31170. // "description": "User profile ID associated with this request.",
  31171. // "format": "int64",
  31172. // "location": "path",
  31173. // "required": true,
  31174. // "type": "string"
  31175. // },
  31176. // "projectId": {
  31177. // "description": "Project ID for order documents.",
  31178. // "format": "int64",
  31179. // "location": "path",
  31180. // "required": true,
  31181. // "type": "string"
  31182. // },
  31183. // "siteId": {
  31184. // "description": "Select only inventory items that are associated with these sites.",
  31185. // "format": "int64",
  31186. // "location": "query",
  31187. // "repeated": true,
  31188. // "type": "string"
  31189. // },
  31190. // "sortField": {
  31191. // "default": "ID",
  31192. // "description": "Field by which to sort the list.",
  31193. // "enum": [
  31194. // "ID",
  31195. // "NAME"
  31196. // ],
  31197. // "enumDescriptions": [
  31198. // "",
  31199. // ""
  31200. // ],
  31201. // "location": "query",
  31202. // "type": "string"
  31203. // },
  31204. // "sortOrder": {
  31205. // "default": "ASCENDING",
  31206. // "description": "Order of sorted results.",
  31207. // "enum": [
  31208. // "ASCENDING",
  31209. // "DESCENDING"
  31210. // ],
  31211. // "enumDescriptions": [
  31212. // "",
  31213. // ""
  31214. // ],
  31215. // "location": "query",
  31216. // "type": "string"
  31217. // },
  31218. // "type": {
  31219. // "description": "Select only inventory items with this type.",
  31220. // "enum": [
  31221. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  31222. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31223. // ],
  31224. // "enumDescriptions": [
  31225. // "",
  31226. // ""
  31227. // ],
  31228. // "location": "query",
  31229. // "type": "string"
  31230. // }
  31231. // },
  31232. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  31233. // "response": {
  31234. // "$ref": "InventoryItemsListResponse"
  31235. // },
  31236. // "scopes": [
  31237. // "https://www.googleapis.com/auth/dfatrafficking"
  31238. // ]
  31239. // }
  31240. }
  31241. // Pages invokes f for each page of results.
  31242. // A non-nil error returned from f will halt the iteration.
  31243. // The provided context supersedes any context provided to the Context method.
  31244. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  31245. c.ctx_ = ctx
  31246. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31247. for {
  31248. x, err := c.Do()
  31249. if err != nil {
  31250. return err
  31251. }
  31252. if err := f(x); err != nil {
  31253. return err
  31254. }
  31255. if x.NextPageToken == "" {
  31256. return nil
  31257. }
  31258. c.PageToken(x.NextPageToken)
  31259. }
  31260. }
  31261. // method id "dfareporting.languages.list":
  31262. type LanguagesListCall struct {
  31263. s *Service
  31264. profileId int64
  31265. urlParams_ gensupport.URLParams
  31266. ifNoneMatch_ string
  31267. ctx_ context.Context
  31268. header_ http.Header
  31269. }
  31270. // List: Retrieves a list of languages.
  31271. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  31272. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31273. c.profileId = profileId
  31274. return c
  31275. }
  31276. // Fields allows partial responses to be retrieved. See
  31277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31278. // for more information.
  31279. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  31280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31281. return c
  31282. }
  31283. // IfNoneMatch sets the optional parameter which makes the operation
  31284. // fail if the object's ETag matches the given value. This is useful for
  31285. // getting updates only after the object has changed since the last
  31286. // request. Use googleapi.IsNotModified to check whether the response
  31287. // error from Do is the result of In-None-Match.
  31288. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  31289. c.ifNoneMatch_ = entityTag
  31290. return c
  31291. }
  31292. // Context sets the context to be used in this call's Do method. Any
  31293. // pending HTTP request will be aborted if the provided context is
  31294. // canceled.
  31295. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  31296. c.ctx_ = ctx
  31297. return c
  31298. }
  31299. // Header returns an http.Header that can be modified by the caller to
  31300. // add HTTP headers to the request.
  31301. func (c *LanguagesListCall) Header() http.Header {
  31302. if c.header_ == nil {
  31303. c.header_ = make(http.Header)
  31304. }
  31305. return c.header_
  31306. }
  31307. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  31308. reqHeaders := make(http.Header)
  31309. for k, v := range c.header_ {
  31310. reqHeaders[k] = v
  31311. }
  31312. reqHeaders.Set("User-Agent", c.s.userAgent())
  31313. if c.ifNoneMatch_ != "" {
  31314. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31315. }
  31316. var body io.Reader = nil
  31317. c.urlParams_.Set("alt", alt)
  31318. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  31319. urls += "?" + c.urlParams_.Encode()
  31320. req, _ := http.NewRequest("GET", urls, body)
  31321. req.Header = reqHeaders
  31322. googleapi.Expand(req.URL, map[string]string{
  31323. "profileId": strconv.FormatInt(c.profileId, 10),
  31324. })
  31325. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31326. }
  31327. // Do executes the "dfareporting.languages.list" call.
  31328. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  31329. // non-2xx status code is an error. Response headers are in either
  31330. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  31331. // returned at all) in error.(*googleapi.Error).Header. Use
  31332. // googleapi.IsNotModified to check whether the returned error was
  31333. // because http.StatusNotModified was returned.
  31334. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  31335. gensupport.SetOptions(c.urlParams_, opts...)
  31336. res, err := c.doRequest("json")
  31337. if res != nil && res.StatusCode == http.StatusNotModified {
  31338. if res.Body != nil {
  31339. res.Body.Close()
  31340. }
  31341. return nil, &googleapi.Error{
  31342. Code: res.StatusCode,
  31343. Header: res.Header,
  31344. }
  31345. }
  31346. if err != nil {
  31347. return nil, err
  31348. }
  31349. defer googleapi.CloseBody(res)
  31350. if err := googleapi.CheckResponse(res); err != nil {
  31351. return nil, err
  31352. }
  31353. ret := &LanguagesListResponse{
  31354. ServerResponse: googleapi.ServerResponse{
  31355. Header: res.Header,
  31356. HTTPStatusCode: res.StatusCode,
  31357. },
  31358. }
  31359. target := &ret
  31360. if err := gensupport.DecodeResponse(target, res); err != nil {
  31361. return nil, err
  31362. }
  31363. return ret, nil
  31364. // {
  31365. // "description": "Retrieves a list of languages.",
  31366. // "httpMethod": "GET",
  31367. // "id": "dfareporting.languages.list",
  31368. // "parameterOrder": [
  31369. // "profileId"
  31370. // ],
  31371. // "parameters": {
  31372. // "profileId": {
  31373. // "description": "User profile ID associated with this request.",
  31374. // "format": "int64",
  31375. // "location": "path",
  31376. // "required": true,
  31377. // "type": "string"
  31378. // }
  31379. // },
  31380. // "path": "userprofiles/{profileId}/languages",
  31381. // "response": {
  31382. // "$ref": "LanguagesListResponse"
  31383. // },
  31384. // "scopes": [
  31385. // "https://www.googleapis.com/auth/dfatrafficking"
  31386. // ]
  31387. // }
  31388. }
  31389. // method id "dfareporting.metros.list":
  31390. type MetrosListCall struct {
  31391. s *Service
  31392. profileId int64
  31393. urlParams_ gensupport.URLParams
  31394. ifNoneMatch_ string
  31395. ctx_ context.Context
  31396. header_ http.Header
  31397. }
  31398. // List: Retrieves a list of metros.
  31399. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  31400. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31401. c.profileId = profileId
  31402. return c
  31403. }
  31404. // Fields allows partial responses to be retrieved. See
  31405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31406. // for more information.
  31407. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  31408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31409. return c
  31410. }
  31411. // IfNoneMatch sets the optional parameter which makes the operation
  31412. // fail if the object's ETag matches the given value. This is useful for
  31413. // getting updates only after the object has changed since the last
  31414. // request. Use googleapi.IsNotModified to check whether the response
  31415. // error from Do is the result of In-None-Match.
  31416. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  31417. c.ifNoneMatch_ = entityTag
  31418. return c
  31419. }
  31420. // Context sets the context to be used in this call's Do method. Any
  31421. // pending HTTP request will be aborted if the provided context is
  31422. // canceled.
  31423. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  31424. c.ctx_ = ctx
  31425. return c
  31426. }
  31427. // Header returns an http.Header that can be modified by the caller to
  31428. // add HTTP headers to the request.
  31429. func (c *MetrosListCall) Header() http.Header {
  31430. if c.header_ == nil {
  31431. c.header_ = make(http.Header)
  31432. }
  31433. return c.header_
  31434. }
  31435. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  31436. reqHeaders := make(http.Header)
  31437. for k, v := range c.header_ {
  31438. reqHeaders[k] = v
  31439. }
  31440. reqHeaders.Set("User-Agent", c.s.userAgent())
  31441. if c.ifNoneMatch_ != "" {
  31442. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31443. }
  31444. var body io.Reader = nil
  31445. c.urlParams_.Set("alt", alt)
  31446. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  31447. urls += "?" + c.urlParams_.Encode()
  31448. req, _ := http.NewRequest("GET", urls, body)
  31449. req.Header = reqHeaders
  31450. googleapi.Expand(req.URL, map[string]string{
  31451. "profileId": strconv.FormatInt(c.profileId, 10),
  31452. })
  31453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31454. }
  31455. // Do executes the "dfareporting.metros.list" call.
  31456. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  31457. // non-2xx status code is an error. Response headers are in either
  31458. // *MetrosListResponse.ServerResponse.Header or (if a response was
  31459. // returned at all) in error.(*googleapi.Error).Header. Use
  31460. // googleapi.IsNotModified to check whether the returned error was
  31461. // because http.StatusNotModified was returned.
  31462. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  31463. gensupport.SetOptions(c.urlParams_, opts...)
  31464. res, err := c.doRequest("json")
  31465. if res != nil && res.StatusCode == http.StatusNotModified {
  31466. if res.Body != nil {
  31467. res.Body.Close()
  31468. }
  31469. return nil, &googleapi.Error{
  31470. Code: res.StatusCode,
  31471. Header: res.Header,
  31472. }
  31473. }
  31474. if err != nil {
  31475. return nil, err
  31476. }
  31477. defer googleapi.CloseBody(res)
  31478. if err := googleapi.CheckResponse(res); err != nil {
  31479. return nil, err
  31480. }
  31481. ret := &MetrosListResponse{
  31482. ServerResponse: googleapi.ServerResponse{
  31483. Header: res.Header,
  31484. HTTPStatusCode: res.StatusCode,
  31485. },
  31486. }
  31487. target := &ret
  31488. if err := gensupport.DecodeResponse(target, res); err != nil {
  31489. return nil, err
  31490. }
  31491. return ret, nil
  31492. // {
  31493. // "description": "Retrieves a list of metros.",
  31494. // "httpMethod": "GET",
  31495. // "id": "dfareporting.metros.list",
  31496. // "parameterOrder": [
  31497. // "profileId"
  31498. // ],
  31499. // "parameters": {
  31500. // "profileId": {
  31501. // "description": "User profile ID associated with this request.",
  31502. // "format": "int64",
  31503. // "location": "path",
  31504. // "required": true,
  31505. // "type": "string"
  31506. // }
  31507. // },
  31508. // "path": "userprofiles/{profileId}/metros",
  31509. // "response": {
  31510. // "$ref": "MetrosListResponse"
  31511. // },
  31512. // "scopes": [
  31513. // "https://www.googleapis.com/auth/dfatrafficking"
  31514. // ]
  31515. // }
  31516. }
  31517. // method id "dfareporting.mobileApps.get":
  31518. type MobileAppsGetCall struct {
  31519. s *Service
  31520. profileId int64
  31521. id string
  31522. urlParams_ gensupport.URLParams
  31523. ifNoneMatch_ string
  31524. ctx_ context.Context
  31525. header_ http.Header
  31526. }
  31527. // Get: Gets one mobile app by ID.
  31528. func (r *MobileAppsService) Get(profileId int64, id string) *MobileAppsGetCall {
  31529. c := &MobileAppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31530. c.profileId = profileId
  31531. c.id = id
  31532. return c
  31533. }
  31534. // Fields allows partial responses to be retrieved. See
  31535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31536. // for more information.
  31537. func (c *MobileAppsGetCall) Fields(s ...googleapi.Field) *MobileAppsGetCall {
  31538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31539. return c
  31540. }
  31541. // IfNoneMatch sets the optional parameter which makes the operation
  31542. // fail if the object's ETag matches the given value. This is useful for
  31543. // getting updates only after the object has changed since the last
  31544. // request. Use googleapi.IsNotModified to check whether the response
  31545. // error from Do is the result of In-None-Match.
  31546. func (c *MobileAppsGetCall) IfNoneMatch(entityTag string) *MobileAppsGetCall {
  31547. c.ifNoneMatch_ = entityTag
  31548. return c
  31549. }
  31550. // Context sets the context to be used in this call's Do method. Any
  31551. // pending HTTP request will be aborted if the provided context is
  31552. // canceled.
  31553. func (c *MobileAppsGetCall) Context(ctx context.Context) *MobileAppsGetCall {
  31554. c.ctx_ = ctx
  31555. return c
  31556. }
  31557. // Header returns an http.Header that can be modified by the caller to
  31558. // add HTTP headers to the request.
  31559. func (c *MobileAppsGetCall) Header() http.Header {
  31560. if c.header_ == nil {
  31561. c.header_ = make(http.Header)
  31562. }
  31563. return c.header_
  31564. }
  31565. func (c *MobileAppsGetCall) doRequest(alt string) (*http.Response, error) {
  31566. reqHeaders := make(http.Header)
  31567. for k, v := range c.header_ {
  31568. reqHeaders[k] = v
  31569. }
  31570. reqHeaders.Set("User-Agent", c.s.userAgent())
  31571. if c.ifNoneMatch_ != "" {
  31572. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31573. }
  31574. var body io.Reader = nil
  31575. c.urlParams_.Set("alt", alt)
  31576. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps/{id}")
  31577. urls += "?" + c.urlParams_.Encode()
  31578. req, _ := http.NewRequest("GET", urls, body)
  31579. req.Header = reqHeaders
  31580. googleapi.Expand(req.URL, map[string]string{
  31581. "profileId": strconv.FormatInt(c.profileId, 10),
  31582. "id": c.id,
  31583. })
  31584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31585. }
  31586. // Do executes the "dfareporting.mobileApps.get" call.
  31587. // Exactly one of *MobileApp or error will be non-nil. Any non-2xx
  31588. // status code is an error. Response headers are in either
  31589. // *MobileApp.ServerResponse.Header or (if a response was returned at
  31590. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31591. // to check whether the returned error was because
  31592. // http.StatusNotModified was returned.
  31593. func (c *MobileAppsGetCall) Do(opts ...googleapi.CallOption) (*MobileApp, error) {
  31594. gensupport.SetOptions(c.urlParams_, opts...)
  31595. res, err := c.doRequest("json")
  31596. if res != nil && res.StatusCode == http.StatusNotModified {
  31597. if res.Body != nil {
  31598. res.Body.Close()
  31599. }
  31600. return nil, &googleapi.Error{
  31601. Code: res.StatusCode,
  31602. Header: res.Header,
  31603. }
  31604. }
  31605. if err != nil {
  31606. return nil, err
  31607. }
  31608. defer googleapi.CloseBody(res)
  31609. if err := googleapi.CheckResponse(res); err != nil {
  31610. return nil, err
  31611. }
  31612. ret := &MobileApp{
  31613. ServerResponse: googleapi.ServerResponse{
  31614. Header: res.Header,
  31615. HTTPStatusCode: res.StatusCode,
  31616. },
  31617. }
  31618. target := &ret
  31619. if err := gensupport.DecodeResponse(target, res); err != nil {
  31620. return nil, err
  31621. }
  31622. return ret, nil
  31623. // {
  31624. // "description": "Gets one mobile app by ID.",
  31625. // "httpMethod": "GET",
  31626. // "id": "dfareporting.mobileApps.get",
  31627. // "parameterOrder": [
  31628. // "profileId",
  31629. // "id"
  31630. // ],
  31631. // "parameters": {
  31632. // "id": {
  31633. // "description": "Mobile app ID.",
  31634. // "location": "path",
  31635. // "required": true,
  31636. // "type": "string"
  31637. // },
  31638. // "profileId": {
  31639. // "description": "User profile ID associated with this request.",
  31640. // "format": "int64",
  31641. // "location": "path",
  31642. // "required": true,
  31643. // "type": "string"
  31644. // }
  31645. // },
  31646. // "path": "userprofiles/{profileId}/mobileApps/{id}",
  31647. // "response": {
  31648. // "$ref": "MobileApp"
  31649. // },
  31650. // "scopes": [
  31651. // "https://www.googleapis.com/auth/dfatrafficking"
  31652. // ]
  31653. // }
  31654. }
  31655. // method id "dfareporting.mobileApps.list":
  31656. type MobileAppsListCall struct {
  31657. s *Service
  31658. profileId int64
  31659. urlParams_ gensupport.URLParams
  31660. ifNoneMatch_ string
  31661. ctx_ context.Context
  31662. header_ http.Header
  31663. }
  31664. // List: Retrieves list of available mobile apps.
  31665. func (r *MobileAppsService) List(profileId int64) *MobileAppsListCall {
  31666. c := &MobileAppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31667. c.profileId = profileId
  31668. return c
  31669. }
  31670. // Directories sets the optional parameter "directories": Select only
  31671. // apps from these directories.
  31672. //
  31673. // Possible values:
  31674. // "APPLE_APP_STORE"
  31675. // "GOOGLE_PLAY_STORE"
  31676. // "UNKNOWN"
  31677. func (c *MobileAppsListCall) Directories(directories ...string) *MobileAppsListCall {
  31678. c.urlParams_.SetMulti("directories", append([]string{}, directories...))
  31679. return c
  31680. }
  31681. // Ids sets the optional parameter "ids": Select only apps with these
  31682. // IDs.
  31683. func (c *MobileAppsListCall) Ids(ids ...string) *MobileAppsListCall {
  31684. c.urlParams_.SetMulti("ids", append([]string{}, ids...))
  31685. return c
  31686. }
  31687. // MaxResults sets the optional parameter "maxResults": Maximum number
  31688. // of results to return.
  31689. func (c *MobileAppsListCall) MaxResults(maxResults int64) *MobileAppsListCall {
  31690. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31691. return c
  31692. }
  31693. // PageToken sets the optional parameter "pageToken": Value of the
  31694. // nextPageToken from the previous result page.
  31695. func (c *MobileAppsListCall) PageToken(pageToken string) *MobileAppsListCall {
  31696. c.urlParams_.Set("pageToken", pageToken)
  31697. return c
  31698. }
  31699. // SearchString sets the optional parameter "searchString": Allows
  31700. // searching for objects by name or ID. Wildcards (*) are allowed. For
  31701. // example, "app*2015" will return objects with names like "app Jan
  31702. // 2018", "app Jan 2018", or simply "app 2018". Most of the searches
  31703. // also add wildcards implicitly at the start and the end of the search
  31704. // string. For example, a search string of "app" will match objects with
  31705. // name "my app", "app 2018", or simply "app".
  31706. func (c *MobileAppsListCall) SearchString(searchString string) *MobileAppsListCall {
  31707. c.urlParams_.Set("searchString", searchString)
  31708. return c
  31709. }
  31710. // Fields allows partial responses to be retrieved. See
  31711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31712. // for more information.
  31713. func (c *MobileAppsListCall) Fields(s ...googleapi.Field) *MobileAppsListCall {
  31714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31715. return c
  31716. }
  31717. // IfNoneMatch sets the optional parameter which makes the operation
  31718. // fail if the object's ETag matches the given value. This is useful for
  31719. // getting updates only after the object has changed since the last
  31720. // request. Use googleapi.IsNotModified to check whether the response
  31721. // error from Do is the result of In-None-Match.
  31722. func (c *MobileAppsListCall) IfNoneMatch(entityTag string) *MobileAppsListCall {
  31723. c.ifNoneMatch_ = entityTag
  31724. return c
  31725. }
  31726. // Context sets the context to be used in this call's Do method. Any
  31727. // pending HTTP request will be aborted if the provided context is
  31728. // canceled.
  31729. func (c *MobileAppsListCall) Context(ctx context.Context) *MobileAppsListCall {
  31730. c.ctx_ = ctx
  31731. return c
  31732. }
  31733. // Header returns an http.Header that can be modified by the caller to
  31734. // add HTTP headers to the request.
  31735. func (c *MobileAppsListCall) Header() http.Header {
  31736. if c.header_ == nil {
  31737. c.header_ = make(http.Header)
  31738. }
  31739. return c.header_
  31740. }
  31741. func (c *MobileAppsListCall) doRequest(alt string) (*http.Response, error) {
  31742. reqHeaders := make(http.Header)
  31743. for k, v := range c.header_ {
  31744. reqHeaders[k] = v
  31745. }
  31746. reqHeaders.Set("User-Agent", c.s.userAgent())
  31747. if c.ifNoneMatch_ != "" {
  31748. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31749. }
  31750. var body io.Reader = nil
  31751. c.urlParams_.Set("alt", alt)
  31752. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileApps")
  31753. urls += "?" + c.urlParams_.Encode()
  31754. req, _ := http.NewRequest("GET", urls, body)
  31755. req.Header = reqHeaders
  31756. googleapi.Expand(req.URL, map[string]string{
  31757. "profileId": strconv.FormatInt(c.profileId, 10),
  31758. })
  31759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31760. }
  31761. // Do executes the "dfareporting.mobileApps.list" call.
  31762. // Exactly one of *MobileAppsListResponse or error will be non-nil. Any
  31763. // non-2xx status code is an error. Response headers are in either
  31764. // *MobileAppsListResponse.ServerResponse.Header or (if a response was
  31765. // returned at all) in error.(*googleapi.Error).Header. Use
  31766. // googleapi.IsNotModified to check whether the returned error was
  31767. // because http.StatusNotModified was returned.
  31768. func (c *MobileAppsListCall) Do(opts ...googleapi.CallOption) (*MobileAppsListResponse, error) {
  31769. gensupport.SetOptions(c.urlParams_, opts...)
  31770. res, err := c.doRequest("json")
  31771. if res != nil && res.StatusCode == http.StatusNotModified {
  31772. if res.Body != nil {
  31773. res.Body.Close()
  31774. }
  31775. return nil, &googleapi.Error{
  31776. Code: res.StatusCode,
  31777. Header: res.Header,
  31778. }
  31779. }
  31780. if err != nil {
  31781. return nil, err
  31782. }
  31783. defer googleapi.CloseBody(res)
  31784. if err := googleapi.CheckResponse(res); err != nil {
  31785. return nil, err
  31786. }
  31787. ret := &MobileAppsListResponse{
  31788. ServerResponse: googleapi.ServerResponse{
  31789. Header: res.Header,
  31790. HTTPStatusCode: res.StatusCode,
  31791. },
  31792. }
  31793. target := &ret
  31794. if err := gensupport.DecodeResponse(target, res); err != nil {
  31795. return nil, err
  31796. }
  31797. return ret, nil
  31798. // {
  31799. // "description": "Retrieves list of available mobile apps.",
  31800. // "httpMethod": "GET",
  31801. // "id": "dfareporting.mobileApps.list",
  31802. // "parameterOrder": [
  31803. // "profileId"
  31804. // ],
  31805. // "parameters": {
  31806. // "directories": {
  31807. // "description": "Select only apps from these directories.",
  31808. // "enum": [
  31809. // "APPLE_APP_STORE",
  31810. // "GOOGLE_PLAY_STORE",
  31811. // "UNKNOWN"
  31812. // ],
  31813. // "enumDescriptions": [
  31814. // "",
  31815. // "",
  31816. // ""
  31817. // ],
  31818. // "location": "query",
  31819. // "repeated": true,
  31820. // "type": "string"
  31821. // },
  31822. // "ids": {
  31823. // "description": "Select only apps with these IDs.",
  31824. // "location": "query",
  31825. // "repeated": true,
  31826. // "type": "string"
  31827. // },
  31828. // "maxResults": {
  31829. // "default": "1000",
  31830. // "description": "Maximum number of results to return.",
  31831. // "format": "int32",
  31832. // "location": "query",
  31833. // "maximum": "1000",
  31834. // "minimum": "0",
  31835. // "type": "integer"
  31836. // },
  31837. // "pageToken": {
  31838. // "description": "Value of the nextPageToken from the previous result page.",
  31839. // "location": "query",
  31840. // "type": "string"
  31841. // },
  31842. // "profileId": {
  31843. // "description": "User profile ID associated with this request.",
  31844. // "format": "int64",
  31845. // "location": "path",
  31846. // "required": true,
  31847. // "type": "string"
  31848. // },
  31849. // "searchString": {
  31850. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"app*2015\" will return objects with names like \"app Jan 2018\", \"app Jan 2018\", or simply \"app 2018\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"app\" will match objects with name \"my app\", \"app 2018\", or simply \"app\".",
  31851. // "location": "query",
  31852. // "type": "string"
  31853. // }
  31854. // },
  31855. // "path": "userprofiles/{profileId}/mobileApps",
  31856. // "response": {
  31857. // "$ref": "MobileAppsListResponse"
  31858. // },
  31859. // "scopes": [
  31860. // "https://www.googleapis.com/auth/dfatrafficking"
  31861. // ]
  31862. // }
  31863. }
  31864. // Pages invokes f for each page of results.
  31865. // A non-nil error returned from f will halt the iteration.
  31866. // The provided context supersedes any context provided to the Context method.
  31867. func (c *MobileAppsListCall) Pages(ctx context.Context, f func(*MobileAppsListResponse) error) error {
  31868. c.ctx_ = ctx
  31869. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31870. for {
  31871. x, err := c.Do()
  31872. if err != nil {
  31873. return err
  31874. }
  31875. if err := f(x); err != nil {
  31876. return err
  31877. }
  31878. if x.NextPageToken == "" {
  31879. return nil
  31880. }
  31881. c.PageToken(x.NextPageToken)
  31882. }
  31883. }
  31884. // method id "dfareporting.mobileCarriers.get":
  31885. type MobileCarriersGetCall struct {
  31886. s *Service
  31887. profileId int64
  31888. id int64
  31889. urlParams_ gensupport.URLParams
  31890. ifNoneMatch_ string
  31891. ctx_ context.Context
  31892. header_ http.Header
  31893. }
  31894. // Get: Gets one mobile carrier by ID.
  31895. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  31896. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31897. c.profileId = profileId
  31898. c.id = id
  31899. return c
  31900. }
  31901. // Fields allows partial responses to be retrieved. See
  31902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31903. // for more information.
  31904. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  31905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31906. return c
  31907. }
  31908. // IfNoneMatch sets the optional parameter which makes the operation
  31909. // fail if the object's ETag matches the given value. This is useful for
  31910. // getting updates only after the object has changed since the last
  31911. // request. Use googleapi.IsNotModified to check whether the response
  31912. // error from Do is the result of In-None-Match.
  31913. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  31914. c.ifNoneMatch_ = entityTag
  31915. return c
  31916. }
  31917. // Context sets the context to be used in this call's Do method. Any
  31918. // pending HTTP request will be aborted if the provided context is
  31919. // canceled.
  31920. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  31921. c.ctx_ = ctx
  31922. return c
  31923. }
  31924. // Header returns an http.Header that can be modified by the caller to
  31925. // add HTTP headers to the request.
  31926. func (c *MobileCarriersGetCall) Header() http.Header {
  31927. if c.header_ == nil {
  31928. c.header_ = make(http.Header)
  31929. }
  31930. return c.header_
  31931. }
  31932. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  31933. reqHeaders := make(http.Header)
  31934. for k, v := range c.header_ {
  31935. reqHeaders[k] = v
  31936. }
  31937. reqHeaders.Set("User-Agent", c.s.userAgent())
  31938. if c.ifNoneMatch_ != "" {
  31939. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31940. }
  31941. var body io.Reader = nil
  31942. c.urlParams_.Set("alt", alt)
  31943. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  31944. urls += "?" + c.urlParams_.Encode()
  31945. req, _ := http.NewRequest("GET", urls, body)
  31946. req.Header = reqHeaders
  31947. googleapi.Expand(req.URL, map[string]string{
  31948. "profileId": strconv.FormatInt(c.profileId, 10),
  31949. "id": strconv.FormatInt(c.id, 10),
  31950. })
  31951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31952. }
  31953. // Do executes the "dfareporting.mobileCarriers.get" call.
  31954. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  31955. // status code is an error. Response headers are in either
  31956. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  31957. // at all) in error.(*googleapi.Error).Header. Use
  31958. // googleapi.IsNotModified to check whether the returned error was
  31959. // because http.StatusNotModified was returned.
  31960. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  31961. gensupport.SetOptions(c.urlParams_, opts...)
  31962. res, err := c.doRequest("json")
  31963. if res != nil && res.StatusCode == http.StatusNotModified {
  31964. if res.Body != nil {
  31965. res.Body.Close()
  31966. }
  31967. return nil, &googleapi.Error{
  31968. Code: res.StatusCode,
  31969. Header: res.Header,
  31970. }
  31971. }
  31972. if err != nil {
  31973. return nil, err
  31974. }
  31975. defer googleapi.CloseBody(res)
  31976. if err := googleapi.CheckResponse(res); err != nil {
  31977. return nil, err
  31978. }
  31979. ret := &MobileCarrier{
  31980. ServerResponse: googleapi.ServerResponse{
  31981. Header: res.Header,
  31982. HTTPStatusCode: res.StatusCode,
  31983. },
  31984. }
  31985. target := &ret
  31986. if err := gensupport.DecodeResponse(target, res); err != nil {
  31987. return nil, err
  31988. }
  31989. return ret, nil
  31990. // {
  31991. // "description": "Gets one mobile carrier by ID.",
  31992. // "httpMethod": "GET",
  31993. // "id": "dfareporting.mobileCarriers.get",
  31994. // "parameterOrder": [
  31995. // "profileId",
  31996. // "id"
  31997. // ],
  31998. // "parameters": {
  31999. // "id": {
  32000. // "description": "Mobile carrier ID.",
  32001. // "format": "int64",
  32002. // "location": "path",
  32003. // "required": true,
  32004. // "type": "string"
  32005. // },
  32006. // "profileId": {
  32007. // "description": "User profile ID associated with this request.",
  32008. // "format": "int64",
  32009. // "location": "path",
  32010. // "required": true,
  32011. // "type": "string"
  32012. // }
  32013. // },
  32014. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  32015. // "response": {
  32016. // "$ref": "MobileCarrier"
  32017. // },
  32018. // "scopes": [
  32019. // "https://www.googleapis.com/auth/dfatrafficking"
  32020. // ]
  32021. // }
  32022. }
  32023. // method id "dfareporting.mobileCarriers.list":
  32024. type MobileCarriersListCall struct {
  32025. s *Service
  32026. profileId int64
  32027. urlParams_ gensupport.URLParams
  32028. ifNoneMatch_ string
  32029. ctx_ context.Context
  32030. header_ http.Header
  32031. }
  32032. // List: Retrieves a list of mobile carriers.
  32033. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  32034. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32035. c.profileId = profileId
  32036. return c
  32037. }
  32038. // Fields allows partial responses to be retrieved. See
  32039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32040. // for more information.
  32041. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  32042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32043. return c
  32044. }
  32045. // IfNoneMatch sets the optional parameter which makes the operation
  32046. // fail if the object's ETag matches the given value. This is useful for
  32047. // getting updates only after the object has changed since the last
  32048. // request. Use googleapi.IsNotModified to check whether the response
  32049. // error from Do is the result of In-None-Match.
  32050. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  32051. c.ifNoneMatch_ = entityTag
  32052. return c
  32053. }
  32054. // Context sets the context to be used in this call's Do method. Any
  32055. // pending HTTP request will be aborted if the provided context is
  32056. // canceled.
  32057. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  32058. c.ctx_ = ctx
  32059. return c
  32060. }
  32061. // Header returns an http.Header that can be modified by the caller to
  32062. // add HTTP headers to the request.
  32063. func (c *MobileCarriersListCall) Header() http.Header {
  32064. if c.header_ == nil {
  32065. c.header_ = make(http.Header)
  32066. }
  32067. return c.header_
  32068. }
  32069. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  32070. reqHeaders := make(http.Header)
  32071. for k, v := range c.header_ {
  32072. reqHeaders[k] = v
  32073. }
  32074. reqHeaders.Set("User-Agent", c.s.userAgent())
  32075. if c.ifNoneMatch_ != "" {
  32076. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32077. }
  32078. var body io.Reader = nil
  32079. c.urlParams_.Set("alt", alt)
  32080. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  32081. urls += "?" + c.urlParams_.Encode()
  32082. req, _ := http.NewRequest("GET", urls, body)
  32083. req.Header = reqHeaders
  32084. googleapi.Expand(req.URL, map[string]string{
  32085. "profileId": strconv.FormatInt(c.profileId, 10),
  32086. })
  32087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32088. }
  32089. // Do executes the "dfareporting.mobileCarriers.list" call.
  32090. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  32091. // Any non-2xx status code is an error. Response headers are in either
  32092. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  32093. // was returned at all) in error.(*googleapi.Error).Header. Use
  32094. // googleapi.IsNotModified to check whether the returned error was
  32095. // because http.StatusNotModified was returned.
  32096. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  32097. gensupport.SetOptions(c.urlParams_, opts...)
  32098. res, err := c.doRequest("json")
  32099. if res != nil && res.StatusCode == http.StatusNotModified {
  32100. if res.Body != nil {
  32101. res.Body.Close()
  32102. }
  32103. return nil, &googleapi.Error{
  32104. Code: res.StatusCode,
  32105. Header: res.Header,
  32106. }
  32107. }
  32108. if err != nil {
  32109. return nil, err
  32110. }
  32111. defer googleapi.CloseBody(res)
  32112. if err := googleapi.CheckResponse(res); err != nil {
  32113. return nil, err
  32114. }
  32115. ret := &MobileCarriersListResponse{
  32116. ServerResponse: googleapi.ServerResponse{
  32117. Header: res.Header,
  32118. HTTPStatusCode: res.StatusCode,
  32119. },
  32120. }
  32121. target := &ret
  32122. if err := gensupport.DecodeResponse(target, res); err != nil {
  32123. return nil, err
  32124. }
  32125. return ret, nil
  32126. // {
  32127. // "description": "Retrieves a list of mobile carriers.",
  32128. // "httpMethod": "GET",
  32129. // "id": "dfareporting.mobileCarriers.list",
  32130. // "parameterOrder": [
  32131. // "profileId"
  32132. // ],
  32133. // "parameters": {
  32134. // "profileId": {
  32135. // "description": "User profile ID associated with this request.",
  32136. // "format": "int64",
  32137. // "location": "path",
  32138. // "required": true,
  32139. // "type": "string"
  32140. // }
  32141. // },
  32142. // "path": "userprofiles/{profileId}/mobileCarriers",
  32143. // "response": {
  32144. // "$ref": "MobileCarriersListResponse"
  32145. // },
  32146. // "scopes": [
  32147. // "https://www.googleapis.com/auth/dfatrafficking"
  32148. // ]
  32149. // }
  32150. }
  32151. // method id "dfareporting.operatingSystemVersions.get":
  32152. type OperatingSystemVersionsGetCall struct {
  32153. s *Service
  32154. profileId int64
  32155. id int64
  32156. urlParams_ gensupport.URLParams
  32157. ifNoneMatch_ string
  32158. ctx_ context.Context
  32159. header_ http.Header
  32160. }
  32161. // Get: Gets one operating system version by ID.
  32162. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  32163. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32164. c.profileId = profileId
  32165. c.id = id
  32166. return c
  32167. }
  32168. // Fields allows partial responses to be retrieved. See
  32169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32170. // for more information.
  32171. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  32172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32173. return c
  32174. }
  32175. // IfNoneMatch sets the optional parameter which makes the operation
  32176. // fail if the object's ETag matches the given value. This is useful for
  32177. // getting updates only after the object has changed since the last
  32178. // request. Use googleapi.IsNotModified to check whether the response
  32179. // error from Do is the result of In-None-Match.
  32180. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  32181. c.ifNoneMatch_ = entityTag
  32182. return c
  32183. }
  32184. // Context sets the context to be used in this call's Do method. Any
  32185. // pending HTTP request will be aborted if the provided context is
  32186. // canceled.
  32187. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  32188. c.ctx_ = ctx
  32189. return c
  32190. }
  32191. // Header returns an http.Header that can be modified by the caller to
  32192. // add HTTP headers to the request.
  32193. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  32194. if c.header_ == nil {
  32195. c.header_ = make(http.Header)
  32196. }
  32197. return c.header_
  32198. }
  32199. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  32200. reqHeaders := make(http.Header)
  32201. for k, v := range c.header_ {
  32202. reqHeaders[k] = v
  32203. }
  32204. reqHeaders.Set("User-Agent", c.s.userAgent())
  32205. if c.ifNoneMatch_ != "" {
  32206. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32207. }
  32208. var body io.Reader = nil
  32209. c.urlParams_.Set("alt", alt)
  32210. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  32211. urls += "?" + c.urlParams_.Encode()
  32212. req, _ := http.NewRequest("GET", urls, body)
  32213. req.Header = reqHeaders
  32214. googleapi.Expand(req.URL, map[string]string{
  32215. "profileId": strconv.FormatInt(c.profileId, 10),
  32216. "id": strconv.FormatInt(c.id, 10),
  32217. })
  32218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32219. }
  32220. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  32221. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  32222. // non-2xx status code is an error. Response headers are in either
  32223. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  32224. // returned at all) in error.(*googleapi.Error).Header. Use
  32225. // googleapi.IsNotModified to check whether the returned error was
  32226. // because http.StatusNotModified was returned.
  32227. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  32228. gensupport.SetOptions(c.urlParams_, opts...)
  32229. res, err := c.doRequest("json")
  32230. if res != nil && res.StatusCode == http.StatusNotModified {
  32231. if res.Body != nil {
  32232. res.Body.Close()
  32233. }
  32234. return nil, &googleapi.Error{
  32235. Code: res.StatusCode,
  32236. Header: res.Header,
  32237. }
  32238. }
  32239. if err != nil {
  32240. return nil, err
  32241. }
  32242. defer googleapi.CloseBody(res)
  32243. if err := googleapi.CheckResponse(res); err != nil {
  32244. return nil, err
  32245. }
  32246. ret := &OperatingSystemVersion{
  32247. ServerResponse: googleapi.ServerResponse{
  32248. Header: res.Header,
  32249. HTTPStatusCode: res.StatusCode,
  32250. },
  32251. }
  32252. target := &ret
  32253. if err := gensupport.DecodeResponse(target, res); err != nil {
  32254. return nil, err
  32255. }
  32256. return ret, nil
  32257. // {
  32258. // "description": "Gets one operating system version by ID.",
  32259. // "httpMethod": "GET",
  32260. // "id": "dfareporting.operatingSystemVersions.get",
  32261. // "parameterOrder": [
  32262. // "profileId",
  32263. // "id"
  32264. // ],
  32265. // "parameters": {
  32266. // "id": {
  32267. // "description": "Operating system version ID.",
  32268. // "format": "int64",
  32269. // "location": "path",
  32270. // "required": true,
  32271. // "type": "string"
  32272. // },
  32273. // "profileId": {
  32274. // "description": "User profile ID associated with this request.",
  32275. // "format": "int64",
  32276. // "location": "path",
  32277. // "required": true,
  32278. // "type": "string"
  32279. // }
  32280. // },
  32281. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  32282. // "response": {
  32283. // "$ref": "OperatingSystemVersion"
  32284. // },
  32285. // "scopes": [
  32286. // "https://www.googleapis.com/auth/dfatrafficking"
  32287. // ]
  32288. // }
  32289. }
  32290. // method id "dfareporting.operatingSystemVersions.list":
  32291. type OperatingSystemVersionsListCall struct {
  32292. s *Service
  32293. profileId int64
  32294. urlParams_ gensupport.URLParams
  32295. ifNoneMatch_ string
  32296. ctx_ context.Context
  32297. header_ http.Header
  32298. }
  32299. // List: Retrieves a list of operating system versions.
  32300. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  32301. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32302. c.profileId = profileId
  32303. return c
  32304. }
  32305. // Fields allows partial responses to be retrieved. See
  32306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32307. // for more information.
  32308. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  32309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32310. return c
  32311. }
  32312. // IfNoneMatch sets the optional parameter which makes the operation
  32313. // fail if the object's ETag matches the given value. This is useful for
  32314. // getting updates only after the object has changed since the last
  32315. // request. Use googleapi.IsNotModified to check whether the response
  32316. // error from Do is the result of In-None-Match.
  32317. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  32318. c.ifNoneMatch_ = entityTag
  32319. return c
  32320. }
  32321. // Context sets the context to be used in this call's Do method. Any
  32322. // pending HTTP request will be aborted if the provided context is
  32323. // canceled.
  32324. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  32325. c.ctx_ = ctx
  32326. return c
  32327. }
  32328. // Header returns an http.Header that can be modified by the caller to
  32329. // add HTTP headers to the request.
  32330. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  32331. if c.header_ == nil {
  32332. c.header_ = make(http.Header)
  32333. }
  32334. return c.header_
  32335. }
  32336. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  32337. reqHeaders := make(http.Header)
  32338. for k, v := range c.header_ {
  32339. reqHeaders[k] = v
  32340. }
  32341. reqHeaders.Set("User-Agent", c.s.userAgent())
  32342. if c.ifNoneMatch_ != "" {
  32343. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32344. }
  32345. var body io.Reader = nil
  32346. c.urlParams_.Set("alt", alt)
  32347. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  32348. urls += "?" + c.urlParams_.Encode()
  32349. req, _ := http.NewRequest("GET", urls, body)
  32350. req.Header = reqHeaders
  32351. googleapi.Expand(req.URL, map[string]string{
  32352. "profileId": strconv.FormatInt(c.profileId, 10),
  32353. })
  32354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32355. }
  32356. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  32357. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  32358. // non-nil. Any non-2xx status code is an error. Response headers are in
  32359. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  32360. // (if a response was returned at all) in
  32361. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  32362. // whether the returned error was because http.StatusNotModified was
  32363. // returned.
  32364. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  32365. gensupport.SetOptions(c.urlParams_, opts...)
  32366. res, err := c.doRequest("json")
  32367. if res != nil && res.StatusCode == http.StatusNotModified {
  32368. if res.Body != nil {
  32369. res.Body.Close()
  32370. }
  32371. return nil, &googleapi.Error{
  32372. Code: res.StatusCode,
  32373. Header: res.Header,
  32374. }
  32375. }
  32376. if err != nil {
  32377. return nil, err
  32378. }
  32379. defer googleapi.CloseBody(res)
  32380. if err := googleapi.CheckResponse(res); err != nil {
  32381. return nil, err
  32382. }
  32383. ret := &OperatingSystemVersionsListResponse{
  32384. ServerResponse: googleapi.ServerResponse{
  32385. Header: res.Header,
  32386. HTTPStatusCode: res.StatusCode,
  32387. },
  32388. }
  32389. target := &ret
  32390. if err := gensupport.DecodeResponse(target, res); err != nil {
  32391. return nil, err
  32392. }
  32393. return ret, nil
  32394. // {
  32395. // "description": "Retrieves a list of operating system versions.",
  32396. // "httpMethod": "GET",
  32397. // "id": "dfareporting.operatingSystemVersions.list",
  32398. // "parameterOrder": [
  32399. // "profileId"
  32400. // ],
  32401. // "parameters": {
  32402. // "profileId": {
  32403. // "description": "User profile ID associated with this request.",
  32404. // "format": "int64",
  32405. // "location": "path",
  32406. // "required": true,
  32407. // "type": "string"
  32408. // }
  32409. // },
  32410. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  32411. // "response": {
  32412. // "$ref": "OperatingSystemVersionsListResponse"
  32413. // },
  32414. // "scopes": [
  32415. // "https://www.googleapis.com/auth/dfatrafficking"
  32416. // ]
  32417. // }
  32418. }
  32419. // method id "dfareporting.operatingSystems.get":
  32420. type OperatingSystemsGetCall struct {
  32421. s *Service
  32422. profileId int64
  32423. dartId int64
  32424. urlParams_ gensupport.URLParams
  32425. ifNoneMatch_ string
  32426. ctx_ context.Context
  32427. header_ http.Header
  32428. }
  32429. // Get: Gets one operating system by DART ID.
  32430. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  32431. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32432. c.profileId = profileId
  32433. c.dartId = dartId
  32434. return c
  32435. }
  32436. // Fields allows partial responses to be retrieved. See
  32437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32438. // for more information.
  32439. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  32440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32441. return c
  32442. }
  32443. // IfNoneMatch sets the optional parameter which makes the operation
  32444. // fail if the object's ETag matches the given value. This is useful for
  32445. // getting updates only after the object has changed since the last
  32446. // request. Use googleapi.IsNotModified to check whether the response
  32447. // error from Do is the result of In-None-Match.
  32448. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  32449. c.ifNoneMatch_ = entityTag
  32450. return c
  32451. }
  32452. // Context sets the context to be used in this call's Do method. Any
  32453. // pending HTTP request will be aborted if the provided context is
  32454. // canceled.
  32455. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  32456. c.ctx_ = ctx
  32457. return c
  32458. }
  32459. // Header returns an http.Header that can be modified by the caller to
  32460. // add HTTP headers to the request.
  32461. func (c *OperatingSystemsGetCall) Header() http.Header {
  32462. if c.header_ == nil {
  32463. c.header_ = make(http.Header)
  32464. }
  32465. return c.header_
  32466. }
  32467. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  32468. reqHeaders := make(http.Header)
  32469. for k, v := range c.header_ {
  32470. reqHeaders[k] = v
  32471. }
  32472. reqHeaders.Set("User-Agent", c.s.userAgent())
  32473. if c.ifNoneMatch_ != "" {
  32474. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32475. }
  32476. var body io.Reader = nil
  32477. c.urlParams_.Set("alt", alt)
  32478. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  32479. urls += "?" + c.urlParams_.Encode()
  32480. req, _ := http.NewRequest("GET", urls, body)
  32481. req.Header = reqHeaders
  32482. googleapi.Expand(req.URL, map[string]string{
  32483. "profileId": strconv.FormatInt(c.profileId, 10),
  32484. "dartId": strconv.FormatInt(c.dartId, 10),
  32485. })
  32486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32487. }
  32488. // Do executes the "dfareporting.operatingSystems.get" call.
  32489. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  32490. // status code is an error. Response headers are in either
  32491. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  32492. // at all) in error.(*googleapi.Error).Header. Use
  32493. // googleapi.IsNotModified to check whether the returned error was
  32494. // because http.StatusNotModified was returned.
  32495. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  32496. gensupport.SetOptions(c.urlParams_, opts...)
  32497. res, err := c.doRequest("json")
  32498. if res != nil && res.StatusCode == http.StatusNotModified {
  32499. if res.Body != nil {
  32500. res.Body.Close()
  32501. }
  32502. return nil, &googleapi.Error{
  32503. Code: res.StatusCode,
  32504. Header: res.Header,
  32505. }
  32506. }
  32507. if err != nil {
  32508. return nil, err
  32509. }
  32510. defer googleapi.CloseBody(res)
  32511. if err := googleapi.CheckResponse(res); err != nil {
  32512. return nil, err
  32513. }
  32514. ret := &OperatingSystem{
  32515. ServerResponse: googleapi.ServerResponse{
  32516. Header: res.Header,
  32517. HTTPStatusCode: res.StatusCode,
  32518. },
  32519. }
  32520. target := &ret
  32521. if err := gensupport.DecodeResponse(target, res); err != nil {
  32522. return nil, err
  32523. }
  32524. return ret, nil
  32525. // {
  32526. // "description": "Gets one operating system by DART ID.",
  32527. // "httpMethod": "GET",
  32528. // "id": "dfareporting.operatingSystems.get",
  32529. // "parameterOrder": [
  32530. // "profileId",
  32531. // "dartId"
  32532. // ],
  32533. // "parameters": {
  32534. // "dartId": {
  32535. // "description": "Operating system DART ID.",
  32536. // "format": "int64",
  32537. // "location": "path",
  32538. // "required": true,
  32539. // "type": "string"
  32540. // },
  32541. // "profileId": {
  32542. // "description": "User profile ID associated with this request.",
  32543. // "format": "int64",
  32544. // "location": "path",
  32545. // "required": true,
  32546. // "type": "string"
  32547. // }
  32548. // },
  32549. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  32550. // "response": {
  32551. // "$ref": "OperatingSystem"
  32552. // },
  32553. // "scopes": [
  32554. // "https://www.googleapis.com/auth/dfatrafficking"
  32555. // ]
  32556. // }
  32557. }
  32558. // method id "dfareporting.operatingSystems.list":
  32559. type OperatingSystemsListCall struct {
  32560. s *Service
  32561. profileId int64
  32562. urlParams_ gensupport.URLParams
  32563. ifNoneMatch_ string
  32564. ctx_ context.Context
  32565. header_ http.Header
  32566. }
  32567. // List: Retrieves a list of operating systems.
  32568. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  32569. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32570. c.profileId = profileId
  32571. return c
  32572. }
  32573. // Fields allows partial responses to be retrieved. See
  32574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32575. // for more information.
  32576. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  32577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32578. return c
  32579. }
  32580. // IfNoneMatch sets the optional parameter which makes the operation
  32581. // fail if the object's ETag matches the given value. This is useful for
  32582. // getting updates only after the object has changed since the last
  32583. // request. Use googleapi.IsNotModified to check whether the response
  32584. // error from Do is the result of In-None-Match.
  32585. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  32586. c.ifNoneMatch_ = entityTag
  32587. return c
  32588. }
  32589. // Context sets the context to be used in this call's Do method. Any
  32590. // pending HTTP request will be aborted if the provided context is
  32591. // canceled.
  32592. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  32593. c.ctx_ = ctx
  32594. return c
  32595. }
  32596. // Header returns an http.Header that can be modified by the caller to
  32597. // add HTTP headers to the request.
  32598. func (c *OperatingSystemsListCall) Header() http.Header {
  32599. if c.header_ == nil {
  32600. c.header_ = make(http.Header)
  32601. }
  32602. return c.header_
  32603. }
  32604. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  32605. reqHeaders := make(http.Header)
  32606. for k, v := range c.header_ {
  32607. reqHeaders[k] = v
  32608. }
  32609. reqHeaders.Set("User-Agent", c.s.userAgent())
  32610. if c.ifNoneMatch_ != "" {
  32611. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32612. }
  32613. var body io.Reader = nil
  32614. c.urlParams_.Set("alt", alt)
  32615. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  32616. urls += "?" + c.urlParams_.Encode()
  32617. req, _ := http.NewRequest("GET", urls, body)
  32618. req.Header = reqHeaders
  32619. googleapi.Expand(req.URL, map[string]string{
  32620. "profileId": strconv.FormatInt(c.profileId, 10),
  32621. })
  32622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32623. }
  32624. // Do executes the "dfareporting.operatingSystems.list" call.
  32625. // Exactly one of *OperatingSystemsListResponse or error will be
  32626. // non-nil. Any non-2xx status code is an error. Response headers are in
  32627. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  32628. // response was returned at all) in error.(*googleapi.Error).Header. Use
  32629. // googleapi.IsNotModified to check whether the returned error was
  32630. // because http.StatusNotModified was returned.
  32631. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  32632. gensupport.SetOptions(c.urlParams_, opts...)
  32633. res, err := c.doRequest("json")
  32634. if res != nil && res.StatusCode == http.StatusNotModified {
  32635. if res.Body != nil {
  32636. res.Body.Close()
  32637. }
  32638. return nil, &googleapi.Error{
  32639. Code: res.StatusCode,
  32640. Header: res.Header,
  32641. }
  32642. }
  32643. if err != nil {
  32644. return nil, err
  32645. }
  32646. defer googleapi.CloseBody(res)
  32647. if err := googleapi.CheckResponse(res); err != nil {
  32648. return nil, err
  32649. }
  32650. ret := &OperatingSystemsListResponse{
  32651. ServerResponse: googleapi.ServerResponse{
  32652. Header: res.Header,
  32653. HTTPStatusCode: res.StatusCode,
  32654. },
  32655. }
  32656. target := &ret
  32657. if err := gensupport.DecodeResponse(target, res); err != nil {
  32658. return nil, err
  32659. }
  32660. return ret, nil
  32661. // {
  32662. // "description": "Retrieves a list of operating systems.",
  32663. // "httpMethod": "GET",
  32664. // "id": "dfareporting.operatingSystems.list",
  32665. // "parameterOrder": [
  32666. // "profileId"
  32667. // ],
  32668. // "parameters": {
  32669. // "profileId": {
  32670. // "description": "User profile ID associated with this request.",
  32671. // "format": "int64",
  32672. // "location": "path",
  32673. // "required": true,
  32674. // "type": "string"
  32675. // }
  32676. // },
  32677. // "path": "userprofiles/{profileId}/operatingSystems",
  32678. // "response": {
  32679. // "$ref": "OperatingSystemsListResponse"
  32680. // },
  32681. // "scopes": [
  32682. // "https://www.googleapis.com/auth/dfatrafficking"
  32683. // ]
  32684. // }
  32685. }
  32686. // method id "dfareporting.orderDocuments.get":
  32687. type OrderDocumentsGetCall struct {
  32688. s *Service
  32689. profileId int64
  32690. projectId int64
  32691. id int64
  32692. urlParams_ gensupport.URLParams
  32693. ifNoneMatch_ string
  32694. ctx_ context.Context
  32695. header_ http.Header
  32696. }
  32697. // Get: Gets one order document by ID.
  32698. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  32699. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32700. c.profileId = profileId
  32701. c.projectId = projectId
  32702. c.id = id
  32703. return c
  32704. }
  32705. // Fields allows partial responses to be retrieved. See
  32706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32707. // for more information.
  32708. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  32709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32710. return c
  32711. }
  32712. // IfNoneMatch sets the optional parameter which makes the operation
  32713. // fail if the object's ETag matches the given value. This is useful for
  32714. // getting updates only after the object has changed since the last
  32715. // request. Use googleapi.IsNotModified to check whether the response
  32716. // error from Do is the result of In-None-Match.
  32717. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  32718. c.ifNoneMatch_ = entityTag
  32719. return c
  32720. }
  32721. // Context sets the context to be used in this call's Do method. Any
  32722. // pending HTTP request will be aborted if the provided context is
  32723. // canceled.
  32724. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  32725. c.ctx_ = ctx
  32726. return c
  32727. }
  32728. // Header returns an http.Header that can be modified by the caller to
  32729. // add HTTP headers to the request.
  32730. func (c *OrderDocumentsGetCall) Header() http.Header {
  32731. if c.header_ == nil {
  32732. c.header_ = make(http.Header)
  32733. }
  32734. return c.header_
  32735. }
  32736. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  32737. reqHeaders := make(http.Header)
  32738. for k, v := range c.header_ {
  32739. reqHeaders[k] = v
  32740. }
  32741. reqHeaders.Set("User-Agent", c.s.userAgent())
  32742. if c.ifNoneMatch_ != "" {
  32743. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32744. }
  32745. var body io.Reader = nil
  32746. c.urlParams_.Set("alt", alt)
  32747. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  32748. urls += "?" + c.urlParams_.Encode()
  32749. req, _ := http.NewRequest("GET", urls, body)
  32750. req.Header = reqHeaders
  32751. googleapi.Expand(req.URL, map[string]string{
  32752. "profileId": strconv.FormatInt(c.profileId, 10),
  32753. "projectId": strconv.FormatInt(c.projectId, 10),
  32754. "id": strconv.FormatInt(c.id, 10),
  32755. })
  32756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32757. }
  32758. // Do executes the "dfareporting.orderDocuments.get" call.
  32759. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  32760. // status code is an error. Response headers are in either
  32761. // *OrderDocument.ServerResponse.Header or (if a response was returned
  32762. // at all) in error.(*googleapi.Error).Header. Use
  32763. // googleapi.IsNotModified to check whether the returned error was
  32764. // because http.StatusNotModified was returned.
  32765. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  32766. gensupport.SetOptions(c.urlParams_, opts...)
  32767. res, err := c.doRequest("json")
  32768. if res != nil && res.StatusCode == http.StatusNotModified {
  32769. if res.Body != nil {
  32770. res.Body.Close()
  32771. }
  32772. return nil, &googleapi.Error{
  32773. Code: res.StatusCode,
  32774. Header: res.Header,
  32775. }
  32776. }
  32777. if err != nil {
  32778. return nil, err
  32779. }
  32780. defer googleapi.CloseBody(res)
  32781. if err := googleapi.CheckResponse(res); err != nil {
  32782. return nil, err
  32783. }
  32784. ret := &OrderDocument{
  32785. ServerResponse: googleapi.ServerResponse{
  32786. Header: res.Header,
  32787. HTTPStatusCode: res.StatusCode,
  32788. },
  32789. }
  32790. target := &ret
  32791. if err := gensupport.DecodeResponse(target, res); err != nil {
  32792. return nil, err
  32793. }
  32794. return ret, nil
  32795. // {
  32796. // "description": "Gets one order document by ID.",
  32797. // "httpMethod": "GET",
  32798. // "id": "dfareporting.orderDocuments.get",
  32799. // "parameterOrder": [
  32800. // "profileId",
  32801. // "projectId",
  32802. // "id"
  32803. // ],
  32804. // "parameters": {
  32805. // "id": {
  32806. // "description": "Order document ID.",
  32807. // "format": "int64",
  32808. // "location": "path",
  32809. // "required": true,
  32810. // "type": "string"
  32811. // },
  32812. // "profileId": {
  32813. // "description": "User profile ID associated with this request.",
  32814. // "format": "int64",
  32815. // "location": "path",
  32816. // "required": true,
  32817. // "type": "string"
  32818. // },
  32819. // "projectId": {
  32820. // "description": "Project ID for order documents.",
  32821. // "format": "int64",
  32822. // "location": "path",
  32823. // "required": true,
  32824. // "type": "string"
  32825. // }
  32826. // },
  32827. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  32828. // "response": {
  32829. // "$ref": "OrderDocument"
  32830. // },
  32831. // "scopes": [
  32832. // "https://www.googleapis.com/auth/dfatrafficking"
  32833. // ]
  32834. // }
  32835. }
  32836. // method id "dfareporting.orderDocuments.list":
  32837. type OrderDocumentsListCall struct {
  32838. s *Service
  32839. profileId int64
  32840. projectId int64
  32841. urlParams_ gensupport.URLParams
  32842. ifNoneMatch_ string
  32843. ctx_ context.Context
  32844. header_ http.Header
  32845. }
  32846. // List: Retrieves a list of order documents, possibly filtered. This
  32847. // method supports paging.
  32848. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  32849. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32850. c.profileId = profileId
  32851. c.projectId = projectId
  32852. return c
  32853. }
  32854. // Approved sets the optional parameter "approved": Select only order
  32855. // documents that have been approved by at least one user.
  32856. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  32857. c.urlParams_.Set("approved", fmt.Sprint(approved))
  32858. return c
  32859. }
  32860. // Ids sets the optional parameter "ids": Select only order documents
  32861. // with these IDs.
  32862. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  32863. var ids_ []string
  32864. for _, v := range ids {
  32865. ids_ = append(ids_, fmt.Sprint(v))
  32866. }
  32867. c.urlParams_.SetMulti("ids", ids_)
  32868. return c
  32869. }
  32870. // MaxResults sets the optional parameter "maxResults": Maximum number
  32871. // of results to return.
  32872. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  32873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32874. return c
  32875. }
  32876. // OrderId sets the optional parameter "orderId": Select only order
  32877. // documents for specified orders.
  32878. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  32879. var orderId_ []string
  32880. for _, v := range orderId {
  32881. orderId_ = append(orderId_, fmt.Sprint(v))
  32882. }
  32883. c.urlParams_.SetMulti("orderId", orderId_)
  32884. return c
  32885. }
  32886. // PageToken sets the optional parameter "pageToken": Value of the
  32887. // nextPageToken from the previous result page.
  32888. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  32889. c.urlParams_.Set("pageToken", pageToken)
  32890. return c
  32891. }
  32892. // SearchString sets the optional parameter "searchString": Allows
  32893. // searching for order documents by name or ID. Wildcards (*) are
  32894. // allowed. For example, "orderdocument*2015" will return order
  32895. // documents with names like "orderdocument June 2015", "orderdocument
  32896. // April 2015", or simply "orderdocument 2015". Most of the searches
  32897. // also add wildcards implicitly at the start and the end of the search
  32898. // string. For example, a search string of "orderdocument" will match
  32899. // order documents with name "my orderdocument", "orderdocument 2015",
  32900. // or simply "orderdocument".
  32901. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  32902. c.urlParams_.Set("searchString", searchString)
  32903. return c
  32904. }
  32905. // SiteId sets the optional parameter "siteId": Select only order
  32906. // documents that are associated with these sites.
  32907. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  32908. var siteId_ []string
  32909. for _, v := range siteId {
  32910. siteId_ = append(siteId_, fmt.Sprint(v))
  32911. }
  32912. c.urlParams_.SetMulti("siteId", siteId_)
  32913. return c
  32914. }
  32915. // SortField sets the optional parameter "sortField": Field by which to
  32916. // sort the list.
  32917. //
  32918. // Possible values:
  32919. // "ID" (default)
  32920. // "NAME"
  32921. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  32922. c.urlParams_.Set("sortField", sortField)
  32923. return c
  32924. }
  32925. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32926. // results.
  32927. //
  32928. // Possible values:
  32929. // "ASCENDING" (default)
  32930. // "DESCENDING"
  32931. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  32932. c.urlParams_.Set("sortOrder", sortOrder)
  32933. return c
  32934. }
  32935. // Fields allows partial responses to be retrieved. See
  32936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32937. // for more information.
  32938. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  32939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32940. return c
  32941. }
  32942. // IfNoneMatch sets the optional parameter which makes the operation
  32943. // fail if the object's ETag matches the given value. This is useful for
  32944. // getting updates only after the object has changed since the last
  32945. // request. Use googleapi.IsNotModified to check whether the response
  32946. // error from Do is the result of In-None-Match.
  32947. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  32948. c.ifNoneMatch_ = entityTag
  32949. return c
  32950. }
  32951. // Context sets the context to be used in this call's Do method. Any
  32952. // pending HTTP request will be aborted if the provided context is
  32953. // canceled.
  32954. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  32955. c.ctx_ = ctx
  32956. return c
  32957. }
  32958. // Header returns an http.Header that can be modified by the caller to
  32959. // add HTTP headers to the request.
  32960. func (c *OrderDocumentsListCall) Header() http.Header {
  32961. if c.header_ == nil {
  32962. c.header_ = make(http.Header)
  32963. }
  32964. return c.header_
  32965. }
  32966. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  32967. reqHeaders := make(http.Header)
  32968. for k, v := range c.header_ {
  32969. reqHeaders[k] = v
  32970. }
  32971. reqHeaders.Set("User-Agent", c.s.userAgent())
  32972. if c.ifNoneMatch_ != "" {
  32973. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32974. }
  32975. var body io.Reader = nil
  32976. c.urlParams_.Set("alt", alt)
  32977. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  32978. urls += "?" + c.urlParams_.Encode()
  32979. req, _ := http.NewRequest("GET", urls, body)
  32980. req.Header = reqHeaders
  32981. googleapi.Expand(req.URL, map[string]string{
  32982. "profileId": strconv.FormatInt(c.profileId, 10),
  32983. "projectId": strconv.FormatInt(c.projectId, 10),
  32984. })
  32985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32986. }
  32987. // Do executes the "dfareporting.orderDocuments.list" call.
  32988. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  32989. // Any non-2xx status code is an error. Response headers are in either
  32990. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  32991. // was returned at all) in error.(*googleapi.Error).Header. Use
  32992. // googleapi.IsNotModified to check whether the returned error was
  32993. // because http.StatusNotModified was returned.
  32994. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  32995. gensupport.SetOptions(c.urlParams_, opts...)
  32996. res, err := c.doRequest("json")
  32997. if res != nil && res.StatusCode == http.StatusNotModified {
  32998. if res.Body != nil {
  32999. res.Body.Close()
  33000. }
  33001. return nil, &googleapi.Error{
  33002. Code: res.StatusCode,
  33003. Header: res.Header,
  33004. }
  33005. }
  33006. if err != nil {
  33007. return nil, err
  33008. }
  33009. defer googleapi.CloseBody(res)
  33010. if err := googleapi.CheckResponse(res); err != nil {
  33011. return nil, err
  33012. }
  33013. ret := &OrderDocumentsListResponse{
  33014. ServerResponse: googleapi.ServerResponse{
  33015. Header: res.Header,
  33016. HTTPStatusCode: res.StatusCode,
  33017. },
  33018. }
  33019. target := &ret
  33020. if err := gensupport.DecodeResponse(target, res); err != nil {
  33021. return nil, err
  33022. }
  33023. return ret, nil
  33024. // {
  33025. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  33026. // "httpMethod": "GET",
  33027. // "id": "dfareporting.orderDocuments.list",
  33028. // "parameterOrder": [
  33029. // "profileId",
  33030. // "projectId"
  33031. // ],
  33032. // "parameters": {
  33033. // "approved": {
  33034. // "description": "Select only order documents that have been approved by at least one user.",
  33035. // "location": "query",
  33036. // "type": "boolean"
  33037. // },
  33038. // "ids": {
  33039. // "description": "Select only order documents with these IDs.",
  33040. // "format": "int64",
  33041. // "location": "query",
  33042. // "repeated": true,
  33043. // "type": "string"
  33044. // },
  33045. // "maxResults": {
  33046. // "default": "1000",
  33047. // "description": "Maximum number of results to return.",
  33048. // "format": "int32",
  33049. // "location": "query",
  33050. // "maximum": "1000",
  33051. // "minimum": "0",
  33052. // "type": "integer"
  33053. // },
  33054. // "orderId": {
  33055. // "description": "Select only order documents for specified orders.",
  33056. // "format": "int64",
  33057. // "location": "query",
  33058. // "repeated": true,
  33059. // "type": "string"
  33060. // },
  33061. // "pageToken": {
  33062. // "description": "Value of the nextPageToken from the previous result page.",
  33063. // "location": "query",
  33064. // "type": "string"
  33065. // },
  33066. // "profileId": {
  33067. // "description": "User profile ID associated with this request.",
  33068. // "format": "int64",
  33069. // "location": "path",
  33070. // "required": true,
  33071. // "type": "string"
  33072. // },
  33073. // "projectId": {
  33074. // "description": "Project ID for order documents.",
  33075. // "format": "int64",
  33076. // "location": "path",
  33077. // "required": true,
  33078. // "type": "string"
  33079. // },
  33080. // "searchString": {
  33081. // "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\".",
  33082. // "location": "query",
  33083. // "type": "string"
  33084. // },
  33085. // "siteId": {
  33086. // "description": "Select only order documents that are associated with these sites.",
  33087. // "format": "int64",
  33088. // "location": "query",
  33089. // "repeated": true,
  33090. // "type": "string"
  33091. // },
  33092. // "sortField": {
  33093. // "default": "ID",
  33094. // "description": "Field by which to sort the list.",
  33095. // "enum": [
  33096. // "ID",
  33097. // "NAME"
  33098. // ],
  33099. // "enumDescriptions": [
  33100. // "",
  33101. // ""
  33102. // ],
  33103. // "location": "query",
  33104. // "type": "string"
  33105. // },
  33106. // "sortOrder": {
  33107. // "default": "ASCENDING",
  33108. // "description": "Order of sorted results.",
  33109. // "enum": [
  33110. // "ASCENDING",
  33111. // "DESCENDING"
  33112. // ],
  33113. // "enumDescriptions": [
  33114. // "",
  33115. // ""
  33116. // ],
  33117. // "location": "query",
  33118. // "type": "string"
  33119. // }
  33120. // },
  33121. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  33122. // "response": {
  33123. // "$ref": "OrderDocumentsListResponse"
  33124. // },
  33125. // "scopes": [
  33126. // "https://www.googleapis.com/auth/dfatrafficking"
  33127. // ]
  33128. // }
  33129. }
  33130. // Pages invokes f for each page of results.
  33131. // A non-nil error returned from f will halt the iteration.
  33132. // The provided context supersedes any context provided to the Context method.
  33133. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  33134. c.ctx_ = ctx
  33135. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33136. for {
  33137. x, err := c.Do()
  33138. if err != nil {
  33139. return err
  33140. }
  33141. if err := f(x); err != nil {
  33142. return err
  33143. }
  33144. if x.NextPageToken == "" {
  33145. return nil
  33146. }
  33147. c.PageToken(x.NextPageToken)
  33148. }
  33149. }
  33150. // method id "dfareporting.orders.get":
  33151. type OrdersGetCall struct {
  33152. s *Service
  33153. profileId int64
  33154. projectId int64
  33155. id int64
  33156. urlParams_ gensupport.URLParams
  33157. ifNoneMatch_ string
  33158. ctx_ context.Context
  33159. header_ http.Header
  33160. }
  33161. // Get: Gets one order by ID.
  33162. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  33163. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33164. c.profileId = profileId
  33165. c.projectId = projectId
  33166. c.id = id
  33167. return c
  33168. }
  33169. // Fields allows partial responses to be retrieved. See
  33170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33171. // for more information.
  33172. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  33173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33174. return c
  33175. }
  33176. // IfNoneMatch sets the optional parameter which makes the operation
  33177. // fail if the object's ETag matches the given value. This is useful for
  33178. // getting updates only after the object has changed since the last
  33179. // request. Use googleapi.IsNotModified to check whether the response
  33180. // error from Do is the result of In-None-Match.
  33181. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  33182. c.ifNoneMatch_ = entityTag
  33183. return c
  33184. }
  33185. // Context sets the context to be used in this call's Do method. Any
  33186. // pending HTTP request will be aborted if the provided context is
  33187. // canceled.
  33188. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  33189. c.ctx_ = ctx
  33190. return c
  33191. }
  33192. // Header returns an http.Header that can be modified by the caller to
  33193. // add HTTP headers to the request.
  33194. func (c *OrdersGetCall) Header() http.Header {
  33195. if c.header_ == nil {
  33196. c.header_ = make(http.Header)
  33197. }
  33198. return c.header_
  33199. }
  33200. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  33201. reqHeaders := make(http.Header)
  33202. for k, v := range c.header_ {
  33203. reqHeaders[k] = v
  33204. }
  33205. reqHeaders.Set("User-Agent", c.s.userAgent())
  33206. if c.ifNoneMatch_ != "" {
  33207. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33208. }
  33209. var body io.Reader = nil
  33210. c.urlParams_.Set("alt", alt)
  33211. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  33212. urls += "?" + c.urlParams_.Encode()
  33213. req, _ := http.NewRequest("GET", urls, body)
  33214. req.Header = reqHeaders
  33215. googleapi.Expand(req.URL, map[string]string{
  33216. "profileId": strconv.FormatInt(c.profileId, 10),
  33217. "projectId": strconv.FormatInt(c.projectId, 10),
  33218. "id": strconv.FormatInt(c.id, 10),
  33219. })
  33220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33221. }
  33222. // Do executes the "dfareporting.orders.get" call.
  33223. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  33224. // code is an error. Response headers are in either
  33225. // *Order.ServerResponse.Header or (if a response was returned at all)
  33226. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33227. // check whether the returned error was because http.StatusNotModified
  33228. // was returned.
  33229. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  33230. gensupport.SetOptions(c.urlParams_, opts...)
  33231. res, err := c.doRequest("json")
  33232. if res != nil && res.StatusCode == http.StatusNotModified {
  33233. if res.Body != nil {
  33234. res.Body.Close()
  33235. }
  33236. return nil, &googleapi.Error{
  33237. Code: res.StatusCode,
  33238. Header: res.Header,
  33239. }
  33240. }
  33241. if err != nil {
  33242. return nil, err
  33243. }
  33244. defer googleapi.CloseBody(res)
  33245. if err := googleapi.CheckResponse(res); err != nil {
  33246. return nil, err
  33247. }
  33248. ret := &Order{
  33249. ServerResponse: googleapi.ServerResponse{
  33250. Header: res.Header,
  33251. HTTPStatusCode: res.StatusCode,
  33252. },
  33253. }
  33254. target := &ret
  33255. if err := gensupport.DecodeResponse(target, res); err != nil {
  33256. return nil, err
  33257. }
  33258. return ret, nil
  33259. // {
  33260. // "description": "Gets one order by ID.",
  33261. // "httpMethod": "GET",
  33262. // "id": "dfareporting.orders.get",
  33263. // "parameterOrder": [
  33264. // "profileId",
  33265. // "projectId",
  33266. // "id"
  33267. // ],
  33268. // "parameters": {
  33269. // "id": {
  33270. // "description": "Order ID.",
  33271. // "format": "int64",
  33272. // "location": "path",
  33273. // "required": true,
  33274. // "type": "string"
  33275. // },
  33276. // "profileId": {
  33277. // "description": "User profile ID associated with this request.",
  33278. // "format": "int64",
  33279. // "location": "path",
  33280. // "required": true,
  33281. // "type": "string"
  33282. // },
  33283. // "projectId": {
  33284. // "description": "Project ID for orders.",
  33285. // "format": "int64",
  33286. // "location": "path",
  33287. // "required": true,
  33288. // "type": "string"
  33289. // }
  33290. // },
  33291. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  33292. // "response": {
  33293. // "$ref": "Order"
  33294. // },
  33295. // "scopes": [
  33296. // "https://www.googleapis.com/auth/dfatrafficking"
  33297. // ]
  33298. // }
  33299. }
  33300. // method id "dfareporting.orders.list":
  33301. type OrdersListCall struct {
  33302. s *Service
  33303. profileId int64
  33304. projectId int64
  33305. urlParams_ gensupport.URLParams
  33306. ifNoneMatch_ string
  33307. ctx_ context.Context
  33308. header_ http.Header
  33309. }
  33310. // List: Retrieves a list of orders, possibly filtered. This method
  33311. // supports paging.
  33312. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  33313. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33314. c.profileId = profileId
  33315. c.projectId = projectId
  33316. return c
  33317. }
  33318. // Ids sets the optional parameter "ids": Select only orders with these
  33319. // IDs.
  33320. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  33321. var ids_ []string
  33322. for _, v := range ids {
  33323. ids_ = append(ids_, fmt.Sprint(v))
  33324. }
  33325. c.urlParams_.SetMulti("ids", ids_)
  33326. return c
  33327. }
  33328. // MaxResults sets the optional parameter "maxResults": Maximum number
  33329. // of results to return.
  33330. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  33331. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33332. return c
  33333. }
  33334. // PageToken sets the optional parameter "pageToken": Value of the
  33335. // nextPageToken from the previous result page.
  33336. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  33337. c.urlParams_.Set("pageToken", pageToken)
  33338. return c
  33339. }
  33340. // SearchString sets the optional parameter "searchString": Allows
  33341. // searching for orders by name or ID. Wildcards (*) are allowed. For
  33342. // example, "order*2015" will return orders with names like "order June
  33343. // 2015", "order April 2015", or simply "order 2015". Most of the
  33344. // searches also add wildcards implicitly at the start and the end of
  33345. // the search string. For example, a search string of "order" will match
  33346. // orders with name "my order", "order 2015", or simply "order".
  33347. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  33348. c.urlParams_.Set("searchString", searchString)
  33349. return c
  33350. }
  33351. // SiteId sets the optional parameter "siteId": Select only orders that
  33352. // are associated with these site IDs.
  33353. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  33354. var siteId_ []string
  33355. for _, v := range siteId {
  33356. siteId_ = append(siteId_, fmt.Sprint(v))
  33357. }
  33358. c.urlParams_.SetMulti("siteId", siteId_)
  33359. return c
  33360. }
  33361. // SortField sets the optional parameter "sortField": Field by which to
  33362. // sort the list.
  33363. //
  33364. // Possible values:
  33365. // "ID" (default)
  33366. // "NAME"
  33367. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  33368. c.urlParams_.Set("sortField", sortField)
  33369. return c
  33370. }
  33371. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33372. // results.
  33373. //
  33374. // Possible values:
  33375. // "ASCENDING" (default)
  33376. // "DESCENDING"
  33377. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  33378. c.urlParams_.Set("sortOrder", sortOrder)
  33379. return c
  33380. }
  33381. // Fields allows partial responses to be retrieved. See
  33382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33383. // for more information.
  33384. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  33385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33386. return c
  33387. }
  33388. // IfNoneMatch sets the optional parameter which makes the operation
  33389. // fail if the object's ETag matches the given value. This is useful for
  33390. // getting updates only after the object has changed since the last
  33391. // request. Use googleapi.IsNotModified to check whether the response
  33392. // error from Do is the result of In-None-Match.
  33393. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  33394. c.ifNoneMatch_ = entityTag
  33395. return c
  33396. }
  33397. // Context sets the context to be used in this call's Do method. Any
  33398. // pending HTTP request will be aborted if the provided context is
  33399. // canceled.
  33400. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  33401. c.ctx_ = ctx
  33402. return c
  33403. }
  33404. // Header returns an http.Header that can be modified by the caller to
  33405. // add HTTP headers to the request.
  33406. func (c *OrdersListCall) Header() http.Header {
  33407. if c.header_ == nil {
  33408. c.header_ = make(http.Header)
  33409. }
  33410. return c.header_
  33411. }
  33412. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  33413. reqHeaders := make(http.Header)
  33414. for k, v := range c.header_ {
  33415. reqHeaders[k] = v
  33416. }
  33417. reqHeaders.Set("User-Agent", c.s.userAgent())
  33418. if c.ifNoneMatch_ != "" {
  33419. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33420. }
  33421. var body io.Reader = nil
  33422. c.urlParams_.Set("alt", alt)
  33423. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  33424. urls += "?" + c.urlParams_.Encode()
  33425. req, _ := http.NewRequest("GET", urls, body)
  33426. req.Header = reqHeaders
  33427. googleapi.Expand(req.URL, map[string]string{
  33428. "profileId": strconv.FormatInt(c.profileId, 10),
  33429. "projectId": strconv.FormatInt(c.projectId, 10),
  33430. })
  33431. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33432. }
  33433. // Do executes the "dfareporting.orders.list" call.
  33434. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  33435. // non-2xx status code is an error. Response headers are in either
  33436. // *OrdersListResponse.ServerResponse.Header or (if a response was
  33437. // returned at all) in error.(*googleapi.Error).Header. Use
  33438. // googleapi.IsNotModified to check whether the returned error was
  33439. // because http.StatusNotModified was returned.
  33440. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  33441. gensupport.SetOptions(c.urlParams_, opts...)
  33442. res, err := c.doRequest("json")
  33443. if res != nil && res.StatusCode == http.StatusNotModified {
  33444. if res.Body != nil {
  33445. res.Body.Close()
  33446. }
  33447. return nil, &googleapi.Error{
  33448. Code: res.StatusCode,
  33449. Header: res.Header,
  33450. }
  33451. }
  33452. if err != nil {
  33453. return nil, err
  33454. }
  33455. defer googleapi.CloseBody(res)
  33456. if err := googleapi.CheckResponse(res); err != nil {
  33457. return nil, err
  33458. }
  33459. ret := &OrdersListResponse{
  33460. ServerResponse: googleapi.ServerResponse{
  33461. Header: res.Header,
  33462. HTTPStatusCode: res.StatusCode,
  33463. },
  33464. }
  33465. target := &ret
  33466. if err := gensupport.DecodeResponse(target, res); err != nil {
  33467. return nil, err
  33468. }
  33469. return ret, nil
  33470. // {
  33471. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  33472. // "httpMethod": "GET",
  33473. // "id": "dfareporting.orders.list",
  33474. // "parameterOrder": [
  33475. // "profileId",
  33476. // "projectId"
  33477. // ],
  33478. // "parameters": {
  33479. // "ids": {
  33480. // "description": "Select only orders with these IDs.",
  33481. // "format": "int64",
  33482. // "location": "query",
  33483. // "repeated": true,
  33484. // "type": "string"
  33485. // },
  33486. // "maxResults": {
  33487. // "default": "1000",
  33488. // "description": "Maximum number of results to return.",
  33489. // "format": "int32",
  33490. // "location": "query",
  33491. // "maximum": "1000",
  33492. // "minimum": "0",
  33493. // "type": "integer"
  33494. // },
  33495. // "pageToken": {
  33496. // "description": "Value of the nextPageToken from the previous result page.",
  33497. // "location": "query",
  33498. // "type": "string"
  33499. // },
  33500. // "profileId": {
  33501. // "description": "User profile ID associated with this request.",
  33502. // "format": "int64",
  33503. // "location": "path",
  33504. // "required": true,
  33505. // "type": "string"
  33506. // },
  33507. // "projectId": {
  33508. // "description": "Project ID for orders.",
  33509. // "format": "int64",
  33510. // "location": "path",
  33511. // "required": true,
  33512. // "type": "string"
  33513. // },
  33514. // "searchString": {
  33515. // "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\".",
  33516. // "location": "query",
  33517. // "type": "string"
  33518. // },
  33519. // "siteId": {
  33520. // "description": "Select only orders that are associated with these site IDs.",
  33521. // "format": "int64",
  33522. // "location": "query",
  33523. // "repeated": true,
  33524. // "type": "string"
  33525. // },
  33526. // "sortField": {
  33527. // "default": "ID",
  33528. // "description": "Field by which to sort the list.",
  33529. // "enum": [
  33530. // "ID",
  33531. // "NAME"
  33532. // ],
  33533. // "enumDescriptions": [
  33534. // "",
  33535. // ""
  33536. // ],
  33537. // "location": "query",
  33538. // "type": "string"
  33539. // },
  33540. // "sortOrder": {
  33541. // "default": "ASCENDING",
  33542. // "description": "Order of sorted results.",
  33543. // "enum": [
  33544. // "ASCENDING",
  33545. // "DESCENDING"
  33546. // ],
  33547. // "enumDescriptions": [
  33548. // "",
  33549. // ""
  33550. // ],
  33551. // "location": "query",
  33552. // "type": "string"
  33553. // }
  33554. // },
  33555. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  33556. // "response": {
  33557. // "$ref": "OrdersListResponse"
  33558. // },
  33559. // "scopes": [
  33560. // "https://www.googleapis.com/auth/dfatrafficking"
  33561. // ]
  33562. // }
  33563. }
  33564. // Pages invokes f for each page of results.
  33565. // A non-nil error returned from f will halt the iteration.
  33566. // The provided context supersedes any context provided to the Context method.
  33567. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  33568. c.ctx_ = ctx
  33569. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33570. for {
  33571. x, err := c.Do()
  33572. if err != nil {
  33573. return err
  33574. }
  33575. if err := f(x); err != nil {
  33576. return err
  33577. }
  33578. if x.NextPageToken == "" {
  33579. return nil
  33580. }
  33581. c.PageToken(x.NextPageToken)
  33582. }
  33583. }
  33584. // method id "dfareporting.placementGroups.get":
  33585. type PlacementGroupsGetCall struct {
  33586. s *Service
  33587. profileId int64
  33588. id int64
  33589. urlParams_ gensupport.URLParams
  33590. ifNoneMatch_ string
  33591. ctx_ context.Context
  33592. header_ http.Header
  33593. }
  33594. // Get: Gets one placement group by ID.
  33595. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  33596. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33597. c.profileId = profileId
  33598. c.id = id
  33599. return c
  33600. }
  33601. // Fields allows partial responses to be retrieved. See
  33602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33603. // for more information.
  33604. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  33605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33606. return c
  33607. }
  33608. // IfNoneMatch sets the optional parameter which makes the operation
  33609. // fail if the object's ETag matches the given value. This is useful for
  33610. // getting updates only after the object has changed since the last
  33611. // request. Use googleapi.IsNotModified to check whether the response
  33612. // error from Do is the result of In-None-Match.
  33613. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  33614. c.ifNoneMatch_ = entityTag
  33615. return c
  33616. }
  33617. // Context sets the context to be used in this call's Do method. Any
  33618. // pending HTTP request will be aborted if the provided context is
  33619. // canceled.
  33620. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  33621. c.ctx_ = ctx
  33622. return c
  33623. }
  33624. // Header returns an http.Header that can be modified by the caller to
  33625. // add HTTP headers to the request.
  33626. func (c *PlacementGroupsGetCall) Header() http.Header {
  33627. if c.header_ == nil {
  33628. c.header_ = make(http.Header)
  33629. }
  33630. return c.header_
  33631. }
  33632. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  33633. reqHeaders := make(http.Header)
  33634. for k, v := range c.header_ {
  33635. reqHeaders[k] = v
  33636. }
  33637. reqHeaders.Set("User-Agent", c.s.userAgent())
  33638. if c.ifNoneMatch_ != "" {
  33639. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33640. }
  33641. var body io.Reader = nil
  33642. c.urlParams_.Set("alt", alt)
  33643. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  33644. urls += "?" + c.urlParams_.Encode()
  33645. req, _ := http.NewRequest("GET", urls, body)
  33646. req.Header = reqHeaders
  33647. googleapi.Expand(req.URL, map[string]string{
  33648. "profileId": strconv.FormatInt(c.profileId, 10),
  33649. "id": strconv.FormatInt(c.id, 10),
  33650. })
  33651. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33652. }
  33653. // Do executes the "dfareporting.placementGroups.get" call.
  33654. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33655. // status code is an error. Response headers are in either
  33656. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33657. // at all) in error.(*googleapi.Error).Header. Use
  33658. // googleapi.IsNotModified to check whether the returned error was
  33659. // because http.StatusNotModified was returned.
  33660. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33661. gensupport.SetOptions(c.urlParams_, opts...)
  33662. res, err := c.doRequest("json")
  33663. if res != nil && res.StatusCode == http.StatusNotModified {
  33664. if res.Body != nil {
  33665. res.Body.Close()
  33666. }
  33667. return nil, &googleapi.Error{
  33668. Code: res.StatusCode,
  33669. Header: res.Header,
  33670. }
  33671. }
  33672. if err != nil {
  33673. return nil, err
  33674. }
  33675. defer googleapi.CloseBody(res)
  33676. if err := googleapi.CheckResponse(res); err != nil {
  33677. return nil, err
  33678. }
  33679. ret := &PlacementGroup{
  33680. ServerResponse: googleapi.ServerResponse{
  33681. Header: res.Header,
  33682. HTTPStatusCode: res.StatusCode,
  33683. },
  33684. }
  33685. target := &ret
  33686. if err := gensupport.DecodeResponse(target, res); err != nil {
  33687. return nil, err
  33688. }
  33689. return ret, nil
  33690. // {
  33691. // "description": "Gets one placement group by ID.",
  33692. // "httpMethod": "GET",
  33693. // "id": "dfareporting.placementGroups.get",
  33694. // "parameterOrder": [
  33695. // "profileId",
  33696. // "id"
  33697. // ],
  33698. // "parameters": {
  33699. // "id": {
  33700. // "description": "Placement group ID.",
  33701. // "format": "int64",
  33702. // "location": "path",
  33703. // "required": true,
  33704. // "type": "string"
  33705. // },
  33706. // "profileId": {
  33707. // "description": "User profile ID associated with this request.",
  33708. // "format": "int64",
  33709. // "location": "path",
  33710. // "required": true,
  33711. // "type": "string"
  33712. // }
  33713. // },
  33714. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  33715. // "response": {
  33716. // "$ref": "PlacementGroup"
  33717. // },
  33718. // "scopes": [
  33719. // "https://www.googleapis.com/auth/dfatrafficking"
  33720. // ]
  33721. // }
  33722. }
  33723. // method id "dfareporting.placementGroups.insert":
  33724. type PlacementGroupsInsertCall struct {
  33725. s *Service
  33726. profileId int64
  33727. placementgroup *PlacementGroup
  33728. urlParams_ gensupport.URLParams
  33729. ctx_ context.Context
  33730. header_ http.Header
  33731. }
  33732. // Insert: Inserts a new placement group.
  33733. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  33734. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33735. c.profileId = profileId
  33736. c.placementgroup = placementgroup
  33737. return c
  33738. }
  33739. // Fields allows partial responses to be retrieved. See
  33740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33741. // for more information.
  33742. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  33743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33744. return c
  33745. }
  33746. // Context sets the context to be used in this call's Do method. Any
  33747. // pending HTTP request will be aborted if the provided context is
  33748. // canceled.
  33749. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  33750. c.ctx_ = ctx
  33751. return c
  33752. }
  33753. // Header returns an http.Header that can be modified by the caller to
  33754. // add HTTP headers to the request.
  33755. func (c *PlacementGroupsInsertCall) Header() http.Header {
  33756. if c.header_ == nil {
  33757. c.header_ = make(http.Header)
  33758. }
  33759. return c.header_
  33760. }
  33761. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  33762. reqHeaders := make(http.Header)
  33763. for k, v := range c.header_ {
  33764. reqHeaders[k] = v
  33765. }
  33766. reqHeaders.Set("User-Agent", c.s.userAgent())
  33767. var body io.Reader = nil
  33768. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33769. if err != nil {
  33770. return nil, err
  33771. }
  33772. reqHeaders.Set("Content-Type", "application/json")
  33773. c.urlParams_.Set("alt", alt)
  33774. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33775. urls += "?" + c.urlParams_.Encode()
  33776. req, _ := http.NewRequest("POST", urls, body)
  33777. req.Header = reqHeaders
  33778. googleapi.Expand(req.URL, map[string]string{
  33779. "profileId": strconv.FormatInt(c.profileId, 10),
  33780. })
  33781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33782. }
  33783. // Do executes the "dfareporting.placementGroups.insert" call.
  33784. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33785. // status code is an error. Response headers are in either
  33786. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33787. // at all) in error.(*googleapi.Error).Header. Use
  33788. // googleapi.IsNotModified to check whether the returned error was
  33789. // because http.StatusNotModified was returned.
  33790. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33791. gensupport.SetOptions(c.urlParams_, opts...)
  33792. res, err := c.doRequest("json")
  33793. if res != nil && res.StatusCode == http.StatusNotModified {
  33794. if res.Body != nil {
  33795. res.Body.Close()
  33796. }
  33797. return nil, &googleapi.Error{
  33798. Code: res.StatusCode,
  33799. Header: res.Header,
  33800. }
  33801. }
  33802. if err != nil {
  33803. return nil, err
  33804. }
  33805. defer googleapi.CloseBody(res)
  33806. if err := googleapi.CheckResponse(res); err != nil {
  33807. return nil, err
  33808. }
  33809. ret := &PlacementGroup{
  33810. ServerResponse: googleapi.ServerResponse{
  33811. Header: res.Header,
  33812. HTTPStatusCode: res.StatusCode,
  33813. },
  33814. }
  33815. target := &ret
  33816. if err := gensupport.DecodeResponse(target, res); err != nil {
  33817. return nil, err
  33818. }
  33819. return ret, nil
  33820. // {
  33821. // "description": "Inserts a new placement group.",
  33822. // "httpMethod": "POST",
  33823. // "id": "dfareporting.placementGroups.insert",
  33824. // "parameterOrder": [
  33825. // "profileId"
  33826. // ],
  33827. // "parameters": {
  33828. // "profileId": {
  33829. // "description": "User profile ID associated with this request.",
  33830. // "format": "int64",
  33831. // "location": "path",
  33832. // "required": true,
  33833. // "type": "string"
  33834. // }
  33835. // },
  33836. // "path": "userprofiles/{profileId}/placementGroups",
  33837. // "request": {
  33838. // "$ref": "PlacementGroup"
  33839. // },
  33840. // "response": {
  33841. // "$ref": "PlacementGroup"
  33842. // },
  33843. // "scopes": [
  33844. // "https://www.googleapis.com/auth/dfatrafficking"
  33845. // ]
  33846. // }
  33847. }
  33848. // method id "dfareporting.placementGroups.list":
  33849. type PlacementGroupsListCall struct {
  33850. s *Service
  33851. profileId int64
  33852. urlParams_ gensupport.URLParams
  33853. ifNoneMatch_ string
  33854. ctx_ context.Context
  33855. header_ http.Header
  33856. }
  33857. // List: Retrieves a list of placement groups, possibly filtered. This
  33858. // method supports paging.
  33859. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  33860. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33861. c.profileId = profileId
  33862. return c
  33863. }
  33864. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  33865. // only placement groups that belong to these advertisers.
  33866. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  33867. var advertiserIds_ []string
  33868. for _, v := range advertiserIds {
  33869. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  33870. }
  33871. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  33872. return c
  33873. }
  33874. // Archived sets the optional parameter "archived": Select only archived
  33875. // placements. Don't set this field to select both archived and
  33876. // non-archived placements.
  33877. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  33878. c.urlParams_.Set("archived", fmt.Sprint(archived))
  33879. return c
  33880. }
  33881. // CampaignIds sets the optional parameter "campaignIds": Select only
  33882. // placement groups that belong to these campaigns.
  33883. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  33884. var campaignIds_ []string
  33885. for _, v := range campaignIds {
  33886. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  33887. }
  33888. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  33889. return c
  33890. }
  33891. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  33892. // Select only placement groups that are associated with these content
  33893. // categories.
  33894. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  33895. var contentCategoryIds_ []string
  33896. for _, v := range contentCategoryIds {
  33897. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  33898. }
  33899. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  33900. return c
  33901. }
  33902. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  33903. // Select only placement groups that are associated with these directory
  33904. // sites.
  33905. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  33906. var directorySiteIds_ []string
  33907. for _, v := range directorySiteIds {
  33908. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  33909. }
  33910. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  33911. return c
  33912. }
  33913. // Ids sets the optional parameter "ids": Select only placement groups
  33914. // with these IDs.
  33915. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  33916. var ids_ []string
  33917. for _, v := range ids {
  33918. ids_ = append(ids_, fmt.Sprint(v))
  33919. }
  33920. c.urlParams_.SetMulti("ids", ids_)
  33921. return c
  33922. }
  33923. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  33924. // placements or placement groups whose end date is on or before the
  33925. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  33926. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  33927. c.urlParams_.Set("maxEndDate", maxEndDate)
  33928. return c
  33929. }
  33930. // MaxResults sets the optional parameter "maxResults": Maximum number
  33931. // of results to return.
  33932. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  33933. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33934. return c
  33935. }
  33936. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  33937. // placements or placement groups whose start date is on or before the
  33938. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  33939. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  33940. c.urlParams_.Set("maxStartDate", maxStartDate)
  33941. return c
  33942. }
  33943. // MinEndDate sets the optional parameter "minEndDate": Select only
  33944. // placements or placement groups whose end date is on or after the
  33945. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  33946. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  33947. c.urlParams_.Set("minEndDate", minEndDate)
  33948. return c
  33949. }
  33950. // MinStartDate sets the optional parameter "minStartDate": Select only
  33951. // placements or placement groups whose start date is on or after the
  33952. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  33953. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  33954. c.urlParams_.Set("minStartDate", minStartDate)
  33955. return c
  33956. }
  33957. // PageToken sets the optional parameter "pageToken": Value of the
  33958. // nextPageToken from the previous result page.
  33959. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  33960. c.urlParams_.Set("pageToken", pageToken)
  33961. return c
  33962. }
  33963. // PlacementGroupType sets the optional parameter "placementGroupType":
  33964. // Select only placement groups belonging with this group type. A
  33965. // package is a simple group of placements that acts as a single pricing
  33966. // point for a group of tags. A roadblock is a group of placements that
  33967. // not only acts as a single pricing point but also assumes that all the
  33968. // tags in it will be served at the same time. A roadblock requires one
  33969. // of its assigned placements to be marked as primary for reporting.
  33970. //
  33971. // Possible values:
  33972. // "PLACEMENT_PACKAGE"
  33973. // "PLACEMENT_ROADBLOCK"
  33974. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  33975. c.urlParams_.Set("placementGroupType", placementGroupType)
  33976. return c
  33977. }
  33978. // PlacementStrategyIds sets the optional parameter
  33979. // "placementStrategyIds": Select only placement groups that are
  33980. // associated with these placement strategies.
  33981. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  33982. var placementStrategyIds_ []string
  33983. for _, v := range placementStrategyIds {
  33984. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  33985. }
  33986. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  33987. return c
  33988. }
  33989. // PricingTypes sets the optional parameter "pricingTypes": Select only
  33990. // placement groups with these pricing types.
  33991. //
  33992. // Possible values:
  33993. // "PRICING_TYPE_CPA"
  33994. // "PRICING_TYPE_CPC"
  33995. // "PRICING_TYPE_CPM"
  33996. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  33997. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  33998. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  33999. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  34000. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  34001. return c
  34002. }
  34003. // SearchString sets the optional parameter "searchString": Allows
  34004. // searching for placement groups by name or ID. Wildcards (*) are
  34005. // allowed. For example, "placement*2015" will return placement groups
  34006. // with names like "placement group June 2015", "placement group May
  34007. // 2015", or simply "placements 2015". Most of the searches also add
  34008. // wildcards implicitly at the start and the end of the search string.
  34009. // For example, a search string of "placementgroup" will match placement
  34010. // groups with name "my placementgroup", "placementgroup 2015", or
  34011. // simply "placementgroup".
  34012. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  34013. c.urlParams_.Set("searchString", searchString)
  34014. return c
  34015. }
  34016. // SiteIds sets the optional parameter "siteIds": Select only placement
  34017. // groups that are associated with these sites.
  34018. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  34019. var siteIds_ []string
  34020. for _, v := range siteIds {
  34021. siteIds_ = append(siteIds_, fmt.Sprint(v))
  34022. }
  34023. c.urlParams_.SetMulti("siteIds", siteIds_)
  34024. return c
  34025. }
  34026. // SortField sets the optional parameter "sortField": Field by which to
  34027. // sort the list.
  34028. //
  34029. // Possible values:
  34030. // "ID" (default)
  34031. // "NAME"
  34032. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  34033. c.urlParams_.Set("sortField", sortField)
  34034. return c
  34035. }
  34036. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34037. // results.
  34038. //
  34039. // Possible values:
  34040. // "ASCENDING" (default)
  34041. // "DESCENDING"
  34042. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  34043. c.urlParams_.Set("sortOrder", sortOrder)
  34044. return c
  34045. }
  34046. // Fields allows partial responses to be retrieved. See
  34047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34048. // for more information.
  34049. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  34050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34051. return c
  34052. }
  34053. // IfNoneMatch sets the optional parameter which makes the operation
  34054. // fail if the object's ETag matches the given value. This is useful for
  34055. // getting updates only after the object has changed since the last
  34056. // request. Use googleapi.IsNotModified to check whether the response
  34057. // error from Do is the result of In-None-Match.
  34058. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  34059. c.ifNoneMatch_ = entityTag
  34060. return c
  34061. }
  34062. // Context sets the context to be used in this call's Do method. Any
  34063. // pending HTTP request will be aborted if the provided context is
  34064. // canceled.
  34065. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  34066. c.ctx_ = ctx
  34067. return c
  34068. }
  34069. // Header returns an http.Header that can be modified by the caller to
  34070. // add HTTP headers to the request.
  34071. func (c *PlacementGroupsListCall) Header() http.Header {
  34072. if c.header_ == nil {
  34073. c.header_ = make(http.Header)
  34074. }
  34075. return c.header_
  34076. }
  34077. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  34078. reqHeaders := make(http.Header)
  34079. for k, v := range c.header_ {
  34080. reqHeaders[k] = v
  34081. }
  34082. reqHeaders.Set("User-Agent", c.s.userAgent())
  34083. if c.ifNoneMatch_ != "" {
  34084. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34085. }
  34086. var body io.Reader = nil
  34087. c.urlParams_.Set("alt", alt)
  34088. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34089. urls += "?" + c.urlParams_.Encode()
  34090. req, _ := http.NewRequest("GET", urls, body)
  34091. req.Header = reqHeaders
  34092. googleapi.Expand(req.URL, map[string]string{
  34093. "profileId": strconv.FormatInt(c.profileId, 10),
  34094. })
  34095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34096. }
  34097. // Do executes the "dfareporting.placementGroups.list" call.
  34098. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  34099. // Any non-2xx status code is an error. Response headers are in either
  34100. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  34101. // was returned at all) in error.(*googleapi.Error).Header. Use
  34102. // googleapi.IsNotModified to check whether the returned error was
  34103. // because http.StatusNotModified was returned.
  34104. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  34105. gensupport.SetOptions(c.urlParams_, opts...)
  34106. res, err := c.doRequest("json")
  34107. if res != nil && res.StatusCode == http.StatusNotModified {
  34108. if res.Body != nil {
  34109. res.Body.Close()
  34110. }
  34111. return nil, &googleapi.Error{
  34112. Code: res.StatusCode,
  34113. Header: res.Header,
  34114. }
  34115. }
  34116. if err != nil {
  34117. return nil, err
  34118. }
  34119. defer googleapi.CloseBody(res)
  34120. if err := googleapi.CheckResponse(res); err != nil {
  34121. return nil, err
  34122. }
  34123. ret := &PlacementGroupsListResponse{
  34124. ServerResponse: googleapi.ServerResponse{
  34125. Header: res.Header,
  34126. HTTPStatusCode: res.StatusCode,
  34127. },
  34128. }
  34129. target := &ret
  34130. if err := gensupport.DecodeResponse(target, res); err != nil {
  34131. return nil, err
  34132. }
  34133. return ret, nil
  34134. // {
  34135. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  34136. // "httpMethod": "GET",
  34137. // "id": "dfareporting.placementGroups.list",
  34138. // "parameterOrder": [
  34139. // "profileId"
  34140. // ],
  34141. // "parameters": {
  34142. // "advertiserIds": {
  34143. // "description": "Select only placement groups that belong to these advertisers.",
  34144. // "format": "int64",
  34145. // "location": "query",
  34146. // "repeated": true,
  34147. // "type": "string"
  34148. // },
  34149. // "archived": {
  34150. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  34151. // "location": "query",
  34152. // "type": "boolean"
  34153. // },
  34154. // "campaignIds": {
  34155. // "description": "Select only placement groups that belong to these campaigns.",
  34156. // "format": "int64",
  34157. // "location": "query",
  34158. // "repeated": true,
  34159. // "type": "string"
  34160. // },
  34161. // "contentCategoryIds": {
  34162. // "description": "Select only placement groups that are associated with these content categories.",
  34163. // "format": "int64",
  34164. // "location": "query",
  34165. // "repeated": true,
  34166. // "type": "string"
  34167. // },
  34168. // "directorySiteIds": {
  34169. // "description": "Select only placement groups that are associated with these directory sites.",
  34170. // "format": "int64",
  34171. // "location": "query",
  34172. // "repeated": true,
  34173. // "type": "string"
  34174. // },
  34175. // "ids": {
  34176. // "description": "Select only placement groups with these IDs.",
  34177. // "format": "int64",
  34178. // "location": "query",
  34179. // "repeated": true,
  34180. // "type": "string"
  34181. // },
  34182. // "maxEndDate": {
  34183. // "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\".",
  34184. // "location": "query",
  34185. // "type": "string"
  34186. // },
  34187. // "maxResults": {
  34188. // "default": "800",
  34189. // "description": "Maximum number of results to return.",
  34190. // "format": "int32",
  34191. // "location": "query",
  34192. // "maximum": "800",
  34193. // "minimum": "0",
  34194. // "type": "integer"
  34195. // },
  34196. // "maxStartDate": {
  34197. // "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\".",
  34198. // "location": "query",
  34199. // "type": "string"
  34200. // },
  34201. // "minEndDate": {
  34202. // "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\".",
  34203. // "location": "query",
  34204. // "type": "string"
  34205. // },
  34206. // "minStartDate": {
  34207. // "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\".",
  34208. // "location": "query",
  34209. // "type": "string"
  34210. // },
  34211. // "pageToken": {
  34212. // "description": "Value of the nextPageToken from the previous result page.",
  34213. // "location": "query",
  34214. // "type": "string"
  34215. // },
  34216. // "placementGroupType": {
  34217. // "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.",
  34218. // "enum": [
  34219. // "PLACEMENT_PACKAGE",
  34220. // "PLACEMENT_ROADBLOCK"
  34221. // ],
  34222. // "enumDescriptions": [
  34223. // "",
  34224. // ""
  34225. // ],
  34226. // "location": "query",
  34227. // "type": "string"
  34228. // },
  34229. // "placementStrategyIds": {
  34230. // "description": "Select only placement groups that are associated with these placement strategies.",
  34231. // "format": "int64",
  34232. // "location": "query",
  34233. // "repeated": true,
  34234. // "type": "string"
  34235. // },
  34236. // "pricingTypes": {
  34237. // "description": "Select only placement groups with these pricing types.",
  34238. // "enum": [
  34239. // "PRICING_TYPE_CPA",
  34240. // "PRICING_TYPE_CPC",
  34241. // "PRICING_TYPE_CPM",
  34242. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  34243. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  34244. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34245. // ],
  34246. // "enumDescriptions": [
  34247. // "",
  34248. // "",
  34249. // "",
  34250. // "",
  34251. // "",
  34252. // ""
  34253. // ],
  34254. // "location": "query",
  34255. // "repeated": true,
  34256. // "type": "string"
  34257. // },
  34258. // "profileId": {
  34259. // "description": "User profile ID associated with this request.",
  34260. // "format": "int64",
  34261. // "location": "path",
  34262. // "required": true,
  34263. // "type": "string"
  34264. // },
  34265. // "searchString": {
  34266. // "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\".",
  34267. // "location": "query",
  34268. // "type": "string"
  34269. // },
  34270. // "siteIds": {
  34271. // "description": "Select only placement groups that are associated with these sites.",
  34272. // "format": "int64",
  34273. // "location": "query",
  34274. // "repeated": true,
  34275. // "type": "string"
  34276. // },
  34277. // "sortField": {
  34278. // "default": "ID",
  34279. // "description": "Field by which to sort the list.",
  34280. // "enum": [
  34281. // "ID",
  34282. // "NAME"
  34283. // ],
  34284. // "enumDescriptions": [
  34285. // "",
  34286. // ""
  34287. // ],
  34288. // "location": "query",
  34289. // "type": "string"
  34290. // },
  34291. // "sortOrder": {
  34292. // "default": "ASCENDING",
  34293. // "description": "Order of sorted results.",
  34294. // "enum": [
  34295. // "ASCENDING",
  34296. // "DESCENDING"
  34297. // ],
  34298. // "enumDescriptions": [
  34299. // "",
  34300. // ""
  34301. // ],
  34302. // "location": "query",
  34303. // "type": "string"
  34304. // }
  34305. // },
  34306. // "path": "userprofiles/{profileId}/placementGroups",
  34307. // "response": {
  34308. // "$ref": "PlacementGroupsListResponse"
  34309. // },
  34310. // "scopes": [
  34311. // "https://www.googleapis.com/auth/dfatrafficking"
  34312. // ]
  34313. // }
  34314. }
  34315. // Pages invokes f for each page of results.
  34316. // A non-nil error returned from f will halt the iteration.
  34317. // The provided context supersedes any context provided to the Context method.
  34318. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  34319. c.ctx_ = ctx
  34320. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34321. for {
  34322. x, err := c.Do()
  34323. if err != nil {
  34324. return err
  34325. }
  34326. if err := f(x); err != nil {
  34327. return err
  34328. }
  34329. if x.NextPageToken == "" {
  34330. return nil
  34331. }
  34332. c.PageToken(x.NextPageToken)
  34333. }
  34334. }
  34335. // method id "dfareporting.placementGroups.patch":
  34336. type PlacementGroupsPatchCall struct {
  34337. s *Service
  34338. profileId int64
  34339. placementgroup *PlacementGroup
  34340. urlParams_ gensupport.URLParams
  34341. ctx_ context.Context
  34342. header_ http.Header
  34343. }
  34344. // Patch: Updates an existing placement group. This method supports
  34345. // patch semantics.
  34346. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  34347. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34348. c.profileId = profileId
  34349. c.urlParams_.Set("id", fmt.Sprint(id))
  34350. c.placementgroup = placementgroup
  34351. return c
  34352. }
  34353. // Fields allows partial responses to be retrieved. See
  34354. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34355. // for more information.
  34356. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  34357. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34358. return c
  34359. }
  34360. // Context sets the context to be used in this call's Do method. Any
  34361. // pending HTTP request will be aborted if the provided context is
  34362. // canceled.
  34363. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  34364. c.ctx_ = ctx
  34365. return c
  34366. }
  34367. // Header returns an http.Header that can be modified by the caller to
  34368. // add HTTP headers to the request.
  34369. func (c *PlacementGroupsPatchCall) Header() http.Header {
  34370. if c.header_ == nil {
  34371. c.header_ = make(http.Header)
  34372. }
  34373. return c.header_
  34374. }
  34375. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  34376. reqHeaders := make(http.Header)
  34377. for k, v := range c.header_ {
  34378. reqHeaders[k] = v
  34379. }
  34380. reqHeaders.Set("User-Agent", c.s.userAgent())
  34381. var body io.Reader = nil
  34382. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34383. if err != nil {
  34384. return nil, err
  34385. }
  34386. reqHeaders.Set("Content-Type", "application/json")
  34387. c.urlParams_.Set("alt", alt)
  34388. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34389. urls += "?" + c.urlParams_.Encode()
  34390. req, _ := http.NewRequest("PATCH", urls, body)
  34391. req.Header = reqHeaders
  34392. googleapi.Expand(req.URL, map[string]string{
  34393. "profileId": strconv.FormatInt(c.profileId, 10),
  34394. })
  34395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34396. }
  34397. // Do executes the "dfareporting.placementGroups.patch" call.
  34398. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34399. // status code is an error. Response headers are in either
  34400. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34401. // at all) in error.(*googleapi.Error).Header. Use
  34402. // googleapi.IsNotModified to check whether the returned error was
  34403. // because http.StatusNotModified was returned.
  34404. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34405. gensupport.SetOptions(c.urlParams_, opts...)
  34406. res, err := c.doRequest("json")
  34407. if res != nil && res.StatusCode == http.StatusNotModified {
  34408. if res.Body != nil {
  34409. res.Body.Close()
  34410. }
  34411. return nil, &googleapi.Error{
  34412. Code: res.StatusCode,
  34413. Header: res.Header,
  34414. }
  34415. }
  34416. if err != nil {
  34417. return nil, err
  34418. }
  34419. defer googleapi.CloseBody(res)
  34420. if err := googleapi.CheckResponse(res); err != nil {
  34421. return nil, err
  34422. }
  34423. ret := &PlacementGroup{
  34424. ServerResponse: googleapi.ServerResponse{
  34425. Header: res.Header,
  34426. HTTPStatusCode: res.StatusCode,
  34427. },
  34428. }
  34429. target := &ret
  34430. if err := gensupport.DecodeResponse(target, res); err != nil {
  34431. return nil, err
  34432. }
  34433. return ret, nil
  34434. // {
  34435. // "description": "Updates an existing placement group. This method supports patch semantics.",
  34436. // "httpMethod": "PATCH",
  34437. // "id": "dfareporting.placementGroups.patch",
  34438. // "parameterOrder": [
  34439. // "profileId",
  34440. // "id"
  34441. // ],
  34442. // "parameters": {
  34443. // "id": {
  34444. // "description": "Placement group ID.",
  34445. // "format": "int64",
  34446. // "location": "query",
  34447. // "required": true,
  34448. // "type": "string"
  34449. // },
  34450. // "profileId": {
  34451. // "description": "User profile ID associated with this request.",
  34452. // "format": "int64",
  34453. // "location": "path",
  34454. // "required": true,
  34455. // "type": "string"
  34456. // }
  34457. // },
  34458. // "path": "userprofiles/{profileId}/placementGroups",
  34459. // "request": {
  34460. // "$ref": "PlacementGroup"
  34461. // },
  34462. // "response": {
  34463. // "$ref": "PlacementGroup"
  34464. // },
  34465. // "scopes": [
  34466. // "https://www.googleapis.com/auth/dfatrafficking"
  34467. // ]
  34468. // }
  34469. }
  34470. // method id "dfareporting.placementGroups.update":
  34471. type PlacementGroupsUpdateCall struct {
  34472. s *Service
  34473. profileId int64
  34474. placementgroup *PlacementGroup
  34475. urlParams_ gensupport.URLParams
  34476. ctx_ context.Context
  34477. header_ http.Header
  34478. }
  34479. // Update: Updates an existing placement group.
  34480. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  34481. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34482. c.profileId = profileId
  34483. c.placementgroup = placementgroup
  34484. return c
  34485. }
  34486. // Fields allows partial responses to be retrieved. See
  34487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34488. // for more information.
  34489. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  34490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34491. return c
  34492. }
  34493. // Context sets the context to be used in this call's Do method. Any
  34494. // pending HTTP request will be aborted if the provided context is
  34495. // canceled.
  34496. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  34497. c.ctx_ = ctx
  34498. return c
  34499. }
  34500. // Header returns an http.Header that can be modified by the caller to
  34501. // add HTTP headers to the request.
  34502. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  34503. if c.header_ == nil {
  34504. c.header_ = make(http.Header)
  34505. }
  34506. return c.header_
  34507. }
  34508. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  34509. reqHeaders := make(http.Header)
  34510. for k, v := range c.header_ {
  34511. reqHeaders[k] = v
  34512. }
  34513. reqHeaders.Set("User-Agent", c.s.userAgent())
  34514. var body io.Reader = nil
  34515. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34516. if err != nil {
  34517. return nil, err
  34518. }
  34519. reqHeaders.Set("Content-Type", "application/json")
  34520. c.urlParams_.Set("alt", alt)
  34521. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34522. urls += "?" + c.urlParams_.Encode()
  34523. req, _ := http.NewRequest("PUT", urls, body)
  34524. req.Header = reqHeaders
  34525. googleapi.Expand(req.URL, map[string]string{
  34526. "profileId": strconv.FormatInt(c.profileId, 10),
  34527. })
  34528. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34529. }
  34530. // Do executes the "dfareporting.placementGroups.update" call.
  34531. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34532. // status code is an error. Response headers are in either
  34533. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34534. // at all) in error.(*googleapi.Error).Header. Use
  34535. // googleapi.IsNotModified to check whether the returned error was
  34536. // because http.StatusNotModified was returned.
  34537. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34538. gensupport.SetOptions(c.urlParams_, opts...)
  34539. res, err := c.doRequest("json")
  34540. if res != nil && res.StatusCode == http.StatusNotModified {
  34541. if res.Body != nil {
  34542. res.Body.Close()
  34543. }
  34544. return nil, &googleapi.Error{
  34545. Code: res.StatusCode,
  34546. Header: res.Header,
  34547. }
  34548. }
  34549. if err != nil {
  34550. return nil, err
  34551. }
  34552. defer googleapi.CloseBody(res)
  34553. if err := googleapi.CheckResponse(res); err != nil {
  34554. return nil, err
  34555. }
  34556. ret := &PlacementGroup{
  34557. ServerResponse: googleapi.ServerResponse{
  34558. Header: res.Header,
  34559. HTTPStatusCode: res.StatusCode,
  34560. },
  34561. }
  34562. target := &ret
  34563. if err := gensupport.DecodeResponse(target, res); err != nil {
  34564. return nil, err
  34565. }
  34566. return ret, nil
  34567. // {
  34568. // "description": "Updates an existing placement group.",
  34569. // "httpMethod": "PUT",
  34570. // "id": "dfareporting.placementGroups.update",
  34571. // "parameterOrder": [
  34572. // "profileId"
  34573. // ],
  34574. // "parameters": {
  34575. // "profileId": {
  34576. // "description": "User profile ID associated with this request.",
  34577. // "format": "int64",
  34578. // "location": "path",
  34579. // "required": true,
  34580. // "type": "string"
  34581. // }
  34582. // },
  34583. // "path": "userprofiles/{profileId}/placementGroups",
  34584. // "request": {
  34585. // "$ref": "PlacementGroup"
  34586. // },
  34587. // "response": {
  34588. // "$ref": "PlacementGroup"
  34589. // },
  34590. // "scopes": [
  34591. // "https://www.googleapis.com/auth/dfatrafficking"
  34592. // ]
  34593. // }
  34594. }
  34595. // method id "dfareporting.placementStrategies.delete":
  34596. type PlacementStrategiesDeleteCall struct {
  34597. s *Service
  34598. profileId int64
  34599. id int64
  34600. urlParams_ gensupport.URLParams
  34601. ctx_ context.Context
  34602. header_ http.Header
  34603. }
  34604. // Delete: Deletes an existing placement strategy.
  34605. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  34606. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34607. c.profileId = profileId
  34608. c.id = id
  34609. return c
  34610. }
  34611. // Fields allows partial responses to be retrieved. See
  34612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34613. // for more information.
  34614. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  34615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34616. return c
  34617. }
  34618. // Context sets the context to be used in this call's Do method. Any
  34619. // pending HTTP request will be aborted if the provided context is
  34620. // canceled.
  34621. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  34622. c.ctx_ = ctx
  34623. return c
  34624. }
  34625. // Header returns an http.Header that can be modified by the caller to
  34626. // add HTTP headers to the request.
  34627. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  34628. if c.header_ == nil {
  34629. c.header_ = make(http.Header)
  34630. }
  34631. return c.header_
  34632. }
  34633. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  34634. reqHeaders := make(http.Header)
  34635. for k, v := range c.header_ {
  34636. reqHeaders[k] = v
  34637. }
  34638. reqHeaders.Set("User-Agent", c.s.userAgent())
  34639. var body io.Reader = nil
  34640. c.urlParams_.Set("alt", alt)
  34641. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34642. urls += "?" + c.urlParams_.Encode()
  34643. req, _ := http.NewRequest("DELETE", urls, body)
  34644. req.Header = reqHeaders
  34645. googleapi.Expand(req.URL, map[string]string{
  34646. "profileId": strconv.FormatInt(c.profileId, 10),
  34647. "id": strconv.FormatInt(c.id, 10),
  34648. })
  34649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34650. }
  34651. // Do executes the "dfareporting.placementStrategies.delete" call.
  34652. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  34653. gensupport.SetOptions(c.urlParams_, opts...)
  34654. res, err := c.doRequest("json")
  34655. if err != nil {
  34656. return err
  34657. }
  34658. defer googleapi.CloseBody(res)
  34659. if err := googleapi.CheckResponse(res); err != nil {
  34660. return err
  34661. }
  34662. return nil
  34663. // {
  34664. // "description": "Deletes an existing placement strategy.",
  34665. // "httpMethod": "DELETE",
  34666. // "id": "dfareporting.placementStrategies.delete",
  34667. // "parameterOrder": [
  34668. // "profileId",
  34669. // "id"
  34670. // ],
  34671. // "parameters": {
  34672. // "id": {
  34673. // "description": "Placement strategy ID.",
  34674. // "format": "int64",
  34675. // "location": "path",
  34676. // "required": true,
  34677. // "type": "string"
  34678. // },
  34679. // "profileId": {
  34680. // "description": "User profile ID associated with this request.",
  34681. // "format": "int64",
  34682. // "location": "path",
  34683. // "required": true,
  34684. // "type": "string"
  34685. // }
  34686. // },
  34687. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  34688. // "scopes": [
  34689. // "https://www.googleapis.com/auth/dfatrafficking"
  34690. // ]
  34691. // }
  34692. }
  34693. // method id "dfareporting.placementStrategies.get":
  34694. type PlacementStrategiesGetCall struct {
  34695. s *Service
  34696. profileId int64
  34697. id int64
  34698. urlParams_ gensupport.URLParams
  34699. ifNoneMatch_ string
  34700. ctx_ context.Context
  34701. header_ http.Header
  34702. }
  34703. // Get: Gets one placement strategy by ID.
  34704. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  34705. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34706. c.profileId = profileId
  34707. c.id = id
  34708. return c
  34709. }
  34710. // Fields allows partial responses to be retrieved. See
  34711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34712. // for more information.
  34713. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  34714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34715. return c
  34716. }
  34717. // IfNoneMatch sets the optional parameter which makes the operation
  34718. // fail if the object's ETag matches the given value. This is useful for
  34719. // getting updates only after the object has changed since the last
  34720. // request. Use googleapi.IsNotModified to check whether the response
  34721. // error from Do is the result of In-None-Match.
  34722. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  34723. c.ifNoneMatch_ = entityTag
  34724. return c
  34725. }
  34726. // Context sets the context to be used in this call's Do method. Any
  34727. // pending HTTP request will be aborted if the provided context is
  34728. // canceled.
  34729. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  34730. c.ctx_ = ctx
  34731. return c
  34732. }
  34733. // Header returns an http.Header that can be modified by the caller to
  34734. // add HTTP headers to the request.
  34735. func (c *PlacementStrategiesGetCall) Header() http.Header {
  34736. if c.header_ == nil {
  34737. c.header_ = make(http.Header)
  34738. }
  34739. return c.header_
  34740. }
  34741. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  34742. reqHeaders := make(http.Header)
  34743. for k, v := range c.header_ {
  34744. reqHeaders[k] = v
  34745. }
  34746. reqHeaders.Set("User-Agent", c.s.userAgent())
  34747. if c.ifNoneMatch_ != "" {
  34748. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34749. }
  34750. var body io.Reader = nil
  34751. c.urlParams_.Set("alt", alt)
  34752. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34753. urls += "?" + c.urlParams_.Encode()
  34754. req, _ := http.NewRequest("GET", urls, body)
  34755. req.Header = reqHeaders
  34756. googleapi.Expand(req.URL, map[string]string{
  34757. "profileId": strconv.FormatInt(c.profileId, 10),
  34758. "id": strconv.FormatInt(c.id, 10),
  34759. })
  34760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34761. }
  34762. // Do executes the "dfareporting.placementStrategies.get" call.
  34763. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34764. // non-2xx status code is an error. Response headers are in either
  34765. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34766. // returned at all) in error.(*googleapi.Error).Header. Use
  34767. // googleapi.IsNotModified to check whether the returned error was
  34768. // because http.StatusNotModified was returned.
  34769. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34770. gensupport.SetOptions(c.urlParams_, opts...)
  34771. res, err := c.doRequest("json")
  34772. if res != nil && res.StatusCode == http.StatusNotModified {
  34773. if res.Body != nil {
  34774. res.Body.Close()
  34775. }
  34776. return nil, &googleapi.Error{
  34777. Code: res.StatusCode,
  34778. Header: res.Header,
  34779. }
  34780. }
  34781. if err != nil {
  34782. return nil, err
  34783. }
  34784. defer googleapi.CloseBody(res)
  34785. if err := googleapi.CheckResponse(res); err != nil {
  34786. return nil, err
  34787. }
  34788. ret := &PlacementStrategy{
  34789. ServerResponse: googleapi.ServerResponse{
  34790. Header: res.Header,
  34791. HTTPStatusCode: res.StatusCode,
  34792. },
  34793. }
  34794. target := &ret
  34795. if err := gensupport.DecodeResponse(target, res); err != nil {
  34796. return nil, err
  34797. }
  34798. return ret, nil
  34799. // {
  34800. // "description": "Gets one placement strategy by ID.",
  34801. // "httpMethod": "GET",
  34802. // "id": "dfareporting.placementStrategies.get",
  34803. // "parameterOrder": [
  34804. // "profileId",
  34805. // "id"
  34806. // ],
  34807. // "parameters": {
  34808. // "id": {
  34809. // "description": "Placement strategy ID.",
  34810. // "format": "int64",
  34811. // "location": "path",
  34812. // "required": true,
  34813. // "type": "string"
  34814. // },
  34815. // "profileId": {
  34816. // "description": "User profile ID associated with this request.",
  34817. // "format": "int64",
  34818. // "location": "path",
  34819. // "required": true,
  34820. // "type": "string"
  34821. // }
  34822. // },
  34823. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  34824. // "response": {
  34825. // "$ref": "PlacementStrategy"
  34826. // },
  34827. // "scopes": [
  34828. // "https://www.googleapis.com/auth/dfatrafficking"
  34829. // ]
  34830. // }
  34831. }
  34832. // method id "dfareporting.placementStrategies.insert":
  34833. type PlacementStrategiesInsertCall struct {
  34834. s *Service
  34835. profileId int64
  34836. placementstrategy *PlacementStrategy
  34837. urlParams_ gensupport.URLParams
  34838. ctx_ context.Context
  34839. header_ http.Header
  34840. }
  34841. // Insert: Inserts a new placement strategy.
  34842. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  34843. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34844. c.profileId = profileId
  34845. c.placementstrategy = placementstrategy
  34846. return c
  34847. }
  34848. // Fields allows partial responses to be retrieved. See
  34849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34850. // for more information.
  34851. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  34852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34853. return c
  34854. }
  34855. // Context sets the context to be used in this call's Do method. Any
  34856. // pending HTTP request will be aborted if the provided context is
  34857. // canceled.
  34858. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  34859. c.ctx_ = ctx
  34860. return c
  34861. }
  34862. // Header returns an http.Header that can be modified by the caller to
  34863. // add HTTP headers to the request.
  34864. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  34865. if c.header_ == nil {
  34866. c.header_ = make(http.Header)
  34867. }
  34868. return c.header_
  34869. }
  34870. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  34871. reqHeaders := make(http.Header)
  34872. for k, v := range c.header_ {
  34873. reqHeaders[k] = v
  34874. }
  34875. reqHeaders.Set("User-Agent", c.s.userAgent())
  34876. var body io.Reader = nil
  34877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34878. if err != nil {
  34879. return nil, err
  34880. }
  34881. reqHeaders.Set("Content-Type", "application/json")
  34882. c.urlParams_.Set("alt", alt)
  34883. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34884. urls += "?" + c.urlParams_.Encode()
  34885. req, _ := http.NewRequest("POST", urls, body)
  34886. req.Header = reqHeaders
  34887. googleapi.Expand(req.URL, map[string]string{
  34888. "profileId": strconv.FormatInt(c.profileId, 10),
  34889. })
  34890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34891. }
  34892. // Do executes the "dfareporting.placementStrategies.insert" call.
  34893. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34894. // non-2xx status code is an error. Response headers are in either
  34895. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34896. // returned at all) in error.(*googleapi.Error).Header. Use
  34897. // googleapi.IsNotModified to check whether the returned error was
  34898. // because http.StatusNotModified was returned.
  34899. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34900. gensupport.SetOptions(c.urlParams_, opts...)
  34901. res, err := c.doRequest("json")
  34902. if res != nil && res.StatusCode == http.StatusNotModified {
  34903. if res.Body != nil {
  34904. res.Body.Close()
  34905. }
  34906. return nil, &googleapi.Error{
  34907. Code: res.StatusCode,
  34908. Header: res.Header,
  34909. }
  34910. }
  34911. if err != nil {
  34912. return nil, err
  34913. }
  34914. defer googleapi.CloseBody(res)
  34915. if err := googleapi.CheckResponse(res); err != nil {
  34916. return nil, err
  34917. }
  34918. ret := &PlacementStrategy{
  34919. ServerResponse: googleapi.ServerResponse{
  34920. Header: res.Header,
  34921. HTTPStatusCode: res.StatusCode,
  34922. },
  34923. }
  34924. target := &ret
  34925. if err := gensupport.DecodeResponse(target, res); err != nil {
  34926. return nil, err
  34927. }
  34928. return ret, nil
  34929. // {
  34930. // "description": "Inserts a new placement strategy.",
  34931. // "httpMethod": "POST",
  34932. // "id": "dfareporting.placementStrategies.insert",
  34933. // "parameterOrder": [
  34934. // "profileId"
  34935. // ],
  34936. // "parameters": {
  34937. // "profileId": {
  34938. // "description": "User profile ID associated with this request.",
  34939. // "format": "int64",
  34940. // "location": "path",
  34941. // "required": true,
  34942. // "type": "string"
  34943. // }
  34944. // },
  34945. // "path": "userprofiles/{profileId}/placementStrategies",
  34946. // "request": {
  34947. // "$ref": "PlacementStrategy"
  34948. // },
  34949. // "response": {
  34950. // "$ref": "PlacementStrategy"
  34951. // },
  34952. // "scopes": [
  34953. // "https://www.googleapis.com/auth/dfatrafficking"
  34954. // ]
  34955. // }
  34956. }
  34957. // method id "dfareporting.placementStrategies.list":
  34958. type PlacementStrategiesListCall struct {
  34959. s *Service
  34960. profileId int64
  34961. urlParams_ gensupport.URLParams
  34962. ifNoneMatch_ string
  34963. ctx_ context.Context
  34964. header_ http.Header
  34965. }
  34966. // List: Retrieves a list of placement strategies, possibly filtered.
  34967. // This method supports paging.
  34968. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  34969. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34970. c.profileId = profileId
  34971. return c
  34972. }
  34973. // Ids sets the optional parameter "ids": Select only placement
  34974. // strategies with these IDs.
  34975. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  34976. var ids_ []string
  34977. for _, v := range ids {
  34978. ids_ = append(ids_, fmt.Sprint(v))
  34979. }
  34980. c.urlParams_.SetMulti("ids", ids_)
  34981. return c
  34982. }
  34983. // MaxResults sets the optional parameter "maxResults": Maximum number
  34984. // of results to return.
  34985. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  34986. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34987. return c
  34988. }
  34989. // PageToken sets the optional parameter "pageToken": Value of the
  34990. // nextPageToken from the previous result page.
  34991. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  34992. c.urlParams_.Set("pageToken", pageToken)
  34993. return c
  34994. }
  34995. // SearchString sets the optional parameter "searchString": Allows
  34996. // searching for objects by name or ID. Wildcards (*) are allowed. For
  34997. // example, "placementstrategy*2015" will return objects with names like
  34998. // "placementstrategy June 2015", "placementstrategy April 2015", or
  34999. // simply "placementstrategy 2015". Most of the searches also add
  35000. // wildcards implicitly at the start and the end of the search string.
  35001. // For example, a search string of "placementstrategy" will match
  35002. // objects with name "my placementstrategy", "placementstrategy 2015",
  35003. // or simply "placementstrategy".
  35004. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  35005. c.urlParams_.Set("searchString", searchString)
  35006. return c
  35007. }
  35008. // SortField sets the optional parameter "sortField": Field by which to
  35009. // sort the list.
  35010. //
  35011. // Possible values:
  35012. // "ID" (default)
  35013. // "NAME"
  35014. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  35015. c.urlParams_.Set("sortField", sortField)
  35016. return c
  35017. }
  35018. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35019. // results.
  35020. //
  35021. // Possible values:
  35022. // "ASCENDING" (default)
  35023. // "DESCENDING"
  35024. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  35025. c.urlParams_.Set("sortOrder", sortOrder)
  35026. return c
  35027. }
  35028. // Fields allows partial responses to be retrieved. See
  35029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35030. // for more information.
  35031. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  35032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35033. return c
  35034. }
  35035. // IfNoneMatch sets the optional parameter which makes the operation
  35036. // fail if the object's ETag matches the given value. This is useful for
  35037. // getting updates only after the object has changed since the last
  35038. // request. Use googleapi.IsNotModified to check whether the response
  35039. // error from Do is the result of In-None-Match.
  35040. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  35041. c.ifNoneMatch_ = entityTag
  35042. return c
  35043. }
  35044. // Context sets the context to be used in this call's Do method. Any
  35045. // pending HTTP request will be aborted if the provided context is
  35046. // canceled.
  35047. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  35048. c.ctx_ = ctx
  35049. return c
  35050. }
  35051. // Header returns an http.Header that can be modified by the caller to
  35052. // add HTTP headers to the request.
  35053. func (c *PlacementStrategiesListCall) Header() http.Header {
  35054. if c.header_ == nil {
  35055. c.header_ = make(http.Header)
  35056. }
  35057. return c.header_
  35058. }
  35059. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  35060. reqHeaders := make(http.Header)
  35061. for k, v := range c.header_ {
  35062. reqHeaders[k] = v
  35063. }
  35064. reqHeaders.Set("User-Agent", c.s.userAgent())
  35065. if c.ifNoneMatch_ != "" {
  35066. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35067. }
  35068. var body io.Reader = nil
  35069. c.urlParams_.Set("alt", alt)
  35070. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35071. urls += "?" + c.urlParams_.Encode()
  35072. req, _ := http.NewRequest("GET", urls, body)
  35073. req.Header = reqHeaders
  35074. googleapi.Expand(req.URL, map[string]string{
  35075. "profileId": strconv.FormatInt(c.profileId, 10),
  35076. })
  35077. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35078. }
  35079. // Do executes the "dfareporting.placementStrategies.list" call.
  35080. // Exactly one of *PlacementStrategiesListResponse or error will be
  35081. // non-nil. Any non-2xx status code is an error. Response headers are in
  35082. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  35083. // a response was returned at all) in error.(*googleapi.Error).Header.
  35084. // Use googleapi.IsNotModified to check whether the returned error was
  35085. // because http.StatusNotModified was returned.
  35086. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  35087. gensupport.SetOptions(c.urlParams_, opts...)
  35088. res, err := c.doRequest("json")
  35089. if res != nil && res.StatusCode == http.StatusNotModified {
  35090. if res.Body != nil {
  35091. res.Body.Close()
  35092. }
  35093. return nil, &googleapi.Error{
  35094. Code: res.StatusCode,
  35095. Header: res.Header,
  35096. }
  35097. }
  35098. if err != nil {
  35099. return nil, err
  35100. }
  35101. defer googleapi.CloseBody(res)
  35102. if err := googleapi.CheckResponse(res); err != nil {
  35103. return nil, err
  35104. }
  35105. ret := &PlacementStrategiesListResponse{
  35106. ServerResponse: googleapi.ServerResponse{
  35107. Header: res.Header,
  35108. HTTPStatusCode: res.StatusCode,
  35109. },
  35110. }
  35111. target := &ret
  35112. if err := gensupport.DecodeResponse(target, res); err != nil {
  35113. return nil, err
  35114. }
  35115. return ret, nil
  35116. // {
  35117. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  35118. // "httpMethod": "GET",
  35119. // "id": "dfareporting.placementStrategies.list",
  35120. // "parameterOrder": [
  35121. // "profileId"
  35122. // ],
  35123. // "parameters": {
  35124. // "ids": {
  35125. // "description": "Select only placement strategies with these IDs.",
  35126. // "format": "int64",
  35127. // "location": "query",
  35128. // "repeated": true,
  35129. // "type": "string"
  35130. // },
  35131. // "maxResults": {
  35132. // "default": "1000",
  35133. // "description": "Maximum number of results to return.",
  35134. // "format": "int32",
  35135. // "location": "query",
  35136. // "maximum": "1000",
  35137. // "minimum": "0",
  35138. // "type": "integer"
  35139. // },
  35140. // "pageToken": {
  35141. // "description": "Value of the nextPageToken from the previous result page.",
  35142. // "location": "query",
  35143. // "type": "string"
  35144. // },
  35145. // "profileId": {
  35146. // "description": "User profile ID associated with this request.",
  35147. // "format": "int64",
  35148. // "location": "path",
  35149. // "required": true,
  35150. // "type": "string"
  35151. // },
  35152. // "searchString": {
  35153. // "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\".",
  35154. // "location": "query",
  35155. // "type": "string"
  35156. // },
  35157. // "sortField": {
  35158. // "default": "ID",
  35159. // "description": "Field by which to sort the list.",
  35160. // "enum": [
  35161. // "ID",
  35162. // "NAME"
  35163. // ],
  35164. // "enumDescriptions": [
  35165. // "",
  35166. // ""
  35167. // ],
  35168. // "location": "query",
  35169. // "type": "string"
  35170. // },
  35171. // "sortOrder": {
  35172. // "default": "ASCENDING",
  35173. // "description": "Order of sorted results.",
  35174. // "enum": [
  35175. // "ASCENDING",
  35176. // "DESCENDING"
  35177. // ],
  35178. // "enumDescriptions": [
  35179. // "",
  35180. // ""
  35181. // ],
  35182. // "location": "query",
  35183. // "type": "string"
  35184. // }
  35185. // },
  35186. // "path": "userprofiles/{profileId}/placementStrategies",
  35187. // "response": {
  35188. // "$ref": "PlacementStrategiesListResponse"
  35189. // },
  35190. // "scopes": [
  35191. // "https://www.googleapis.com/auth/dfatrafficking"
  35192. // ]
  35193. // }
  35194. }
  35195. // Pages invokes f for each page of results.
  35196. // A non-nil error returned from f will halt the iteration.
  35197. // The provided context supersedes any context provided to the Context method.
  35198. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  35199. c.ctx_ = ctx
  35200. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35201. for {
  35202. x, err := c.Do()
  35203. if err != nil {
  35204. return err
  35205. }
  35206. if err := f(x); err != nil {
  35207. return err
  35208. }
  35209. if x.NextPageToken == "" {
  35210. return nil
  35211. }
  35212. c.PageToken(x.NextPageToken)
  35213. }
  35214. }
  35215. // method id "dfareporting.placementStrategies.patch":
  35216. type PlacementStrategiesPatchCall struct {
  35217. s *Service
  35218. profileId int64
  35219. placementstrategy *PlacementStrategy
  35220. urlParams_ gensupport.URLParams
  35221. ctx_ context.Context
  35222. header_ http.Header
  35223. }
  35224. // Patch: Updates an existing placement strategy. This method supports
  35225. // patch semantics.
  35226. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  35227. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35228. c.profileId = profileId
  35229. c.urlParams_.Set("id", fmt.Sprint(id))
  35230. c.placementstrategy = placementstrategy
  35231. return c
  35232. }
  35233. // Fields allows partial responses to be retrieved. See
  35234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35235. // for more information.
  35236. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  35237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35238. return c
  35239. }
  35240. // Context sets the context to be used in this call's Do method. Any
  35241. // pending HTTP request will be aborted if the provided context is
  35242. // canceled.
  35243. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  35244. c.ctx_ = ctx
  35245. return c
  35246. }
  35247. // Header returns an http.Header that can be modified by the caller to
  35248. // add HTTP headers to the request.
  35249. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  35250. if c.header_ == nil {
  35251. c.header_ = make(http.Header)
  35252. }
  35253. return c.header_
  35254. }
  35255. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  35256. reqHeaders := make(http.Header)
  35257. for k, v := range c.header_ {
  35258. reqHeaders[k] = v
  35259. }
  35260. reqHeaders.Set("User-Agent", c.s.userAgent())
  35261. var body io.Reader = nil
  35262. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35263. if err != nil {
  35264. return nil, err
  35265. }
  35266. reqHeaders.Set("Content-Type", "application/json")
  35267. c.urlParams_.Set("alt", alt)
  35268. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35269. urls += "?" + c.urlParams_.Encode()
  35270. req, _ := http.NewRequest("PATCH", urls, body)
  35271. req.Header = reqHeaders
  35272. googleapi.Expand(req.URL, map[string]string{
  35273. "profileId": strconv.FormatInt(c.profileId, 10),
  35274. })
  35275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35276. }
  35277. // Do executes the "dfareporting.placementStrategies.patch" call.
  35278. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35279. // non-2xx status code is an error. Response headers are in either
  35280. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35281. // returned at all) in error.(*googleapi.Error).Header. Use
  35282. // googleapi.IsNotModified to check whether the returned error was
  35283. // because http.StatusNotModified was returned.
  35284. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35285. gensupport.SetOptions(c.urlParams_, opts...)
  35286. res, err := c.doRequest("json")
  35287. if res != nil && res.StatusCode == http.StatusNotModified {
  35288. if res.Body != nil {
  35289. res.Body.Close()
  35290. }
  35291. return nil, &googleapi.Error{
  35292. Code: res.StatusCode,
  35293. Header: res.Header,
  35294. }
  35295. }
  35296. if err != nil {
  35297. return nil, err
  35298. }
  35299. defer googleapi.CloseBody(res)
  35300. if err := googleapi.CheckResponse(res); err != nil {
  35301. return nil, err
  35302. }
  35303. ret := &PlacementStrategy{
  35304. ServerResponse: googleapi.ServerResponse{
  35305. Header: res.Header,
  35306. HTTPStatusCode: res.StatusCode,
  35307. },
  35308. }
  35309. target := &ret
  35310. if err := gensupport.DecodeResponse(target, res); err != nil {
  35311. return nil, err
  35312. }
  35313. return ret, nil
  35314. // {
  35315. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  35316. // "httpMethod": "PATCH",
  35317. // "id": "dfareporting.placementStrategies.patch",
  35318. // "parameterOrder": [
  35319. // "profileId",
  35320. // "id"
  35321. // ],
  35322. // "parameters": {
  35323. // "id": {
  35324. // "description": "Placement strategy ID.",
  35325. // "format": "int64",
  35326. // "location": "query",
  35327. // "required": true,
  35328. // "type": "string"
  35329. // },
  35330. // "profileId": {
  35331. // "description": "User profile ID associated with this request.",
  35332. // "format": "int64",
  35333. // "location": "path",
  35334. // "required": true,
  35335. // "type": "string"
  35336. // }
  35337. // },
  35338. // "path": "userprofiles/{profileId}/placementStrategies",
  35339. // "request": {
  35340. // "$ref": "PlacementStrategy"
  35341. // },
  35342. // "response": {
  35343. // "$ref": "PlacementStrategy"
  35344. // },
  35345. // "scopes": [
  35346. // "https://www.googleapis.com/auth/dfatrafficking"
  35347. // ]
  35348. // }
  35349. }
  35350. // method id "dfareporting.placementStrategies.update":
  35351. type PlacementStrategiesUpdateCall struct {
  35352. s *Service
  35353. profileId int64
  35354. placementstrategy *PlacementStrategy
  35355. urlParams_ gensupport.URLParams
  35356. ctx_ context.Context
  35357. header_ http.Header
  35358. }
  35359. // Update: Updates an existing placement strategy.
  35360. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  35361. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35362. c.profileId = profileId
  35363. c.placementstrategy = placementstrategy
  35364. return c
  35365. }
  35366. // Fields allows partial responses to be retrieved. See
  35367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35368. // for more information.
  35369. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  35370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35371. return c
  35372. }
  35373. // Context sets the context to be used in this call's Do method. Any
  35374. // pending HTTP request will be aborted if the provided context is
  35375. // canceled.
  35376. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  35377. c.ctx_ = ctx
  35378. return c
  35379. }
  35380. // Header returns an http.Header that can be modified by the caller to
  35381. // add HTTP headers to the request.
  35382. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  35383. if c.header_ == nil {
  35384. c.header_ = make(http.Header)
  35385. }
  35386. return c.header_
  35387. }
  35388. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  35389. reqHeaders := make(http.Header)
  35390. for k, v := range c.header_ {
  35391. reqHeaders[k] = v
  35392. }
  35393. reqHeaders.Set("User-Agent", c.s.userAgent())
  35394. var body io.Reader = nil
  35395. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35396. if err != nil {
  35397. return nil, err
  35398. }
  35399. reqHeaders.Set("Content-Type", "application/json")
  35400. c.urlParams_.Set("alt", alt)
  35401. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35402. urls += "?" + c.urlParams_.Encode()
  35403. req, _ := http.NewRequest("PUT", urls, body)
  35404. req.Header = reqHeaders
  35405. googleapi.Expand(req.URL, map[string]string{
  35406. "profileId": strconv.FormatInt(c.profileId, 10),
  35407. })
  35408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35409. }
  35410. // Do executes the "dfareporting.placementStrategies.update" call.
  35411. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35412. // non-2xx status code is an error. Response headers are in either
  35413. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35414. // returned at all) in error.(*googleapi.Error).Header. Use
  35415. // googleapi.IsNotModified to check whether the returned error was
  35416. // because http.StatusNotModified was returned.
  35417. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35418. gensupport.SetOptions(c.urlParams_, opts...)
  35419. res, err := c.doRequest("json")
  35420. if res != nil && res.StatusCode == http.StatusNotModified {
  35421. if res.Body != nil {
  35422. res.Body.Close()
  35423. }
  35424. return nil, &googleapi.Error{
  35425. Code: res.StatusCode,
  35426. Header: res.Header,
  35427. }
  35428. }
  35429. if err != nil {
  35430. return nil, err
  35431. }
  35432. defer googleapi.CloseBody(res)
  35433. if err := googleapi.CheckResponse(res); err != nil {
  35434. return nil, err
  35435. }
  35436. ret := &PlacementStrategy{
  35437. ServerResponse: googleapi.ServerResponse{
  35438. Header: res.Header,
  35439. HTTPStatusCode: res.StatusCode,
  35440. },
  35441. }
  35442. target := &ret
  35443. if err := gensupport.DecodeResponse(target, res); err != nil {
  35444. return nil, err
  35445. }
  35446. return ret, nil
  35447. // {
  35448. // "description": "Updates an existing placement strategy.",
  35449. // "httpMethod": "PUT",
  35450. // "id": "dfareporting.placementStrategies.update",
  35451. // "parameterOrder": [
  35452. // "profileId"
  35453. // ],
  35454. // "parameters": {
  35455. // "profileId": {
  35456. // "description": "User profile ID associated with this request.",
  35457. // "format": "int64",
  35458. // "location": "path",
  35459. // "required": true,
  35460. // "type": "string"
  35461. // }
  35462. // },
  35463. // "path": "userprofiles/{profileId}/placementStrategies",
  35464. // "request": {
  35465. // "$ref": "PlacementStrategy"
  35466. // },
  35467. // "response": {
  35468. // "$ref": "PlacementStrategy"
  35469. // },
  35470. // "scopes": [
  35471. // "https://www.googleapis.com/auth/dfatrafficking"
  35472. // ]
  35473. // }
  35474. }
  35475. // method id "dfareporting.placements.generatetags":
  35476. type PlacementsGeneratetagsCall struct {
  35477. s *Service
  35478. profileId int64
  35479. urlParams_ gensupport.URLParams
  35480. ctx_ context.Context
  35481. header_ http.Header
  35482. }
  35483. // Generatetags: Generates tags for a placement.
  35484. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  35485. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35486. c.profileId = profileId
  35487. return c
  35488. }
  35489. // CampaignId sets the optional parameter "campaignId": Generate
  35490. // placements belonging to this campaign. This is a required field.
  35491. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  35492. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  35493. return c
  35494. }
  35495. // PlacementIds sets the optional parameter "placementIds": Generate
  35496. // tags for these placements.
  35497. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  35498. var placementIds_ []string
  35499. for _, v := range placementIds {
  35500. placementIds_ = append(placementIds_, fmt.Sprint(v))
  35501. }
  35502. c.urlParams_.SetMulti("placementIds", placementIds_)
  35503. return c
  35504. }
  35505. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  35506. // generate for these placements.
  35507. //
  35508. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  35509. // placements.
  35510. //
  35511. // Possible values:
  35512. // "PLACEMENT_TAG_CLICK_COMMANDS"
  35513. // "PLACEMENT_TAG_IFRAME_ILAYER"
  35514. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  35515. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  35516. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  35517. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  35518. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  35519. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  35520. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  35521. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  35522. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  35523. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  35524. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  35525. // "PLACEMENT_TAG_JAVASCRIPT"
  35526. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  35527. // "PLACEMENT_TAG_STANDARD"
  35528. // "PLACEMENT_TAG_TRACKING"
  35529. // "PLACEMENT_TAG_TRACKING_IFRAME"
  35530. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35531. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  35532. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  35533. return c
  35534. }
  35535. // Fields allows partial responses to be retrieved. See
  35536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35537. // for more information.
  35538. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  35539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35540. return c
  35541. }
  35542. // Context sets the context to be used in this call's Do method. Any
  35543. // pending HTTP request will be aborted if the provided context is
  35544. // canceled.
  35545. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  35546. c.ctx_ = ctx
  35547. return c
  35548. }
  35549. // Header returns an http.Header that can be modified by the caller to
  35550. // add HTTP headers to the request.
  35551. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  35552. if c.header_ == nil {
  35553. c.header_ = make(http.Header)
  35554. }
  35555. return c.header_
  35556. }
  35557. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  35558. reqHeaders := make(http.Header)
  35559. for k, v := range c.header_ {
  35560. reqHeaders[k] = v
  35561. }
  35562. reqHeaders.Set("User-Agent", c.s.userAgent())
  35563. var body io.Reader = nil
  35564. c.urlParams_.Set("alt", alt)
  35565. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  35566. urls += "?" + c.urlParams_.Encode()
  35567. req, _ := http.NewRequest("POST", urls, body)
  35568. req.Header = reqHeaders
  35569. googleapi.Expand(req.URL, map[string]string{
  35570. "profileId": strconv.FormatInt(c.profileId, 10),
  35571. })
  35572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35573. }
  35574. // Do executes the "dfareporting.placements.generatetags" call.
  35575. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  35576. // non-nil. Any non-2xx status code is an error. Response headers are in
  35577. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  35578. // response was returned at all) in error.(*googleapi.Error).Header. Use
  35579. // googleapi.IsNotModified to check whether the returned error was
  35580. // because http.StatusNotModified was returned.
  35581. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  35582. gensupport.SetOptions(c.urlParams_, opts...)
  35583. res, err := c.doRequest("json")
  35584. if res != nil && res.StatusCode == http.StatusNotModified {
  35585. if res.Body != nil {
  35586. res.Body.Close()
  35587. }
  35588. return nil, &googleapi.Error{
  35589. Code: res.StatusCode,
  35590. Header: res.Header,
  35591. }
  35592. }
  35593. if err != nil {
  35594. return nil, err
  35595. }
  35596. defer googleapi.CloseBody(res)
  35597. if err := googleapi.CheckResponse(res); err != nil {
  35598. return nil, err
  35599. }
  35600. ret := &PlacementsGenerateTagsResponse{
  35601. ServerResponse: googleapi.ServerResponse{
  35602. Header: res.Header,
  35603. HTTPStatusCode: res.StatusCode,
  35604. },
  35605. }
  35606. target := &ret
  35607. if err := gensupport.DecodeResponse(target, res); err != nil {
  35608. return nil, err
  35609. }
  35610. return ret, nil
  35611. // {
  35612. // "description": "Generates tags for a placement.",
  35613. // "httpMethod": "POST",
  35614. // "id": "dfareporting.placements.generatetags",
  35615. // "parameterOrder": [
  35616. // "profileId"
  35617. // ],
  35618. // "parameters": {
  35619. // "campaignId": {
  35620. // "description": "Generate placements belonging to this campaign. This is a required field.",
  35621. // "format": "int64",
  35622. // "location": "query",
  35623. // "type": "string"
  35624. // },
  35625. // "placementIds": {
  35626. // "description": "Generate tags for these placements.",
  35627. // "format": "int64",
  35628. // "location": "query",
  35629. // "repeated": true,
  35630. // "type": "string"
  35631. // },
  35632. // "profileId": {
  35633. // "description": "User profile ID associated with this request.",
  35634. // "format": "int64",
  35635. // "location": "path",
  35636. // "required": true,
  35637. // "type": "string"
  35638. // },
  35639. // "tagFormats": {
  35640. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  35641. // "enum": [
  35642. // "PLACEMENT_TAG_CLICK_COMMANDS",
  35643. // "PLACEMENT_TAG_IFRAME_ILAYER",
  35644. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  35645. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  35646. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  35647. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  35648. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  35649. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  35650. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  35651. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  35652. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  35653. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  35654. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  35655. // "PLACEMENT_TAG_JAVASCRIPT",
  35656. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  35657. // "PLACEMENT_TAG_STANDARD",
  35658. // "PLACEMENT_TAG_TRACKING",
  35659. // "PLACEMENT_TAG_TRACKING_IFRAME",
  35660. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35661. // ],
  35662. // "enumDescriptions": [
  35663. // "",
  35664. // "",
  35665. // "",
  35666. // "",
  35667. // "",
  35668. // "",
  35669. // "",
  35670. // "",
  35671. // "",
  35672. // "",
  35673. // "",
  35674. // "",
  35675. // "",
  35676. // "",
  35677. // "",
  35678. // "",
  35679. // "",
  35680. // "",
  35681. // ""
  35682. // ],
  35683. // "location": "query",
  35684. // "repeated": true,
  35685. // "type": "string"
  35686. // }
  35687. // },
  35688. // "path": "userprofiles/{profileId}/placements/generatetags",
  35689. // "response": {
  35690. // "$ref": "PlacementsGenerateTagsResponse"
  35691. // },
  35692. // "scopes": [
  35693. // "https://www.googleapis.com/auth/dfatrafficking"
  35694. // ]
  35695. // }
  35696. }
  35697. // method id "dfareporting.placements.get":
  35698. type PlacementsGetCall struct {
  35699. s *Service
  35700. profileId int64
  35701. id int64
  35702. urlParams_ gensupport.URLParams
  35703. ifNoneMatch_ string
  35704. ctx_ context.Context
  35705. header_ http.Header
  35706. }
  35707. // Get: Gets one placement by ID.
  35708. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  35709. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35710. c.profileId = profileId
  35711. c.id = id
  35712. return c
  35713. }
  35714. // Fields allows partial responses to be retrieved. See
  35715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35716. // for more information.
  35717. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  35718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35719. return c
  35720. }
  35721. // IfNoneMatch sets the optional parameter which makes the operation
  35722. // fail if the object's ETag matches the given value. This is useful for
  35723. // getting updates only after the object has changed since the last
  35724. // request. Use googleapi.IsNotModified to check whether the response
  35725. // error from Do is the result of In-None-Match.
  35726. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  35727. c.ifNoneMatch_ = entityTag
  35728. return c
  35729. }
  35730. // Context sets the context to be used in this call's Do method. Any
  35731. // pending HTTP request will be aborted if the provided context is
  35732. // canceled.
  35733. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  35734. c.ctx_ = ctx
  35735. return c
  35736. }
  35737. // Header returns an http.Header that can be modified by the caller to
  35738. // add HTTP headers to the request.
  35739. func (c *PlacementsGetCall) Header() http.Header {
  35740. if c.header_ == nil {
  35741. c.header_ = make(http.Header)
  35742. }
  35743. return c.header_
  35744. }
  35745. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  35746. reqHeaders := make(http.Header)
  35747. for k, v := range c.header_ {
  35748. reqHeaders[k] = v
  35749. }
  35750. reqHeaders.Set("User-Agent", c.s.userAgent())
  35751. if c.ifNoneMatch_ != "" {
  35752. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35753. }
  35754. var body io.Reader = nil
  35755. c.urlParams_.Set("alt", alt)
  35756. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  35757. urls += "?" + c.urlParams_.Encode()
  35758. req, _ := http.NewRequest("GET", urls, body)
  35759. req.Header = reqHeaders
  35760. googleapi.Expand(req.URL, map[string]string{
  35761. "profileId": strconv.FormatInt(c.profileId, 10),
  35762. "id": strconv.FormatInt(c.id, 10),
  35763. })
  35764. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35765. }
  35766. // Do executes the "dfareporting.placements.get" call.
  35767. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35768. // status code is an error. Response headers are in either
  35769. // *Placement.ServerResponse.Header or (if a response was returned at
  35770. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35771. // to check whether the returned error was because
  35772. // http.StatusNotModified was returned.
  35773. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35774. gensupport.SetOptions(c.urlParams_, opts...)
  35775. res, err := c.doRequest("json")
  35776. if res != nil && res.StatusCode == http.StatusNotModified {
  35777. if res.Body != nil {
  35778. res.Body.Close()
  35779. }
  35780. return nil, &googleapi.Error{
  35781. Code: res.StatusCode,
  35782. Header: res.Header,
  35783. }
  35784. }
  35785. if err != nil {
  35786. return nil, err
  35787. }
  35788. defer googleapi.CloseBody(res)
  35789. if err := googleapi.CheckResponse(res); err != nil {
  35790. return nil, err
  35791. }
  35792. ret := &Placement{
  35793. ServerResponse: googleapi.ServerResponse{
  35794. Header: res.Header,
  35795. HTTPStatusCode: res.StatusCode,
  35796. },
  35797. }
  35798. target := &ret
  35799. if err := gensupport.DecodeResponse(target, res); err != nil {
  35800. return nil, err
  35801. }
  35802. return ret, nil
  35803. // {
  35804. // "description": "Gets one placement by ID.",
  35805. // "httpMethod": "GET",
  35806. // "id": "dfareporting.placements.get",
  35807. // "parameterOrder": [
  35808. // "profileId",
  35809. // "id"
  35810. // ],
  35811. // "parameters": {
  35812. // "id": {
  35813. // "description": "Placement ID.",
  35814. // "format": "int64",
  35815. // "location": "path",
  35816. // "required": true,
  35817. // "type": "string"
  35818. // },
  35819. // "profileId": {
  35820. // "description": "User profile ID associated with this request.",
  35821. // "format": "int64",
  35822. // "location": "path",
  35823. // "required": true,
  35824. // "type": "string"
  35825. // }
  35826. // },
  35827. // "path": "userprofiles/{profileId}/placements/{id}",
  35828. // "response": {
  35829. // "$ref": "Placement"
  35830. // },
  35831. // "scopes": [
  35832. // "https://www.googleapis.com/auth/dfatrafficking"
  35833. // ]
  35834. // }
  35835. }
  35836. // method id "dfareporting.placements.insert":
  35837. type PlacementsInsertCall struct {
  35838. s *Service
  35839. profileId int64
  35840. placement *Placement
  35841. urlParams_ gensupport.URLParams
  35842. ctx_ context.Context
  35843. header_ http.Header
  35844. }
  35845. // Insert: Inserts a new placement.
  35846. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  35847. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35848. c.profileId = profileId
  35849. c.placement = placement
  35850. return c
  35851. }
  35852. // Fields allows partial responses to be retrieved. See
  35853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35854. // for more information.
  35855. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  35856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35857. return c
  35858. }
  35859. // Context sets the context to be used in this call's Do method. Any
  35860. // pending HTTP request will be aborted if the provided context is
  35861. // canceled.
  35862. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  35863. c.ctx_ = ctx
  35864. return c
  35865. }
  35866. // Header returns an http.Header that can be modified by the caller to
  35867. // add HTTP headers to the request.
  35868. func (c *PlacementsInsertCall) Header() http.Header {
  35869. if c.header_ == nil {
  35870. c.header_ = make(http.Header)
  35871. }
  35872. return c.header_
  35873. }
  35874. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  35875. reqHeaders := make(http.Header)
  35876. for k, v := range c.header_ {
  35877. reqHeaders[k] = v
  35878. }
  35879. reqHeaders.Set("User-Agent", c.s.userAgent())
  35880. var body io.Reader = nil
  35881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35882. if err != nil {
  35883. return nil, err
  35884. }
  35885. reqHeaders.Set("Content-Type", "application/json")
  35886. c.urlParams_.Set("alt", alt)
  35887. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35888. urls += "?" + c.urlParams_.Encode()
  35889. req, _ := http.NewRequest("POST", urls, body)
  35890. req.Header = reqHeaders
  35891. googleapi.Expand(req.URL, map[string]string{
  35892. "profileId": strconv.FormatInt(c.profileId, 10),
  35893. })
  35894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35895. }
  35896. // Do executes the "dfareporting.placements.insert" call.
  35897. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35898. // status code is an error. Response headers are in either
  35899. // *Placement.ServerResponse.Header or (if a response was returned at
  35900. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35901. // to check whether the returned error was because
  35902. // http.StatusNotModified was returned.
  35903. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35904. gensupport.SetOptions(c.urlParams_, opts...)
  35905. res, err := c.doRequest("json")
  35906. if res != nil && res.StatusCode == http.StatusNotModified {
  35907. if res.Body != nil {
  35908. res.Body.Close()
  35909. }
  35910. return nil, &googleapi.Error{
  35911. Code: res.StatusCode,
  35912. Header: res.Header,
  35913. }
  35914. }
  35915. if err != nil {
  35916. return nil, err
  35917. }
  35918. defer googleapi.CloseBody(res)
  35919. if err := googleapi.CheckResponse(res); err != nil {
  35920. return nil, err
  35921. }
  35922. ret := &Placement{
  35923. ServerResponse: googleapi.ServerResponse{
  35924. Header: res.Header,
  35925. HTTPStatusCode: res.StatusCode,
  35926. },
  35927. }
  35928. target := &ret
  35929. if err := gensupport.DecodeResponse(target, res); err != nil {
  35930. return nil, err
  35931. }
  35932. return ret, nil
  35933. // {
  35934. // "description": "Inserts a new placement.",
  35935. // "httpMethod": "POST",
  35936. // "id": "dfareporting.placements.insert",
  35937. // "parameterOrder": [
  35938. // "profileId"
  35939. // ],
  35940. // "parameters": {
  35941. // "profileId": {
  35942. // "description": "User profile ID associated with this request.",
  35943. // "format": "int64",
  35944. // "location": "path",
  35945. // "required": true,
  35946. // "type": "string"
  35947. // }
  35948. // },
  35949. // "path": "userprofiles/{profileId}/placements",
  35950. // "request": {
  35951. // "$ref": "Placement"
  35952. // },
  35953. // "response": {
  35954. // "$ref": "Placement"
  35955. // },
  35956. // "scopes": [
  35957. // "https://www.googleapis.com/auth/dfatrafficking"
  35958. // ]
  35959. // }
  35960. }
  35961. // method id "dfareporting.placements.list":
  35962. type PlacementsListCall struct {
  35963. s *Service
  35964. profileId int64
  35965. urlParams_ gensupport.URLParams
  35966. ifNoneMatch_ string
  35967. ctx_ context.Context
  35968. header_ http.Header
  35969. }
  35970. // List: Retrieves a list of placements, possibly filtered. This method
  35971. // supports paging.
  35972. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  35973. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35974. c.profileId = profileId
  35975. return c
  35976. }
  35977. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  35978. // only placements that belong to these advertisers.
  35979. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  35980. var advertiserIds_ []string
  35981. for _, v := range advertiserIds {
  35982. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  35983. }
  35984. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  35985. return c
  35986. }
  35987. // Archived sets the optional parameter "archived": Select only archived
  35988. // placements. Don't set this field to select both archived and
  35989. // non-archived placements.
  35990. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  35991. c.urlParams_.Set("archived", fmt.Sprint(archived))
  35992. return c
  35993. }
  35994. // CampaignIds sets the optional parameter "campaignIds": Select only
  35995. // placements that belong to these campaigns.
  35996. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  35997. var campaignIds_ []string
  35998. for _, v := range campaignIds {
  35999. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  36000. }
  36001. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  36002. return c
  36003. }
  36004. // Compatibilities sets the optional parameter "compatibilities": Select
  36005. // only placements that are associated with these compatibilities.
  36006. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  36007. // or on mobile devices for regular or interstitial ads respectively.
  36008. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  36009. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  36010. // with the VAST standard.
  36011. //
  36012. // Possible values:
  36013. // "APP"
  36014. // "APP_INTERSTITIAL"
  36015. // "DISPLAY"
  36016. // "DISPLAY_INTERSTITIAL"
  36017. // "IN_STREAM_AUDIO"
  36018. // "IN_STREAM_VIDEO"
  36019. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  36020. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  36021. return c
  36022. }
  36023. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  36024. // Select only placements that are associated with these content
  36025. // categories.
  36026. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  36027. var contentCategoryIds_ []string
  36028. for _, v := range contentCategoryIds {
  36029. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  36030. }
  36031. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  36032. return c
  36033. }
  36034. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  36035. // Select only placements that are associated with these directory
  36036. // sites.
  36037. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  36038. var directorySiteIds_ []string
  36039. for _, v := range directorySiteIds {
  36040. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  36041. }
  36042. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  36043. return c
  36044. }
  36045. // GroupIds sets the optional parameter "groupIds": Select only
  36046. // placements that belong to these placement groups.
  36047. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  36048. var groupIds_ []string
  36049. for _, v := range groupIds {
  36050. groupIds_ = append(groupIds_, fmt.Sprint(v))
  36051. }
  36052. c.urlParams_.SetMulti("groupIds", groupIds_)
  36053. return c
  36054. }
  36055. // Ids sets the optional parameter "ids": Select only placements with
  36056. // these IDs.
  36057. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  36058. var ids_ []string
  36059. for _, v := range ids {
  36060. ids_ = append(ids_, fmt.Sprint(v))
  36061. }
  36062. c.urlParams_.SetMulti("ids", ids_)
  36063. return c
  36064. }
  36065. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  36066. // placements or placement groups whose end date is on or before the
  36067. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  36068. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  36069. c.urlParams_.Set("maxEndDate", maxEndDate)
  36070. return c
  36071. }
  36072. // MaxResults sets the optional parameter "maxResults": Maximum number
  36073. // of results to return.
  36074. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  36075. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36076. return c
  36077. }
  36078. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  36079. // placements or placement groups whose start date is on or before the
  36080. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  36081. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  36082. c.urlParams_.Set("maxStartDate", maxStartDate)
  36083. return c
  36084. }
  36085. // MinEndDate sets the optional parameter "minEndDate": Select only
  36086. // placements or placement groups whose end date is on or after the
  36087. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  36088. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  36089. c.urlParams_.Set("minEndDate", minEndDate)
  36090. return c
  36091. }
  36092. // MinStartDate sets the optional parameter "minStartDate": Select only
  36093. // placements or placement groups whose start date is on or after the
  36094. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  36095. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  36096. c.urlParams_.Set("minStartDate", minStartDate)
  36097. return c
  36098. }
  36099. // PageToken sets the optional parameter "pageToken": Value of the
  36100. // nextPageToken from the previous result page.
  36101. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  36102. c.urlParams_.Set("pageToken", pageToken)
  36103. return c
  36104. }
  36105. // PaymentSource sets the optional parameter "paymentSource": Select
  36106. // only placements with this payment source.
  36107. //
  36108. // Possible values:
  36109. // "PLACEMENT_AGENCY_PAID"
  36110. // "PLACEMENT_PUBLISHER_PAID"
  36111. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  36112. c.urlParams_.Set("paymentSource", paymentSource)
  36113. return c
  36114. }
  36115. // PlacementStrategyIds sets the optional parameter
  36116. // "placementStrategyIds": Select only placements that are associated
  36117. // with these placement strategies.
  36118. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  36119. var placementStrategyIds_ []string
  36120. for _, v := range placementStrategyIds {
  36121. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  36122. }
  36123. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  36124. return c
  36125. }
  36126. // PricingTypes sets the optional parameter "pricingTypes": Select only
  36127. // placements with these pricing types.
  36128. //
  36129. // Possible values:
  36130. // "PRICING_TYPE_CPA"
  36131. // "PRICING_TYPE_CPC"
  36132. // "PRICING_TYPE_CPM"
  36133. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  36134. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  36135. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36136. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  36137. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  36138. return c
  36139. }
  36140. // SearchString sets the optional parameter "searchString": Allows
  36141. // searching for placements by name or ID. Wildcards (*) are allowed.
  36142. // For example, "placement*2015" will return placements with names like
  36143. // "placement June 2015", "placement May 2015", or simply "placements
  36144. // 2015". Most of the searches also add wildcards implicitly at the
  36145. // start and the end of the search string. For example, a search string
  36146. // of "placement" will match placements with name "my placement",
  36147. // "placement 2015", or simply "placement".
  36148. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  36149. c.urlParams_.Set("searchString", searchString)
  36150. return c
  36151. }
  36152. // SiteIds sets the optional parameter "siteIds": Select only placements
  36153. // that are associated with these sites.
  36154. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  36155. var siteIds_ []string
  36156. for _, v := range siteIds {
  36157. siteIds_ = append(siteIds_, fmt.Sprint(v))
  36158. }
  36159. c.urlParams_.SetMulti("siteIds", siteIds_)
  36160. return c
  36161. }
  36162. // SizeIds sets the optional parameter "sizeIds": Select only placements
  36163. // that are associated with these sizes.
  36164. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  36165. var sizeIds_ []string
  36166. for _, v := range sizeIds {
  36167. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  36168. }
  36169. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  36170. return c
  36171. }
  36172. // SortField sets the optional parameter "sortField": Field by which to
  36173. // sort the list.
  36174. //
  36175. // Possible values:
  36176. // "ID" (default)
  36177. // "NAME"
  36178. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  36179. c.urlParams_.Set("sortField", sortField)
  36180. return c
  36181. }
  36182. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  36183. // results.
  36184. //
  36185. // Possible values:
  36186. // "ASCENDING" (default)
  36187. // "DESCENDING"
  36188. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  36189. c.urlParams_.Set("sortOrder", sortOrder)
  36190. return c
  36191. }
  36192. // Fields allows partial responses to be retrieved. See
  36193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36194. // for more information.
  36195. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  36196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36197. return c
  36198. }
  36199. // IfNoneMatch sets the optional parameter which makes the operation
  36200. // fail if the object's ETag matches the given value. This is useful for
  36201. // getting updates only after the object has changed since the last
  36202. // request. Use googleapi.IsNotModified to check whether the response
  36203. // error from Do is the result of In-None-Match.
  36204. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  36205. c.ifNoneMatch_ = entityTag
  36206. return c
  36207. }
  36208. // Context sets the context to be used in this call's Do method. Any
  36209. // pending HTTP request will be aborted if the provided context is
  36210. // canceled.
  36211. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  36212. c.ctx_ = ctx
  36213. return c
  36214. }
  36215. // Header returns an http.Header that can be modified by the caller to
  36216. // add HTTP headers to the request.
  36217. func (c *PlacementsListCall) Header() http.Header {
  36218. if c.header_ == nil {
  36219. c.header_ = make(http.Header)
  36220. }
  36221. return c.header_
  36222. }
  36223. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  36224. reqHeaders := make(http.Header)
  36225. for k, v := range c.header_ {
  36226. reqHeaders[k] = v
  36227. }
  36228. reqHeaders.Set("User-Agent", c.s.userAgent())
  36229. if c.ifNoneMatch_ != "" {
  36230. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36231. }
  36232. var body io.Reader = nil
  36233. c.urlParams_.Set("alt", alt)
  36234. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36235. urls += "?" + c.urlParams_.Encode()
  36236. req, _ := http.NewRequest("GET", urls, body)
  36237. req.Header = reqHeaders
  36238. googleapi.Expand(req.URL, map[string]string{
  36239. "profileId": strconv.FormatInt(c.profileId, 10),
  36240. })
  36241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36242. }
  36243. // Do executes the "dfareporting.placements.list" call.
  36244. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  36245. // non-2xx status code is an error. Response headers are in either
  36246. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  36247. // returned at all) in error.(*googleapi.Error).Header. Use
  36248. // googleapi.IsNotModified to check whether the returned error was
  36249. // because http.StatusNotModified was returned.
  36250. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  36251. gensupport.SetOptions(c.urlParams_, opts...)
  36252. res, err := c.doRequest("json")
  36253. if res != nil && res.StatusCode == http.StatusNotModified {
  36254. if res.Body != nil {
  36255. res.Body.Close()
  36256. }
  36257. return nil, &googleapi.Error{
  36258. Code: res.StatusCode,
  36259. Header: res.Header,
  36260. }
  36261. }
  36262. if err != nil {
  36263. return nil, err
  36264. }
  36265. defer googleapi.CloseBody(res)
  36266. if err := googleapi.CheckResponse(res); err != nil {
  36267. return nil, err
  36268. }
  36269. ret := &PlacementsListResponse{
  36270. ServerResponse: googleapi.ServerResponse{
  36271. Header: res.Header,
  36272. HTTPStatusCode: res.StatusCode,
  36273. },
  36274. }
  36275. target := &ret
  36276. if err := gensupport.DecodeResponse(target, res); err != nil {
  36277. return nil, err
  36278. }
  36279. return ret, nil
  36280. // {
  36281. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  36282. // "httpMethod": "GET",
  36283. // "id": "dfareporting.placements.list",
  36284. // "parameterOrder": [
  36285. // "profileId"
  36286. // ],
  36287. // "parameters": {
  36288. // "advertiserIds": {
  36289. // "description": "Select only placements that belong to these advertisers.",
  36290. // "format": "int64",
  36291. // "location": "query",
  36292. // "repeated": true,
  36293. // "type": "string"
  36294. // },
  36295. // "archived": {
  36296. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  36297. // "location": "query",
  36298. // "type": "boolean"
  36299. // },
  36300. // "campaignIds": {
  36301. // "description": "Select only placements that belong to these campaigns.",
  36302. // "format": "int64",
  36303. // "location": "query",
  36304. // "repeated": true,
  36305. // "type": "string"
  36306. // },
  36307. // "compatibilities": {
  36308. // "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.",
  36309. // "enum": [
  36310. // "APP",
  36311. // "APP_INTERSTITIAL",
  36312. // "DISPLAY",
  36313. // "DISPLAY_INTERSTITIAL",
  36314. // "IN_STREAM_AUDIO",
  36315. // "IN_STREAM_VIDEO"
  36316. // ],
  36317. // "enumDescriptions": [
  36318. // "",
  36319. // "",
  36320. // "",
  36321. // "",
  36322. // "",
  36323. // ""
  36324. // ],
  36325. // "location": "query",
  36326. // "repeated": true,
  36327. // "type": "string"
  36328. // },
  36329. // "contentCategoryIds": {
  36330. // "description": "Select only placements that are associated with these content categories.",
  36331. // "format": "int64",
  36332. // "location": "query",
  36333. // "repeated": true,
  36334. // "type": "string"
  36335. // },
  36336. // "directorySiteIds": {
  36337. // "description": "Select only placements that are associated with these directory sites.",
  36338. // "format": "int64",
  36339. // "location": "query",
  36340. // "repeated": true,
  36341. // "type": "string"
  36342. // },
  36343. // "groupIds": {
  36344. // "description": "Select only placements that belong to these placement groups.",
  36345. // "format": "int64",
  36346. // "location": "query",
  36347. // "repeated": true,
  36348. // "type": "string"
  36349. // },
  36350. // "ids": {
  36351. // "description": "Select only placements with these IDs.",
  36352. // "format": "int64",
  36353. // "location": "query",
  36354. // "repeated": true,
  36355. // "type": "string"
  36356. // },
  36357. // "maxEndDate": {
  36358. // "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\".",
  36359. // "location": "query",
  36360. // "type": "string"
  36361. // },
  36362. // "maxResults": {
  36363. // "default": "1000",
  36364. // "description": "Maximum number of results to return.",
  36365. // "format": "int32",
  36366. // "location": "query",
  36367. // "maximum": "1000",
  36368. // "minimum": "0",
  36369. // "type": "integer"
  36370. // },
  36371. // "maxStartDate": {
  36372. // "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\".",
  36373. // "location": "query",
  36374. // "type": "string"
  36375. // },
  36376. // "minEndDate": {
  36377. // "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\".",
  36378. // "location": "query",
  36379. // "type": "string"
  36380. // },
  36381. // "minStartDate": {
  36382. // "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\".",
  36383. // "location": "query",
  36384. // "type": "string"
  36385. // },
  36386. // "pageToken": {
  36387. // "description": "Value of the nextPageToken from the previous result page.",
  36388. // "location": "query",
  36389. // "type": "string"
  36390. // },
  36391. // "paymentSource": {
  36392. // "description": "Select only placements with this payment source.",
  36393. // "enum": [
  36394. // "PLACEMENT_AGENCY_PAID",
  36395. // "PLACEMENT_PUBLISHER_PAID"
  36396. // ],
  36397. // "enumDescriptions": [
  36398. // "",
  36399. // ""
  36400. // ],
  36401. // "location": "query",
  36402. // "type": "string"
  36403. // },
  36404. // "placementStrategyIds": {
  36405. // "description": "Select only placements that are associated with these placement strategies.",
  36406. // "format": "int64",
  36407. // "location": "query",
  36408. // "repeated": true,
  36409. // "type": "string"
  36410. // },
  36411. // "pricingTypes": {
  36412. // "description": "Select only placements with these pricing types.",
  36413. // "enum": [
  36414. // "PRICING_TYPE_CPA",
  36415. // "PRICING_TYPE_CPC",
  36416. // "PRICING_TYPE_CPM",
  36417. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  36418. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  36419. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36420. // ],
  36421. // "enumDescriptions": [
  36422. // "",
  36423. // "",
  36424. // "",
  36425. // "",
  36426. // "",
  36427. // ""
  36428. // ],
  36429. // "location": "query",
  36430. // "repeated": true,
  36431. // "type": "string"
  36432. // },
  36433. // "profileId": {
  36434. // "description": "User profile ID associated with this request.",
  36435. // "format": "int64",
  36436. // "location": "path",
  36437. // "required": true,
  36438. // "type": "string"
  36439. // },
  36440. // "searchString": {
  36441. // "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\".",
  36442. // "location": "query",
  36443. // "type": "string"
  36444. // },
  36445. // "siteIds": {
  36446. // "description": "Select only placements that are associated with these sites.",
  36447. // "format": "int64",
  36448. // "location": "query",
  36449. // "repeated": true,
  36450. // "type": "string"
  36451. // },
  36452. // "sizeIds": {
  36453. // "description": "Select only placements that are associated with these sizes.",
  36454. // "format": "int64",
  36455. // "location": "query",
  36456. // "repeated": true,
  36457. // "type": "string"
  36458. // },
  36459. // "sortField": {
  36460. // "default": "ID",
  36461. // "description": "Field by which to sort the list.",
  36462. // "enum": [
  36463. // "ID",
  36464. // "NAME"
  36465. // ],
  36466. // "enumDescriptions": [
  36467. // "",
  36468. // ""
  36469. // ],
  36470. // "location": "query",
  36471. // "type": "string"
  36472. // },
  36473. // "sortOrder": {
  36474. // "default": "ASCENDING",
  36475. // "description": "Order of sorted results.",
  36476. // "enum": [
  36477. // "ASCENDING",
  36478. // "DESCENDING"
  36479. // ],
  36480. // "enumDescriptions": [
  36481. // "",
  36482. // ""
  36483. // ],
  36484. // "location": "query",
  36485. // "type": "string"
  36486. // }
  36487. // },
  36488. // "path": "userprofiles/{profileId}/placements",
  36489. // "response": {
  36490. // "$ref": "PlacementsListResponse"
  36491. // },
  36492. // "scopes": [
  36493. // "https://www.googleapis.com/auth/dfatrafficking"
  36494. // ]
  36495. // }
  36496. }
  36497. // Pages invokes f for each page of results.
  36498. // A non-nil error returned from f will halt the iteration.
  36499. // The provided context supersedes any context provided to the Context method.
  36500. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  36501. c.ctx_ = ctx
  36502. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36503. for {
  36504. x, err := c.Do()
  36505. if err != nil {
  36506. return err
  36507. }
  36508. if err := f(x); err != nil {
  36509. return err
  36510. }
  36511. if x.NextPageToken == "" {
  36512. return nil
  36513. }
  36514. c.PageToken(x.NextPageToken)
  36515. }
  36516. }
  36517. // method id "dfareporting.placements.patch":
  36518. type PlacementsPatchCall struct {
  36519. s *Service
  36520. profileId int64
  36521. placement *Placement
  36522. urlParams_ gensupport.URLParams
  36523. ctx_ context.Context
  36524. header_ http.Header
  36525. }
  36526. // Patch: Updates an existing placement. This method supports patch
  36527. // semantics.
  36528. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  36529. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36530. c.profileId = profileId
  36531. c.urlParams_.Set("id", fmt.Sprint(id))
  36532. c.placement = placement
  36533. return c
  36534. }
  36535. // Fields allows partial responses to be retrieved. See
  36536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36537. // for more information.
  36538. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  36539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36540. return c
  36541. }
  36542. // Context sets the context to be used in this call's Do method. Any
  36543. // pending HTTP request will be aborted if the provided context is
  36544. // canceled.
  36545. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  36546. c.ctx_ = ctx
  36547. return c
  36548. }
  36549. // Header returns an http.Header that can be modified by the caller to
  36550. // add HTTP headers to the request.
  36551. func (c *PlacementsPatchCall) Header() http.Header {
  36552. if c.header_ == nil {
  36553. c.header_ = make(http.Header)
  36554. }
  36555. return c.header_
  36556. }
  36557. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  36558. reqHeaders := make(http.Header)
  36559. for k, v := range c.header_ {
  36560. reqHeaders[k] = v
  36561. }
  36562. reqHeaders.Set("User-Agent", c.s.userAgent())
  36563. var body io.Reader = nil
  36564. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36565. if err != nil {
  36566. return nil, err
  36567. }
  36568. reqHeaders.Set("Content-Type", "application/json")
  36569. c.urlParams_.Set("alt", alt)
  36570. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36571. urls += "?" + c.urlParams_.Encode()
  36572. req, _ := http.NewRequest("PATCH", urls, body)
  36573. req.Header = reqHeaders
  36574. googleapi.Expand(req.URL, map[string]string{
  36575. "profileId": strconv.FormatInt(c.profileId, 10),
  36576. })
  36577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36578. }
  36579. // Do executes the "dfareporting.placements.patch" call.
  36580. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36581. // status code is an error. Response headers are in either
  36582. // *Placement.ServerResponse.Header or (if a response was returned at
  36583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36584. // to check whether the returned error was because
  36585. // http.StatusNotModified was returned.
  36586. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36587. gensupport.SetOptions(c.urlParams_, opts...)
  36588. res, err := c.doRequest("json")
  36589. if res != nil && res.StatusCode == http.StatusNotModified {
  36590. if res.Body != nil {
  36591. res.Body.Close()
  36592. }
  36593. return nil, &googleapi.Error{
  36594. Code: res.StatusCode,
  36595. Header: res.Header,
  36596. }
  36597. }
  36598. if err != nil {
  36599. return nil, err
  36600. }
  36601. defer googleapi.CloseBody(res)
  36602. if err := googleapi.CheckResponse(res); err != nil {
  36603. return nil, err
  36604. }
  36605. ret := &Placement{
  36606. ServerResponse: googleapi.ServerResponse{
  36607. Header: res.Header,
  36608. HTTPStatusCode: res.StatusCode,
  36609. },
  36610. }
  36611. target := &ret
  36612. if err := gensupport.DecodeResponse(target, res); err != nil {
  36613. return nil, err
  36614. }
  36615. return ret, nil
  36616. // {
  36617. // "description": "Updates an existing placement. This method supports patch semantics.",
  36618. // "httpMethod": "PATCH",
  36619. // "id": "dfareporting.placements.patch",
  36620. // "parameterOrder": [
  36621. // "profileId",
  36622. // "id"
  36623. // ],
  36624. // "parameters": {
  36625. // "id": {
  36626. // "description": "Placement ID.",
  36627. // "format": "int64",
  36628. // "location": "query",
  36629. // "required": true,
  36630. // "type": "string"
  36631. // },
  36632. // "profileId": {
  36633. // "description": "User profile ID associated with this request.",
  36634. // "format": "int64",
  36635. // "location": "path",
  36636. // "required": true,
  36637. // "type": "string"
  36638. // }
  36639. // },
  36640. // "path": "userprofiles/{profileId}/placements",
  36641. // "request": {
  36642. // "$ref": "Placement"
  36643. // },
  36644. // "response": {
  36645. // "$ref": "Placement"
  36646. // },
  36647. // "scopes": [
  36648. // "https://www.googleapis.com/auth/dfatrafficking"
  36649. // ]
  36650. // }
  36651. }
  36652. // method id "dfareporting.placements.update":
  36653. type PlacementsUpdateCall struct {
  36654. s *Service
  36655. profileId int64
  36656. placement *Placement
  36657. urlParams_ gensupport.URLParams
  36658. ctx_ context.Context
  36659. header_ http.Header
  36660. }
  36661. // Update: Updates an existing placement.
  36662. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  36663. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36664. c.profileId = profileId
  36665. c.placement = placement
  36666. return c
  36667. }
  36668. // Fields allows partial responses to be retrieved. See
  36669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36670. // for more information.
  36671. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  36672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36673. return c
  36674. }
  36675. // Context sets the context to be used in this call's Do method. Any
  36676. // pending HTTP request will be aborted if the provided context is
  36677. // canceled.
  36678. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  36679. c.ctx_ = ctx
  36680. return c
  36681. }
  36682. // Header returns an http.Header that can be modified by the caller to
  36683. // add HTTP headers to the request.
  36684. func (c *PlacementsUpdateCall) Header() http.Header {
  36685. if c.header_ == nil {
  36686. c.header_ = make(http.Header)
  36687. }
  36688. return c.header_
  36689. }
  36690. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36691. reqHeaders := make(http.Header)
  36692. for k, v := range c.header_ {
  36693. reqHeaders[k] = v
  36694. }
  36695. reqHeaders.Set("User-Agent", c.s.userAgent())
  36696. var body io.Reader = nil
  36697. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36698. if err != nil {
  36699. return nil, err
  36700. }
  36701. reqHeaders.Set("Content-Type", "application/json")
  36702. c.urlParams_.Set("alt", alt)
  36703. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36704. urls += "?" + c.urlParams_.Encode()
  36705. req, _ := http.NewRequest("PUT", urls, body)
  36706. req.Header = reqHeaders
  36707. googleapi.Expand(req.URL, map[string]string{
  36708. "profileId": strconv.FormatInt(c.profileId, 10),
  36709. })
  36710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36711. }
  36712. // Do executes the "dfareporting.placements.update" call.
  36713. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36714. // status code is an error. Response headers are in either
  36715. // *Placement.ServerResponse.Header or (if a response was returned at
  36716. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36717. // to check whether the returned error was because
  36718. // http.StatusNotModified was returned.
  36719. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36720. gensupport.SetOptions(c.urlParams_, opts...)
  36721. res, err := c.doRequest("json")
  36722. if res != nil && res.StatusCode == http.StatusNotModified {
  36723. if res.Body != nil {
  36724. res.Body.Close()
  36725. }
  36726. return nil, &googleapi.Error{
  36727. Code: res.StatusCode,
  36728. Header: res.Header,
  36729. }
  36730. }
  36731. if err != nil {
  36732. return nil, err
  36733. }
  36734. defer googleapi.CloseBody(res)
  36735. if err := googleapi.CheckResponse(res); err != nil {
  36736. return nil, err
  36737. }
  36738. ret := &Placement{
  36739. ServerResponse: googleapi.ServerResponse{
  36740. Header: res.Header,
  36741. HTTPStatusCode: res.StatusCode,
  36742. },
  36743. }
  36744. target := &ret
  36745. if err := gensupport.DecodeResponse(target, res); err != nil {
  36746. return nil, err
  36747. }
  36748. return ret, nil
  36749. // {
  36750. // "description": "Updates an existing placement.",
  36751. // "httpMethod": "PUT",
  36752. // "id": "dfareporting.placements.update",
  36753. // "parameterOrder": [
  36754. // "profileId"
  36755. // ],
  36756. // "parameters": {
  36757. // "profileId": {
  36758. // "description": "User profile ID associated with this request.",
  36759. // "format": "int64",
  36760. // "location": "path",
  36761. // "required": true,
  36762. // "type": "string"
  36763. // }
  36764. // },
  36765. // "path": "userprofiles/{profileId}/placements",
  36766. // "request": {
  36767. // "$ref": "Placement"
  36768. // },
  36769. // "response": {
  36770. // "$ref": "Placement"
  36771. // },
  36772. // "scopes": [
  36773. // "https://www.googleapis.com/auth/dfatrafficking"
  36774. // ]
  36775. // }
  36776. }
  36777. // method id "dfareporting.platformTypes.get":
  36778. type PlatformTypesGetCall struct {
  36779. s *Service
  36780. profileId int64
  36781. id int64
  36782. urlParams_ gensupport.URLParams
  36783. ifNoneMatch_ string
  36784. ctx_ context.Context
  36785. header_ http.Header
  36786. }
  36787. // Get: Gets one platform type by ID.
  36788. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  36789. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36790. c.profileId = profileId
  36791. c.id = id
  36792. return c
  36793. }
  36794. // Fields allows partial responses to be retrieved. See
  36795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36796. // for more information.
  36797. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  36798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36799. return c
  36800. }
  36801. // IfNoneMatch sets the optional parameter which makes the operation
  36802. // fail if the object's ETag matches the given value. This is useful for
  36803. // getting updates only after the object has changed since the last
  36804. // request. Use googleapi.IsNotModified to check whether the response
  36805. // error from Do is the result of In-None-Match.
  36806. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  36807. c.ifNoneMatch_ = entityTag
  36808. return c
  36809. }
  36810. // Context sets the context to be used in this call's Do method. Any
  36811. // pending HTTP request will be aborted if the provided context is
  36812. // canceled.
  36813. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  36814. c.ctx_ = ctx
  36815. return c
  36816. }
  36817. // Header returns an http.Header that can be modified by the caller to
  36818. // add HTTP headers to the request.
  36819. func (c *PlatformTypesGetCall) Header() http.Header {
  36820. if c.header_ == nil {
  36821. c.header_ = make(http.Header)
  36822. }
  36823. return c.header_
  36824. }
  36825. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  36826. reqHeaders := make(http.Header)
  36827. for k, v := range c.header_ {
  36828. reqHeaders[k] = v
  36829. }
  36830. reqHeaders.Set("User-Agent", c.s.userAgent())
  36831. if c.ifNoneMatch_ != "" {
  36832. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36833. }
  36834. var body io.Reader = nil
  36835. c.urlParams_.Set("alt", alt)
  36836. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  36837. urls += "?" + c.urlParams_.Encode()
  36838. req, _ := http.NewRequest("GET", urls, body)
  36839. req.Header = reqHeaders
  36840. googleapi.Expand(req.URL, map[string]string{
  36841. "profileId": strconv.FormatInt(c.profileId, 10),
  36842. "id": strconv.FormatInt(c.id, 10),
  36843. })
  36844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36845. }
  36846. // Do executes the "dfareporting.platformTypes.get" call.
  36847. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  36848. // status code is an error. Response headers are in either
  36849. // *PlatformType.ServerResponse.Header or (if a response was returned at
  36850. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36851. // to check whether the returned error was because
  36852. // http.StatusNotModified was returned.
  36853. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  36854. gensupport.SetOptions(c.urlParams_, opts...)
  36855. res, err := c.doRequest("json")
  36856. if res != nil && res.StatusCode == http.StatusNotModified {
  36857. if res.Body != nil {
  36858. res.Body.Close()
  36859. }
  36860. return nil, &googleapi.Error{
  36861. Code: res.StatusCode,
  36862. Header: res.Header,
  36863. }
  36864. }
  36865. if err != nil {
  36866. return nil, err
  36867. }
  36868. defer googleapi.CloseBody(res)
  36869. if err := googleapi.CheckResponse(res); err != nil {
  36870. return nil, err
  36871. }
  36872. ret := &PlatformType{
  36873. ServerResponse: googleapi.ServerResponse{
  36874. Header: res.Header,
  36875. HTTPStatusCode: res.StatusCode,
  36876. },
  36877. }
  36878. target := &ret
  36879. if err := gensupport.DecodeResponse(target, res); err != nil {
  36880. return nil, err
  36881. }
  36882. return ret, nil
  36883. // {
  36884. // "description": "Gets one platform type by ID.",
  36885. // "httpMethod": "GET",
  36886. // "id": "dfareporting.platformTypes.get",
  36887. // "parameterOrder": [
  36888. // "profileId",
  36889. // "id"
  36890. // ],
  36891. // "parameters": {
  36892. // "id": {
  36893. // "description": "Platform type ID.",
  36894. // "format": "int64",
  36895. // "location": "path",
  36896. // "required": true,
  36897. // "type": "string"
  36898. // },
  36899. // "profileId": {
  36900. // "description": "User profile ID associated with this request.",
  36901. // "format": "int64",
  36902. // "location": "path",
  36903. // "required": true,
  36904. // "type": "string"
  36905. // }
  36906. // },
  36907. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  36908. // "response": {
  36909. // "$ref": "PlatformType"
  36910. // },
  36911. // "scopes": [
  36912. // "https://www.googleapis.com/auth/dfatrafficking"
  36913. // ]
  36914. // }
  36915. }
  36916. // method id "dfareporting.platformTypes.list":
  36917. type PlatformTypesListCall struct {
  36918. s *Service
  36919. profileId int64
  36920. urlParams_ gensupport.URLParams
  36921. ifNoneMatch_ string
  36922. ctx_ context.Context
  36923. header_ http.Header
  36924. }
  36925. // List: Retrieves a list of platform types.
  36926. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  36927. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36928. c.profileId = profileId
  36929. return c
  36930. }
  36931. // Fields allows partial responses to be retrieved. See
  36932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36933. // for more information.
  36934. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  36935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36936. return c
  36937. }
  36938. // IfNoneMatch sets the optional parameter which makes the operation
  36939. // fail if the object's ETag matches the given value. This is useful for
  36940. // getting updates only after the object has changed since the last
  36941. // request. Use googleapi.IsNotModified to check whether the response
  36942. // error from Do is the result of In-None-Match.
  36943. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  36944. c.ifNoneMatch_ = entityTag
  36945. return c
  36946. }
  36947. // Context sets the context to be used in this call's Do method. Any
  36948. // pending HTTP request will be aborted if the provided context is
  36949. // canceled.
  36950. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  36951. c.ctx_ = ctx
  36952. return c
  36953. }
  36954. // Header returns an http.Header that can be modified by the caller to
  36955. // add HTTP headers to the request.
  36956. func (c *PlatformTypesListCall) Header() http.Header {
  36957. if c.header_ == nil {
  36958. c.header_ = make(http.Header)
  36959. }
  36960. return c.header_
  36961. }
  36962. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  36963. reqHeaders := make(http.Header)
  36964. for k, v := range c.header_ {
  36965. reqHeaders[k] = v
  36966. }
  36967. reqHeaders.Set("User-Agent", c.s.userAgent())
  36968. if c.ifNoneMatch_ != "" {
  36969. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36970. }
  36971. var body io.Reader = nil
  36972. c.urlParams_.Set("alt", alt)
  36973. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  36974. urls += "?" + c.urlParams_.Encode()
  36975. req, _ := http.NewRequest("GET", urls, body)
  36976. req.Header = reqHeaders
  36977. googleapi.Expand(req.URL, map[string]string{
  36978. "profileId": strconv.FormatInt(c.profileId, 10),
  36979. })
  36980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36981. }
  36982. // Do executes the "dfareporting.platformTypes.list" call.
  36983. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  36984. // Any non-2xx status code is an error. Response headers are in either
  36985. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  36986. // was returned at all) in error.(*googleapi.Error).Header. Use
  36987. // googleapi.IsNotModified to check whether the returned error was
  36988. // because http.StatusNotModified was returned.
  36989. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  36990. gensupport.SetOptions(c.urlParams_, opts...)
  36991. res, err := c.doRequest("json")
  36992. if res != nil && res.StatusCode == http.StatusNotModified {
  36993. if res.Body != nil {
  36994. res.Body.Close()
  36995. }
  36996. return nil, &googleapi.Error{
  36997. Code: res.StatusCode,
  36998. Header: res.Header,
  36999. }
  37000. }
  37001. if err != nil {
  37002. return nil, err
  37003. }
  37004. defer googleapi.CloseBody(res)
  37005. if err := googleapi.CheckResponse(res); err != nil {
  37006. return nil, err
  37007. }
  37008. ret := &PlatformTypesListResponse{
  37009. ServerResponse: googleapi.ServerResponse{
  37010. Header: res.Header,
  37011. HTTPStatusCode: res.StatusCode,
  37012. },
  37013. }
  37014. target := &ret
  37015. if err := gensupport.DecodeResponse(target, res); err != nil {
  37016. return nil, err
  37017. }
  37018. return ret, nil
  37019. // {
  37020. // "description": "Retrieves a list of platform types.",
  37021. // "httpMethod": "GET",
  37022. // "id": "dfareporting.platformTypes.list",
  37023. // "parameterOrder": [
  37024. // "profileId"
  37025. // ],
  37026. // "parameters": {
  37027. // "profileId": {
  37028. // "description": "User profile ID associated with this request.",
  37029. // "format": "int64",
  37030. // "location": "path",
  37031. // "required": true,
  37032. // "type": "string"
  37033. // }
  37034. // },
  37035. // "path": "userprofiles/{profileId}/platformTypes",
  37036. // "response": {
  37037. // "$ref": "PlatformTypesListResponse"
  37038. // },
  37039. // "scopes": [
  37040. // "https://www.googleapis.com/auth/dfatrafficking"
  37041. // ]
  37042. // }
  37043. }
  37044. // method id "dfareporting.postalCodes.get":
  37045. type PostalCodesGetCall struct {
  37046. s *Service
  37047. profileId int64
  37048. code string
  37049. urlParams_ gensupport.URLParams
  37050. ifNoneMatch_ string
  37051. ctx_ context.Context
  37052. header_ http.Header
  37053. }
  37054. // Get: Gets one postal code by ID.
  37055. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  37056. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37057. c.profileId = profileId
  37058. c.code = code
  37059. return c
  37060. }
  37061. // Fields allows partial responses to be retrieved. See
  37062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37063. // for more information.
  37064. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  37065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37066. return c
  37067. }
  37068. // IfNoneMatch sets the optional parameter which makes the operation
  37069. // fail if the object's ETag matches the given value. This is useful for
  37070. // getting updates only after the object has changed since the last
  37071. // request. Use googleapi.IsNotModified to check whether the response
  37072. // error from Do is the result of In-None-Match.
  37073. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  37074. c.ifNoneMatch_ = entityTag
  37075. return c
  37076. }
  37077. // Context sets the context to be used in this call's Do method. Any
  37078. // pending HTTP request will be aborted if the provided context is
  37079. // canceled.
  37080. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  37081. c.ctx_ = ctx
  37082. return c
  37083. }
  37084. // Header returns an http.Header that can be modified by the caller to
  37085. // add HTTP headers to the request.
  37086. func (c *PostalCodesGetCall) Header() http.Header {
  37087. if c.header_ == nil {
  37088. c.header_ = make(http.Header)
  37089. }
  37090. return c.header_
  37091. }
  37092. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  37093. reqHeaders := make(http.Header)
  37094. for k, v := range c.header_ {
  37095. reqHeaders[k] = v
  37096. }
  37097. reqHeaders.Set("User-Agent", c.s.userAgent())
  37098. if c.ifNoneMatch_ != "" {
  37099. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37100. }
  37101. var body io.Reader = nil
  37102. c.urlParams_.Set("alt", alt)
  37103. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  37104. urls += "?" + c.urlParams_.Encode()
  37105. req, _ := http.NewRequest("GET", urls, body)
  37106. req.Header = reqHeaders
  37107. googleapi.Expand(req.URL, map[string]string{
  37108. "profileId": strconv.FormatInt(c.profileId, 10),
  37109. "code": c.code,
  37110. })
  37111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37112. }
  37113. // Do executes the "dfareporting.postalCodes.get" call.
  37114. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  37115. // status code is an error. Response headers are in either
  37116. // *PostalCode.ServerResponse.Header or (if a response was returned at
  37117. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37118. // to check whether the returned error was because
  37119. // http.StatusNotModified was returned.
  37120. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  37121. gensupport.SetOptions(c.urlParams_, opts...)
  37122. res, err := c.doRequest("json")
  37123. if res != nil && res.StatusCode == http.StatusNotModified {
  37124. if res.Body != nil {
  37125. res.Body.Close()
  37126. }
  37127. return nil, &googleapi.Error{
  37128. Code: res.StatusCode,
  37129. Header: res.Header,
  37130. }
  37131. }
  37132. if err != nil {
  37133. return nil, err
  37134. }
  37135. defer googleapi.CloseBody(res)
  37136. if err := googleapi.CheckResponse(res); err != nil {
  37137. return nil, err
  37138. }
  37139. ret := &PostalCode{
  37140. ServerResponse: googleapi.ServerResponse{
  37141. Header: res.Header,
  37142. HTTPStatusCode: res.StatusCode,
  37143. },
  37144. }
  37145. target := &ret
  37146. if err := gensupport.DecodeResponse(target, res); err != nil {
  37147. return nil, err
  37148. }
  37149. return ret, nil
  37150. // {
  37151. // "description": "Gets one postal code by ID.",
  37152. // "httpMethod": "GET",
  37153. // "id": "dfareporting.postalCodes.get",
  37154. // "parameterOrder": [
  37155. // "profileId",
  37156. // "code"
  37157. // ],
  37158. // "parameters": {
  37159. // "code": {
  37160. // "description": "Postal code ID.",
  37161. // "location": "path",
  37162. // "required": true,
  37163. // "type": "string"
  37164. // },
  37165. // "profileId": {
  37166. // "description": "User profile ID associated with this request.",
  37167. // "format": "int64",
  37168. // "location": "path",
  37169. // "required": true,
  37170. // "type": "string"
  37171. // }
  37172. // },
  37173. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  37174. // "response": {
  37175. // "$ref": "PostalCode"
  37176. // },
  37177. // "scopes": [
  37178. // "https://www.googleapis.com/auth/dfatrafficking"
  37179. // ]
  37180. // }
  37181. }
  37182. // method id "dfareporting.postalCodes.list":
  37183. type PostalCodesListCall struct {
  37184. s *Service
  37185. profileId int64
  37186. urlParams_ gensupport.URLParams
  37187. ifNoneMatch_ string
  37188. ctx_ context.Context
  37189. header_ http.Header
  37190. }
  37191. // List: Retrieves a list of postal codes.
  37192. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  37193. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37194. c.profileId = profileId
  37195. return c
  37196. }
  37197. // Fields allows partial responses to be retrieved. See
  37198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37199. // for more information.
  37200. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  37201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37202. return c
  37203. }
  37204. // IfNoneMatch sets the optional parameter which makes the operation
  37205. // fail if the object's ETag matches the given value. This is useful for
  37206. // getting updates only after the object has changed since the last
  37207. // request. Use googleapi.IsNotModified to check whether the response
  37208. // error from Do is the result of In-None-Match.
  37209. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  37210. c.ifNoneMatch_ = entityTag
  37211. return c
  37212. }
  37213. // Context sets the context to be used in this call's Do method. Any
  37214. // pending HTTP request will be aborted if the provided context is
  37215. // canceled.
  37216. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  37217. c.ctx_ = ctx
  37218. return c
  37219. }
  37220. // Header returns an http.Header that can be modified by the caller to
  37221. // add HTTP headers to the request.
  37222. func (c *PostalCodesListCall) Header() http.Header {
  37223. if c.header_ == nil {
  37224. c.header_ = make(http.Header)
  37225. }
  37226. return c.header_
  37227. }
  37228. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  37229. reqHeaders := make(http.Header)
  37230. for k, v := range c.header_ {
  37231. reqHeaders[k] = v
  37232. }
  37233. reqHeaders.Set("User-Agent", c.s.userAgent())
  37234. if c.ifNoneMatch_ != "" {
  37235. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37236. }
  37237. var body io.Reader = nil
  37238. c.urlParams_.Set("alt", alt)
  37239. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  37240. urls += "?" + c.urlParams_.Encode()
  37241. req, _ := http.NewRequest("GET", urls, body)
  37242. req.Header = reqHeaders
  37243. googleapi.Expand(req.URL, map[string]string{
  37244. "profileId": strconv.FormatInt(c.profileId, 10),
  37245. })
  37246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37247. }
  37248. // Do executes the "dfareporting.postalCodes.list" call.
  37249. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  37250. // non-2xx status code is an error. Response headers are in either
  37251. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  37252. // returned at all) in error.(*googleapi.Error).Header. Use
  37253. // googleapi.IsNotModified to check whether the returned error was
  37254. // because http.StatusNotModified was returned.
  37255. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  37256. gensupport.SetOptions(c.urlParams_, opts...)
  37257. res, err := c.doRequest("json")
  37258. if res != nil && res.StatusCode == http.StatusNotModified {
  37259. if res.Body != nil {
  37260. res.Body.Close()
  37261. }
  37262. return nil, &googleapi.Error{
  37263. Code: res.StatusCode,
  37264. Header: res.Header,
  37265. }
  37266. }
  37267. if err != nil {
  37268. return nil, err
  37269. }
  37270. defer googleapi.CloseBody(res)
  37271. if err := googleapi.CheckResponse(res); err != nil {
  37272. return nil, err
  37273. }
  37274. ret := &PostalCodesListResponse{
  37275. ServerResponse: googleapi.ServerResponse{
  37276. Header: res.Header,
  37277. HTTPStatusCode: res.StatusCode,
  37278. },
  37279. }
  37280. target := &ret
  37281. if err := gensupport.DecodeResponse(target, res); err != nil {
  37282. return nil, err
  37283. }
  37284. return ret, nil
  37285. // {
  37286. // "description": "Retrieves a list of postal codes.",
  37287. // "httpMethod": "GET",
  37288. // "id": "dfareporting.postalCodes.list",
  37289. // "parameterOrder": [
  37290. // "profileId"
  37291. // ],
  37292. // "parameters": {
  37293. // "profileId": {
  37294. // "description": "User profile ID associated with this request.",
  37295. // "format": "int64",
  37296. // "location": "path",
  37297. // "required": true,
  37298. // "type": "string"
  37299. // }
  37300. // },
  37301. // "path": "userprofiles/{profileId}/postalCodes",
  37302. // "response": {
  37303. // "$ref": "PostalCodesListResponse"
  37304. // },
  37305. // "scopes": [
  37306. // "https://www.googleapis.com/auth/dfatrafficking"
  37307. // ]
  37308. // }
  37309. }
  37310. // method id "dfareporting.projects.get":
  37311. type ProjectsGetCall struct {
  37312. s *Service
  37313. profileId int64
  37314. id int64
  37315. urlParams_ gensupport.URLParams
  37316. ifNoneMatch_ string
  37317. ctx_ context.Context
  37318. header_ http.Header
  37319. }
  37320. // Get: Gets one project by ID.
  37321. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  37322. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37323. c.profileId = profileId
  37324. c.id = id
  37325. return c
  37326. }
  37327. // Fields allows partial responses to be retrieved. See
  37328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37329. // for more information.
  37330. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  37331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37332. return c
  37333. }
  37334. // IfNoneMatch sets the optional parameter which makes the operation
  37335. // fail if the object's ETag matches the given value. This is useful for
  37336. // getting updates only after the object has changed since the last
  37337. // request. Use googleapi.IsNotModified to check whether the response
  37338. // error from Do is the result of In-None-Match.
  37339. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  37340. c.ifNoneMatch_ = entityTag
  37341. return c
  37342. }
  37343. // Context sets the context to be used in this call's Do method. Any
  37344. // pending HTTP request will be aborted if the provided context is
  37345. // canceled.
  37346. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  37347. c.ctx_ = ctx
  37348. return c
  37349. }
  37350. // Header returns an http.Header that can be modified by the caller to
  37351. // add HTTP headers to the request.
  37352. func (c *ProjectsGetCall) Header() http.Header {
  37353. if c.header_ == nil {
  37354. c.header_ = make(http.Header)
  37355. }
  37356. return c.header_
  37357. }
  37358. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  37359. reqHeaders := make(http.Header)
  37360. for k, v := range c.header_ {
  37361. reqHeaders[k] = v
  37362. }
  37363. reqHeaders.Set("User-Agent", c.s.userAgent())
  37364. if c.ifNoneMatch_ != "" {
  37365. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37366. }
  37367. var body io.Reader = nil
  37368. c.urlParams_.Set("alt", alt)
  37369. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  37370. urls += "?" + c.urlParams_.Encode()
  37371. req, _ := http.NewRequest("GET", urls, body)
  37372. req.Header = reqHeaders
  37373. googleapi.Expand(req.URL, map[string]string{
  37374. "profileId": strconv.FormatInt(c.profileId, 10),
  37375. "id": strconv.FormatInt(c.id, 10),
  37376. })
  37377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37378. }
  37379. // Do executes the "dfareporting.projects.get" call.
  37380. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  37381. // code is an error. Response headers are in either
  37382. // *Project.ServerResponse.Header or (if a response was returned at all)
  37383. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  37384. // check whether the returned error was because http.StatusNotModified
  37385. // was returned.
  37386. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  37387. gensupport.SetOptions(c.urlParams_, opts...)
  37388. res, err := c.doRequest("json")
  37389. if res != nil && res.StatusCode == http.StatusNotModified {
  37390. if res.Body != nil {
  37391. res.Body.Close()
  37392. }
  37393. return nil, &googleapi.Error{
  37394. Code: res.StatusCode,
  37395. Header: res.Header,
  37396. }
  37397. }
  37398. if err != nil {
  37399. return nil, err
  37400. }
  37401. defer googleapi.CloseBody(res)
  37402. if err := googleapi.CheckResponse(res); err != nil {
  37403. return nil, err
  37404. }
  37405. ret := &Project{
  37406. ServerResponse: googleapi.ServerResponse{
  37407. Header: res.Header,
  37408. HTTPStatusCode: res.StatusCode,
  37409. },
  37410. }
  37411. target := &ret
  37412. if err := gensupport.DecodeResponse(target, res); err != nil {
  37413. return nil, err
  37414. }
  37415. return ret, nil
  37416. // {
  37417. // "description": "Gets one project by ID.",
  37418. // "httpMethod": "GET",
  37419. // "id": "dfareporting.projects.get",
  37420. // "parameterOrder": [
  37421. // "profileId",
  37422. // "id"
  37423. // ],
  37424. // "parameters": {
  37425. // "id": {
  37426. // "description": "Project ID.",
  37427. // "format": "int64",
  37428. // "location": "path",
  37429. // "required": true,
  37430. // "type": "string"
  37431. // },
  37432. // "profileId": {
  37433. // "description": "User profile ID associated with this request.",
  37434. // "format": "int64",
  37435. // "location": "path",
  37436. // "required": true,
  37437. // "type": "string"
  37438. // }
  37439. // },
  37440. // "path": "userprofiles/{profileId}/projects/{id}",
  37441. // "response": {
  37442. // "$ref": "Project"
  37443. // },
  37444. // "scopes": [
  37445. // "https://www.googleapis.com/auth/dfatrafficking"
  37446. // ]
  37447. // }
  37448. }
  37449. // method id "dfareporting.projects.list":
  37450. type ProjectsListCall struct {
  37451. s *Service
  37452. profileId int64
  37453. urlParams_ gensupport.URLParams
  37454. ifNoneMatch_ string
  37455. ctx_ context.Context
  37456. header_ http.Header
  37457. }
  37458. // List: Retrieves a list of projects, possibly filtered. This method
  37459. // supports paging.
  37460. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  37461. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37462. c.profileId = profileId
  37463. return c
  37464. }
  37465. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  37466. // only projects with these advertiser IDs.
  37467. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  37468. var advertiserIds_ []string
  37469. for _, v := range advertiserIds {
  37470. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  37471. }
  37472. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  37473. return c
  37474. }
  37475. // Ids sets the optional parameter "ids": Select only projects with
  37476. // these IDs.
  37477. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  37478. var ids_ []string
  37479. for _, v := range ids {
  37480. ids_ = append(ids_, fmt.Sprint(v))
  37481. }
  37482. c.urlParams_.SetMulti("ids", ids_)
  37483. return c
  37484. }
  37485. // MaxResults sets the optional parameter "maxResults": Maximum number
  37486. // of results to return.
  37487. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  37488. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37489. return c
  37490. }
  37491. // PageToken sets the optional parameter "pageToken": Value of the
  37492. // nextPageToken from the previous result page.
  37493. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  37494. c.urlParams_.Set("pageToken", pageToken)
  37495. return c
  37496. }
  37497. // SearchString sets the optional parameter "searchString": Allows
  37498. // searching for projects by name or ID. Wildcards (*) are allowed. For
  37499. // example, "project*2015" will return projects with names like "project
  37500. // June 2015", "project April 2015", or simply "project 2015". Most of
  37501. // the searches also add wildcards implicitly at the start and the end
  37502. // of the search string. For example, a search string of "project" will
  37503. // match projects with name "my project", "project 2015", or simply
  37504. // "project".
  37505. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  37506. c.urlParams_.Set("searchString", searchString)
  37507. return c
  37508. }
  37509. // SortField sets the optional parameter "sortField": Field by which to
  37510. // sort the list.
  37511. //
  37512. // Possible values:
  37513. // "ID" (default)
  37514. // "NAME"
  37515. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  37516. c.urlParams_.Set("sortField", sortField)
  37517. return c
  37518. }
  37519. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  37520. // results.
  37521. //
  37522. // Possible values:
  37523. // "ASCENDING" (default)
  37524. // "DESCENDING"
  37525. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  37526. c.urlParams_.Set("sortOrder", sortOrder)
  37527. return c
  37528. }
  37529. // Fields allows partial responses to be retrieved. See
  37530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37531. // for more information.
  37532. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  37533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37534. return c
  37535. }
  37536. // IfNoneMatch sets the optional parameter which makes the operation
  37537. // fail if the object's ETag matches the given value. This is useful for
  37538. // getting updates only after the object has changed since the last
  37539. // request. Use googleapi.IsNotModified to check whether the response
  37540. // error from Do is the result of In-None-Match.
  37541. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  37542. c.ifNoneMatch_ = entityTag
  37543. return c
  37544. }
  37545. // Context sets the context to be used in this call's Do method. Any
  37546. // pending HTTP request will be aborted if the provided context is
  37547. // canceled.
  37548. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  37549. c.ctx_ = ctx
  37550. return c
  37551. }
  37552. // Header returns an http.Header that can be modified by the caller to
  37553. // add HTTP headers to the request.
  37554. func (c *ProjectsListCall) Header() http.Header {
  37555. if c.header_ == nil {
  37556. c.header_ = make(http.Header)
  37557. }
  37558. return c.header_
  37559. }
  37560. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  37561. reqHeaders := make(http.Header)
  37562. for k, v := range c.header_ {
  37563. reqHeaders[k] = v
  37564. }
  37565. reqHeaders.Set("User-Agent", c.s.userAgent())
  37566. if c.ifNoneMatch_ != "" {
  37567. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37568. }
  37569. var body io.Reader = nil
  37570. c.urlParams_.Set("alt", alt)
  37571. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  37572. urls += "?" + c.urlParams_.Encode()
  37573. req, _ := http.NewRequest("GET", urls, body)
  37574. req.Header = reqHeaders
  37575. googleapi.Expand(req.URL, map[string]string{
  37576. "profileId": strconv.FormatInt(c.profileId, 10),
  37577. })
  37578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37579. }
  37580. // Do executes the "dfareporting.projects.list" call.
  37581. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  37582. // non-2xx status code is an error. Response headers are in either
  37583. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  37584. // returned at all) in error.(*googleapi.Error).Header. Use
  37585. // googleapi.IsNotModified to check whether the returned error was
  37586. // because http.StatusNotModified was returned.
  37587. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  37588. gensupport.SetOptions(c.urlParams_, opts...)
  37589. res, err := c.doRequest("json")
  37590. if res != nil && res.StatusCode == http.StatusNotModified {
  37591. if res.Body != nil {
  37592. res.Body.Close()
  37593. }
  37594. return nil, &googleapi.Error{
  37595. Code: res.StatusCode,
  37596. Header: res.Header,
  37597. }
  37598. }
  37599. if err != nil {
  37600. return nil, err
  37601. }
  37602. defer googleapi.CloseBody(res)
  37603. if err := googleapi.CheckResponse(res); err != nil {
  37604. return nil, err
  37605. }
  37606. ret := &ProjectsListResponse{
  37607. ServerResponse: googleapi.ServerResponse{
  37608. Header: res.Header,
  37609. HTTPStatusCode: res.StatusCode,
  37610. },
  37611. }
  37612. target := &ret
  37613. if err := gensupport.DecodeResponse(target, res); err != nil {
  37614. return nil, err
  37615. }
  37616. return ret, nil
  37617. // {
  37618. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  37619. // "httpMethod": "GET",
  37620. // "id": "dfareporting.projects.list",
  37621. // "parameterOrder": [
  37622. // "profileId"
  37623. // ],
  37624. // "parameters": {
  37625. // "advertiserIds": {
  37626. // "description": "Select only projects with these advertiser IDs.",
  37627. // "format": "int64",
  37628. // "location": "query",
  37629. // "repeated": true,
  37630. // "type": "string"
  37631. // },
  37632. // "ids": {
  37633. // "description": "Select only projects with these IDs.",
  37634. // "format": "int64",
  37635. // "location": "query",
  37636. // "repeated": true,
  37637. // "type": "string"
  37638. // },
  37639. // "maxResults": {
  37640. // "default": "1000",
  37641. // "description": "Maximum number of results to return.",
  37642. // "format": "int32",
  37643. // "location": "query",
  37644. // "maximum": "1000",
  37645. // "minimum": "0",
  37646. // "type": "integer"
  37647. // },
  37648. // "pageToken": {
  37649. // "description": "Value of the nextPageToken from the previous result page.",
  37650. // "location": "query",
  37651. // "type": "string"
  37652. // },
  37653. // "profileId": {
  37654. // "description": "User profile ID associated with this request.",
  37655. // "format": "int64",
  37656. // "location": "path",
  37657. // "required": true,
  37658. // "type": "string"
  37659. // },
  37660. // "searchString": {
  37661. // "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\".",
  37662. // "location": "query",
  37663. // "type": "string"
  37664. // },
  37665. // "sortField": {
  37666. // "default": "ID",
  37667. // "description": "Field by which to sort the list.",
  37668. // "enum": [
  37669. // "ID",
  37670. // "NAME"
  37671. // ],
  37672. // "enumDescriptions": [
  37673. // "",
  37674. // ""
  37675. // ],
  37676. // "location": "query",
  37677. // "type": "string"
  37678. // },
  37679. // "sortOrder": {
  37680. // "default": "ASCENDING",
  37681. // "description": "Order of sorted results.",
  37682. // "enum": [
  37683. // "ASCENDING",
  37684. // "DESCENDING"
  37685. // ],
  37686. // "enumDescriptions": [
  37687. // "",
  37688. // ""
  37689. // ],
  37690. // "location": "query",
  37691. // "type": "string"
  37692. // }
  37693. // },
  37694. // "path": "userprofiles/{profileId}/projects",
  37695. // "response": {
  37696. // "$ref": "ProjectsListResponse"
  37697. // },
  37698. // "scopes": [
  37699. // "https://www.googleapis.com/auth/dfatrafficking"
  37700. // ]
  37701. // }
  37702. }
  37703. // Pages invokes f for each page of results.
  37704. // A non-nil error returned from f will halt the iteration.
  37705. // The provided context supersedes any context provided to the Context method.
  37706. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  37707. c.ctx_ = ctx
  37708. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37709. for {
  37710. x, err := c.Do()
  37711. if err != nil {
  37712. return err
  37713. }
  37714. if err := f(x); err != nil {
  37715. return err
  37716. }
  37717. if x.NextPageToken == "" {
  37718. return nil
  37719. }
  37720. c.PageToken(x.NextPageToken)
  37721. }
  37722. }
  37723. // method id "dfareporting.regions.list":
  37724. type RegionsListCall struct {
  37725. s *Service
  37726. profileId int64
  37727. urlParams_ gensupport.URLParams
  37728. ifNoneMatch_ string
  37729. ctx_ context.Context
  37730. header_ http.Header
  37731. }
  37732. // List: Retrieves a list of regions.
  37733. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  37734. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37735. c.profileId = profileId
  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 *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  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 *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  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 *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  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 *RegionsListCall) Header() http.Header {
  37764. if c.header_ == nil {
  37765. c.header_ = make(http.Header)
  37766. }
  37767. return c.header_
  37768. }
  37769. func (c *RegionsListCall) 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}/regions")
  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.regions.list" call.
  37790. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  37791. // non-2xx status code is an error. Response headers are in either
  37792. // *RegionsListResponse.ServerResponse.Header or (if a response was
  37793. // 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 *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, 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 := &RegionsListResponse{
  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 regions.",
  37828. // "httpMethod": "GET",
  37829. // "id": "dfareporting.regions.list",
  37830. // "parameterOrder": [
  37831. // "profileId"
  37832. // ],
  37833. // "parameters": {
  37834. // "profileId": {
  37835. // "description": "User profile ID associated with this request.",
  37836. // "format": "int64",
  37837. // "location": "path",
  37838. // "required": true,
  37839. // "type": "string"
  37840. // }
  37841. // },
  37842. // "path": "userprofiles/{profileId}/regions",
  37843. // "response": {
  37844. // "$ref": "RegionsListResponse"
  37845. // },
  37846. // "scopes": [
  37847. // "https://www.googleapis.com/auth/dfatrafficking"
  37848. // ]
  37849. // }
  37850. }
  37851. // method id "dfareporting.remarketingListShares.get":
  37852. type RemarketingListSharesGetCall struct {
  37853. s *Service
  37854. profileId int64
  37855. remarketingListId int64
  37856. urlParams_ gensupport.URLParams
  37857. ifNoneMatch_ string
  37858. ctx_ context.Context
  37859. header_ http.Header
  37860. }
  37861. // Get: Gets one remarketing list share by remarketing list ID.
  37862. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  37863. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37864. c.profileId = profileId
  37865. c.remarketingListId = remarketingListId
  37866. return c
  37867. }
  37868. // Fields allows partial responses to be retrieved. See
  37869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37870. // for more information.
  37871. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  37872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37873. return c
  37874. }
  37875. // IfNoneMatch sets the optional parameter which makes the operation
  37876. // fail if the object's ETag matches the given value. This is useful for
  37877. // getting updates only after the object has changed since the last
  37878. // request. Use googleapi.IsNotModified to check whether the response
  37879. // error from Do is the result of In-None-Match.
  37880. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  37881. c.ifNoneMatch_ = entityTag
  37882. return c
  37883. }
  37884. // Context sets the context to be used in this call's Do method. Any
  37885. // pending HTTP request will be aborted if the provided context is
  37886. // canceled.
  37887. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  37888. c.ctx_ = ctx
  37889. return c
  37890. }
  37891. // Header returns an http.Header that can be modified by the caller to
  37892. // add HTTP headers to the request.
  37893. func (c *RemarketingListSharesGetCall) Header() http.Header {
  37894. if c.header_ == nil {
  37895. c.header_ = make(http.Header)
  37896. }
  37897. return c.header_
  37898. }
  37899. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  37900. reqHeaders := make(http.Header)
  37901. for k, v := range c.header_ {
  37902. reqHeaders[k] = v
  37903. }
  37904. reqHeaders.Set("User-Agent", c.s.userAgent())
  37905. if c.ifNoneMatch_ != "" {
  37906. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37907. }
  37908. var body io.Reader = nil
  37909. c.urlParams_.Set("alt", alt)
  37910. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  37911. urls += "?" + c.urlParams_.Encode()
  37912. req, _ := http.NewRequest("GET", urls, body)
  37913. req.Header = reqHeaders
  37914. googleapi.Expand(req.URL, map[string]string{
  37915. "profileId": strconv.FormatInt(c.profileId, 10),
  37916. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  37917. })
  37918. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37919. }
  37920. // Do executes the "dfareporting.remarketingListShares.get" call.
  37921. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37922. // non-2xx status code is an error. Response headers are in either
  37923. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37924. // returned at all) in error.(*googleapi.Error).Header. Use
  37925. // googleapi.IsNotModified to check whether the returned error was
  37926. // because http.StatusNotModified was returned.
  37927. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37928. gensupport.SetOptions(c.urlParams_, opts...)
  37929. res, err := c.doRequest("json")
  37930. if res != nil && res.StatusCode == http.StatusNotModified {
  37931. if res.Body != nil {
  37932. res.Body.Close()
  37933. }
  37934. return nil, &googleapi.Error{
  37935. Code: res.StatusCode,
  37936. Header: res.Header,
  37937. }
  37938. }
  37939. if err != nil {
  37940. return nil, err
  37941. }
  37942. defer googleapi.CloseBody(res)
  37943. if err := googleapi.CheckResponse(res); err != nil {
  37944. return nil, err
  37945. }
  37946. ret := &RemarketingListShare{
  37947. ServerResponse: googleapi.ServerResponse{
  37948. Header: res.Header,
  37949. HTTPStatusCode: res.StatusCode,
  37950. },
  37951. }
  37952. target := &ret
  37953. if err := gensupport.DecodeResponse(target, res); err != nil {
  37954. return nil, err
  37955. }
  37956. return ret, nil
  37957. // {
  37958. // "description": "Gets one remarketing list share by remarketing list ID.",
  37959. // "httpMethod": "GET",
  37960. // "id": "dfareporting.remarketingListShares.get",
  37961. // "parameterOrder": [
  37962. // "profileId",
  37963. // "remarketingListId"
  37964. // ],
  37965. // "parameters": {
  37966. // "profileId": {
  37967. // "description": "User profile ID associated with this request.",
  37968. // "format": "int64",
  37969. // "location": "path",
  37970. // "required": true,
  37971. // "type": "string"
  37972. // },
  37973. // "remarketingListId": {
  37974. // "description": "Remarketing list ID.",
  37975. // "format": "int64",
  37976. // "location": "path",
  37977. // "required": true,
  37978. // "type": "string"
  37979. // }
  37980. // },
  37981. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  37982. // "response": {
  37983. // "$ref": "RemarketingListShare"
  37984. // },
  37985. // "scopes": [
  37986. // "https://www.googleapis.com/auth/dfatrafficking"
  37987. // ]
  37988. // }
  37989. }
  37990. // method id "dfareporting.remarketingListShares.patch":
  37991. type RemarketingListSharesPatchCall struct {
  37992. s *Service
  37993. profileId int64
  37994. remarketinglistshare *RemarketingListShare
  37995. urlParams_ gensupport.URLParams
  37996. ctx_ context.Context
  37997. header_ http.Header
  37998. }
  37999. // Patch: Updates an existing remarketing list share. This method
  38000. // supports patch semantics.
  38001. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  38002. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38003. c.profileId = profileId
  38004. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  38005. c.remarketinglistshare = remarketinglistshare
  38006. return c
  38007. }
  38008. // Fields allows partial responses to be retrieved. See
  38009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38010. // for more information.
  38011. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  38012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38013. return c
  38014. }
  38015. // Context sets the context to be used in this call's Do method. Any
  38016. // pending HTTP request will be aborted if the provided context is
  38017. // canceled.
  38018. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  38019. c.ctx_ = ctx
  38020. return c
  38021. }
  38022. // Header returns an http.Header that can be modified by the caller to
  38023. // add HTTP headers to the request.
  38024. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  38025. if c.header_ == nil {
  38026. c.header_ = make(http.Header)
  38027. }
  38028. return c.header_
  38029. }
  38030. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  38031. reqHeaders := make(http.Header)
  38032. for k, v := range c.header_ {
  38033. reqHeaders[k] = v
  38034. }
  38035. reqHeaders.Set("User-Agent", c.s.userAgent())
  38036. var body io.Reader = nil
  38037. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38038. if err != nil {
  38039. return nil, err
  38040. }
  38041. reqHeaders.Set("Content-Type", "application/json")
  38042. c.urlParams_.Set("alt", alt)
  38043. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38044. urls += "?" + c.urlParams_.Encode()
  38045. req, _ := http.NewRequest("PATCH", urls, body)
  38046. req.Header = reqHeaders
  38047. googleapi.Expand(req.URL, map[string]string{
  38048. "profileId": strconv.FormatInt(c.profileId, 10),
  38049. })
  38050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38051. }
  38052. // Do executes the "dfareporting.remarketingListShares.patch" call.
  38053. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38054. // non-2xx status code is an error. Response headers are in either
  38055. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38056. // returned at all) in error.(*googleapi.Error).Header. Use
  38057. // googleapi.IsNotModified to check whether the returned error was
  38058. // because http.StatusNotModified was returned.
  38059. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38060. gensupport.SetOptions(c.urlParams_, opts...)
  38061. res, err := c.doRequest("json")
  38062. if res != nil && res.StatusCode == http.StatusNotModified {
  38063. if res.Body != nil {
  38064. res.Body.Close()
  38065. }
  38066. return nil, &googleapi.Error{
  38067. Code: res.StatusCode,
  38068. Header: res.Header,
  38069. }
  38070. }
  38071. if err != nil {
  38072. return nil, err
  38073. }
  38074. defer googleapi.CloseBody(res)
  38075. if err := googleapi.CheckResponse(res); err != nil {
  38076. return nil, err
  38077. }
  38078. ret := &RemarketingListShare{
  38079. ServerResponse: googleapi.ServerResponse{
  38080. Header: res.Header,
  38081. HTTPStatusCode: res.StatusCode,
  38082. },
  38083. }
  38084. target := &ret
  38085. if err := gensupport.DecodeResponse(target, res); err != nil {
  38086. return nil, err
  38087. }
  38088. return ret, nil
  38089. // {
  38090. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  38091. // "httpMethod": "PATCH",
  38092. // "id": "dfareporting.remarketingListShares.patch",
  38093. // "parameterOrder": [
  38094. // "profileId",
  38095. // "remarketingListId"
  38096. // ],
  38097. // "parameters": {
  38098. // "profileId": {
  38099. // "description": "User profile ID associated with this request.",
  38100. // "format": "int64",
  38101. // "location": "path",
  38102. // "required": true,
  38103. // "type": "string"
  38104. // },
  38105. // "remarketingListId": {
  38106. // "description": "Remarketing list ID.",
  38107. // "format": "int64",
  38108. // "location": "query",
  38109. // "required": true,
  38110. // "type": "string"
  38111. // }
  38112. // },
  38113. // "path": "userprofiles/{profileId}/remarketingListShares",
  38114. // "request": {
  38115. // "$ref": "RemarketingListShare"
  38116. // },
  38117. // "response": {
  38118. // "$ref": "RemarketingListShare"
  38119. // },
  38120. // "scopes": [
  38121. // "https://www.googleapis.com/auth/dfatrafficking"
  38122. // ]
  38123. // }
  38124. }
  38125. // method id "dfareporting.remarketingListShares.update":
  38126. type RemarketingListSharesUpdateCall struct {
  38127. s *Service
  38128. profileId int64
  38129. remarketinglistshare *RemarketingListShare
  38130. urlParams_ gensupport.URLParams
  38131. ctx_ context.Context
  38132. header_ http.Header
  38133. }
  38134. // Update: Updates an existing remarketing list share.
  38135. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  38136. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38137. c.profileId = profileId
  38138. c.remarketinglistshare = remarketinglistshare
  38139. return c
  38140. }
  38141. // Fields allows partial responses to be retrieved. See
  38142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38143. // for more information.
  38144. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  38145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38146. return c
  38147. }
  38148. // Context sets the context to be used in this call's Do method. Any
  38149. // pending HTTP request will be aborted if the provided context is
  38150. // canceled.
  38151. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  38152. c.ctx_ = ctx
  38153. return c
  38154. }
  38155. // Header returns an http.Header that can be modified by the caller to
  38156. // add HTTP headers to the request.
  38157. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  38158. if c.header_ == nil {
  38159. c.header_ = make(http.Header)
  38160. }
  38161. return c.header_
  38162. }
  38163. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  38164. reqHeaders := make(http.Header)
  38165. for k, v := range c.header_ {
  38166. reqHeaders[k] = v
  38167. }
  38168. reqHeaders.Set("User-Agent", c.s.userAgent())
  38169. var body io.Reader = nil
  38170. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38171. if err != nil {
  38172. return nil, err
  38173. }
  38174. reqHeaders.Set("Content-Type", "application/json")
  38175. c.urlParams_.Set("alt", alt)
  38176. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38177. urls += "?" + c.urlParams_.Encode()
  38178. req, _ := http.NewRequest("PUT", urls, body)
  38179. req.Header = reqHeaders
  38180. googleapi.Expand(req.URL, map[string]string{
  38181. "profileId": strconv.FormatInt(c.profileId, 10),
  38182. })
  38183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38184. }
  38185. // Do executes the "dfareporting.remarketingListShares.update" call.
  38186. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38187. // non-2xx status code is an error. Response headers are in either
  38188. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38189. // returned at all) in error.(*googleapi.Error).Header. Use
  38190. // googleapi.IsNotModified to check whether the returned error was
  38191. // because http.StatusNotModified was returned.
  38192. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38193. gensupport.SetOptions(c.urlParams_, opts...)
  38194. res, err := c.doRequest("json")
  38195. if res != nil && res.StatusCode == http.StatusNotModified {
  38196. if res.Body != nil {
  38197. res.Body.Close()
  38198. }
  38199. return nil, &googleapi.Error{
  38200. Code: res.StatusCode,
  38201. Header: res.Header,
  38202. }
  38203. }
  38204. if err != nil {
  38205. return nil, err
  38206. }
  38207. defer googleapi.CloseBody(res)
  38208. if err := googleapi.CheckResponse(res); err != nil {
  38209. return nil, err
  38210. }
  38211. ret := &RemarketingListShare{
  38212. ServerResponse: googleapi.ServerResponse{
  38213. Header: res.Header,
  38214. HTTPStatusCode: res.StatusCode,
  38215. },
  38216. }
  38217. target := &ret
  38218. if err := gensupport.DecodeResponse(target, res); err != nil {
  38219. return nil, err
  38220. }
  38221. return ret, nil
  38222. // {
  38223. // "description": "Updates an existing remarketing list share.",
  38224. // "httpMethod": "PUT",
  38225. // "id": "dfareporting.remarketingListShares.update",
  38226. // "parameterOrder": [
  38227. // "profileId"
  38228. // ],
  38229. // "parameters": {
  38230. // "profileId": {
  38231. // "description": "User profile ID associated with this request.",
  38232. // "format": "int64",
  38233. // "location": "path",
  38234. // "required": true,
  38235. // "type": "string"
  38236. // }
  38237. // },
  38238. // "path": "userprofiles/{profileId}/remarketingListShares",
  38239. // "request": {
  38240. // "$ref": "RemarketingListShare"
  38241. // },
  38242. // "response": {
  38243. // "$ref": "RemarketingListShare"
  38244. // },
  38245. // "scopes": [
  38246. // "https://www.googleapis.com/auth/dfatrafficking"
  38247. // ]
  38248. // }
  38249. }
  38250. // method id "dfareporting.remarketingLists.get":
  38251. type RemarketingListsGetCall struct {
  38252. s *Service
  38253. profileId int64
  38254. id int64
  38255. urlParams_ gensupport.URLParams
  38256. ifNoneMatch_ string
  38257. ctx_ context.Context
  38258. header_ http.Header
  38259. }
  38260. // Get: Gets one remarketing list by ID.
  38261. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  38262. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38263. c.profileId = profileId
  38264. c.id = id
  38265. return c
  38266. }
  38267. // Fields allows partial responses to be retrieved. See
  38268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38269. // for more information.
  38270. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  38271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38272. return c
  38273. }
  38274. // IfNoneMatch sets the optional parameter which makes the operation
  38275. // fail if the object's ETag matches the given value. This is useful for
  38276. // getting updates only after the object has changed since the last
  38277. // request. Use googleapi.IsNotModified to check whether the response
  38278. // error from Do is the result of In-None-Match.
  38279. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  38280. c.ifNoneMatch_ = entityTag
  38281. return c
  38282. }
  38283. // Context sets the context to be used in this call's Do method. Any
  38284. // pending HTTP request will be aborted if the provided context is
  38285. // canceled.
  38286. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  38287. c.ctx_ = ctx
  38288. return c
  38289. }
  38290. // Header returns an http.Header that can be modified by the caller to
  38291. // add HTTP headers to the request.
  38292. func (c *RemarketingListsGetCall) Header() http.Header {
  38293. if c.header_ == nil {
  38294. c.header_ = make(http.Header)
  38295. }
  38296. return c.header_
  38297. }
  38298. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  38299. reqHeaders := make(http.Header)
  38300. for k, v := range c.header_ {
  38301. reqHeaders[k] = v
  38302. }
  38303. reqHeaders.Set("User-Agent", c.s.userAgent())
  38304. if c.ifNoneMatch_ != "" {
  38305. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38306. }
  38307. var body io.Reader = nil
  38308. c.urlParams_.Set("alt", alt)
  38309. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  38310. urls += "?" + c.urlParams_.Encode()
  38311. req, _ := http.NewRequest("GET", urls, body)
  38312. req.Header = reqHeaders
  38313. googleapi.Expand(req.URL, map[string]string{
  38314. "profileId": strconv.FormatInt(c.profileId, 10),
  38315. "id": strconv.FormatInt(c.id, 10),
  38316. })
  38317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38318. }
  38319. // Do executes the "dfareporting.remarketingLists.get" call.
  38320. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38321. // status code is an error. Response headers are in either
  38322. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38323. // at all) in error.(*googleapi.Error).Header. Use
  38324. // googleapi.IsNotModified to check whether the returned error was
  38325. // because http.StatusNotModified was returned.
  38326. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38327. gensupport.SetOptions(c.urlParams_, opts...)
  38328. res, err := c.doRequest("json")
  38329. if res != nil && res.StatusCode == http.StatusNotModified {
  38330. if res.Body != nil {
  38331. res.Body.Close()
  38332. }
  38333. return nil, &googleapi.Error{
  38334. Code: res.StatusCode,
  38335. Header: res.Header,
  38336. }
  38337. }
  38338. if err != nil {
  38339. return nil, err
  38340. }
  38341. defer googleapi.CloseBody(res)
  38342. if err := googleapi.CheckResponse(res); err != nil {
  38343. return nil, err
  38344. }
  38345. ret := &RemarketingList{
  38346. ServerResponse: googleapi.ServerResponse{
  38347. Header: res.Header,
  38348. HTTPStatusCode: res.StatusCode,
  38349. },
  38350. }
  38351. target := &ret
  38352. if err := gensupport.DecodeResponse(target, res); err != nil {
  38353. return nil, err
  38354. }
  38355. return ret, nil
  38356. // {
  38357. // "description": "Gets one remarketing list by ID.",
  38358. // "httpMethod": "GET",
  38359. // "id": "dfareporting.remarketingLists.get",
  38360. // "parameterOrder": [
  38361. // "profileId",
  38362. // "id"
  38363. // ],
  38364. // "parameters": {
  38365. // "id": {
  38366. // "description": "Remarketing list ID.",
  38367. // "format": "int64",
  38368. // "location": "path",
  38369. // "required": true,
  38370. // "type": "string"
  38371. // },
  38372. // "profileId": {
  38373. // "description": "User profile ID associated with this request.",
  38374. // "format": "int64",
  38375. // "location": "path",
  38376. // "required": true,
  38377. // "type": "string"
  38378. // }
  38379. // },
  38380. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  38381. // "response": {
  38382. // "$ref": "RemarketingList"
  38383. // },
  38384. // "scopes": [
  38385. // "https://www.googleapis.com/auth/dfatrafficking"
  38386. // ]
  38387. // }
  38388. }
  38389. // method id "dfareporting.remarketingLists.insert":
  38390. type RemarketingListsInsertCall struct {
  38391. s *Service
  38392. profileId int64
  38393. remarketinglist *RemarketingList
  38394. urlParams_ gensupport.URLParams
  38395. ctx_ context.Context
  38396. header_ http.Header
  38397. }
  38398. // Insert: Inserts a new remarketing list.
  38399. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  38400. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38401. c.profileId = profileId
  38402. c.remarketinglist = remarketinglist
  38403. return c
  38404. }
  38405. // Fields allows partial responses to be retrieved. See
  38406. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38407. // for more information.
  38408. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  38409. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38410. return c
  38411. }
  38412. // Context sets the context to be used in this call's Do method. Any
  38413. // pending HTTP request will be aborted if the provided context is
  38414. // canceled.
  38415. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  38416. c.ctx_ = ctx
  38417. return c
  38418. }
  38419. // Header returns an http.Header that can be modified by the caller to
  38420. // add HTTP headers to the request.
  38421. func (c *RemarketingListsInsertCall) Header() http.Header {
  38422. if c.header_ == nil {
  38423. c.header_ = make(http.Header)
  38424. }
  38425. return c.header_
  38426. }
  38427. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  38428. reqHeaders := make(http.Header)
  38429. for k, v := range c.header_ {
  38430. reqHeaders[k] = v
  38431. }
  38432. reqHeaders.Set("User-Agent", c.s.userAgent())
  38433. var body io.Reader = nil
  38434. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38435. if err != nil {
  38436. return nil, err
  38437. }
  38438. reqHeaders.Set("Content-Type", "application/json")
  38439. c.urlParams_.Set("alt", alt)
  38440. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38441. urls += "?" + c.urlParams_.Encode()
  38442. req, _ := http.NewRequest("POST", urls, body)
  38443. req.Header = reqHeaders
  38444. googleapi.Expand(req.URL, map[string]string{
  38445. "profileId": strconv.FormatInt(c.profileId, 10),
  38446. })
  38447. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38448. }
  38449. // Do executes the "dfareporting.remarketingLists.insert" call.
  38450. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38451. // status code is an error. Response headers are in either
  38452. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38453. // at all) in error.(*googleapi.Error).Header. Use
  38454. // googleapi.IsNotModified to check whether the returned error was
  38455. // because http.StatusNotModified was returned.
  38456. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38457. gensupport.SetOptions(c.urlParams_, opts...)
  38458. res, err := c.doRequest("json")
  38459. if res != nil && res.StatusCode == http.StatusNotModified {
  38460. if res.Body != nil {
  38461. res.Body.Close()
  38462. }
  38463. return nil, &googleapi.Error{
  38464. Code: res.StatusCode,
  38465. Header: res.Header,
  38466. }
  38467. }
  38468. if err != nil {
  38469. return nil, err
  38470. }
  38471. defer googleapi.CloseBody(res)
  38472. if err := googleapi.CheckResponse(res); err != nil {
  38473. return nil, err
  38474. }
  38475. ret := &RemarketingList{
  38476. ServerResponse: googleapi.ServerResponse{
  38477. Header: res.Header,
  38478. HTTPStatusCode: res.StatusCode,
  38479. },
  38480. }
  38481. target := &ret
  38482. if err := gensupport.DecodeResponse(target, res); err != nil {
  38483. return nil, err
  38484. }
  38485. return ret, nil
  38486. // {
  38487. // "description": "Inserts a new remarketing list.",
  38488. // "httpMethod": "POST",
  38489. // "id": "dfareporting.remarketingLists.insert",
  38490. // "parameterOrder": [
  38491. // "profileId"
  38492. // ],
  38493. // "parameters": {
  38494. // "profileId": {
  38495. // "description": "User profile ID associated with this request.",
  38496. // "format": "int64",
  38497. // "location": "path",
  38498. // "required": true,
  38499. // "type": "string"
  38500. // }
  38501. // },
  38502. // "path": "userprofiles/{profileId}/remarketingLists",
  38503. // "request": {
  38504. // "$ref": "RemarketingList"
  38505. // },
  38506. // "response": {
  38507. // "$ref": "RemarketingList"
  38508. // },
  38509. // "scopes": [
  38510. // "https://www.googleapis.com/auth/dfatrafficking"
  38511. // ]
  38512. // }
  38513. }
  38514. // method id "dfareporting.remarketingLists.list":
  38515. type RemarketingListsListCall struct {
  38516. s *Service
  38517. profileId int64
  38518. urlParams_ gensupport.URLParams
  38519. ifNoneMatch_ string
  38520. ctx_ context.Context
  38521. header_ http.Header
  38522. }
  38523. // List: Retrieves a list of remarketing lists, possibly filtered. This
  38524. // method supports paging.
  38525. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  38526. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38527. c.profileId = profileId
  38528. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  38529. return c
  38530. }
  38531. // Active sets the optional parameter "active": Select only active or
  38532. // only inactive remarketing lists.
  38533. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  38534. c.urlParams_.Set("active", fmt.Sprint(active))
  38535. return c
  38536. }
  38537. // FloodlightActivityId sets the optional parameter
  38538. // "floodlightActivityId": Select only remarketing lists that have this
  38539. // floodlight activity ID.
  38540. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  38541. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  38542. return c
  38543. }
  38544. // MaxResults sets the optional parameter "maxResults": Maximum number
  38545. // of results to return.
  38546. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  38547. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38548. return c
  38549. }
  38550. // Name sets the optional parameter "name": Allows searching for objects
  38551. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  38552. // list*2015" will return objects with names like "remarketing list June
  38553. // 2015", "remarketing list April 2015", or simply "remarketing list
  38554. // 2015". Most of the searches also add wildcards implicitly at the
  38555. // start and the end of the search string. For example, a search string
  38556. // of "remarketing list" will match objects with name "my remarketing
  38557. // list", "remarketing list 2015", or simply "remarketing list".
  38558. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  38559. c.urlParams_.Set("name", name)
  38560. return c
  38561. }
  38562. // PageToken sets the optional parameter "pageToken": Value of the
  38563. // nextPageToken from the previous result page.
  38564. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  38565. c.urlParams_.Set("pageToken", pageToken)
  38566. return c
  38567. }
  38568. // SortField sets the optional parameter "sortField": Field by which to
  38569. // sort the list.
  38570. //
  38571. // Possible values:
  38572. // "ID" (default)
  38573. // "NAME"
  38574. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  38575. c.urlParams_.Set("sortField", sortField)
  38576. return c
  38577. }
  38578. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38579. // results.
  38580. //
  38581. // Possible values:
  38582. // "ASCENDING" (default)
  38583. // "DESCENDING"
  38584. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  38585. c.urlParams_.Set("sortOrder", sortOrder)
  38586. return c
  38587. }
  38588. // Fields allows partial responses to be retrieved. See
  38589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38590. // for more information.
  38591. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  38592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38593. return c
  38594. }
  38595. // IfNoneMatch sets the optional parameter which makes the operation
  38596. // fail if the object's ETag matches the given value. This is useful for
  38597. // getting updates only after the object has changed since the last
  38598. // request. Use googleapi.IsNotModified to check whether the response
  38599. // error from Do is the result of In-None-Match.
  38600. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  38601. c.ifNoneMatch_ = entityTag
  38602. return c
  38603. }
  38604. // Context sets the context to be used in this call's Do method. Any
  38605. // pending HTTP request will be aborted if the provided context is
  38606. // canceled.
  38607. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  38608. c.ctx_ = ctx
  38609. return c
  38610. }
  38611. // Header returns an http.Header that can be modified by the caller to
  38612. // add HTTP headers to the request.
  38613. func (c *RemarketingListsListCall) Header() http.Header {
  38614. if c.header_ == nil {
  38615. c.header_ = make(http.Header)
  38616. }
  38617. return c.header_
  38618. }
  38619. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  38620. reqHeaders := make(http.Header)
  38621. for k, v := range c.header_ {
  38622. reqHeaders[k] = v
  38623. }
  38624. reqHeaders.Set("User-Agent", c.s.userAgent())
  38625. if c.ifNoneMatch_ != "" {
  38626. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38627. }
  38628. var body io.Reader = nil
  38629. c.urlParams_.Set("alt", alt)
  38630. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38631. urls += "?" + c.urlParams_.Encode()
  38632. req, _ := http.NewRequest("GET", urls, body)
  38633. req.Header = reqHeaders
  38634. googleapi.Expand(req.URL, map[string]string{
  38635. "profileId": strconv.FormatInt(c.profileId, 10),
  38636. })
  38637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38638. }
  38639. // Do executes the "dfareporting.remarketingLists.list" call.
  38640. // Exactly one of *RemarketingListsListResponse or error will be
  38641. // non-nil. Any non-2xx status code is an error. Response headers are in
  38642. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  38643. // response was returned at all) in error.(*googleapi.Error).Header. Use
  38644. // googleapi.IsNotModified to check whether the returned error was
  38645. // because http.StatusNotModified was returned.
  38646. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  38647. gensupport.SetOptions(c.urlParams_, opts...)
  38648. res, err := c.doRequest("json")
  38649. if res != nil && res.StatusCode == http.StatusNotModified {
  38650. if res.Body != nil {
  38651. res.Body.Close()
  38652. }
  38653. return nil, &googleapi.Error{
  38654. Code: res.StatusCode,
  38655. Header: res.Header,
  38656. }
  38657. }
  38658. if err != nil {
  38659. return nil, err
  38660. }
  38661. defer googleapi.CloseBody(res)
  38662. if err := googleapi.CheckResponse(res); err != nil {
  38663. return nil, err
  38664. }
  38665. ret := &RemarketingListsListResponse{
  38666. ServerResponse: googleapi.ServerResponse{
  38667. Header: res.Header,
  38668. HTTPStatusCode: res.StatusCode,
  38669. },
  38670. }
  38671. target := &ret
  38672. if err := gensupport.DecodeResponse(target, res); err != nil {
  38673. return nil, err
  38674. }
  38675. return ret, nil
  38676. // {
  38677. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  38678. // "httpMethod": "GET",
  38679. // "id": "dfareporting.remarketingLists.list",
  38680. // "parameterOrder": [
  38681. // "profileId",
  38682. // "advertiserId"
  38683. // ],
  38684. // "parameters": {
  38685. // "active": {
  38686. // "description": "Select only active or only inactive remarketing lists.",
  38687. // "location": "query",
  38688. // "type": "boolean"
  38689. // },
  38690. // "advertiserId": {
  38691. // "description": "Select only remarketing lists owned by this advertiser.",
  38692. // "format": "int64",
  38693. // "location": "query",
  38694. // "required": true,
  38695. // "type": "string"
  38696. // },
  38697. // "floodlightActivityId": {
  38698. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  38699. // "format": "int64",
  38700. // "location": "query",
  38701. // "type": "string"
  38702. // },
  38703. // "maxResults": {
  38704. // "default": "1000",
  38705. // "description": "Maximum number of results to return.",
  38706. // "format": "int32",
  38707. // "location": "query",
  38708. // "maximum": "1000",
  38709. // "minimum": "0",
  38710. // "type": "integer"
  38711. // },
  38712. // "name": {
  38713. // "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\".",
  38714. // "location": "query",
  38715. // "type": "string"
  38716. // },
  38717. // "pageToken": {
  38718. // "description": "Value of the nextPageToken from the previous result page.",
  38719. // "location": "query",
  38720. // "type": "string"
  38721. // },
  38722. // "profileId": {
  38723. // "description": "User profile ID associated with this request.",
  38724. // "format": "int64",
  38725. // "location": "path",
  38726. // "required": true,
  38727. // "type": "string"
  38728. // },
  38729. // "sortField": {
  38730. // "default": "ID",
  38731. // "description": "Field by which to sort the list.",
  38732. // "enum": [
  38733. // "ID",
  38734. // "NAME"
  38735. // ],
  38736. // "enumDescriptions": [
  38737. // "",
  38738. // ""
  38739. // ],
  38740. // "location": "query",
  38741. // "type": "string"
  38742. // },
  38743. // "sortOrder": {
  38744. // "default": "ASCENDING",
  38745. // "description": "Order of sorted results.",
  38746. // "enum": [
  38747. // "ASCENDING",
  38748. // "DESCENDING"
  38749. // ],
  38750. // "enumDescriptions": [
  38751. // "",
  38752. // ""
  38753. // ],
  38754. // "location": "query",
  38755. // "type": "string"
  38756. // }
  38757. // },
  38758. // "path": "userprofiles/{profileId}/remarketingLists",
  38759. // "response": {
  38760. // "$ref": "RemarketingListsListResponse"
  38761. // },
  38762. // "scopes": [
  38763. // "https://www.googleapis.com/auth/dfatrafficking"
  38764. // ]
  38765. // }
  38766. }
  38767. // Pages invokes f for each page of results.
  38768. // A non-nil error returned from f will halt the iteration.
  38769. // The provided context supersedes any context provided to the Context method.
  38770. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  38771. c.ctx_ = ctx
  38772. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38773. for {
  38774. x, err := c.Do()
  38775. if err != nil {
  38776. return err
  38777. }
  38778. if err := f(x); err != nil {
  38779. return err
  38780. }
  38781. if x.NextPageToken == "" {
  38782. return nil
  38783. }
  38784. c.PageToken(x.NextPageToken)
  38785. }
  38786. }
  38787. // method id "dfareporting.remarketingLists.patch":
  38788. type RemarketingListsPatchCall struct {
  38789. s *Service
  38790. profileId int64
  38791. remarketinglist *RemarketingList
  38792. urlParams_ gensupport.URLParams
  38793. ctx_ context.Context
  38794. header_ http.Header
  38795. }
  38796. // Patch: Updates an existing remarketing list. This method supports
  38797. // patch semantics.
  38798. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  38799. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38800. c.profileId = profileId
  38801. c.urlParams_.Set("id", fmt.Sprint(id))
  38802. c.remarketinglist = remarketinglist
  38803. return c
  38804. }
  38805. // Fields allows partial responses to be retrieved. See
  38806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38807. // for more information.
  38808. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  38809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38810. return c
  38811. }
  38812. // Context sets the context to be used in this call's Do method. Any
  38813. // pending HTTP request will be aborted if the provided context is
  38814. // canceled.
  38815. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  38816. c.ctx_ = ctx
  38817. return c
  38818. }
  38819. // Header returns an http.Header that can be modified by the caller to
  38820. // add HTTP headers to the request.
  38821. func (c *RemarketingListsPatchCall) Header() http.Header {
  38822. if c.header_ == nil {
  38823. c.header_ = make(http.Header)
  38824. }
  38825. return c.header_
  38826. }
  38827. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  38828. reqHeaders := make(http.Header)
  38829. for k, v := range c.header_ {
  38830. reqHeaders[k] = v
  38831. }
  38832. reqHeaders.Set("User-Agent", c.s.userAgent())
  38833. var body io.Reader = nil
  38834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38835. if err != nil {
  38836. return nil, err
  38837. }
  38838. reqHeaders.Set("Content-Type", "application/json")
  38839. c.urlParams_.Set("alt", alt)
  38840. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38841. urls += "?" + c.urlParams_.Encode()
  38842. req, _ := http.NewRequest("PATCH", urls, body)
  38843. req.Header = reqHeaders
  38844. googleapi.Expand(req.URL, map[string]string{
  38845. "profileId": strconv.FormatInt(c.profileId, 10),
  38846. })
  38847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38848. }
  38849. // Do executes the "dfareporting.remarketingLists.patch" call.
  38850. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38851. // status code is an error. Response headers are in either
  38852. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38853. // at all) in error.(*googleapi.Error).Header. Use
  38854. // googleapi.IsNotModified to check whether the returned error was
  38855. // because http.StatusNotModified was returned.
  38856. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38857. gensupport.SetOptions(c.urlParams_, opts...)
  38858. res, err := c.doRequest("json")
  38859. if res != nil && res.StatusCode == http.StatusNotModified {
  38860. if res.Body != nil {
  38861. res.Body.Close()
  38862. }
  38863. return nil, &googleapi.Error{
  38864. Code: res.StatusCode,
  38865. Header: res.Header,
  38866. }
  38867. }
  38868. if err != nil {
  38869. return nil, err
  38870. }
  38871. defer googleapi.CloseBody(res)
  38872. if err := googleapi.CheckResponse(res); err != nil {
  38873. return nil, err
  38874. }
  38875. ret := &RemarketingList{
  38876. ServerResponse: googleapi.ServerResponse{
  38877. Header: res.Header,
  38878. HTTPStatusCode: res.StatusCode,
  38879. },
  38880. }
  38881. target := &ret
  38882. if err := gensupport.DecodeResponse(target, res); err != nil {
  38883. return nil, err
  38884. }
  38885. return ret, nil
  38886. // {
  38887. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  38888. // "httpMethod": "PATCH",
  38889. // "id": "dfareporting.remarketingLists.patch",
  38890. // "parameterOrder": [
  38891. // "profileId",
  38892. // "id"
  38893. // ],
  38894. // "parameters": {
  38895. // "id": {
  38896. // "description": "Remarketing list ID.",
  38897. // "format": "int64",
  38898. // "location": "query",
  38899. // "required": true,
  38900. // "type": "string"
  38901. // },
  38902. // "profileId": {
  38903. // "description": "User profile ID associated with this request.",
  38904. // "format": "int64",
  38905. // "location": "path",
  38906. // "required": true,
  38907. // "type": "string"
  38908. // }
  38909. // },
  38910. // "path": "userprofiles/{profileId}/remarketingLists",
  38911. // "request": {
  38912. // "$ref": "RemarketingList"
  38913. // },
  38914. // "response": {
  38915. // "$ref": "RemarketingList"
  38916. // },
  38917. // "scopes": [
  38918. // "https://www.googleapis.com/auth/dfatrafficking"
  38919. // ]
  38920. // }
  38921. }
  38922. // method id "dfareporting.remarketingLists.update":
  38923. type RemarketingListsUpdateCall struct {
  38924. s *Service
  38925. profileId int64
  38926. remarketinglist *RemarketingList
  38927. urlParams_ gensupport.URLParams
  38928. ctx_ context.Context
  38929. header_ http.Header
  38930. }
  38931. // Update: Updates an existing remarketing list.
  38932. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  38933. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38934. c.profileId = profileId
  38935. c.remarketinglist = remarketinglist
  38936. return c
  38937. }
  38938. // Fields allows partial responses to be retrieved. See
  38939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38940. // for more information.
  38941. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  38942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38943. return c
  38944. }
  38945. // Context sets the context to be used in this call's Do method. Any
  38946. // pending HTTP request will be aborted if the provided context is
  38947. // canceled.
  38948. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  38949. c.ctx_ = ctx
  38950. return c
  38951. }
  38952. // Header returns an http.Header that can be modified by the caller to
  38953. // add HTTP headers to the request.
  38954. func (c *RemarketingListsUpdateCall) Header() http.Header {
  38955. if c.header_ == nil {
  38956. c.header_ = make(http.Header)
  38957. }
  38958. return c.header_
  38959. }
  38960. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  38961. reqHeaders := make(http.Header)
  38962. for k, v := range c.header_ {
  38963. reqHeaders[k] = v
  38964. }
  38965. reqHeaders.Set("User-Agent", c.s.userAgent())
  38966. var body io.Reader = nil
  38967. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38968. if err != nil {
  38969. return nil, err
  38970. }
  38971. reqHeaders.Set("Content-Type", "application/json")
  38972. c.urlParams_.Set("alt", alt)
  38973. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38974. urls += "?" + c.urlParams_.Encode()
  38975. req, _ := http.NewRequest("PUT", urls, body)
  38976. req.Header = reqHeaders
  38977. googleapi.Expand(req.URL, map[string]string{
  38978. "profileId": strconv.FormatInt(c.profileId, 10),
  38979. })
  38980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38981. }
  38982. // Do executes the "dfareporting.remarketingLists.update" call.
  38983. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38984. // status code is an error. Response headers are in either
  38985. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38986. // at all) in error.(*googleapi.Error).Header. Use
  38987. // googleapi.IsNotModified to check whether the returned error was
  38988. // because http.StatusNotModified was returned.
  38989. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38990. gensupport.SetOptions(c.urlParams_, opts...)
  38991. res, err := c.doRequest("json")
  38992. if res != nil && res.StatusCode == http.StatusNotModified {
  38993. if res.Body != nil {
  38994. res.Body.Close()
  38995. }
  38996. return nil, &googleapi.Error{
  38997. Code: res.StatusCode,
  38998. Header: res.Header,
  38999. }
  39000. }
  39001. if err != nil {
  39002. return nil, err
  39003. }
  39004. defer googleapi.CloseBody(res)
  39005. if err := googleapi.CheckResponse(res); err != nil {
  39006. return nil, err
  39007. }
  39008. ret := &RemarketingList{
  39009. ServerResponse: googleapi.ServerResponse{
  39010. Header: res.Header,
  39011. HTTPStatusCode: res.StatusCode,
  39012. },
  39013. }
  39014. target := &ret
  39015. if err := gensupport.DecodeResponse(target, res); err != nil {
  39016. return nil, err
  39017. }
  39018. return ret, nil
  39019. // {
  39020. // "description": "Updates an existing remarketing list.",
  39021. // "httpMethod": "PUT",
  39022. // "id": "dfareporting.remarketingLists.update",
  39023. // "parameterOrder": [
  39024. // "profileId"
  39025. // ],
  39026. // "parameters": {
  39027. // "profileId": {
  39028. // "description": "User profile ID associated with this request.",
  39029. // "format": "int64",
  39030. // "location": "path",
  39031. // "required": true,
  39032. // "type": "string"
  39033. // }
  39034. // },
  39035. // "path": "userprofiles/{profileId}/remarketingLists",
  39036. // "request": {
  39037. // "$ref": "RemarketingList"
  39038. // },
  39039. // "response": {
  39040. // "$ref": "RemarketingList"
  39041. // },
  39042. // "scopes": [
  39043. // "https://www.googleapis.com/auth/dfatrafficking"
  39044. // ]
  39045. // }
  39046. }
  39047. // method id "dfareporting.reports.delete":
  39048. type ReportsDeleteCall struct {
  39049. s *Service
  39050. profileId int64
  39051. reportId int64
  39052. urlParams_ gensupport.URLParams
  39053. ctx_ context.Context
  39054. header_ http.Header
  39055. }
  39056. // Delete: Deletes a report by its ID.
  39057. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  39058. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39059. c.profileId = profileId
  39060. c.reportId = reportId
  39061. return c
  39062. }
  39063. // Fields allows partial responses to be retrieved. See
  39064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39065. // for more information.
  39066. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  39067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39068. return c
  39069. }
  39070. // Context sets the context to be used in this call's Do method. Any
  39071. // pending HTTP request will be aborted if the provided context is
  39072. // canceled.
  39073. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  39074. c.ctx_ = ctx
  39075. return c
  39076. }
  39077. // Header returns an http.Header that can be modified by the caller to
  39078. // add HTTP headers to the request.
  39079. func (c *ReportsDeleteCall) Header() http.Header {
  39080. if c.header_ == nil {
  39081. c.header_ = make(http.Header)
  39082. }
  39083. return c.header_
  39084. }
  39085. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39086. reqHeaders := make(http.Header)
  39087. for k, v := range c.header_ {
  39088. reqHeaders[k] = v
  39089. }
  39090. reqHeaders.Set("User-Agent", c.s.userAgent())
  39091. var body io.Reader = nil
  39092. c.urlParams_.Set("alt", alt)
  39093. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39094. urls += "?" + c.urlParams_.Encode()
  39095. req, _ := http.NewRequest("DELETE", urls, body)
  39096. req.Header = reqHeaders
  39097. googleapi.Expand(req.URL, map[string]string{
  39098. "profileId": strconv.FormatInt(c.profileId, 10),
  39099. "reportId": strconv.FormatInt(c.reportId, 10),
  39100. })
  39101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39102. }
  39103. // Do executes the "dfareporting.reports.delete" call.
  39104. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  39105. gensupport.SetOptions(c.urlParams_, opts...)
  39106. res, err := c.doRequest("json")
  39107. if err != nil {
  39108. return err
  39109. }
  39110. defer googleapi.CloseBody(res)
  39111. if err := googleapi.CheckResponse(res); err != nil {
  39112. return err
  39113. }
  39114. return nil
  39115. // {
  39116. // "description": "Deletes a report by its ID.",
  39117. // "httpMethod": "DELETE",
  39118. // "id": "dfareporting.reports.delete",
  39119. // "parameterOrder": [
  39120. // "profileId",
  39121. // "reportId"
  39122. // ],
  39123. // "parameters": {
  39124. // "profileId": {
  39125. // "description": "The DFA user profile ID.",
  39126. // "format": "int64",
  39127. // "location": "path",
  39128. // "required": true,
  39129. // "type": "string"
  39130. // },
  39131. // "reportId": {
  39132. // "description": "The ID of the report.",
  39133. // "format": "int64",
  39134. // "location": "path",
  39135. // "required": true,
  39136. // "type": "string"
  39137. // }
  39138. // },
  39139. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39140. // "scopes": [
  39141. // "https://www.googleapis.com/auth/dfareporting"
  39142. // ]
  39143. // }
  39144. }
  39145. // method id "dfareporting.reports.get":
  39146. type ReportsGetCall struct {
  39147. s *Service
  39148. profileId int64
  39149. reportId int64
  39150. urlParams_ gensupport.URLParams
  39151. ifNoneMatch_ string
  39152. ctx_ context.Context
  39153. header_ http.Header
  39154. }
  39155. // Get: Retrieves a report by its ID.
  39156. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  39157. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39158. c.profileId = profileId
  39159. c.reportId = reportId
  39160. return c
  39161. }
  39162. // Fields allows partial responses to be retrieved. See
  39163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39164. // for more information.
  39165. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  39166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39167. return c
  39168. }
  39169. // IfNoneMatch sets the optional parameter which makes the operation
  39170. // fail if the object's ETag matches the given value. This is useful for
  39171. // getting updates only after the object has changed since the last
  39172. // request. Use googleapi.IsNotModified to check whether the response
  39173. // error from Do is the result of In-None-Match.
  39174. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  39175. c.ifNoneMatch_ = entityTag
  39176. return c
  39177. }
  39178. // Context sets the context to be used in this call's Do method. Any
  39179. // pending HTTP request will be aborted if the provided context is
  39180. // canceled.
  39181. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  39182. c.ctx_ = ctx
  39183. return c
  39184. }
  39185. // Header returns an http.Header that can be modified by the caller to
  39186. // add HTTP headers to the request.
  39187. func (c *ReportsGetCall) Header() http.Header {
  39188. if c.header_ == nil {
  39189. c.header_ = make(http.Header)
  39190. }
  39191. return c.header_
  39192. }
  39193. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  39194. reqHeaders := make(http.Header)
  39195. for k, v := range c.header_ {
  39196. reqHeaders[k] = v
  39197. }
  39198. reqHeaders.Set("User-Agent", c.s.userAgent())
  39199. if c.ifNoneMatch_ != "" {
  39200. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39201. }
  39202. var body io.Reader = nil
  39203. c.urlParams_.Set("alt", alt)
  39204. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39205. urls += "?" + c.urlParams_.Encode()
  39206. req, _ := http.NewRequest("GET", urls, body)
  39207. req.Header = reqHeaders
  39208. googleapi.Expand(req.URL, map[string]string{
  39209. "profileId": strconv.FormatInt(c.profileId, 10),
  39210. "reportId": strconv.FormatInt(c.reportId, 10),
  39211. })
  39212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39213. }
  39214. // Do executes the "dfareporting.reports.get" call.
  39215. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39216. // code is an error. Response headers are in either
  39217. // *Report.ServerResponse.Header or (if a response was returned at all)
  39218. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39219. // check whether the returned error was because http.StatusNotModified
  39220. // was returned.
  39221. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39222. gensupport.SetOptions(c.urlParams_, opts...)
  39223. res, err := c.doRequest("json")
  39224. if res != nil && res.StatusCode == http.StatusNotModified {
  39225. if res.Body != nil {
  39226. res.Body.Close()
  39227. }
  39228. return nil, &googleapi.Error{
  39229. Code: res.StatusCode,
  39230. Header: res.Header,
  39231. }
  39232. }
  39233. if err != nil {
  39234. return nil, err
  39235. }
  39236. defer googleapi.CloseBody(res)
  39237. if err := googleapi.CheckResponse(res); err != nil {
  39238. return nil, err
  39239. }
  39240. ret := &Report{
  39241. ServerResponse: googleapi.ServerResponse{
  39242. Header: res.Header,
  39243. HTTPStatusCode: res.StatusCode,
  39244. },
  39245. }
  39246. target := &ret
  39247. if err := gensupport.DecodeResponse(target, res); err != nil {
  39248. return nil, err
  39249. }
  39250. return ret, nil
  39251. // {
  39252. // "description": "Retrieves a report by its ID.",
  39253. // "httpMethod": "GET",
  39254. // "id": "dfareporting.reports.get",
  39255. // "parameterOrder": [
  39256. // "profileId",
  39257. // "reportId"
  39258. // ],
  39259. // "parameters": {
  39260. // "profileId": {
  39261. // "description": "The DFA user profile ID.",
  39262. // "format": "int64",
  39263. // "location": "path",
  39264. // "required": true,
  39265. // "type": "string"
  39266. // },
  39267. // "reportId": {
  39268. // "description": "The ID of the report.",
  39269. // "format": "int64",
  39270. // "location": "path",
  39271. // "required": true,
  39272. // "type": "string"
  39273. // }
  39274. // },
  39275. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39276. // "response": {
  39277. // "$ref": "Report"
  39278. // },
  39279. // "scopes": [
  39280. // "https://www.googleapis.com/auth/dfareporting"
  39281. // ]
  39282. // }
  39283. }
  39284. // method id "dfareporting.reports.insert":
  39285. type ReportsInsertCall struct {
  39286. s *Service
  39287. profileId int64
  39288. report *Report
  39289. urlParams_ gensupport.URLParams
  39290. ctx_ context.Context
  39291. header_ http.Header
  39292. }
  39293. // Insert: Creates a report.
  39294. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  39295. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39296. c.profileId = profileId
  39297. c.report = report
  39298. return c
  39299. }
  39300. // Fields allows partial responses to be retrieved. See
  39301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39302. // for more information.
  39303. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  39304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39305. return c
  39306. }
  39307. // Context sets the context to be used in this call's Do method. Any
  39308. // pending HTTP request will be aborted if the provided context is
  39309. // canceled.
  39310. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  39311. c.ctx_ = ctx
  39312. return c
  39313. }
  39314. // Header returns an http.Header that can be modified by the caller to
  39315. // add HTTP headers to the request.
  39316. func (c *ReportsInsertCall) Header() http.Header {
  39317. if c.header_ == nil {
  39318. c.header_ = make(http.Header)
  39319. }
  39320. return c.header_
  39321. }
  39322. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  39323. reqHeaders := make(http.Header)
  39324. for k, v := range c.header_ {
  39325. reqHeaders[k] = v
  39326. }
  39327. reqHeaders.Set("User-Agent", c.s.userAgent())
  39328. var body io.Reader = nil
  39329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39330. if err != nil {
  39331. return nil, err
  39332. }
  39333. reqHeaders.Set("Content-Type", "application/json")
  39334. c.urlParams_.Set("alt", alt)
  39335. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  39336. urls += "?" + c.urlParams_.Encode()
  39337. req, _ := http.NewRequest("POST", urls, body)
  39338. req.Header = reqHeaders
  39339. googleapi.Expand(req.URL, map[string]string{
  39340. "profileId": strconv.FormatInt(c.profileId, 10),
  39341. })
  39342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39343. }
  39344. // Do executes the "dfareporting.reports.insert" call.
  39345. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39346. // code is an error. Response headers are in either
  39347. // *Report.ServerResponse.Header or (if a response was returned at all)
  39348. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39349. // check whether the returned error was because http.StatusNotModified
  39350. // was returned.
  39351. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39352. gensupport.SetOptions(c.urlParams_, opts...)
  39353. res, err := c.doRequest("json")
  39354. if res != nil && res.StatusCode == http.StatusNotModified {
  39355. if res.Body != nil {
  39356. res.Body.Close()
  39357. }
  39358. return nil, &googleapi.Error{
  39359. Code: res.StatusCode,
  39360. Header: res.Header,
  39361. }
  39362. }
  39363. if err != nil {
  39364. return nil, err
  39365. }
  39366. defer googleapi.CloseBody(res)
  39367. if err := googleapi.CheckResponse(res); err != nil {
  39368. return nil, err
  39369. }
  39370. ret := &Report{
  39371. ServerResponse: googleapi.ServerResponse{
  39372. Header: res.Header,
  39373. HTTPStatusCode: res.StatusCode,
  39374. },
  39375. }
  39376. target := &ret
  39377. if err := gensupport.DecodeResponse(target, res); err != nil {
  39378. return nil, err
  39379. }
  39380. return ret, nil
  39381. // {
  39382. // "description": "Creates a report.",
  39383. // "httpMethod": "POST",
  39384. // "id": "dfareporting.reports.insert",
  39385. // "parameterOrder": [
  39386. // "profileId"
  39387. // ],
  39388. // "parameters": {
  39389. // "profileId": {
  39390. // "description": "The DFA user profile ID.",
  39391. // "format": "int64",
  39392. // "location": "path",
  39393. // "required": true,
  39394. // "type": "string"
  39395. // }
  39396. // },
  39397. // "path": "userprofiles/{profileId}/reports",
  39398. // "request": {
  39399. // "$ref": "Report"
  39400. // },
  39401. // "response": {
  39402. // "$ref": "Report"
  39403. // },
  39404. // "scopes": [
  39405. // "https://www.googleapis.com/auth/dfareporting"
  39406. // ]
  39407. // }
  39408. }
  39409. // method id "dfareporting.reports.list":
  39410. type ReportsListCall struct {
  39411. s *Service
  39412. profileId int64
  39413. urlParams_ gensupport.URLParams
  39414. ifNoneMatch_ string
  39415. ctx_ context.Context
  39416. header_ http.Header
  39417. }
  39418. // List: Retrieves list of reports.
  39419. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  39420. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39421. c.profileId = profileId
  39422. return c
  39423. }
  39424. // MaxResults sets the optional parameter "maxResults": Maximum number
  39425. // of results to return.
  39426. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  39427. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39428. return c
  39429. }
  39430. // PageToken sets the optional parameter "pageToken": The value of the
  39431. // nextToken from the previous result page.
  39432. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  39433. c.urlParams_.Set("pageToken", pageToken)
  39434. return c
  39435. }
  39436. // Scope sets the optional parameter "scope": The scope that defines
  39437. // which results are returned.
  39438. //
  39439. // Possible values:
  39440. // "ALL" - All reports in account.
  39441. // "MINE" (default) - My reports.
  39442. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  39443. c.urlParams_.Set("scope", scope)
  39444. return c
  39445. }
  39446. // SortField sets the optional parameter "sortField": The field by which
  39447. // to sort the list.
  39448. //
  39449. // Possible values:
  39450. // "ID" - Sort by report ID.
  39451. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  39452. // "NAME" - Sort by name of reports.
  39453. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  39454. c.urlParams_.Set("sortField", sortField)
  39455. return c
  39456. }
  39457. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39458. // results.
  39459. //
  39460. // Possible values:
  39461. // "ASCENDING" - Ascending order.
  39462. // "DESCENDING" (default) - Descending order.
  39463. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  39464. c.urlParams_.Set("sortOrder", sortOrder)
  39465. return c
  39466. }
  39467. // Fields allows partial responses to be retrieved. See
  39468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39469. // for more information.
  39470. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  39471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39472. return c
  39473. }
  39474. // IfNoneMatch sets the optional parameter which makes the operation
  39475. // fail if the object's ETag matches the given value. This is useful for
  39476. // getting updates only after the object has changed since the last
  39477. // request. Use googleapi.IsNotModified to check whether the response
  39478. // error from Do is the result of In-None-Match.
  39479. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  39480. c.ifNoneMatch_ = entityTag
  39481. return c
  39482. }
  39483. // Context sets the context to be used in this call's Do method. Any
  39484. // pending HTTP request will be aborted if the provided context is
  39485. // canceled.
  39486. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  39487. c.ctx_ = ctx
  39488. return c
  39489. }
  39490. // Header returns an http.Header that can be modified by the caller to
  39491. // add HTTP headers to the request.
  39492. func (c *ReportsListCall) Header() http.Header {
  39493. if c.header_ == nil {
  39494. c.header_ = make(http.Header)
  39495. }
  39496. return c.header_
  39497. }
  39498. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  39499. reqHeaders := make(http.Header)
  39500. for k, v := range c.header_ {
  39501. reqHeaders[k] = v
  39502. }
  39503. reqHeaders.Set("User-Agent", c.s.userAgent())
  39504. if c.ifNoneMatch_ != "" {
  39505. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39506. }
  39507. var body io.Reader = nil
  39508. c.urlParams_.Set("alt", alt)
  39509. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  39510. urls += "?" + c.urlParams_.Encode()
  39511. req, _ := http.NewRequest("GET", urls, body)
  39512. req.Header = reqHeaders
  39513. googleapi.Expand(req.URL, map[string]string{
  39514. "profileId": strconv.FormatInt(c.profileId, 10),
  39515. })
  39516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39517. }
  39518. // Do executes the "dfareporting.reports.list" call.
  39519. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  39520. // status code is an error. Response headers are in either
  39521. // *ReportList.ServerResponse.Header or (if a response was returned at
  39522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39523. // to check whether the returned error was because
  39524. // http.StatusNotModified was returned.
  39525. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  39526. gensupport.SetOptions(c.urlParams_, opts...)
  39527. res, err := c.doRequest("json")
  39528. if res != nil && res.StatusCode == http.StatusNotModified {
  39529. if res.Body != nil {
  39530. res.Body.Close()
  39531. }
  39532. return nil, &googleapi.Error{
  39533. Code: res.StatusCode,
  39534. Header: res.Header,
  39535. }
  39536. }
  39537. if err != nil {
  39538. return nil, err
  39539. }
  39540. defer googleapi.CloseBody(res)
  39541. if err := googleapi.CheckResponse(res); err != nil {
  39542. return nil, err
  39543. }
  39544. ret := &ReportList{
  39545. ServerResponse: googleapi.ServerResponse{
  39546. Header: res.Header,
  39547. HTTPStatusCode: res.StatusCode,
  39548. },
  39549. }
  39550. target := &ret
  39551. if err := gensupport.DecodeResponse(target, res); err != nil {
  39552. return nil, err
  39553. }
  39554. return ret, nil
  39555. // {
  39556. // "description": "Retrieves list of reports.",
  39557. // "httpMethod": "GET",
  39558. // "id": "dfareporting.reports.list",
  39559. // "parameterOrder": [
  39560. // "profileId"
  39561. // ],
  39562. // "parameters": {
  39563. // "maxResults": {
  39564. // "default": "10",
  39565. // "description": "Maximum number of results to return.",
  39566. // "format": "int32",
  39567. // "location": "query",
  39568. // "maximum": "10",
  39569. // "minimum": "0",
  39570. // "type": "integer"
  39571. // },
  39572. // "pageToken": {
  39573. // "description": "The value of the nextToken from the previous result page.",
  39574. // "location": "query",
  39575. // "type": "string"
  39576. // },
  39577. // "profileId": {
  39578. // "description": "The DFA user profile ID.",
  39579. // "format": "int64",
  39580. // "location": "path",
  39581. // "required": true,
  39582. // "type": "string"
  39583. // },
  39584. // "scope": {
  39585. // "default": "MINE",
  39586. // "description": "The scope that defines which results are returned.",
  39587. // "enum": [
  39588. // "ALL",
  39589. // "MINE"
  39590. // ],
  39591. // "enumDescriptions": [
  39592. // "All reports in account.",
  39593. // "My reports."
  39594. // ],
  39595. // "location": "query",
  39596. // "type": "string"
  39597. // },
  39598. // "sortField": {
  39599. // "default": "LAST_MODIFIED_TIME",
  39600. // "description": "The field by which to sort the list.",
  39601. // "enum": [
  39602. // "ID",
  39603. // "LAST_MODIFIED_TIME",
  39604. // "NAME"
  39605. // ],
  39606. // "enumDescriptions": [
  39607. // "Sort by report ID.",
  39608. // "Sort by 'lastModifiedTime' field.",
  39609. // "Sort by name of reports."
  39610. // ],
  39611. // "location": "query",
  39612. // "type": "string"
  39613. // },
  39614. // "sortOrder": {
  39615. // "default": "DESCENDING",
  39616. // "description": "Order of sorted results.",
  39617. // "enum": [
  39618. // "ASCENDING",
  39619. // "DESCENDING"
  39620. // ],
  39621. // "enumDescriptions": [
  39622. // "Ascending order.",
  39623. // "Descending order."
  39624. // ],
  39625. // "location": "query",
  39626. // "type": "string"
  39627. // }
  39628. // },
  39629. // "path": "userprofiles/{profileId}/reports",
  39630. // "response": {
  39631. // "$ref": "ReportList"
  39632. // },
  39633. // "scopes": [
  39634. // "https://www.googleapis.com/auth/dfareporting"
  39635. // ]
  39636. // }
  39637. }
  39638. // Pages invokes f for each page of results.
  39639. // A non-nil error returned from f will halt the iteration.
  39640. // The provided context supersedes any context provided to the Context method.
  39641. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  39642. c.ctx_ = ctx
  39643. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39644. for {
  39645. x, err := c.Do()
  39646. if err != nil {
  39647. return err
  39648. }
  39649. if err := f(x); err != nil {
  39650. return err
  39651. }
  39652. if x.NextPageToken == "" {
  39653. return nil
  39654. }
  39655. c.PageToken(x.NextPageToken)
  39656. }
  39657. }
  39658. // method id "dfareporting.reports.patch":
  39659. type ReportsPatchCall struct {
  39660. s *Service
  39661. profileId int64
  39662. reportId int64
  39663. report *Report
  39664. urlParams_ gensupport.URLParams
  39665. ctx_ context.Context
  39666. header_ http.Header
  39667. }
  39668. // Patch: Updates a report. This method supports patch semantics.
  39669. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  39670. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39671. c.profileId = profileId
  39672. c.reportId = reportId
  39673. c.report = report
  39674. return c
  39675. }
  39676. // Fields allows partial responses to be retrieved. See
  39677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39678. // for more information.
  39679. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  39680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39681. return c
  39682. }
  39683. // Context sets the context to be used in this call's Do method. Any
  39684. // pending HTTP request will be aborted if the provided context is
  39685. // canceled.
  39686. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  39687. c.ctx_ = ctx
  39688. return c
  39689. }
  39690. // Header returns an http.Header that can be modified by the caller to
  39691. // add HTTP headers to the request.
  39692. func (c *ReportsPatchCall) Header() http.Header {
  39693. if c.header_ == nil {
  39694. c.header_ = make(http.Header)
  39695. }
  39696. return c.header_
  39697. }
  39698. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  39699. reqHeaders := make(http.Header)
  39700. for k, v := range c.header_ {
  39701. reqHeaders[k] = v
  39702. }
  39703. reqHeaders.Set("User-Agent", c.s.userAgent())
  39704. var body io.Reader = nil
  39705. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39706. if err != nil {
  39707. return nil, err
  39708. }
  39709. reqHeaders.Set("Content-Type", "application/json")
  39710. c.urlParams_.Set("alt", alt)
  39711. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39712. urls += "?" + c.urlParams_.Encode()
  39713. req, _ := http.NewRequest("PATCH", urls, body)
  39714. req.Header = reqHeaders
  39715. googleapi.Expand(req.URL, map[string]string{
  39716. "profileId": strconv.FormatInt(c.profileId, 10),
  39717. "reportId": strconv.FormatInt(c.reportId, 10),
  39718. })
  39719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39720. }
  39721. // Do executes the "dfareporting.reports.patch" call.
  39722. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39723. // code is an error. Response headers are in either
  39724. // *Report.ServerResponse.Header or (if a response was returned at all)
  39725. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39726. // check whether the returned error was because http.StatusNotModified
  39727. // was returned.
  39728. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39729. gensupport.SetOptions(c.urlParams_, opts...)
  39730. res, err := c.doRequest("json")
  39731. if res != nil && res.StatusCode == http.StatusNotModified {
  39732. if res.Body != nil {
  39733. res.Body.Close()
  39734. }
  39735. return nil, &googleapi.Error{
  39736. Code: res.StatusCode,
  39737. Header: res.Header,
  39738. }
  39739. }
  39740. if err != nil {
  39741. return nil, err
  39742. }
  39743. defer googleapi.CloseBody(res)
  39744. if err := googleapi.CheckResponse(res); err != nil {
  39745. return nil, err
  39746. }
  39747. ret := &Report{
  39748. ServerResponse: googleapi.ServerResponse{
  39749. Header: res.Header,
  39750. HTTPStatusCode: res.StatusCode,
  39751. },
  39752. }
  39753. target := &ret
  39754. if err := gensupport.DecodeResponse(target, res); err != nil {
  39755. return nil, err
  39756. }
  39757. return ret, nil
  39758. // {
  39759. // "description": "Updates a report. This method supports patch semantics.",
  39760. // "httpMethod": "PATCH",
  39761. // "id": "dfareporting.reports.patch",
  39762. // "parameterOrder": [
  39763. // "profileId",
  39764. // "reportId"
  39765. // ],
  39766. // "parameters": {
  39767. // "profileId": {
  39768. // "description": "The DFA user profile ID.",
  39769. // "format": "int64",
  39770. // "location": "path",
  39771. // "required": true,
  39772. // "type": "string"
  39773. // },
  39774. // "reportId": {
  39775. // "description": "The ID of the report.",
  39776. // "format": "int64",
  39777. // "location": "path",
  39778. // "required": true,
  39779. // "type": "string"
  39780. // }
  39781. // },
  39782. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39783. // "request": {
  39784. // "$ref": "Report"
  39785. // },
  39786. // "response": {
  39787. // "$ref": "Report"
  39788. // },
  39789. // "scopes": [
  39790. // "https://www.googleapis.com/auth/dfareporting"
  39791. // ]
  39792. // }
  39793. }
  39794. // method id "dfareporting.reports.run":
  39795. type ReportsRunCall struct {
  39796. s *Service
  39797. profileId int64
  39798. reportId int64
  39799. urlParams_ gensupport.URLParams
  39800. ctx_ context.Context
  39801. header_ http.Header
  39802. }
  39803. // Run: Runs a report.
  39804. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  39805. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39806. c.profileId = profileId
  39807. c.reportId = reportId
  39808. return c
  39809. }
  39810. // Synchronous sets the optional parameter "synchronous": If set and
  39811. // true, tries to run the report synchronously.
  39812. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  39813. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  39814. return c
  39815. }
  39816. // Fields allows partial responses to be retrieved. See
  39817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39818. // for more information.
  39819. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  39820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39821. return c
  39822. }
  39823. // Context sets the context to be used in this call's Do method. Any
  39824. // pending HTTP request will be aborted if the provided context is
  39825. // canceled.
  39826. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  39827. c.ctx_ = ctx
  39828. return c
  39829. }
  39830. // Header returns an http.Header that can be modified by the caller to
  39831. // add HTTP headers to the request.
  39832. func (c *ReportsRunCall) Header() http.Header {
  39833. if c.header_ == nil {
  39834. c.header_ = make(http.Header)
  39835. }
  39836. return c.header_
  39837. }
  39838. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  39839. reqHeaders := make(http.Header)
  39840. for k, v := range c.header_ {
  39841. reqHeaders[k] = v
  39842. }
  39843. reqHeaders.Set("User-Agent", c.s.userAgent())
  39844. var body io.Reader = nil
  39845. c.urlParams_.Set("alt", alt)
  39846. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  39847. urls += "?" + c.urlParams_.Encode()
  39848. req, _ := http.NewRequest("POST", urls, body)
  39849. req.Header = reqHeaders
  39850. googleapi.Expand(req.URL, map[string]string{
  39851. "profileId": strconv.FormatInt(c.profileId, 10),
  39852. "reportId": strconv.FormatInt(c.reportId, 10),
  39853. })
  39854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39855. }
  39856. // Do executes the "dfareporting.reports.run" call.
  39857. // Exactly one of *File or error will be non-nil. Any non-2xx status
  39858. // code is an error. Response headers are in either
  39859. // *File.ServerResponse.Header or (if a response was returned at all) in
  39860. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39861. // whether the returned error was because http.StatusNotModified was
  39862. // returned.
  39863. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  39864. gensupport.SetOptions(c.urlParams_, opts...)
  39865. res, err := c.doRequest("json")
  39866. if res != nil && res.StatusCode == http.StatusNotModified {
  39867. if res.Body != nil {
  39868. res.Body.Close()
  39869. }
  39870. return nil, &googleapi.Error{
  39871. Code: res.StatusCode,
  39872. Header: res.Header,
  39873. }
  39874. }
  39875. if err != nil {
  39876. return nil, err
  39877. }
  39878. defer googleapi.CloseBody(res)
  39879. if err := googleapi.CheckResponse(res); err != nil {
  39880. return nil, err
  39881. }
  39882. ret := &File{
  39883. ServerResponse: googleapi.ServerResponse{
  39884. Header: res.Header,
  39885. HTTPStatusCode: res.StatusCode,
  39886. },
  39887. }
  39888. target := &ret
  39889. if err := gensupport.DecodeResponse(target, res); err != nil {
  39890. return nil, err
  39891. }
  39892. return ret, nil
  39893. // {
  39894. // "description": "Runs a report.",
  39895. // "httpMethod": "POST",
  39896. // "id": "dfareporting.reports.run",
  39897. // "parameterOrder": [
  39898. // "profileId",
  39899. // "reportId"
  39900. // ],
  39901. // "parameters": {
  39902. // "profileId": {
  39903. // "description": "The DFA profile ID.",
  39904. // "format": "int64",
  39905. // "location": "path",
  39906. // "required": true,
  39907. // "type": "string"
  39908. // },
  39909. // "reportId": {
  39910. // "description": "The ID of the report.",
  39911. // "format": "int64",
  39912. // "location": "path",
  39913. // "required": true,
  39914. // "type": "string"
  39915. // },
  39916. // "synchronous": {
  39917. // "default": "false",
  39918. // "description": "If set and true, tries to run the report synchronously.",
  39919. // "location": "query",
  39920. // "type": "boolean"
  39921. // }
  39922. // },
  39923. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  39924. // "response": {
  39925. // "$ref": "File"
  39926. // },
  39927. // "scopes": [
  39928. // "https://www.googleapis.com/auth/dfareporting"
  39929. // ]
  39930. // }
  39931. }
  39932. // method id "dfareporting.reports.update":
  39933. type ReportsUpdateCall struct {
  39934. s *Service
  39935. profileId int64
  39936. reportId int64
  39937. report *Report
  39938. urlParams_ gensupport.URLParams
  39939. ctx_ context.Context
  39940. header_ http.Header
  39941. }
  39942. // Update: Updates a report.
  39943. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  39944. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39945. c.profileId = profileId
  39946. c.reportId = reportId
  39947. c.report = report
  39948. return c
  39949. }
  39950. // Fields allows partial responses to be retrieved. See
  39951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39952. // for more information.
  39953. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  39954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39955. return c
  39956. }
  39957. // Context sets the context to be used in this call's Do method. Any
  39958. // pending HTTP request will be aborted if the provided context is
  39959. // canceled.
  39960. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  39961. c.ctx_ = ctx
  39962. return c
  39963. }
  39964. // Header returns an http.Header that can be modified by the caller to
  39965. // add HTTP headers to the request.
  39966. func (c *ReportsUpdateCall) Header() http.Header {
  39967. if c.header_ == nil {
  39968. c.header_ = make(http.Header)
  39969. }
  39970. return c.header_
  39971. }
  39972. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39973. reqHeaders := make(http.Header)
  39974. for k, v := range c.header_ {
  39975. reqHeaders[k] = v
  39976. }
  39977. reqHeaders.Set("User-Agent", c.s.userAgent())
  39978. var body io.Reader = nil
  39979. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39980. if err != nil {
  39981. return nil, err
  39982. }
  39983. reqHeaders.Set("Content-Type", "application/json")
  39984. c.urlParams_.Set("alt", alt)
  39985. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39986. urls += "?" + c.urlParams_.Encode()
  39987. req, _ := http.NewRequest("PUT", urls, body)
  39988. req.Header = reqHeaders
  39989. googleapi.Expand(req.URL, map[string]string{
  39990. "profileId": strconv.FormatInt(c.profileId, 10),
  39991. "reportId": strconv.FormatInt(c.reportId, 10),
  39992. })
  39993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39994. }
  39995. // Do executes the "dfareporting.reports.update" call.
  39996. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39997. // code is an error. Response headers are in either
  39998. // *Report.ServerResponse.Header or (if a response was returned at all)
  39999. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40000. // check whether the returned error was because http.StatusNotModified
  40001. // was returned.
  40002. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40003. gensupport.SetOptions(c.urlParams_, opts...)
  40004. res, err := c.doRequest("json")
  40005. if res != nil && res.StatusCode == http.StatusNotModified {
  40006. if res.Body != nil {
  40007. res.Body.Close()
  40008. }
  40009. return nil, &googleapi.Error{
  40010. Code: res.StatusCode,
  40011. Header: res.Header,
  40012. }
  40013. }
  40014. if err != nil {
  40015. return nil, err
  40016. }
  40017. defer googleapi.CloseBody(res)
  40018. if err := googleapi.CheckResponse(res); err != nil {
  40019. return nil, err
  40020. }
  40021. ret := &Report{
  40022. ServerResponse: googleapi.ServerResponse{
  40023. Header: res.Header,
  40024. HTTPStatusCode: res.StatusCode,
  40025. },
  40026. }
  40027. target := &ret
  40028. if err := gensupport.DecodeResponse(target, res); err != nil {
  40029. return nil, err
  40030. }
  40031. return ret, nil
  40032. // {
  40033. // "description": "Updates a report.",
  40034. // "httpMethod": "PUT",
  40035. // "id": "dfareporting.reports.update",
  40036. // "parameterOrder": [
  40037. // "profileId",
  40038. // "reportId"
  40039. // ],
  40040. // "parameters": {
  40041. // "profileId": {
  40042. // "description": "The DFA user profile ID.",
  40043. // "format": "int64",
  40044. // "location": "path",
  40045. // "required": true,
  40046. // "type": "string"
  40047. // },
  40048. // "reportId": {
  40049. // "description": "The ID of the report.",
  40050. // "format": "int64",
  40051. // "location": "path",
  40052. // "required": true,
  40053. // "type": "string"
  40054. // }
  40055. // },
  40056. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40057. // "request": {
  40058. // "$ref": "Report"
  40059. // },
  40060. // "response": {
  40061. // "$ref": "Report"
  40062. // },
  40063. // "scopes": [
  40064. // "https://www.googleapis.com/auth/dfareporting"
  40065. // ]
  40066. // }
  40067. }
  40068. // method id "dfareporting.reports.compatibleFields.query":
  40069. type ReportsCompatibleFieldsQueryCall struct {
  40070. s *Service
  40071. profileId int64
  40072. report *Report
  40073. urlParams_ gensupport.URLParams
  40074. ctx_ context.Context
  40075. header_ http.Header
  40076. }
  40077. // Query: Returns the fields that are compatible to be selected in the
  40078. // respective sections of a report criteria, given the fields already
  40079. // selected in the input report and user permissions.
  40080. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  40081. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40082. c.profileId = profileId
  40083. c.report = report
  40084. return c
  40085. }
  40086. // Fields allows partial responses to be retrieved. See
  40087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40088. // for more information.
  40089. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  40090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40091. return c
  40092. }
  40093. // Context sets the context to be used in this call's Do method. Any
  40094. // pending HTTP request will be aborted if the provided context is
  40095. // canceled.
  40096. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  40097. c.ctx_ = ctx
  40098. return c
  40099. }
  40100. // Header returns an http.Header that can be modified by the caller to
  40101. // add HTTP headers to the request.
  40102. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  40103. if c.header_ == nil {
  40104. c.header_ = make(http.Header)
  40105. }
  40106. return c.header_
  40107. }
  40108. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  40109. reqHeaders := make(http.Header)
  40110. for k, v := range c.header_ {
  40111. reqHeaders[k] = v
  40112. }
  40113. reqHeaders.Set("User-Agent", c.s.userAgent())
  40114. var body io.Reader = nil
  40115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40116. if err != nil {
  40117. return nil, err
  40118. }
  40119. reqHeaders.Set("Content-Type", "application/json")
  40120. c.urlParams_.Set("alt", alt)
  40121. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  40122. urls += "?" + c.urlParams_.Encode()
  40123. req, _ := http.NewRequest("POST", urls, body)
  40124. req.Header = reqHeaders
  40125. googleapi.Expand(req.URL, map[string]string{
  40126. "profileId": strconv.FormatInt(c.profileId, 10),
  40127. })
  40128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40129. }
  40130. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  40131. // Exactly one of *CompatibleFields or error will be non-nil. Any
  40132. // non-2xx status code is an error. Response headers are in either
  40133. // *CompatibleFields.ServerResponse.Header or (if a response was
  40134. // returned at all) in error.(*googleapi.Error).Header. Use
  40135. // googleapi.IsNotModified to check whether the returned error was
  40136. // because http.StatusNotModified was returned.
  40137. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  40138. gensupport.SetOptions(c.urlParams_, opts...)
  40139. res, err := c.doRequest("json")
  40140. if res != nil && res.StatusCode == http.StatusNotModified {
  40141. if res.Body != nil {
  40142. res.Body.Close()
  40143. }
  40144. return nil, &googleapi.Error{
  40145. Code: res.StatusCode,
  40146. Header: res.Header,
  40147. }
  40148. }
  40149. if err != nil {
  40150. return nil, err
  40151. }
  40152. defer googleapi.CloseBody(res)
  40153. if err := googleapi.CheckResponse(res); err != nil {
  40154. return nil, err
  40155. }
  40156. ret := &CompatibleFields{
  40157. ServerResponse: googleapi.ServerResponse{
  40158. Header: res.Header,
  40159. HTTPStatusCode: res.StatusCode,
  40160. },
  40161. }
  40162. target := &ret
  40163. if err := gensupport.DecodeResponse(target, res); err != nil {
  40164. return nil, err
  40165. }
  40166. return ret, nil
  40167. // {
  40168. // "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.",
  40169. // "httpMethod": "POST",
  40170. // "id": "dfareporting.reports.compatibleFields.query",
  40171. // "parameterOrder": [
  40172. // "profileId"
  40173. // ],
  40174. // "parameters": {
  40175. // "profileId": {
  40176. // "description": "The DFA user profile ID.",
  40177. // "format": "int64",
  40178. // "location": "path",
  40179. // "required": true,
  40180. // "type": "string"
  40181. // }
  40182. // },
  40183. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  40184. // "request": {
  40185. // "$ref": "Report"
  40186. // },
  40187. // "response": {
  40188. // "$ref": "CompatibleFields"
  40189. // },
  40190. // "scopes": [
  40191. // "https://www.googleapis.com/auth/dfareporting"
  40192. // ]
  40193. // }
  40194. }
  40195. // method id "dfareporting.reports.files.get":
  40196. type ReportsFilesGetCall struct {
  40197. s *Service
  40198. profileId int64
  40199. reportId int64
  40200. fileId int64
  40201. urlParams_ gensupport.URLParams
  40202. ifNoneMatch_ string
  40203. ctx_ context.Context
  40204. header_ http.Header
  40205. }
  40206. // Get: Retrieves a report file. This method supports media download.
  40207. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  40208. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40209. c.profileId = profileId
  40210. c.reportId = reportId
  40211. c.fileId = fileId
  40212. return c
  40213. }
  40214. // Fields allows partial responses to be retrieved. See
  40215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40216. // for more information.
  40217. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  40218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40219. return c
  40220. }
  40221. // IfNoneMatch sets the optional parameter which makes the operation
  40222. // fail if the object's ETag matches the given value. This is useful for
  40223. // getting updates only after the object has changed since the last
  40224. // request. Use googleapi.IsNotModified to check whether the response
  40225. // error from Do is the result of In-None-Match.
  40226. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  40227. c.ifNoneMatch_ = entityTag
  40228. return c
  40229. }
  40230. // Context sets the context to be used in this call's Do and Download
  40231. // methods. Any pending HTTP request will be aborted if the provided
  40232. // context is canceled.
  40233. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  40234. c.ctx_ = ctx
  40235. return c
  40236. }
  40237. // Header returns an http.Header that can be modified by the caller to
  40238. // add HTTP headers to the request.
  40239. func (c *ReportsFilesGetCall) Header() http.Header {
  40240. if c.header_ == nil {
  40241. c.header_ = make(http.Header)
  40242. }
  40243. return c.header_
  40244. }
  40245. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  40246. reqHeaders := make(http.Header)
  40247. for k, v := range c.header_ {
  40248. reqHeaders[k] = v
  40249. }
  40250. reqHeaders.Set("User-Agent", c.s.userAgent())
  40251. if c.ifNoneMatch_ != "" {
  40252. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40253. }
  40254. var body io.Reader = nil
  40255. c.urlParams_.Set("alt", alt)
  40256. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  40257. urls += "?" + c.urlParams_.Encode()
  40258. req, _ := http.NewRequest("GET", urls, body)
  40259. req.Header = reqHeaders
  40260. googleapi.Expand(req.URL, map[string]string{
  40261. "profileId": strconv.FormatInt(c.profileId, 10),
  40262. "reportId": strconv.FormatInt(c.reportId, 10),
  40263. "fileId": strconv.FormatInt(c.fileId, 10),
  40264. })
  40265. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40266. }
  40267. // Download fetches the API endpoint's "media" value, instead of the normal
  40268. // API response value. If the returned error is nil, the Response is guaranteed to
  40269. // have a 2xx status code. Callers must close the Response.Body as usual.
  40270. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  40271. gensupport.SetOptions(c.urlParams_, opts...)
  40272. res, err := c.doRequest("media")
  40273. if err != nil {
  40274. return nil, err
  40275. }
  40276. if err := googleapi.CheckMediaResponse(res); err != nil {
  40277. res.Body.Close()
  40278. return nil, err
  40279. }
  40280. return res, nil
  40281. }
  40282. // Do executes the "dfareporting.reports.files.get" call.
  40283. // Exactly one of *File or error will be non-nil. Any non-2xx status
  40284. // code is an error. Response headers are in either
  40285. // *File.ServerResponse.Header or (if a response was returned at all) in
  40286. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40287. // whether the returned error was because http.StatusNotModified was
  40288. // returned.
  40289. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  40290. gensupport.SetOptions(c.urlParams_, opts...)
  40291. res, err := c.doRequest("json")
  40292. if res != nil && res.StatusCode == http.StatusNotModified {
  40293. if res.Body != nil {
  40294. res.Body.Close()
  40295. }
  40296. return nil, &googleapi.Error{
  40297. Code: res.StatusCode,
  40298. Header: res.Header,
  40299. }
  40300. }
  40301. if err != nil {
  40302. return nil, err
  40303. }
  40304. defer googleapi.CloseBody(res)
  40305. if err := googleapi.CheckResponse(res); err != nil {
  40306. return nil, err
  40307. }
  40308. ret := &File{
  40309. ServerResponse: googleapi.ServerResponse{
  40310. Header: res.Header,
  40311. HTTPStatusCode: res.StatusCode,
  40312. },
  40313. }
  40314. target := &ret
  40315. if err := gensupport.DecodeResponse(target, res); err != nil {
  40316. return nil, err
  40317. }
  40318. return ret, nil
  40319. // {
  40320. // "description": "Retrieves a report file. This method supports media download.",
  40321. // "httpMethod": "GET",
  40322. // "id": "dfareporting.reports.files.get",
  40323. // "parameterOrder": [
  40324. // "profileId",
  40325. // "reportId",
  40326. // "fileId"
  40327. // ],
  40328. // "parameters": {
  40329. // "fileId": {
  40330. // "description": "The ID of the report file.",
  40331. // "format": "int64",
  40332. // "location": "path",
  40333. // "required": true,
  40334. // "type": "string"
  40335. // },
  40336. // "profileId": {
  40337. // "description": "The DFA profile ID.",
  40338. // "format": "int64",
  40339. // "location": "path",
  40340. // "required": true,
  40341. // "type": "string"
  40342. // },
  40343. // "reportId": {
  40344. // "description": "The ID of the report.",
  40345. // "format": "int64",
  40346. // "location": "path",
  40347. // "required": true,
  40348. // "type": "string"
  40349. // }
  40350. // },
  40351. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  40352. // "response": {
  40353. // "$ref": "File"
  40354. // },
  40355. // "scopes": [
  40356. // "https://www.googleapis.com/auth/dfareporting"
  40357. // ],
  40358. // "supportsMediaDownload": true
  40359. // }
  40360. }
  40361. // method id "dfareporting.reports.files.list":
  40362. type ReportsFilesListCall struct {
  40363. s *Service
  40364. profileId int64
  40365. reportId int64
  40366. urlParams_ gensupport.URLParams
  40367. ifNoneMatch_ string
  40368. ctx_ context.Context
  40369. header_ http.Header
  40370. }
  40371. // List: Lists files for a report.
  40372. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  40373. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40374. c.profileId = profileId
  40375. c.reportId = reportId
  40376. return c
  40377. }
  40378. // MaxResults sets the optional parameter "maxResults": Maximum number
  40379. // of results to return.
  40380. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  40381. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40382. return c
  40383. }
  40384. // PageToken sets the optional parameter "pageToken": The value of the
  40385. // nextToken from the previous result page.
  40386. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  40387. c.urlParams_.Set("pageToken", pageToken)
  40388. return c
  40389. }
  40390. // SortField sets the optional parameter "sortField": The field by which
  40391. // to sort the list.
  40392. //
  40393. // Possible values:
  40394. // "ID" - Sort by file ID.
  40395. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  40396. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  40397. c.urlParams_.Set("sortField", sortField)
  40398. return c
  40399. }
  40400. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40401. // results.
  40402. //
  40403. // Possible values:
  40404. // "ASCENDING" - Ascending order.
  40405. // "DESCENDING" (default) - Descending order.
  40406. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  40407. c.urlParams_.Set("sortOrder", sortOrder)
  40408. return c
  40409. }
  40410. // Fields allows partial responses to be retrieved. See
  40411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40412. // for more information.
  40413. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  40414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40415. return c
  40416. }
  40417. // IfNoneMatch sets the optional parameter which makes the operation
  40418. // fail if the object's ETag matches the given value. This is useful for
  40419. // getting updates only after the object has changed since the last
  40420. // request. Use googleapi.IsNotModified to check whether the response
  40421. // error from Do is the result of In-None-Match.
  40422. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  40423. c.ifNoneMatch_ = entityTag
  40424. return c
  40425. }
  40426. // Context sets the context to be used in this call's Do method. Any
  40427. // pending HTTP request will be aborted if the provided context is
  40428. // canceled.
  40429. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  40430. c.ctx_ = ctx
  40431. return c
  40432. }
  40433. // Header returns an http.Header that can be modified by the caller to
  40434. // add HTTP headers to the request.
  40435. func (c *ReportsFilesListCall) Header() http.Header {
  40436. if c.header_ == nil {
  40437. c.header_ = make(http.Header)
  40438. }
  40439. return c.header_
  40440. }
  40441. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  40442. reqHeaders := make(http.Header)
  40443. for k, v := range c.header_ {
  40444. reqHeaders[k] = v
  40445. }
  40446. reqHeaders.Set("User-Agent", c.s.userAgent())
  40447. if c.ifNoneMatch_ != "" {
  40448. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40449. }
  40450. var body io.Reader = nil
  40451. c.urlParams_.Set("alt", alt)
  40452. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  40453. urls += "?" + c.urlParams_.Encode()
  40454. req, _ := http.NewRequest("GET", urls, body)
  40455. req.Header = reqHeaders
  40456. googleapi.Expand(req.URL, map[string]string{
  40457. "profileId": strconv.FormatInt(c.profileId, 10),
  40458. "reportId": strconv.FormatInt(c.reportId, 10),
  40459. })
  40460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40461. }
  40462. // Do executes the "dfareporting.reports.files.list" call.
  40463. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  40464. // code is an error. Response headers are in either
  40465. // *FileList.ServerResponse.Header or (if a response was returned at
  40466. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40467. // to check whether the returned error was because
  40468. // http.StatusNotModified was returned.
  40469. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  40470. gensupport.SetOptions(c.urlParams_, opts...)
  40471. res, err := c.doRequest("json")
  40472. if res != nil && res.StatusCode == http.StatusNotModified {
  40473. if res.Body != nil {
  40474. res.Body.Close()
  40475. }
  40476. return nil, &googleapi.Error{
  40477. Code: res.StatusCode,
  40478. Header: res.Header,
  40479. }
  40480. }
  40481. if err != nil {
  40482. return nil, err
  40483. }
  40484. defer googleapi.CloseBody(res)
  40485. if err := googleapi.CheckResponse(res); err != nil {
  40486. return nil, err
  40487. }
  40488. ret := &FileList{
  40489. ServerResponse: googleapi.ServerResponse{
  40490. Header: res.Header,
  40491. HTTPStatusCode: res.StatusCode,
  40492. },
  40493. }
  40494. target := &ret
  40495. if err := gensupport.DecodeResponse(target, res); err != nil {
  40496. return nil, err
  40497. }
  40498. return ret, nil
  40499. // {
  40500. // "description": "Lists files for a report.",
  40501. // "httpMethod": "GET",
  40502. // "id": "dfareporting.reports.files.list",
  40503. // "parameterOrder": [
  40504. // "profileId",
  40505. // "reportId"
  40506. // ],
  40507. // "parameters": {
  40508. // "maxResults": {
  40509. // "default": "10",
  40510. // "description": "Maximum number of results to return.",
  40511. // "format": "int32",
  40512. // "location": "query",
  40513. // "maximum": "10",
  40514. // "minimum": "0",
  40515. // "type": "integer"
  40516. // },
  40517. // "pageToken": {
  40518. // "description": "The value of the nextToken from the previous result page.",
  40519. // "location": "query",
  40520. // "type": "string"
  40521. // },
  40522. // "profileId": {
  40523. // "description": "The DFA profile ID.",
  40524. // "format": "int64",
  40525. // "location": "path",
  40526. // "required": true,
  40527. // "type": "string"
  40528. // },
  40529. // "reportId": {
  40530. // "description": "The ID of the parent report.",
  40531. // "format": "int64",
  40532. // "location": "path",
  40533. // "required": true,
  40534. // "type": "string"
  40535. // },
  40536. // "sortField": {
  40537. // "default": "LAST_MODIFIED_TIME",
  40538. // "description": "The field by which to sort the list.",
  40539. // "enum": [
  40540. // "ID",
  40541. // "LAST_MODIFIED_TIME"
  40542. // ],
  40543. // "enumDescriptions": [
  40544. // "Sort by file ID.",
  40545. // "Sort by 'lastmodifiedAt' field."
  40546. // ],
  40547. // "location": "query",
  40548. // "type": "string"
  40549. // },
  40550. // "sortOrder": {
  40551. // "default": "DESCENDING",
  40552. // "description": "Order of sorted results.",
  40553. // "enum": [
  40554. // "ASCENDING",
  40555. // "DESCENDING"
  40556. // ],
  40557. // "enumDescriptions": [
  40558. // "Ascending order.",
  40559. // "Descending order."
  40560. // ],
  40561. // "location": "query",
  40562. // "type": "string"
  40563. // }
  40564. // },
  40565. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  40566. // "response": {
  40567. // "$ref": "FileList"
  40568. // },
  40569. // "scopes": [
  40570. // "https://www.googleapis.com/auth/dfareporting"
  40571. // ]
  40572. // }
  40573. }
  40574. // Pages invokes f for each page of results.
  40575. // A non-nil error returned from f will halt the iteration.
  40576. // The provided context supersedes any context provided to the Context method.
  40577. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  40578. c.ctx_ = ctx
  40579. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40580. for {
  40581. x, err := c.Do()
  40582. if err != nil {
  40583. return err
  40584. }
  40585. if err := f(x); err != nil {
  40586. return err
  40587. }
  40588. if x.NextPageToken == "" {
  40589. return nil
  40590. }
  40591. c.PageToken(x.NextPageToken)
  40592. }
  40593. }
  40594. // method id "dfareporting.sites.get":
  40595. type SitesGetCall struct {
  40596. s *Service
  40597. profileId int64
  40598. id int64
  40599. urlParams_ gensupport.URLParams
  40600. ifNoneMatch_ string
  40601. ctx_ context.Context
  40602. header_ http.Header
  40603. }
  40604. // Get: Gets one site by ID.
  40605. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  40606. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40607. c.profileId = profileId
  40608. c.id = id
  40609. return c
  40610. }
  40611. // Fields allows partial responses to be retrieved. See
  40612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40613. // for more information.
  40614. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  40615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40616. return c
  40617. }
  40618. // IfNoneMatch sets the optional parameter which makes the operation
  40619. // fail if the object's ETag matches the given value. This is useful for
  40620. // getting updates only after the object has changed since the last
  40621. // request. Use googleapi.IsNotModified to check whether the response
  40622. // error from Do is the result of In-None-Match.
  40623. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  40624. c.ifNoneMatch_ = entityTag
  40625. return c
  40626. }
  40627. // Context sets the context to be used in this call's Do method. Any
  40628. // pending HTTP request will be aborted if the provided context is
  40629. // canceled.
  40630. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  40631. c.ctx_ = ctx
  40632. return c
  40633. }
  40634. // Header returns an http.Header that can be modified by the caller to
  40635. // add HTTP headers to the request.
  40636. func (c *SitesGetCall) Header() http.Header {
  40637. if c.header_ == nil {
  40638. c.header_ = make(http.Header)
  40639. }
  40640. return c.header_
  40641. }
  40642. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  40643. reqHeaders := make(http.Header)
  40644. for k, v := range c.header_ {
  40645. reqHeaders[k] = v
  40646. }
  40647. reqHeaders.Set("User-Agent", c.s.userAgent())
  40648. if c.ifNoneMatch_ != "" {
  40649. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40650. }
  40651. var body io.Reader = nil
  40652. c.urlParams_.Set("alt", alt)
  40653. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  40654. urls += "?" + c.urlParams_.Encode()
  40655. req, _ := http.NewRequest("GET", urls, body)
  40656. req.Header = reqHeaders
  40657. googleapi.Expand(req.URL, map[string]string{
  40658. "profileId": strconv.FormatInt(c.profileId, 10),
  40659. "id": strconv.FormatInt(c.id, 10),
  40660. })
  40661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40662. }
  40663. // Do executes the "dfareporting.sites.get" call.
  40664. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40665. // code is an error. Response headers are in either
  40666. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40667. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40668. // whether the returned error was because http.StatusNotModified was
  40669. // returned.
  40670. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40671. gensupport.SetOptions(c.urlParams_, opts...)
  40672. res, err := c.doRequest("json")
  40673. if res != nil && res.StatusCode == http.StatusNotModified {
  40674. if res.Body != nil {
  40675. res.Body.Close()
  40676. }
  40677. return nil, &googleapi.Error{
  40678. Code: res.StatusCode,
  40679. Header: res.Header,
  40680. }
  40681. }
  40682. if err != nil {
  40683. return nil, err
  40684. }
  40685. defer googleapi.CloseBody(res)
  40686. if err := googleapi.CheckResponse(res); err != nil {
  40687. return nil, err
  40688. }
  40689. ret := &Site{
  40690. ServerResponse: googleapi.ServerResponse{
  40691. Header: res.Header,
  40692. HTTPStatusCode: res.StatusCode,
  40693. },
  40694. }
  40695. target := &ret
  40696. if err := gensupport.DecodeResponse(target, res); err != nil {
  40697. return nil, err
  40698. }
  40699. return ret, nil
  40700. // {
  40701. // "description": "Gets one site by ID.",
  40702. // "httpMethod": "GET",
  40703. // "id": "dfareporting.sites.get",
  40704. // "parameterOrder": [
  40705. // "profileId",
  40706. // "id"
  40707. // ],
  40708. // "parameters": {
  40709. // "id": {
  40710. // "description": "Site ID.",
  40711. // "format": "int64",
  40712. // "location": "path",
  40713. // "required": true,
  40714. // "type": "string"
  40715. // },
  40716. // "profileId": {
  40717. // "description": "User profile ID associated with this request.",
  40718. // "format": "int64",
  40719. // "location": "path",
  40720. // "required": true,
  40721. // "type": "string"
  40722. // }
  40723. // },
  40724. // "path": "userprofiles/{profileId}/sites/{id}",
  40725. // "response": {
  40726. // "$ref": "Site"
  40727. // },
  40728. // "scopes": [
  40729. // "https://www.googleapis.com/auth/dfatrafficking"
  40730. // ]
  40731. // }
  40732. }
  40733. // method id "dfareporting.sites.insert":
  40734. type SitesInsertCall struct {
  40735. s *Service
  40736. profileId int64
  40737. site *Site
  40738. urlParams_ gensupport.URLParams
  40739. ctx_ context.Context
  40740. header_ http.Header
  40741. }
  40742. // Insert: Inserts a new site.
  40743. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  40744. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40745. c.profileId = profileId
  40746. c.site = site
  40747. return c
  40748. }
  40749. // Fields allows partial responses to be retrieved. See
  40750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40751. // for more information.
  40752. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  40753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40754. return c
  40755. }
  40756. // Context sets the context to be used in this call's Do method. Any
  40757. // pending HTTP request will be aborted if the provided context is
  40758. // canceled.
  40759. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  40760. c.ctx_ = ctx
  40761. return c
  40762. }
  40763. // Header returns an http.Header that can be modified by the caller to
  40764. // add HTTP headers to the request.
  40765. func (c *SitesInsertCall) Header() http.Header {
  40766. if c.header_ == nil {
  40767. c.header_ = make(http.Header)
  40768. }
  40769. return c.header_
  40770. }
  40771. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  40772. reqHeaders := make(http.Header)
  40773. for k, v := range c.header_ {
  40774. reqHeaders[k] = v
  40775. }
  40776. reqHeaders.Set("User-Agent", c.s.userAgent())
  40777. var body io.Reader = nil
  40778. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40779. if err != nil {
  40780. return nil, err
  40781. }
  40782. reqHeaders.Set("Content-Type", "application/json")
  40783. c.urlParams_.Set("alt", alt)
  40784. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40785. urls += "?" + c.urlParams_.Encode()
  40786. req, _ := http.NewRequest("POST", urls, body)
  40787. req.Header = reqHeaders
  40788. googleapi.Expand(req.URL, map[string]string{
  40789. "profileId": strconv.FormatInt(c.profileId, 10),
  40790. })
  40791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40792. }
  40793. // Do executes the "dfareporting.sites.insert" call.
  40794. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40795. // code is an error. Response headers are in either
  40796. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40797. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40798. // whether the returned error was because http.StatusNotModified was
  40799. // returned.
  40800. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40801. gensupport.SetOptions(c.urlParams_, opts...)
  40802. res, err := c.doRequest("json")
  40803. if res != nil && res.StatusCode == http.StatusNotModified {
  40804. if res.Body != nil {
  40805. res.Body.Close()
  40806. }
  40807. return nil, &googleapi.Error{
  40808. Code: res.StatusCode,
  40809. Header: res.Header,
  40810. }
  40811. }
  40812. if err != nil {
  40813. return nil, err
  40814. }
  40815. defer googleapi.CloseBody(res)
  40816. if err := googleapi.CheckResponse(res); err != nil {
  40817. return nil, err
  40818. }
  40819. ret := &Site{
  40820. ServerResponse: googleapi.ServerResponse{
  40821. Header: res.Header,
  40822. HTTPStatusCode: res.StatusCode,
  40823. },
  40824. }
  40825. target := &ret
  40826. if err := gensupport.DecodeResponse(target, res); err != nil {
  40827. return nil, err
  40828. }
  40829. return ret, nil
  40830. // {
  40831. // "description": "Inserts a new site.",
  40832. // "httpMethod": "POST",
  40833. // "id": "dfareporting.sites.insert",
  40834. // "parameterOrder": [
  40835. // "profileId"
  40836. // ],
  40837. // "parameters": {
  40838. // "profileId": {
  40839. // "description": "User profile ID associated with this request.",
  40840. // "format": "int64",
  40841. // "location": "path",
  40842. // "required": true,
  40843. // "type": "string"
  40844. // }
  40845. // },
  40846. // "path": "userprofiles/{profileId}/sites",
  40847. // "request": {
  40848. // "$ref": "Site"
  40849. // },
  40850. // "response": {
  40851. // "$ref": "Site"
  40852. // },
  40853. // "scopes": [
  40854. // "https://www.googleapis.com/auth/dfatrafficking"
  40855. // ]
  40856. // }
  40857. }
  40858. // method id "dfareporting.sites.list":
  40859. type SitesListCall struct {
  40860. s *Service
  40861. profileId int64
  40862. urlParams_ gensupport.URLParams
  40863. ifNoneMatch_ string
  40864. ctx_ context.Context
  40865. header_ http.Header
  40866. }
  40867. // List: Retrieves a list of sites, possibly filtered. This method
  40868. // supports paging.
  40869. func (r *SitesService) List(profileId int64) *SitesListCall {
  40870. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40871. c.profileId = profileId
  40872. return c
  40873. }
  40874. // AcceptsInStreamVideoPlacements sets the optional parameter
  40875. // "acceptsInStreamVideoPlacements": This search filter is no longer
  40876. // supported and will have no effect on the results returned.
  40877. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  40878. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  40879. return c
  40880. }
  40881. // AcceptsInterstitialPlacements sets the optional parameter
  40882. // "acceptsInterstitialPlacements": This search filter is no longer
  40883. // supported and will have no effect on the results returned.
  40884. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  40885. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  40886. return c
  40887. }
  40888. // AcceptsPublisherPaidPlacements sets the optional parameter
  40889. // "acceptsPublisherPaidPlacements": Select only sites that accept
  40890. // publisher paid placements.
  40891. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  40892. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  40893. return c
  40894. }
  40895. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  40896. // AdWords sites.
  40897. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  40898. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  40899. return c
  40900. }
  40901. // Approved sets the optional parameter "approved": Select only approved
  40902. // sites.
  40903. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  40904. c.urlParams_.Set("approved", fmt.Sprint(approved))
  40905. return c
  40906. }
  40907. // CampaignIds sets the optional parameter "campaignIds": Select only
  40908. // sites with these campaign IDs.
  40909. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  40910. var campaignIds_ []string
  40911. for _, v := range campaignIds {
  40912. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  40913. }
  40914. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  40915. return c
  40916. }
  40917. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  40918. // Select only sites with these directory site IDs.
  40919. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  40920. var directorySiteIds_ []string
  40921. for _, v := range directorySiteIds {
  40922. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  40923. }
  40924. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  40925. return c
  40926. }
  40927. // Ids sets the optional parameter "ids": Select only sites with these
  40928. // IDs.
  40929. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  40930. var ids_ []string
  40931. for _, v := range ids {
  40932. ids_ = append(ids_, fmt.Sprint(v))
  40933. }
  40934. c.urlParams_.SetMulti("ids", ids_)
  40935. return c
  40936. }
  40937. // MaxResults sets the optional parameter "maxResults": Maximum number
  40938. // of results to return.
  40939. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  40940. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40941. return c
  40942. }
  40943. // PageToken sets the optional parameter "pageToken": Value of the
  40944. // nextPageToken from the previous result page.
  40945. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  40946. c.urlParams_.Set("pageToken", pageToken)
  40947. return c
  40948. }
  40949. // SearchString sets the optional parameter "searchString": Allows
  40950. // searching for objects by name, ID or keyName. Wildcards (*) are
  40951. // allowed. For example, "site*2015" will return objects with names like
  40952. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  40953. // the searches also add wildcards implicitly at the start and the end
  40954. // of the search string. For example, a search string of "site" will
  40955. // match objects with name "my site", "site 2015", or simply "site".
  40956. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  40957. c.urlParams_.Set("searchString", searchString)
  40958. return c
  40959. }
  40960. // SortField sets the optional parameter "sortField": Field by which to
  40961. // sort the list.
  40962. //
  40963. // Possible values:
  40964. // "ID" (default)
  40965. // "NAME"
  40966. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  40967. c.urlParams_.Set("sortField", sortField)
  40968. return c
  40969. }
  40970. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40971. // results.
  40972. //
  40973. // Possible values:
  40974. // "ASCENDING" (default)
  40975. // "DESCENDING"
  40976. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  40977. c.urlParams_.Set("sortOrder", sortOrder)
  40978. return c
  40979. }
  40980. // SubaccountId sets the optional parameter "subaccountId": Select only
  40981. // sites with this subaccount ID.
  40982. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  40983. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  40984. return c
  40985. }
  40986. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  40987. // sites that have not been mapped to a directory site.
  40988. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  40989. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  40990. return c
  40991. }
  40992. // Fields allows partial responses to be retrieved. See
  40993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40994. // for more information.
  40995. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  40996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40997. return c
  40998. }
  40999. // IfNoneMatch sets the optional parameter which makes the operation
  41000. // fail if the object's ETag matches the given value. This is useful for
  41001. // getting updates only after the object has changed since the last
  41002. // request. Use googleapi.IsNotModified to check whether the response
  41003. // error from Do is the result of In-None-Match.
  41004. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  41005. c.ifNoneMatch_ = entityTag
  41006. return c
  41007. }
  41008. // Context sets the context to be used in this call's Do method. Any
  41009. // pending HTTP request will be aborted if the provided context is
  41010. // canceled.
  41011. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  41012. c.ctx_ = ctx
  41013. return c
  41014. }
  41015. // Header returns an http.Header that can be modified by the caller to
  41016. // add HTTP headers to the request.
  41017. func (c *SitesListCall) Header() http.Header {
  41018. if c.header_ == nil {
  41019. c.header_ = make(http.Header)
  41020. }
  41021. return c.header_
  41022. }
  41023. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  41024. reqHeaders := make(http.Header)
  41025. for k, v := range c.header_ {
  41026. reqHeaders[k] = v
  41027. }
  41028. reqHeaders.Set("User-Agent", c.s.userAgent())
  41029. if c.ifNoneMatch_ != "" {
  41030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41031. }
  41032. var body io.Reader = nil
  41033. c.urlParams_.Set("alt", alt)
  41034. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41035. urls += "?" + c.urlParams_.Encode()
  41036. req, _ := http.NewRequest("GET", urls, body)
  41037. req.Header = reqHeaders
  41038. googleapi.Expand(req.URL, map[string]string{
  41039. "profileId": strconv.FormatInt(c.profileId, 10),
  41040. })
  41041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41042. }
  41043. // Do executes the "dfareporting.sites.list" call.
  41044. // Exactly one of *SitesListResponse or error will be non-nil. Any
  41045. // non-2xx status code is an error. Response headers are in either
  41046. // *SitesListResponse.ServerResponse.Header or (if a response was
  41047. // returned at all) in error.(*googleapi.Error).Header. Use
  41048. // googleapi.IsNotModified to check whether the returned error was
  41049. // because http.StatusNotModified was returned.
  41050. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  41051. gensupport.SetOptions(c.urlParams_, opts...)
  41052. res, err := c.doRequest("json")
  41053. if res != nil && res.StatusCode == http.StatusNotModified {
  41054. if res.Body != nil {
  41055. res.Body.Close()
  41056. }
  41057. return nil, &googleapi.Error{
  41058. Code: res.StatusCode,
  41059. Header: res.Header,
  41060. }
  41061. }
  41062. if err != nil {
  41063. return nil, err
  41064. }
  41065. defer googleapi.CloseBody(res)
  41066. if err := googleapi.CheckResponse(res); err != nil {
  41067. return nil, err
  41068. }
  41069. ret := &SitesListResponse{
  41070. ServerResponse: googleapi.ServerResponse{
  41071. Header: res.Header,
  41072. HTTPStatusCode: res.StatusCode,
  41073. },
  41074. }
  41075. target := &ret
  41076. if err := gensupport.DecodeResponse(target, res); err != nil {
  41077. return nil, err
  41078. }
  41079. return ret, nil
  41080. // {
  41081. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  41082. // "httpMethod": "GET",
  41083. // "id": "dfareporting.sites.list",
  41084. // "parameterOrder": [
  41085. // "profileId"
  41086. // ],
  41087. // "parameters": {
  41088. // "acceptsInStreamVideoPlacements": {
  41089. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41090. // "location": "query",
  41091. // "type": "boolean"
  41092. // },
  41093. // "acceptsInterstitialPlacements": {
  41094. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41095. // "location": "query",
  41096. // "type": "boolean"
  41097. // },
  41098. // "acceptsPublisherPaidPlacements": {
  41099. // "description": "Select only sites that accept publisher paid placements.",
  41100. // "location": "query",
  41101. // "type": "boolean"
  41102. // },
  41103. // "adWordsSite": {
  41104. // "description": "Select only AdWords sites.",
  41105. // "location": "query",
  41106. // "type": "boolean"
  41107. // },
  41108. // "approved": {
  41109. // "description": "Select only approved sites.",
  41110. // "location": "query",
  41111. // "type": "boolean"
  41112. // },
  41113. // "campaignIds": {
  41114. // "description": "Select only sites with these campaign IDs.",
  41115. // "format": "int64",
  41116. // "location": "query",
  41117. // "repeated": true,
  41118. // "type": "string"
  41119. // },
  41120. // "directorySiteIds": {
  41121. // "description": "Select only sites with these directory site IDs.",
  41122. // "format": "int64",
  41123. // "location": "query",
  41124. // "repeated": true,
  41125. // "type": "string"
  41126. // },
  41127. // "ids": {
  41128. // "description": "Select only sites with these IDs.",
  41129. // "format": "int64",
  41130. // "location": "query",
  41131. // "repeated": true,
  41132. // "type": "string"
  41133. // },
  41134. // "maxResults": {
  41135. // "default": "1000",
  41136. // "description": "Maximum number of results to return.",
  41137. // "format": "int32",
  41138. // "location": "query",
  41139. // "maximum": "1000",
  41140. // "minimum": "0",
  41141. // "type": "integer"
  41142. // },
  41143. // "pageToken": {
  41144. // "description": "Value of the nextPageToken from the previous result page.",
  41145. // "location": "query",
  41146. // "type": "string"
  41147. // },
  41148. // "profileId": {
  41149. // "description": "User profile ID associated with this request.",
  41150. // "format": "int64",
  41151. // "location": "path",
  41152. // "required": true,
  41153. // "type": "string"
  41154. // },
  41155. // "searchString": {
  41156. // "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\".",
  41157. // "location": "query",
  41158. // "type": "string"
  41159. // },
  41160. // "sortField": {
  41161. // "default": "ID",
  41162. // "description": "Field by which to sort the list.",
  41163. // "enum": [
  41164. // "ID",
  41165. // "NAME"
  41166. // ],
  41167. // "enumDescriptions": [
  41168. // "",
  41169. // ""
  41170. // ],
  41171. // "location": "query",
  41172. // "type": "string"
  41173. // },
  41174. // "sortOrder": {
  41175. // "default": "ASCENDING",
  41176. // "description": "Order of sorted results.",
  41177. // "enum": [
  41178. // "ASCENDING",
  41179. // "DESCENDING"
  41180. // ],
  41181. // "enumDescriptions": [
  41182. // "",
  41183. // ""
  41184. // ],
  41185. // "location": "query",
  41186. // "type": "string"
  41187. // },
  41188. // "subaccountId": {
  41189. // "description": "Select only sites with this subaccount ID.",
  41190. // "format": "int64",
  41191. // "location": "query",
  41192. // "type": "string"
  41193. // },
  41194. // "unmappedSite": {
  41195. // "description": "Select only sites that have not been mapped to a directory site.",
  41196. // "location": "query",
  41197. // "type": "boolean"
  41198. // }
  41199. // },
  41200. // "path": "userprofiles/{profileId}/sites",
  41201. // "response": {
  41202. // "$ref": "SitesListResponse"
  41203. // },
  41204. // "scopes": [
  41205. // "https://www.googleapis.com/auth/dfatrafficking"
  41206. // ]
  41207. // }
  41208. }
  41209. // Pages invokes f for each page of results.
  41210. // A non-nil error returned from f will halt the iteration.
  41211. // The provided context supersedes any context provided to the Context method.
  41212. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  41213. c.ctx_ = ctx
  41214. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41215. for {
  41216. x, err := c.Do()
  41217. if err != nil {
  41218. return err
  41219. }
  41220. if err := f(x); err != nil {
  41221. return err
  41222. }
  41223. if x.NextPageToken == "" {
  41224. return nil
  41225. }
  41226. c.PageToken(x.NextPageToken)
  41227. }
  41228. }
  41229. // method id "dfareporting.sites.patch":
  41230. type SitesPatchCall struct {
  41231. s *Service
  41232. profileId int64
  41233. site *Site
  41234. urlParams_ gensupport.URLParams
  41235. ctx_ context.Context
  41236. header_ http.Header
  41237. }
  41238. // Patch: Updates an existing site. This method supports patch
  41239. // semantics.
  41240. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  41241. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41242. c.profileId = profileId
  41243. c.urlParams_.Set("id", fmt.Sprint(id))
  41244. c.site = site
  41245. return c
  41246. }
  41247. // Fields allows partial responses to be retrieved. See
  41248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41249. // for more information.
  41250. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  41251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41252. return c
  41253. }
  41254. // Context sets the context to be used in this call's Do method. Any
  41255. // pending HTTP request will be aborted if the provided context is
  41256. // canceled.
  41257. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  41258. c.ctx_ = ctx
  41259. return c
  41260. }
  41261. // Header returns an http.Header that can be modified by the caller to
  41262. // add HTTP headers to the request.
  41263. func (c *SitesPatchCall) Header() http.Header {
  41264. if c.header_ == nil {
  41265. c.header_ = make(http.Header)
  41266. }
  41267. return c.header_
  41268. }
  41269. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  41270. reqHeaders := make(http.Header)
  41271. for k, v := range c.header_ {
  41272. reqHeaders[k] = v
  41273. }
  41274. reqHeaders.Set("User-Agent", c.s.userAgent())
  41275. var body io.Reader = nil
  41276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41277. if err != nil {
  41278. return nil, err
  41279. }
  41280. reqHeaders.Set("Content-Type", "application/json")
  41281. c.urlParams_.Set("alt", alt)
  41282. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41283. urls += "?" + c.urlParams_.Encode()
  41284. req, _ := http.NewRequest("PATCH", urls, body)
  41285. req.Header = reqHeaders
  41286. googleapi.Expand(req.URL, map[string]string{
  41287. "profileId": strconv.FormatInt(c.profileId, 10),
  41288. })
  41289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41290. }
  41291. // Do executes the "dfareporting.sites.patch" call.
  41292. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41293. // code is an error. Response headers are in either
  41294. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41295. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41296. // whether the returned error was because http.StatusNotModified was
  41297. // returned.
  41298. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41299. gensupport.SetOptions(c.urlParams_, opts...)
  41300. res, err := c.doRequest("json")
  41301. if res != nil && res.StatusCode == http.StatusNotModified {
  41302. if res.Body != nil {
  41303. res.Body.Close()
  41304. }
  41305. return nil, &googleapi.Error{
  41306. Code: res.StatusCode,
  41307. Header: res.Header,
  41308. }
  41309. }
  41310. if err != nil {
  41311. return nil, err
  41312. }
  41313. defer googleapi.CloseBody(res)
  41314. if err := googleapi.CheckResponse(res); err != nil {
  41315. return nil, err
  41316. }
  41317. ret := &Site{
  41318. ServerResponse: googleapi.ServerResponse{
  41319. Header: res.Header,
  41320. HTTPStatusCode: res.StatusCode,
  41321. },
  41322. }
  41323. target := &ret
  41324. if err := gensupport.DecodeResponse(target, res); err != nil {
  41325. return nil, err
  41326. }
  41327. return ret, nil
  41328. // {
  41329. // "description": "Updates an existing site. This method supports patch semantics.",
  41330. // "httpMethod": "PATCH",
  41331. // "id": "dfareporting.sites.patch",
  41332. // "parameterOrder": [
  41333. // "profileId",
  41334. // "id"
  41335. // ],
  41336. // "parameters": {
  41337. // "id": {
  41338. // "description": "Site ID.",
  41339. // "format": "int64",
  41340. // "location": "query",
  41341. // "required": true,
  41342. // "type": "string"
  41343. // },
  41344. // "profileId": {
  41345. // "description": "User profile ID associated with this request.",
  41346. // "format": "int64",
  41347. // "location": "path",
  41348. // "required": true,
  41349. // "type": "string"
  41350. // }
  41351. // },
  41352. // "path": "userprofiles/{profileId}/sites",
  41353. // "request": {
  41354. // "$ref": "Site"
  41355. // },
  41356. // "response": {
  41357. // "$ref": "Site"
  41358. // },
  41359. // "scopes": [
  41360. // "https://www.googleapis.com/auth/dfatrafficking"
  41361. // ]
  41362. // }
  41363. }
  41364. // method id "dfareporting.sites.update":
  41365. type SitesUpdateCall struct {
  41366. s *Service
  41367. profileId int64
  41368. site *Site
  41369. urlParams_ gensupport.URLParams
  41370. ctx_ context.Context
  41371. header_ http.Header
  41372. }
  41373. // Update: Updates an existing site.
  41374. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  41375. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41376. c.profileId = profileId
  41377. c.site = site
  41378. return c
  41379. }
  41380. // Fields allows partial responses to be retrieved. See
  41381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41382. // for more information.
  41383. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  41384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41385. return c
  41386. }
  41387. // Context sets the context to be used in this call's Do method. Any
  41388. // pending HTTP request will be aborted if the provided context is
  41389. // canceled.
  41390. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  41391. c.ctx_ = ctx
  41392. return c
  41393. }
  41394. // Header returns an http.Header that can be modified by the caller to
  41395. // add HTTP headers to the request.
  41396. func (c *SitesUpdateCall) Header() http.Header {
  41397. if c.header_ == nil {
  41398. c.header_ = make(http.Header)
  41399. }
  41400. return c.header_
  41401. }
  41402. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  41403. reqHeaders := make(http.Header)
  41404. for k, v := range c.header_ {
  41405. reqHeaders[k] = v
  41406. }
  41407. reqHeaders.Set("User-Agent", c.s.userAgent())
  41408. var body io.Reader = nil
  41409. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41410. if err != nil {
  41411. return nil, err
  41412. }
  41413. reqHeaders.Set("Content-Type", "application/json")
  41414. c.urlParams_.Set("alt", alt)
  41415. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41416. urls += "?" + c.urlParams_.Encode()
  41417. req, _ := http.NewRequest("PUT", urls, body)
  41418. req.Header = reqHeaders
  41419. googleapi.Expand(req.URL, map[string]string{
  41420. "profileId": strconv.FormatInt(c.profileId, 10),
  41421. })
  41422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41423. }
  41424. // Do executes the "dfareporting.sites.update" call.
  41425. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41426. // code is an error. Response headers are in either
  41427. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41428. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41429. // whether the returned error was because http.StatusNotModified was
  41430. // returned.
  41431. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41432. gensupport.SetOptions(c.urlParams_, opts...)
  41433. res, err := c.doRequest("json")
  41434. if res != nil && res.StatusCode == http.StatusNotModified {
  41435. if res.Body != nil {
  41436. res.Body.Close()
  41437. }
  41438. return nil, &googleapi.Error{
  41439. Code: res.StatusCode,
  41440. Header: res.Header,
  41441. }
  41442. }
  41443. if err != nil {
  41444. return nil, err
  41445. }
  41446. defer googleapi.CloseBody(res)
  41447. if err := googleapi.CheckResponse(res); err != nil {
  41448. return nil, err
  41449. }
  41450. ret := &Site{
  41451. ServerResponse: googleapi.ServerResponse{
  41452. Header: res.Header,
  41453. HTTPStatusCode: res.StatusCode,
  41454. },
  41455. }
  41456. target := &ret
  41457. if err := gensupport.DecodeResponse(target, res); err != nil {
  41458. return nil, err
  41459. }
  41460. return ret, nil
  41461. // {
  41462. // "description": "Updates an existing site.",
  41463. // "httpMethod": "PUT",
  41464. // "id": "dfareporting.sites.update",
  41465. // "parameterOrder": [
  41466. // "profileId"
  41467. // ],
  41468. // "parameters": {
  41469. // "profileId": {
  41470. // "description": "User profile ID associated with this request.",
  41471. // "format": "int64",
  41472. // "location": "path",
  41473. // "required": true,
  41474. // "type": "string"
  41475. // }
  41476. // },
  41477. // "path": "userprofiles/{profileId}/sites",
  41478. // "request": {
  41479. // "$ref": "Site"
  41480. // },
  41481. // "response": {
  41482. // "$ref": "Site"
  41483. // },
  41484. // "scopes": [
  41485. // "https://www.googleapis.com/auth/dfatrafficking"
  41486. // ]
  41487. // }
  41488. }
  41489. // method id "dfareporting.sizes.get":
  41490. type SizesGetCall struct {
  41491. s *Service
  41492. profileId int64
  41493. id int64
  41494. urlParams_ gensupport.URLParams
  41495. ifNoneMatch_ string
  41496. ctx_ context.Context
  41497. header_ http.Header
  41498. }
  41499. // Get: Gets one size by ID.
  41500. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  41501. c := &SizesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41502. c.profileId = profileId
  41503. c.id = id
  41504. return c
  41505. }
  41506. // Fields allows partial responses to be retrieved. See
  41507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41508. // for more information.
  41509. func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  41510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41511. return c
  41512. }
  41513. // IfNoneMatch sets the optional parameter which makes the operation
  41514. // fail if the object's ETag matches the given value. This is useful for
  41515. // getting updates only after the object has changed since the last
  41516. // request. Use googleapi.IsNotModified to check whether the response
  41517. // error from Do is the result of In-None-Match.
  41518. func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  41519. c.ifNoneMatch_ = entityTag
  41520. return c
  41521. }
  41522. // Context sets the context to be used in this call's Do method. Any
  41523. // pending HTTP request will be aborted if the provided context is
  41524. // canceled.
  41525. func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  41526. c.ctx_ = ctx
  41527. return c
  41528. }
  41529. // Header returns an http.Header that can be modified by the caller to
  41530. // add HTTP headers to the request.
  41531. func (c *SizesGetCall) Header() http.Header {
  41532. if c.header_ == nil {
  41533. c.header_ = make(http.Header)
  41534. }
  41535. return c.header_
  41536. }
  41537. func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) {
  41538. reqHeaders := make(http.Header)
  41539. for k, v := range c.header_ {
  41540. reqHeaders[k] = v
  41541. }
  41542. reqHeaders.Set("User-Agent", c.s.userAgent())
  41543. if c.ifNoneMatch_ != "" {
  41544. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41545. }
  41546. var body io.Reader = nil
  41547. c.urlParams_.Set("alt", alt)
  41548. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}")
  41549. urls += "?" + c.urlParams_.Encode()
  41550. req, _ := http.NewRequest("GET", urls, body)
  41551. req.Header = reqHeaders
  41552. googleapi.Expand(req.URL, map[string]string{
  41553. "profileId": strconv.FormatInt(c.profileId, 10),
  41554. "id": strconv.FormatInt(c.id, 10),
  41555. })
  41556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41557. }
  41558. // Do executes the "dfareporting.sizes.get" call.
  41559. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  41560. // code is an error. Response headers are in either
  41561. // *Size.ServerResponse.Header or (if a response was returned at all) in
  41562. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41563. // whether the returned error was because http.StatusNotModified was
  41564. // returned.
  41565. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  41566. gensupport.SetOptions(c.urlParams_, opts...)
  41567. res, err := c.doRequest("json")
  41568. if res != nil && res.StatusCode == http.StatusNotModified {
  41569. if res.Body != nil {
  41570. res.Body.Close()
  41571. }
  41572. return nil, &googleapi.Error{
  41573. Code: res.StatusCode,
  41574. Header: res.Header,
  41575. }
  41576. }
  41577. if err != nil {
  41578. return nil, err
  41579. }
  41580. defer googleapi.CloseBody(res)
  41581. if err := googleapi.CheckResponse(res); err != nil {
  41582. return nil, err
  41583. }
  41584. ret := &Size{
  41585. ServerResponse: googleapi.ServerResponse{
  41586. Header: res.Header,
  41587. HTTPStatusCode: res.StatusCode,
  41588. },
  41589. }
  41590. target := &ret
  41591. if err := gensupport.DecodeResponse(target, res); err != nil {
  41592. return nil, err
  41593. }
  41594. return ret, nil
  41595. // {
  41596. // "description": "Gets one size by ID.",
  41597. // "httpMethod": "GET",
  41598. // "id": "dfareporting.sizes.get",
  41599. // "parameterOrder": [
  41600. // "profileId",
  41601. // "id"
  41602. // ],
  41603. // "parameters": {
  41604. // "id": {
  41605. // "description": "Size ID.",
  41606. // "format": "int64",
  41607. // "location": "path",
  41608. // "required": true,
  41609. // "type": "string"
  41610. // },
  41611. // "profileId": {
  41612. // "description": "User profile ID associated with this request.",
  41613. // "format": "int64",
  41614. // "location": "path",
  41615. // "required": true,
  41616. // "type": "string"
  41617. // }
  41618. // },
  41619. // "path": "userprofiles/{profileId}/sizes/{id}",
  41620. // "response": {
  41621. // "$ref": "Size"
  41622. // },
  41623. // "scopes": [
  41624. // "https://www.googleapis.com/auth/dfatrafficking"
  41625. // ]
  41626. // }
  41627. }
  41628. // method id "dfareporting.sizes.insert":
  41629. type SizesInsertCall struct {
  41630. s *Service
  41631. profileId int64
  41632. size *Size
  41633. urlParams_ gensupport.URLParams
  41634. ctx_ context.Context
  41635. header_ http.Header
  41636. }
  41637. // Insert: Inserts a new size.
  41638. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  41639. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41640. c.profileId = profileId
  41641. c.size = size
  41642. return c
  41643. }
  41644. // Fields allows partial responses to be retrieved. See
  41645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41646. // for more information.
  41647. func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  41648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41649. return c
  41650. }
  41651. // Context sets the context to be used in this call's Do method. Any
  41652. // pending HTTP request will be aborted if the provided context is
  41653. // canceled.
  41654. func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  41655. c.ctx_ = ctx
  41656. return c
  41657. }
  41658. // Header returns an http.Header that can be modified by the caller to
  41659. // add HTTP headers to the request.
  41660. func (c *SizesInsertCall) Header() http.Header {
  41661. if c.header_ == nil {
  41662. c.header_ = make(http.Header)
  41663. }
  41664. return c.header_
  41665. }
  41666. func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) {
  41667. reqHeaders := make(http.Header)
  41668. for k, v := range c.header_ {
  41669. reqHeaders[k] = v
  41670. }
  41671. reqHeaders.Set("User-Agent", c.s.userAgent())
  41672. var body io.Reader = nil
  41673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.size)
  41674. if err != nil {
  41675. return nil, err
  41676. }
  41677. reqHeaders.Set("Content-Type", "application/json")
  41678. c.urlParams_.Set("alt", alt)
  41679. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  41680. urls += "?" + c.urlParams_.Encode()
  41681. req, _ := http.NewRequest("POST", urls, body)
  41682. req.Header = reqHeaders
  41683. googleapi.Expand(req.URL, map[string]string{
  41684. "profileId": strconv.FormatInt(c.profileId, 10),
  41685. })
  41686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41687. }
  41688. // Do executes the "dfareporting.sizes.insert" call.
  41689. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  41690. // code is an error. Response headers are in either
  41691. // *Size.ServerResponse.Header or (if a response was returned at all) in
  41692. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41693. // whether the returned error was because http.StatusNotModified was
  41694. // returned.
  41695. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  41696. gensupport.SetOptions(c.urlParams_, opts...)
  41697. res, err := c.doRequest("json")
  41698. if res != nil && res.StatusCode == http.StatusNotModified {
  41699. if res.Body != nil {
  41700. res.Body.Close()
  41701. }
  41702. return nil, &googleapi.Error{
  41703. Code: res.StatusCode,
  41704. Header: res.Header,
  41705. }
  41706. }
  41707. if err != nil {
  41708. return nil, err
  41709. }
  41710. defer googleapi.CloseBody(res)
  41711. if err := googleapi.CheckResponse(res); err != nil {
  41712. return nil, err
  41713. }
  41714. ret := &Size{
  41715. ServerResponse: googleapi.ServerResponse{
  41716. Header: res.Header,
  41717. HTTPStatusCode: res.StatusCode,
  41718. },
  41719. }
  41720. target := &ret
  41721. if err := gensupport.DecodeResponse(target, res); err != nil {
  41722. return nil, err
  41723. }
  41724. return ret, nil
  41725. // {
  41726. // "description": "Inserts a new size.",
  41727. // "httpMethod": "POST",
  41728. // "id": "dfareporting.sizes.insert",
  41729. // "parameterOrder": [
  41730. // "profileId"
  41731. // ],
  41732. // "parameters": {
  41733. // "profileId": {
  41734. // "description": "User profile ID associated with this request.",
  41735. // "format": "int64",
  41736. // "location": "path",
  41737. // "required": true,
  41738. // "type": "string"
  41739. // }
  41740. // },
  41741. // "path": "userprofiles/{profileId}/sizes",
  41742. // "request": {
  41743. // "$ref": "Size"
  41744. // },
  41745. // "response": {
  41746. // "$ref": "Size"
  41747. // },
  41748. // "scopes": [
  41749. // "https://www.googleapis.com/auth/dfatrafficking"
  41750. // ]
  41751. // }
  41752. }
  41753. // method id "dfareporting.sizes.list":
  41754. type SizesListCall struct {
  41755. s *Service
  41756. profileId int64
  41757. urlParams_ gensupport.URLParams
  41758. ifNoneMatch_ string
  41759. ctx_ context.Context
  41760. header_ http.Header
  41761. }
  41762. // List: Retrieves a list of sizes, possibly filtered. Retrieved sizes
  41763. // are globally unique and may include values not currently in use by
  41764. // your account. Due to this, the list of sizes returned by this method
  41765. // may differ from the list seen in the Trafficking UI.
  41766. func (r *SizesService) List(profileId int64) *SizesListCall {
  41767. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41768. c.profileId = profileId
  41769. return c
  41770. }
  41771. // Height sets the optional parameter "height": Select only sizes with
  41772. // this height.
  41773. func (c *SizesListCall) Height(height int64) *SizesListCall {
  41774. c.urlParams_.Set("height", fmt.Sprint(height))
  41775. return c
  41776. }
  41777. // IabStandard sets the optional parameter "iabStandard": Select only
  41778. // IAB standard sizes.
  41779. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  41780. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  41781. return c
  41782. }
  41783. // Ids sets the optional parameter "ids": Select only sizes with these
  41784. // IDs.
  41785. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  41786. var ids_ []string
  41787. for _, v := range ids {
  41788. ids_ = append(ids_, fmt.Sprint(v))
  41789. }
  41790. c.urlParams_.SetMulti("ids", ids_)
  41791. return c
  41792. }
  41793. // Width sets the optional parameter "width": Select only sizes with
  41794. // this width.
  41795. func (c *SizesListCall) Width(width int64) *SizesListCall {
  41796. c.urlParams_.Set("width", fmt.Sprint(width))
  41797. return c
  41798. }
  41799. // Fields allows partial responses to be retrieved. See
  41800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41801. // for more information.
  41802. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  41803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41804. return c
  41805. }
  41806. // IfNoneMatch sets the optional parameter which makes the operation
  41807. // fail if the object's ETag matches the given value. This is useful for
  41808. // getting updates only after the object has changed since the last
  41809. // request. Use googleapi.IsNotModified to check whether the response
  41810. // error from Do is the result of In-None-Match.
  41811. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  41812. c.ifNoneMatch_ = entityTag
  41813. return c
  41814. }
  41815. // Context sets the context to be used in this call's Do method. Any
  41816. // pending HTTP request will be aborted if the provided context is
  41817. // canceled.
  41818. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  41819. c.ctx_ = ctx
  41820. return c
  41821. }
  41822. // Header returns an http.Header that can be modified by the caller to
  41823. // add HTTP headers to the request.
  41824. func (c *SizesListCall) Header() http.Header {
  41825. if c.header_ == nil {
  41826. c.header_ = make(http.Header)
  41827. }
  41828. return c.header_
  41829. }
  41830. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  41831. reqHeaders := make(http.Header)
  41832. for k, v := range c.header_ {
  41833. reqHeaders[k] = v
  41834. }
  41835. reqHeaders.Set("User-Agent", c.s.userAgent())
  41836. if c.ifNoneMatch_ != "" {
  41837. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41838. }
  41839. var body io.Reader = nil
  41840. c.urlParams_.Set("alt", alt)
  41841. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  41842. urls += "?" + c.urlParams_.Encode()
  41843. req, _ := http.NewRequest("GET", urls, body)
  41844. req.Header = reqHeaders
  41845. googleapi.Expand(req.URL, map[string]string{
  41846. "profileId": strconv.FormatInt(c.profileId, 10),
  41847. })
  41848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41849. }
  41850. // Do executes the "dfareporting.sizes.list" call.
  41851. // Exactly one of *SizesListResponse or error will be non-nil. Any
  41852. // non-2xx status code is an error. Response headers are in either
  41853. // *SizesListResponse.ServerResponse.Header or (if a response was
  41854. // returned at all) in error.(*googleapi.Error).Header. Use
  41855. // googleapi.IsNotModified to check whether the returned error was
  41856. // because http.StatusNotModified was returned.
  41857. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  41858. gensupport.SetOptions(c.urlParams_, opts...)
  41859. res, err := c.doRequest("json")
  41860. if res != nil && res.StatusCode == http.StatusNotModified {
  41861. if res.Body != nil {
  41862. res.Body.Close()
  41863. }
  41864. return nil, &googleapi.Error{
  41865. Code: res.StatusCode,
  41866. Header: res.Header,
  41867. }
  41868. }
  41869. if err != nil {
  41870. return nil, err
  41871. }
  41872. defer googleapi.CloseBody(res)
  41873. if err := googleapi.CheckResponse(res); err != nil {
  41874. return nil, err
  41875. }
  41876. ret := &SizesListResponse{
  41877. ServerResponse: googleapi.ServerResponse{
  41878. Header: res.Header,
  41879. HTTPStatusCode: res.StatusCode,
  41880. },
  41881. }
  41882. target := &ret
  41883. if err := gensupport.DecodeResponse(target, res); err != nil {
  41884. return nil, err
  41885. }
  41886. return ret, nil
  41887. // {
  41888. // "description": "Retrieves a list of sizes, possibly filtered. Retrieved sizes are globally unique and may include values not currently in use by your account. Due to this, the list of sizes returned by this method may differ from the list seen in the Trafficking UI.",
  41889. // "httpMethod": "GET",
  41890. // "id": "dfareporting.sizes.list",
  41891. // "parameterOrder": [
  41892. // "profileId"
  41893. // ],
  41894. // "parameters": {
  41895. // "height": {
  41896. // "description": "Select only sizes with this height.",
  41897. // "format": "int32",
  41898. // "location": "query",
  41899. // "maximum": "32767",
  41900. // "minimum": "0",
  41901. // "type": "integer"
  41902. // },
  41903. // "iabStandard": {
  41904. // "description": "Select only IAB standard sizes.",
  41905. // "location": "query",
  41906. // "type": "boolean"
  41907. // },
  41908. // "ids": {
  41909. // "description": "Select only sizes with these IDs.",
  41910. // "format": "int64",
  41911. // "location": "query",
  41912. // "repeated": true,
  41913. // "type": "string"
  41914. // },
  41915. // "profileId": {
  41916. // "description": "User profile ID associated with this request.",
  41917. // "format": "int64",
  41918. // "location": "path",
  41919. // "required": true,
  41920. // "type": "string"
  41921. // },
  41922. // "width": {
  41923. // "description": "Select only sizes with this width.",
  41924. // "format": "int32",
  41925. // "location": "query",
  41926. // "maximum": "32767",
  41927. // "minimum": "0",
  41928. // "type": "integer"
  41929. // }
  41930. // },
  41931. // "path": "userprofiles/{profileId}/sizes",
  41932. // "response": {
  41933. // "$ref": "SizesListResponse"
  41934. // },
  41935. // "scopes": [
  41936. // "https://www.googleapis.com/auth/dfatrafficking"
  41937. // ]
  41938. // }
  41939. }
  41940. // method id "dfareporting.subaccounts.get":
  41941. type SubaccountsGetCall struct {
  41942. s *Service
  41943. profileId int64
  41944. id int64
  41945. urlParams_ gensupport.URLParams
  41946. ifNoneMatch_ string
  41947. ctx_ context.Context
  41948. header_ http.Header
  41949. }
  41950. // Get: Gets one subaccount by ID.
  41951. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  41952. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41953. c.profileId = profileId
  41954. c.id = id
  41955. return c
  41956. }
  41957. // Fields allows partial responses to be retrieved. See
  41958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41959. // for more information.
  41960. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  41961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41962. return c
  41963. }
  41964. // IfNoneMatch sets the optional parameter which makes the operation
  41965. // fail if the object's ETag matches the given value. This is useful for
  41966. // getting updates only after the object has changed since the last
  41967. // request. Use googleapi.IsNotModified to check whether the response
  41968. // error from Do is the result of In-None-Match.
  41969. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  41970. c.ifNoneMatch_ = entityTag
  41971. return c
  41972. }
  41973. // Context sets the context to be used in this call's Do method. Any
  41974. // pending HTTP request will be aborted if the provided context is
  41975. // canceled.
  41976. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  41977. c.ctx_ = ctx
  41978. return c
  41979. }
  41980. // Header returns an http.Header that can be modified by the caller to
  41981. // add HTTP headers to the request.
  41982. func (c *SubaccountsGetCall) Header() http.Header {
  41983. if c.header_ == nil {
  41984. c.header_ = make(http.Header)
  41985. }
  41986. return c.header_
  41987. }
  41988. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  41989. reqHeaders := make(http.Header)
  41990. for k, v := range c.header_ {
  41991. reqHeaders[k] = v
  41992. }
  41993. reqHeaders.Set("User-Agent", c.s.userAgent())
  41994. if c.ifNoneMatch_ != "" {
  41995. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41996. }
  41997. var body io.Reader = nil
  41998. c.urlParams_.Set("alt", alt)
  41999. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  42000. urls += "?" + c.urlParams_.Encode()
  42001. req, _ := http.NewRequest("GET", urls, body)
  42002. req.Header = reqHeaders
  42003. googleapi.Expand(req.URL, map[string]string{
  42004. "profileId": strconv.FormatInt(c.profileId, 10),
  42005. "id": strconv.FormatInt(c.id, 10),
  42006. })
  42007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42008. }
  42009. // Do executes the "dfareporting.subaccounts.get" call.
  42010. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42011. // status code is an error. Response headers are in either
  42012. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42014. // to check whether the returned error was because
  42015. // http.StatusNotModified was returned.
  42016. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42017. gensupport.SetOptions(c.urlParams_, opts...)
  42018. res, err := c.doRequest("json")
  42019. if res != nil && res.StatusCode == http.StatusNotModified {
  42020. if res.Body != nil {
  42021. res.Body.Close()
  42022. }
  42023. return nil, &googleapi.Error{
  42024. Code: res.StatusCode,
  42025. Header: res.Header,
  42026. }
  42027. }
  42028. if err != nil {
  42029. return nil, err
  42030. }
  42031. defer googleapi.CloseBody(res)
  42032. if err := googleapi.CheckResponse(res); err != nil {
  42033. return nil, err
  42034. }
  42035. ret := &Subaccount{
  42036. ServerResponse: googleapi.ServerResponse{
  42037. Header: res.Header,
  42038. HTTPStatusCode: res.StatusCode,
  42039. },
  42040. }
  42041. target := &ret
  42042. if err := gensupport.DecodeResponse(target, res); err != nil {
  42043. return nil, err
  42044. }
  42045. return ret, nil
  42046. // {
  42047. // "description": "Gets one subaccount by ID.",
  42048. // "httpMethod": "GET",
  42049. // "id": "dfareporting.subaccounts.get",
  42050. // "parameterOrder": [
  42051. // "profileId",
  42052. // "id"
  42053. // ],
  42054. // "parameters": {
  42055. // "id": {
  42056. // "description": "Subaccount ID.",
  42057. // "format": "int64",
  42058. // "location": "path",
  42059. // "required": true,
  42060. // "type": "string"
  42061. // },
  42062. // "profileId": {
  42063. // "description": "User profile ID associated with this request.",
  42064. // "format": "int64",
  42065. // "location": "path",
  42066. // "required": true,
  42067. // "type": "string"
  42068. // }
  42069. // },
  42070. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  42071. // "response": {
  42072. // "$ref": "Subaccount"
  42073. // },
  42074. // "scopes": [
  42075. // "https://www.googleapis.com/auth/dfatrafficking"
  42076. // ]
  42077. // }
  42078. }
  42079. // method id "dfareporting.subaccounts.insert":
  42080. type SubaccountsInsertCall struct {
  42081. s *Service
  42082. profileId int64
  42083. subaccount *Subaccount
  42084. urlParams_ gensupport.URLParams
  42085. ctx_ context.Context
  42086. header_ http.Header
  42087. }
  42088. // Insert: Inserts a new subaccount.
  42089. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  42090. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42091. c.profileId = profileId
  42092. c.subaccount = subaccount
  42093. return c
  42094. }
  42095. // Fields allows partial responses to be retrieved. See
  42096. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42097. // for more information.
  42098. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  42099. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42100. return c
  42101. }
  42102. // Context sets the context to be used in this call's Do method. Any
  42103. // pending HTTP request will be aborted if the provided context is
  42104. // canceled.
  42105. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  42106. c.ctx_ = ctx
  42107. return c
  42108. }
  42109. // Header returns an http.Header that can be modified by the caller to
  42110. // add HTTP headers to the request.
  42111. func (c *SubaccountsInsertCall) Header() http.Header {
  42112. if c.header_ == nil {
  42113. c.header_ = make(http.Header)
  42114. }
  42115. return c.header_
  42116. }
  42117. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  42118. reqHeaders := make(http.Header)
  42119. for k, v := range c.header_ {
  42120. reqHeaders[k] = v
  42121. }
  42122. reqHeaders.Set("User-Agent", c.s.userAgent())
  42123. var body io.Reader = nil
  42124. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42125. if err != nil {
  42126. return nil, err
  42127. }
  42128. reqHeaders.Set("Content-Type", "application/json")
  42129. c.urlParams_.Set("alt", alt)
  42130. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42131. urls += "?" + c.urlParams_.Encode()
  42132. req, _ := http.NewRequest("POST", urls, body)
  42133. req.Header = reqHeaders
  42134. googleapi.Expand(req.URL, map[string]string{
  42135. "profileId": strconv.FormatInt(c.profileId, 10),
  42136. })
  42137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42138. }
  42139. // Do executes the "dfareporting.subaccounts.insert" call.
  42140. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42141. // status code is an error. Response headers are in either
  42142. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42143. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42144. // to check whether the returned error was because
  42145. // http.StatusNotModified was returned.
  42146. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42147. gensupport.SetOptions(c.urlParams_, opts...)
  42148. res, err := c.doRequest("json")
  42149. if res != nil && res.StatusCode == http.StatusNotModified {
  42150. if res.Body != nil {
  42151. res.Body.Close()
  42152. }
  42153. return nil, &googleapi.Error{
  42154. Code: res.StatusCode,
  42155. Header: res.Header,
  42156. }
  42157. }
  42158. if err != nil {
  42159. return nil, err
  42160. }
  42161. defer googleapi.CloseBody(res)
  42162. if err := googleapi.CheckResponse(res); err != nil {
  42163. return nil, err
  42164. }
  42165. ret := &Subaccount{
  42166. ServerResponse: googleapi.ServerResponse{
  42167. Header: res.Header,
  42168. HTTPStatusCode: res.StatusCode,
  42169. },
  42170. }
  42171. target := &ret
  42172. if err := gensupport.DecodeResponse(target, res); err != nil {
  42173. return nil, err
  42174. }
  42175. return ret, nil
  42176. // {
  42177. // "description": "Inserts a new subaccount.",
  42178. // "httpMethod": "POST",
  42179. // "id": "dfareporting.subaccounts.insert",
  42180. // "parameterOrder": [
  42181. // "profileId"
  42182. // ],
  42183. // "parameters": {
  42184. // "profileId": {
  42185. // "description": "User profile ID associated with this request.",
  42186. // "format": "int64",
  42187. // "location": "path",
  42188. // "required": true,
  42189. // "type": "string"
  42190. // }
  42191. // },
  42192. // "path": "userprofiles/{profileId}/subaccounts",
  42193. // "request": {
  42194. // "$ref": "Subaccount"
  42195. // },
  42196. // "response": {
  42197. // "$ref": "Subaccount"
  42198. // },
  42199. // "scopes": [
  42200. // "https://www.googleapis.com/auth/dfatrafficking"
  42201. // ]
  42202. // }
  42203. }
  42204. // method id "dfareporting.subaccounts.list":
  42205. type SubaccountsListCall struct {
  42206. s *Service
  42207. profileId int64
  42208. urlParams_ gensupport.URLParams
  42209. ifNoneMatch_ string
  42210. ctx_ context.Context
  42211. header_ http.Header
  42212. }
  42213. // List: Gets a list of subaccounts, possibly filtered. This method
  42214. // supports paging.
  42215. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  42216. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42217. c.profileId = profileId
  42218. return c
  42219. }
  42220. // Ids sets the optional parameter "ids": Select only subaccounts with
  42221. // these IDs.
  42222. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  42223. var ids_ []string
  42224. for _, v := range ids {
  42225. ids_ = append(ids_, fmt.Sprint(v))
  42226. }
  42227. c.urlParams_.SetMulti("ids", ids_)
  42228. return c
  42229. }
  42230. // MaxResults sets the optional parameter "maxResults": Maximum number
  42231. // of results to return.
  42232. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  42233. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42234. return c
  42235. }
  42236. // PageToken sets the optional parameter "pageToken": Value of the
  42237. // nextPageToken from the previous result page.
  42238. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  42239. c.urlParams_.Set("pageToken", pageToken)
  42240. return c
  42241. }
  42242. // SearchString sets the optional parameter "searchString": Allows
  42243. // searching for objects by name or ID. Wildcards (*) are allowed. For
  42244. // example, "subaccount*2015" will return objects with names like
  42245. // "subaccount June 2015", "subaccount April 2015", or simply
  42246. // "subaccount 2015". Most of the searches also add wildcards implicitly
  42247. // at the start and the end of the search string. For example, a search
  42248. // string of "subaccount" will match objects with name "my subaccount",
  42249. // "subaccount 2015", or simply "subaccount".
  42250. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  42251. c.urlParams_.Set("searchString", searchString)
  42252. return c
  42253. }
  42254. // SortField sets the optional parameter "sortField": Field by which to
  42255. // sort the list.
  42256. //
  42257. // Possible values:
  42258. // "ID" (default)
  42259. // "NAME"
  42260. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  42261. c.urlParams_.Set("sortField", sortField)
  42262. return c
  42263. }
  42264. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42265. // results.
  42266. //
  42267. // Possible values:
  42268. // "ASCENDING" (default)
  42269. // "DESCENDING"
  42270. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  42271. c.urlParams_.Set("sortOrder", sortOrder)
  42272. return c
  42273. }
  42274. // Fields allows partial responses to be retrieved. See
  42275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42276. // for more information.
  42277. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  42278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42279. return c
  42280. }
  42281. // IfNoneMatch sets the optional parameter which makes the operation
  42282. // fail if the object's ETag matches the given value. This is useful for
  42283. // getting updates only after the object has changed since the last
  42284. // request. Use googleapi.IsNotModified to check whether the response
  42285. // error from Do is the result of In-None-Match.
  42286. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  42287. c.ifNoneMatch_ = entityTag
  42288. return c
  42289. }
  42290. // Context sets the context to be used in this call's Do method. Any
  42291. // pending HTTP request will be aborted if the provided context is
  42292. // canceled.
  42293. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  42294. c.ctx_ = ctx
  42295. return c
  42296. }
  42297. // Header returns an http.Header that can be modified by the caller to
  42298. // add HTTP headers to the request.
  42299. func (c *SubaccountsListCall) Header() http.Header {
  42300. if c.header_ == nil {
  42301. c.header_ = make(http.Header)
  42302. }
  42303. return c.header_
  42304. }
  42305. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  42306. reqHeaders := make(http.Header)
  42307. for k, v := range c.header_ {
  42308. reqHeaders[k] = v
  42309. }
  42310. reqHeaders.Set("User-Agent", c.s.userAgent())
  42311. if c.ifNoneMatch_ != "" {
  42312. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42313. }
  42314. var body io.Reader = nil
  42315. c.urlParams_.Set("alt", alt)
  42316. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42317. urls += "?" + c.urlParams_.Encode()
  42318. req, _ := http.NewRequest("GET", urls, body)
  42319. req.Header = reqHeaders
  42320. googleapi.Expand(req.URL, map[string]string{
  42321. "profileId": strconv.FormatInt(c.profileId, 10),
  42322. })
  42323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42324. }
  42325. // Do executes the "dfareporting.subaccounts.list" call.
  42326. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  42327. // non-2xx status code is an error. Response headers are in either
  42328. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  42329. // returned at all) in error.(*googleapi.Error).Header. Use
  42330. // googleapi.IsNotModified to check whether the returned error was
  42331. // because http.StatusNotModified was returned.
  42332. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  42333. gensupport.SetOptions(c.urlParams_, opts...)
  42334. res, err := c.doRequest("json")
  42335. if res != nil && res.StatusCode == http.StatusNotModified {
  42336. if res.Body != nil {
  42337. res.Body.Close()
  42338. }
  42339. return nil, &googleapi.Error{
  42340. Code: res.StatusCode,
  42341. Header: res.Header,
  42342. }
  42343. }
  42344. if err != nil {
  42345. return nil, err
  42346. }
  42347. defer googleapi.CloseBody(res)
  42348. if err := googleapi.CheckResponse(res); err != nil {
  42349. return nil, err
  42350. }
  42351. ret := &SubaccountsListResponse{
  42352. ServerResponse: googleapi.ServerResponse{
  42353. Header: res.Header,
  42354. HTTPStatusCode: res.StatusCode,
  42355. },
  42356. }
  42357. target := &ret
  42358. if err := gensupport.DecodeResponse(target, res); err != nil {
  42359. return nil, err
  42360. }
  42361. return ret, nil
  42362. // {
  42363. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  42364. // "httpMethod": "GET",
  42365. // "id": "dfareporting.subaccounts.list",
  42366. // "parameterOrder": [
  42367. // "profileId"
  42368. // ],
  42369. // "parameters": {
  42370. // "ids": {
  42371. // "description": "Select only subaccounts with these IDs.",
  42372. // "format": "int64",
  42373. // "location": "query",
  42374. // "repeated": true,
  42375. // "type": "string"
  42376. // },
  42377. // "maxResults": {
  42378. // "default": "1000",
  42379. // "description": "Maximum number of results to return.",
  42380. // "format": "int32",
  42381. // "location": "query",
  42382. // "maximum": "1000",
  42383. // "minimum": "0",
  42384. // "type": "integer"
  42385. // },
  42386. // "pageToken": {
  42387. // "description": "Value of the nextPageToken from the previous result page.",
  42388. // "location": "query",
  42389. // "type": "string"
  42390. // },
  42391. // "profileId": {
  42392. // "description": "User profile ID associated with this request.",
  42393. // "format": "int64",
  42394. // "location": "path",
  42395. // "required": true,
  42396. // "type": "string"
  42397. // },
  42398. // "searchString": {
  42399. // "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\".",
  42400. // "location": "query",
  42401. // "type": "string"
  42402. // },
  42403. // "sortField": {
  42404. // "default": "ID",
  42405. // "description": "Field by which to sort the list.",
  42406. // "enum": [
  42407. // "ID",
  42408. // "NAME"
  42409. // ],
  42410. // "enumDescriptions": [
  42411. // "",
  42412. // ""
  42413. // ],
  42414. // "location": "query",
  42415. // "type": "string"
  42416. // },
  42417. // "sortOrder": {
  42418. // "default": "ASCENDING",
  42419. // "description": "Order of sorted results.",
  42420. // "enum": [
  42421. // "ASCENDING",
  42422. // "DESCENDING"
  42423. // ],
  42424. // "enumDescriptions": [
  42425. // "",
  42426. // ""
  42427. // ],
  42428. // "location": "query",
  42429. // "type": "string"
  42430. // }
  42431. // },
  42432. // "path": "userprofiles/{profileId}/subaccounts",
  42433. // "response": {
  42434. // "$ref": "SubaccountsListResponse"
  42435. // },
  42436. // "scopes": [
  42437. // "https://www.googleapis.com/auth/dfatrafficking"
  42438. // ]
  42439. // }
  42440. }
  42441. // Pages invokes f for each page of results.
  42442. // A non-nil error returned from f will halt the iteration.
  42443. // The provided context supersedes any context provided to the Context method.
  42444. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  42445. c.ctx_ = ctx
  42446. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42447. for {
  42448. x, err := c.Do()
  42449. if err != nil {
  42450. return err
  42451. }
  42452. if err := f(x); err != nil {
  42453. return err
  42454. }
  42455. if x.NextPageToken == "" {
  42456. return nil
  42457. }
  42458. c.PageToken(x.NextPageToken)
  42459. }
  42460. }
  42461. // method id "dfareporting.subaccounts.patch":
  42462. type SubaccountsPatchCall struct {
  42463. s *Service
  42464. profileId int64
  42465. subaccount *Subaccount
  42466. urlParams_ gensupport.URLParams
  42467. ctx_ context.Context
  42468. header_ http.Header
  42469. }
  42470. // Patch: Updates an existing subaccount. This method supports patch
  42471. // semantics.
  42472. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  42473. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42474. c.profileId = profileId
  42475. c.urlParams_.Set("id", fmt.Sprint(id))
  42476. c.subaccount = subaccount
  42477. return c
  42478. }
  42479. // Fields allows partial responses to be retrieved. See
  42480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42481. // for more information.
  42482. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  42483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42484. return c
  42485. }
  42486. // Context sets the context to be used in this call's Do method. Any
  42487. // pending HTTP request will be aborted if the provided context is
  42488. // canceled.
  42489. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  42490. c.ctx_ = ctx
  42491. return c
  42492. }
  42493. // Header returns an http.Header that can be modified by the caller to
  42494. // add HTTP headers to the request.
  42495. func (c *SubaccountsPatchCall) Header() http.Header {
  42496. if c.header_ == nil {
  42497. c.header_ = make(http.Header)
  42498. }
  42499. return c.header_
  42500. }
  42501. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  42502. reqHeaders := make(http.Header)
  42503. for k, v := range c.header_ {
  42504. reqHeaders[k] = v
  42505. }
  42506. reqHeaders.Set("User-Agent", c.s.userAgent())
  42507. var body io.Reader = nil
  42508. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42509. if err != nil {
  42510. return nil, err
  42511. }
  42512. reqHeaders.Set("Content-Type", "application/json")
  42513. c.urlParams_.Set("alt", alt)
  42514. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42515. urls += "?" + c.urlParams_.Encode()
  42516. req, _ := http.NewRequest("PATCH", urls, body)
  42517. req.Header = reqHeaders
  42518. googleapi.Expand(req.URL, map[string]string{
  42519. "profileId": strconv.FormatInt(c.profileId, 10),
  42520. })
  42521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42522. }
  42523. // Do executes the "dfareporting.subaccounts.patch" call.
  42524. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42525. // status code is an error. Response headers are in either
  42526. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42528. // to check whether the returned error was because
  42529. // http.StatusNotModified was returned.
  42530. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42531. gensupport.SetOptions(c.urlParams_, opts...)
  42532. res, err := c.doRequest("json")
  42533. if res != nil && res.StatusCode == http.StatusNotModified {
  42534. if res.Body != nil {
  42535. res.Body.Close()
  42536. }
  42537. return nil, &googleapi.Error{
  42538. Code: res.StatusCode,
  42539. Header: res.Header,
  42540. }
  42541. }
  42542. if err != nil {
  42543. return nil, err
  42544. }
  42545. defer googleapi.CloseBody(res)
  42546. if err := googleapi.CheckResponse(res); err != nil {
  42547. return nil, err
  42548. }
  42549. ret := &Subaccount{
  42550. ServerResponse: googleapi.ServerResponse{
  42551. Header: res.Header,
  42552. HTTPStatusCode: res.StatusCode,
  42553. },
  42554. }
  42555. target := &ret
  42556. if err := gensupport.DecodeResponse(target, res); err != nil {
  42557. return nil, err
  42558. }
  42559. return ret, nil
  42560. // {
  42561. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  42562. // "httpMethod": "PATCH",
  42563. // "id": "dfareporting.subaccounts.patch",
  42564. // "parameterOrder": [
  42565. // "profileId",
  42566. // "id"
  42567. // ],
  42568. // "parameters": {
  42569. // "id": {
  42570. // "description": "Subaccount ID.",
  42571. // "format": "int64",
  42572. // "location": "query",
  42573. // "required": true,
  42574. // "type": "string"
  42575. // },
  42576. // "profileId": {
  42577. // "description": "User profile ID associated with this request.",
  42578. // "format": "int64",
  42579. // "location": "path",
  42580. // "required": true,
  42581. // "type": "string"
  42582. // }
  42583. // },
  42584. // "path": "userprofiles/{profileId}/subaccounts",
  42585. // "request": {
  42586. // "$ref": "Subaccount"
  42587. // },
  42588. // "response": {
  42589. // "$ref": "Subaccount"
  42590. // },
  42591. // "scopes": [
  42592. // "https://www.googleapis.com/auth/dfatrafficking"
  42593. // ]
  42594. // }
  42595. }
  42596. // method id "dfareporting.subaccounts.update":
  42597. type SubaccountsUpdateCall struct {
  42598. s *Service
  42599. profileId int64
  42600. subaccount *Subaccount
  42601. urlParams_ gensupport.URLParams
  42602. ctx_ context.Context
  42603. header_ http.Header
  42604. }
  42605. // Update: Updates an existing subaccount.
  42606. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  42607. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42608. c.profileId = profileId
  42609. c.subaccount = subaccount
  42610. return c
  42611. }
  42612. // Fields allows partial responses to be retrieved. See
  42613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42614. // for more information.
  42615. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  42616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42617. return c
  42618. }
  42619. // Context sets the context to be used in this call's Do method. Any
  42620. // pending HTTP request will be aborted if the provided context is
  42621. // canceled.
  42622. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  42623. c.ctx_ = ctx
  42624. return c
  42625. }
  42626. // Header returns an http.Header that can be modified by the caller to
  42627. // add HTTP headers to the request.
  42628. func (c *SubaccountsUpdateCall) Header() http.Header {
  42629. if c.header_ == nil {
  42630. c.header_ = make(http.Header)
  42631. }
  42632. return c.header_
  42633. }
  42634. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  42635. reqHeaders := make(http.Header)
  42636. for k, v := range c.header_ {
  42637. reqHeaders[k] = v
  42638. }
  42639. reqHeaders.Set("User-Agent", c.s.userAgent())
  42640. var body io.Reader = nil
  42641. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42642. if err != nil {
  42643. return nil, err
  42644. }
  42645. reqHeaders.Set("Content-Type", "application/json")
  42646. c.urlParams_.Set("alt", alt)
  42647. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42648. urls += "?" + c.urlParams_.Encode()
  42649. req, _ := http.NewRequest("PUT", urls, body)
  42650. req.Header = reqHeaders
  42651. googleapi.Expand(req.URL, map[string]string{
  42652. "profileId": strconv.FormatInt(c.profileId, 10),
  42653. })
  42654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42655. }
  42656. // Do executes the "dfareporting.subaccounts.update" call.
  42657. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42658. // status code is an error. Response headers are in either
  42659. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42660. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42661. // to check whether the returned error was because
  42662. // http.StatusNotModified was returned.
  42663. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42664. gensupport.SetOptions(c.urlParams_, opts...)
  42665. res, err := c.doRequest("json")
  42666. if res != nil && res.StatusCode == http.StatusNotModified {
  42667. if res.Body != nil {
  42668. res.Body.Close()
  42669. }
  42670. return nil, &googleapi.Error{
  42671. Code: res.StatusCode,
  42672. Header: res.Header,
  42673. }
  42674. }
  42675. if err != nil {
  42676. return nil, err
  42677. }
  42678. defer googleapi.CloseBody(res)
  42679. if err := googleapi.CheckResponse(res); err != nil {
  42680. return nil, err
  42681. }
  42682. ret := &Subaccount{
  42683. ServerResponse: googleapi.ServerResponse{
  42684. Header: res.Header,
  42685. HTTPStatusCode: res.StatusCode,
  42686. },
  42687. }
  42688. target := &ret
  42689. if err := gensupport.DecodeResponse(target, res); err != nil {
  42690. return nil, err
  42691. }
  42692. return ret, nil
  42693. // {
  42694. // "description": "Updates an existing subaccount.",
  42695. // "httpMethod": "PUT",
  42696. // "id": "dfareporting.subaccounts.update",
  42697. // "parameterOrder": [
  42698. // "profileId"
  42699. // ],
  42700. // "parameters": {
  42701. // "profileId": {
  42702. // "description": "User profile ID associated with this request.",
  42703. // "format": "int64",
  42704. // "location": "path",
  42705. // "required": true,
  42706. // "type": "string"
  42707. // }
  42708. // },
  42709. // "path": "userprofiles/{profileId}/subaccounts",
  42710. // "request": {
  42711. // "$ref": "Subaccount"
  42712. // },
  42713. // "response": {
  42714. // "$ref": "Subaccount"
  42715. // },
  42716. // "scopes": [
  42717. // "https://www.googleapis.com/auth/dfatrafficking"
  42718. // ]
  42719. // }
  42720. }
  42721. // method id "dfareporting.targetableRemarketingLists.get":
  42722. type TargetableRemarketingListsGetCall struct {
  42723. s *Service
  42724. profileId int64
  42725. id int64
  42726. urlParams_ gensupport.URLParams
  42727. ifNoneMatch_ string
  42728. ctx_ context.Context
  42729. header_ http.Header
  42730. }
  42731. // Get: Gets one remarketing list by ID.
  42732. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  42733. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42734. c.profileId = profileId
  42735. c.id = id
  42736. return c
  42737. }
  42738. // Fields allows partial responses to be retrieved. See
  42739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42740. // for more information.
  42741. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  42742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42743. return c
  42744. }
  42745. // IfNoneMatch sets the optional parameter which makes the operation
  42746. // fail if the object's ETag matches the given value. This is useful for
  42747. // getting updates only after the object has changed since the last
  42748. // request. Use googleapi.IsNotModified to check whether the response
  42749. // error from Do is the result of In-None-Match.
  42750. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  42751. c.ifNoneMatch_ = entityTag
  42752. return c
  42753. }
  42754. // Context sets the context to be used in this call's Do method. Any
  42755. // pending HTTP request will be aborted if the provided context is
  42756. // canceled.
  42757. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  42758. c.ctx_ = ctx
  42759. return c
  42760. }
  42761. // Header returns an http.Header that can be modified by the caller to
  42762. // add HTTP headers to the request.
  42763. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  42764. if c.header_ == nil {
  42765. c.header_ = make(http.Header)
  42766. }
  42767. return c.header_
  42768. }
  42769. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  42770. reqHeaders := make(http.Header)
  42771. for k, v := range c.header_ {
  42772. reqHeaders[k] = v
  42773. }
  42774. reqHeaders.Set("User-Agent", c.s.userAgent())
  42775. if c.ifNoneMatch_ != "" {
  42776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42777. }
  42778. var body io.Reader = nil
  42779. c.urlParams_.Set("alt", alt)
  42780. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  42781. urls += "?" + c.urlParams_.Encode()
  42782. req, _ := http.NewRequest("GET", urls, body)
  42783. req.Header = reqHeaders
  42784. googleapi.Expand(req.URL, map[string]string{
  42785. "profileId": strconv.FormatInt(c.profileId, 10),
  42786. "id": strconv.FormatInt(c.id, 10),
  42787. })
  42788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42789. }
  42790. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  42791. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  42792. // Any non-2xx status code is an error. Response headers are in either
  42793. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  42794. // was returned at all) in error.(*googleapi.Error).Header. Use
  42795. // googleapi.IsNotModified to check whether the returned error was
  42796. // because http.StatusNotModified was returned.
  42797. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  42798. gensupport.SetOptions(c.urlParams_, opts...)
  42799. res, err := c.doRequest("json")
  42800. if res != nil && res.StatusCode == http.StatusNotModified {
  42801. if res.Body != nil {
  42802. res.Body.Close()
  42803. }
  42804. return nil, &googleapi.Error{
  42805. Code: res.StatusCode,
  42806. Header: res.Header,
  42807. }
  42808. }
  42809. if err != nil {
  42810. return nil, err
  42811. }
  42812. defer googleapi.CloseBody(res)
  42813. if err := googleapi.CheckResponse(res); err != nil {
  42814. return nil, err
  42815. }
  42816. ret := &TargetableRemarketingList{
  42817. ServerResponse: googleapi.ServerResponse{
  42818. Header: res.Header,
  42819. HTTPStatusCode: res.StatusCode,
  42820. },
  42821. }
  42822. target := &ret
  42823. if err := gensupport.DecodeResponse(target, res); err != nil {
  42824. return nil, err
  42825. }
  42826. return ret, nil
  42827. // {
  42828. // "description": "Gets one remarketing list by ID.",
  42829. // "httpMethod": "GET",
  42830. // "id": "dfareporting.targetableRemarketingLists.get",
  42831. // "parameterOrder": [
  42832. // "profileId",
  42833. // "id"
  42834. // ],
  42835. // "parameters": {
  42836. // "id": {
  42837. // "description": "Remarketing list ID.",
  42838. // "format": "int64",
  42839. // "location": "path",
  42840. // "required": true,
  42841. // "type": "string"
  42842. // },
  42843. // "profileId": {
  42844. // "description": "User profile ID associated with this request.",
  42845. // "format": "int64",
  42846. // "location": "path",
  42847. // "required": true,
  42848. // "type": "string"
  42849. // }
  42850. // },
  42851. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  42852. // "response": {
  42853. // "$ref": "TargetableRemarketingList"
  42854. // },
  42855. // "scopes": [
  42856. // "https://www.googleapis.com/auth/dfatrafficking"
  42857. // ]
  42858. // }
  42859. }
  42860. // method id "dfareporting.targetableRemarketingLists.list":
  42861. type TargetableRemarketingListsListCall struct {
  42862. s *Service
  42863. profileId int64
  42864. urlParams_ gensupport.URLParams
  42865. ifNoneMatch_ string
  42866. ctx_ context.Context
  42867. header_ http.Header
  42868. }
  42869. // List: Retrieves a list of targetable remarketing lists, possibly
  42870. // filtered. This method supports paging.
  42871. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  42872. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42873. c.profileId = profileId
  42874. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  42875. return c
  42876. }
  42877. // Active sets the optional parameter "active": Select only active or
  42878. // only inactive targetable remarketing lists.
  42879. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  42880. c.urlParams_.Set("active", fmt.Sprint(active))
  42881. return c
  42882. }
  42883. // MaxResults sets the optional parameter "maxResults": Maximum number
  42884. // of results to return.
  42885. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  42886. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42887. return c
  42888. }
  42889. // Name sets the optional parameter "name": Allows searching for objects
  42890. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  42891. // list*2015" will return objects with names like "remarketing list June
  42892. // 2015", "remarketing list April 2015", or simply "remarketing list
  42893. // 2015". Most of the searches also add wildcards implicitly at the
  42894. // start and the end of the search string. For example, a search string
  42895. // of "remarketing list" will match objects with name "my remarketing
  42896. // list", "remarketing list 2015", or simply "remarketing list".
  42897. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  42898. c.urlParams_.Set("name", name)
  42899. return c
  42900. }
  42901. // PageToken sets the optional parameter "pageToken": Value of the
  42902. // nextPageToken from the previous result page.
  42903. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  42904. c.urlParams_.Set("pageToken", pageToken)
  42905. return c
  42906. }
  42907. // SortField sets the optional parameter "sortField": Field by which to
  42908. // sort the list.
  42909. //
  42910. // Possible values:
  42911. // "ID" (default)
  42912. // "NAME"
  42913. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  42914. c.urlParams_.Set("sortField", sortField)
  42915. return c
  42916. }
  42917. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42918. // results.
  42919. //
  42920. // Possible values:
  42921. // "ASCENDING" (default)
  42922. // "DESCENDING"
  42923. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  42924. c.urlParams_.Set("sortOrder", sortOrder)
  42925. return c
  42926. }
  42927. // Fields allows partial responses to be retrieved. See
  42928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42929. // for more information.
  42930. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  42931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42932. return c
  42933. }
  42934. // IfNoneMatch sets the optional parameter which makes the operation
  42935. // fail if the object's ETag matches the given value. This is useful for
  42936. // getting updates only after the object has changed since the last
  42937. // request. Use googleapi.IsNotModified to check whether the response
  42938. // error from Do is the result of In-None-Match.
  42939. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  42940. c.ifNoneMatch_ = entityTag
  42941. return c
  42942. }
  42943. // Context sets the context to be used in this call's Do method. Any
  42944. // pending HTTP request will be aborted if the provided context is
  42945. // canceled.
  42946. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  42947. c.ctx_ = ctx
  42948. return c
  42949. }
  42950. // Header returns an http.Header that can be modified by the caller to
  42951. // add HTTP headers to the request.
  42952. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  42953. if c.header_ == nil {
  42954. c.header_ = make(http.Header)
  42955. }
  42956. return c.header_
  42957. }
  42958. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  42959. reqHeaders := make(http.Header)
  42960. for k, v := range c.header_ {
  42961. reqHeaders[k] = v
  42962. }
  42963. reqHeaders.Set("User-Agent", c.s.userAgent())
  42964. if c.ifNoneMatch_ != "" {
  42965. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42966. }
  42967. var body io.Reader = nil
  42968. c.urlParams_.Set("alt", alt)
  42969. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  42970. urls += "?" + c.urlParams_.Encode()
  42971. req, _ := http.NewRequest("GET", urls, body)
  42972. req.Header = reqHeaders
  42973. googleapi.Expand(req.URL, map[string]string{
  42974. "profileId": strconv.FormatInt(c.profileId, 10),
  42975. })
  42976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42977. }
  42978. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  42979. // Exactly one of *TargetableRemarketingListsListResponse or error will
  42980. // be non-nil. Any non-2xx status code is an error. Response headers are
  42981. // in either
  42982. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  42983. // a response was returned at all) in error.(*googleapi.Error).Header.
  42984. // Use googleapi.IsNotModified to check whether the returned error was
  42985. // because http.StatusNotModified was returned.
  42986. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  42987. gensupport.SetOptions(c.urlParams_, opts...)
  42988. res, err := c.doRequest("json")
  42989. if res != nil && res.StatusCode == http.StatusNotModified {
  42990. if res.Body != nil {
  42991. res.Body.Close()
  42992. }
  42993. return nil, &googleapi.Error{
  42994. Code: res.StatusCode,
  42995. Header: res.Header,
  42996. }
  42997. }
  42998. if err != nil {
  42999. return nil, err
  43000. }
  43001. defer googleapi.CloseBody(res)
  43002. if err := googleapi.CheckResponse(res); err != nil {
  43003. return nil, err
  43004. }
  43005. ret := &TargetableRemarketingListsListResponse{
  43006. ServerResponse: googleapi.ServerResponse{
  43007. Header: res.Header,
  43008. HTTPStatusCode: res.StatusCode,
  43009. },
  43010. }
  43011. target := &ret
  43012. if err := gensupport.DecodeResponse(target, res); err != nil {
  43013. return nil, err
  43014. }
  43015. return ret, nil
  43016. // {
  43017. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  43018. // "httpMethod": "GET",
  43019. // "id": "dfareporting.targetableRemarketingLists.list",
  43020. // "parameterOrder": [
  43021. // "profileId",
  43022. // "advertiserId"
  43023. // ],
  43024. // "parameters": {
  43025. // "active": {
  43026. // "description": "Select only active or only inactive targetable remarketing lists.",
  43027. // "location": "query",
  43028. // "type": "boolean"
  43029. // },
  43030. // "advertiserId": {
  43031. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  43032. // "format": "int64",
  43033. // "location": "query",
  43034. // "required": true,
  43035. // "type": "string"
  43036. // },
  43037. // "maxResults": {
  43038. // "default": "1000",
  43039. // "description": "Maximum number of results to return.",
  43040. // "format": "int32",
  43041. // "location": "query",
  43042. // "maximum": "1000",
  43043. // "minimum": "0",
  43044. // "type": "integer"
  43045. // },
  43046. // "name": {
  43047. // "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\".",
  43048. // "location": "query",
  43049. // "type": "string"
  43050. // },
  43051. // "pageToken": {
  43052. // "description": "Value of the nextPageToken from the previous result page.",
  43053. // "location": "query",
  43054. // "type": "string"
  43055. // },
  43056. // "profileId": {
  43057. // "description": "User profile ID associated with this request.",
  43058. // "format": "int64",
  43059. // "location": "path",
  43060. // "required": true,
  43061. // "type": "string"
  43062. // },
  43063. // "sortField": {
  43064. // "default": "ID",
  43065. // "description": "Field by which to sort the list.",
  43066. // "enum": [
  43067. // "ID",
  43068. // "NAME"
  43069. // ],
  43070. // "enumDescriptions": [
  43071. // "",
  43072. // ""
  43073. // ],
  43074. // "location": "query",
  43075. // "type": "string"
  43076. // },
  43077. // "sortOrder": {
  43078. // "default": "ASCENDING",
  43079. // "description": "Order of sorted results.",
  43080. // "enum": [
  43081. // "ASCENDING",
  43082. // "DESCENDING"
  43083. // ],
  43084. // "enumDescriptions": [
  43085. // "",
  43086. // ""
  43087. // ],
  43088. // "location": "query",
  43089. // "type": "string"
  43090. // }
  43091. // },
  43092. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  43093. // "response": {
  43094. // "$ref": "TargetableRemarketingListsListResponse"
  43095. // },
  43096. // "scopes": [
  43097. // "https://www.googleapis.com/auth/dfatrafficking"
  43098. // ]
  43099. // }
  43100. }
  43101. // Pages invokes f for each page of results.
  43102. // A non-nil error returned from f will halt the iteration.
  43103. // The provided context supersedes any context provided to the Context method.
  43104. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  43105. c.ctx_ = ctx
  43106. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43107. for {
  43108. x, err := c.Do()
  43109. if err != nil {
  43110. return err
  43111. }
  43112. if err := f(x); err != nil {
  43113. return err
  43114. }
  43115. if x.NextPageToken == "" {
  43116. return nil
  43117. }
  43118. c.PageToken(x.NextPageToken)
  43119. }
  43120. }
  43121. // method id "dfareporting.targetingTemplates.get":
  43122. type TargetingTemplatesGetCall struct {
  43123. s *Service
  43124. profileId int64
  43125. id int64
  43126. urlParams_ gensupport.URLParams
  43127. ifNoneMatch_ string
  43128. ctx_ context.Context
  43129. header_ http.Header
  43130. }
  43131. // Get: Gets one targeting template by ID.
  43132. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  43133. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43134. c.profileId = profileId
  43135. c.id = id
  43136. return c
  43137. }
  43138. // Fields allows partial responses to be retrieved. See
  43139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43140. // for more information.
  43141. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  43142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43143. return c
  43144. }
  43145. // IfNoneMatch sets the optional parameter which makes the operation
  43146. // fail if the object's ETag matches the given value. This is useful for
  43147. // getting updates only after the object has changed since the last
  43148. // request. Use googleapi.IsNotModified to check whether the response
  43149. // error from Do is the result of In-None-Match.
  43150. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  43151. c.ifNoneMatch_ = entityTag
  43152. return c
  43153. }
  43154. // Context sets the context to be used in this call's Do method. Any
  43155. // pending HTTP request will be aborted if the provided context is
  43156. // canceled.
  43157. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  43158. c.ctx_ = ctx
  43159. return c
  43160. }
  43161. // Header returns an http.Header that can be modified by the caller to
  43162. // add HTTP headers to the request.
  43163. func (c *TargetingTemplatesGetCall) Header() http.Header {
  43164. if c.header_ == nil {
  43165. c.header_ = make(http.Header)
  43166. }
  43167. return c.header_
  43168. }
  43169. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  43170. reqHeaders := make(http.Header)
  43171. for k, v := range c.header_ {
  43172. reqHeaders[k] = v
  43173. }
  43174. reqHeaders.Set("User-Agent", c.s.userAgent())
  43175. if c.ifNoneMatch_ != "" {
  43176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43177. }
  43178. var body io.Reader = nil
  43179. c.urlParams_.Set("alt", alt)
  43180. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  43181. urls += "?" + c.urlParams_.Encode()
  43182. req, _ := http.NewRequest("GET", urls, body)
  43183. req.Header = reqHeaders
  43184. googleapi.Expand(req.URL, map[string]string{
  43185. "profileId": strconv.FormatInt(c.profileId, 10),
  43186. "id": strconv.FormatInt(c.id, 10),
  43187. })
  43188. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43189. }
  43190. // Do executes the "dfareporting.targetingTemplates.get" call.
  43191. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43192. // non-2xx status code is an error. Response headers are in either
  43193. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43194. // returned at all) in error.(*googleapi.Error).Header. Use
  43195. // googleapi.IsNotModified to check whether the returned error was
  43196. // because http.StatusNotModified was returned.
  43197. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43198. gensupport.SetOptions(c.urlParams_, opts...)
  43199. res, err := c.doRequest("json")
  43200. if res != nil && res.StatusCode == http.StatusNotModified {
  43201. if res.Body != nil {
  43202. res.Body.Close()
  43203. }
  43204. return nil, &googleapi.Error{
  43205. Code: res.StatusCode,
  43206. Header: res.Header,
  43207. }
  43208. }
  43209. if err != nil {
  43210. return nil, err
  43211. }
  43212. defer googleapi.CloseBody(res)
  43213. if err := googleapi.CheckResponse(res); err != nil {
  43214. return nil, err
  43215. }
  43216. ret := &TargetingTemplate{
  43217. ServerResponse: googleapi.ServerResponse{
  43218. Header: res.Header,
  43219. HTTPStatusCode: res.StatusCode,
  43220. },
  43221. }
  43222. target := &ret
  43223. if err := gensupport.DecodeResponse(target, res); err != nil {
  43224. return nil, err
  43225. }
  43226. return ret, nil
  43227. // {
  43228. // "description": "Gets one targeting template by ID.",
  43229. // "httpMethod": "GET",
  43230. // "id": "dfareporting.targetingTemplates.get",
  43231. // "parameterOrder": [
  43232. // "profileId",
  43233. // "id"
  43234. // ],
  43235. // "parameters": {
  43236. // "id": {
  43237. // "description": "Targeting template ID.",
  43238. // "format": "int64",
  43239. // "location": "path",
  43240. // "required": true,
  43241. // "type": "string"
  43242. // },
  43243. // "profileId": {
  43244. // "description": "User profile ID associated with this request.",
  43245. // "format": "int64",
  43246. // "location": "path",
  43247. // "required": true,
  43248. // "type": "string"
  43249. // }
  43250. // },
  43251. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  43252. // "response": {
  43253. // "$ref": "TargetingTemplate"
  43254. // },
  43255. // "scopes": [
  43256. // "https://www.googleapis.com/auth/dfatrafficking"
  43257. // ]
  43258. // }
  43259. }
  43260. // method id "dfareporting.targetingTemplates.insert":
  43261. type TargetingTemplatesInsertCall struct {
  43262. s *Service
  43263. profileId int64
  43264. targetingtemplate *TargetingTemplate
  43265. urlParams_ gensupport.URLParams
  43266. ctx_ context.Context
  43267. header_ http.Header
  43268. }
  43269. // Insert: Inserts a new targeting template.
  43270. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  43271. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43272. c.profileId = profileId
  43273. c.targetingtemplate = targetingtemplate
  43274. return c
  43275. }
  43276. // Fields allows partial responses to be retrieved. See
  43277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43278. // for more information.
  43279. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  43280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43281. return c
  43282. }
  43283. // Context sets the context to be used in this call's Do method. Any
  43284. // pending HTTP request will be aborted if the provided context is
  43285. // canceled.
  43286. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  43287. c.ctx_ = ctx
  43288. return c
  43289. }
  43290. // Header returns an http.Header that can be modified by the caller to
  43291. // add HTTP headers to the request.
  43292. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  43293. if c.header_ == nil {
  43294. c.header_ = make(http.Header)
  43295. }
  43296. return c.header_
  43297. }
  43298. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  43299. reqHeaders := make(http.Header)
  43300. for k, v := range c.header_ {
  43301. reqHeaders[k] = v
  43302. }
  43303. reqHeaders.Set("User-Agent", c.s.userAgent())
  43304. var body io.Reader = nil
  43305. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43306. if err != nil {
  43307. return nil, err
  43308. }
  43309. reqHeaders.Set("Content-Type", "application/json")
  43310. c.urlParams_.Set("alt", alt)
  43311. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43312. urls += "?" + c.urlParams_.Encode()
  43313. req, _ := http.NewRequest("POST", urls, body)
  43314. req.Header = reqHeaders
  43315. googleapi.Expand(req.URL, map[string]string{
  43316. "profileId": strconv.FormatInt(c.profileId, 10),
  43317. })
  43318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43319. }
  43320. // Do executes the "dfareporting.targetingTemplates.insert" call.
  43321. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43322. // non-2xx status code is an error. Response headers are in either
  43323. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43324. // returned at all) in error.(*googleapi.Error).Header. Use
  43325. // googleapi.IsNotModified to check whether the returned error was
  43326. // because http.StatusNotModified was returned.
  43327. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43328. gensupport.SetOptions(c.urlParams_, opts...)
  43329. res, err := c.doRequest("json")
  43330. if res != nil && res.StatusCode == http.StatusNotModified {
  43331. if res.Body != nil {
  43332. res.Body.Close()
  43333. }
  43334. return nil, &googleapi.Error{
  43335. Code: res.StatusCode,
  43336. Header: res.Header,
  43337. }
  43338. }
  43339. if err != nil {
  43340. return nil, err
  43341. }
  43342. defer googleapi.CloseBody(res)
  43343. if err := googleapi.CheckResponse(res); err != nil {
  43344. return nil, err
  43345. }
  43346. ret := &TargetingTemplate{
  43347. ServerResponse: googleapi.ServerResponse{
  43348. Header: res.Header,
  43349. HTTPStatusCode: res.StatusCode,
  43350. },
  43351. }
  43352. target := &ret
  43353. if err := gensupport.DecodeResponse(target, res); err != nil {
  43354. return nil, err
  43355. }
  43356. return ret, nil
  43357. // {
  43358. // "description": "Inserts a new targeting template.",
  43359. // "httpMethod": "POST",
  43360. // "id": "dfareporting.targetingTemplates.insert",
  43361. // "parameterOrder": [
  43362. // "profileId"
  43363. // ],
  43364. // "parameters": {
  43365. // "profileId": {
  43366. // "description": "User profile ID associated with this request.",
  43367. // "format": "int64",
  43368. // "location": "path",
  43369. // "required": true,
  43370. // "type": "string"
  43371. // }
  43372. // },
  43373. // "path": "userprofiles/{profileId}/targetingTemplates",
  43374. // "request": {
  43375. // "$ref": "TargetingTemplate"
  43376. // },
  43377. // "response": {
  43378. // "$ref": "TargetingTemplate"
  43379. // },
  43380. // "scopes": [
  43381. // "https://www.googleapis.com/auth/dfatrafficking"
  43382. // ]
  43383. // }
  43384. }
  43385. // method id "dfareporting.targetingTemplates.list":
  43386. type TargetingTemplatesListCall struct {
  43387. s *Service
  43388. profileId int64
  43389. urlParams_ gensupport.URLParams
  43390. ifNoneMatch_ string
  43391. ctx_ context.Context
  43392. header_ http.Header
  43393. }
  43394. // List: Retrieves a list of targeting templates, optionally filtered.
  43395. // This method supports paging.
  43396. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  43397. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43398. c.profileId = profileId
  43399. return c
  43400. }
  43401. // AdvertiserId sets the optional parameter "advertiserId": Select only
  43402. // targeting templates with this advertiser ID.
  43403. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  43404. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  43405. return c
  43406. }
  43407. // Ids sets the optional parameter "ids": Select only targeting
  43408. // templates with these IDs.
  43409. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  43410. var ids_ []string
  43411. for _, v := range ids {
  43412. ids_ = append(ids_, fmt.Sprint(v))
  43413. }
  43414. c.urlParams_.SetMulti("ids", ids_)
  43415. return c
  43416. }
  43417. // MaxResults sets the optional parameter "maxResults": Maximum number
  43418. // of results to return.
  43419. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  43420. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43421. return c
  43422. }
  43423. // PageToken sets the optional parameter "pageToken": Value of the
  43424. // nextPageToken from the previous result page.
  43425. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  43426. c.urlParams_.Set("pageToken", pageToken)
  43427. return c
  43428. }
  43429. // SearchString sets the optional parameter "searchString": Allows
  43430. // searching for objects by name or ID. Wildcards (*) are allowed. For
  43431. // example, "template*2015" will return objects with names like
  43432. // "template June 2015", "template April 2015", or simply "template
  43433. // 2015". Most of the searches also add wildcards implicitly at the
  43434. // start and the end of the search string. For example, a search string
  43435. // of "template" will match objects with name "my template", "template
  43436. // 2015", or simply "template".
  43437. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  43438. c.urlParams_.Set("searchString", searchString)
  43439. return c
  43440. }
  43441. // SortField sets the optional parameter "sortField": Field by which to
  43442. // sort the list.
  43443. //
  43444. // Possible values:
  43445. // "ID" (default)
  43446. // "NAME"
  43447. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  43448. c.urlParams_.Set("sortField", sortField)
  43449. return c
  43450. }
  43451. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43452. // results.
  43453. //
  43454. // Possible values:
  43455. // "ASCENDING" (default)
  43456. // "DESCENDING"
  43457. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  43458. c.urlParams_.Set("sortOrder", sortOrder)
  43459. return c
  43460. }
  43461. // Fields allows partial responses to be retrieved. See
  43462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43463. // for more information.
  43464. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  43465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43466. return c
  43467. }
  43468. // IfNoneMatch sets the optional parameter which makes the operation
  43469. // fail if the object's ETag matches the given value. This is useful for
  43470. // getting updates only after the object has changed since the last
  43471. // request. Use googleapi.IsNotModified to check whether the response
  43472. // error from Do is the result of In-None-Match.
  43473. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  43474. c.ifNoneMatch_ = entityTag
  43475. return c
  43476. }
  43477. // Context sets the context to be used in this call's Do method. Any
  43478. // pending HTTP request will be aborted if the provided context is
  43479. // canceled.
  43480. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  43481. c.ctx_ = ctx
  43482. return c
  43483. }
  43484. // Header returns an http.Header that can be modified by the caller to
  43485. // add HTTP headers to the request.
  43486. func (c *TargetingTemplatesListCall) Header() http.Header {
  43487. if c.header_ == nil {
  43488. c.header_ = make(http.Header)
  43489. }
  43490. return c.header_
  43491. }
  43492. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  43493. reqHeaders := make(http.Header)
  43494. for k, v := range c.header_ {
  43495. reqHeaders[k] = v
  43496. }
  43497. reqHeaders.Set("User-Agent", c.s.userAgent())
  43498. if c.ifNoneMatch_ != "" {
  43499. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43500. }
  43501. var body io.Reader = nil
  43502. c.urlParams_.Set("alt", alt)
  43503. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43504. urls += "?" + c.urlParams_.Encode()
  43505. req, _ := http.NewRequest("GET", urls, body)
  43506. req.Header = reqHeaders
  43507. googleapi.Expand(req.URL, map[string]string{
  43508. "profileId": strconv.FormatInt(c.profileId, 10),
  43509. })
  43510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43511. }
  43512. // Do executes the "dfareporting.targetingTemplates.list" call.
  43513. // Exactly one of *TargetingTemplatesListResponse or error will be
  43514. // non-nil. Any non-2xx status code is an error. Response headers are in
  43515. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  43516. // response was returned at all) in error.(*googleapi.Error).Header. Use
  43517. // googleapi.IsNotModified to check whether the returned error was
  43518. // because http.StatusNotModified was returned.
  43519. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  43520. gensupport.SetOptions(c.urlParams_, opts...)
  43521. res, err := c.doRequest("json")
  43522. if res != nil && res.StatusCode == http.StatusNotModified {
  43523. if res.Body != nil {
  43524. res.Body.Close()
  43525. }
  43526. return nil, &googleapi.Error{
  43527. Code: res.StatusCode,
  43528. Header: res.Header,
  43529. }
  43530. }
  43531. if err != nil {
  43532. return nil, err
  43533. }
  43534. defer googleapi.CloseBody(res)
  43535. if err := googleapi.CheckResponse(res); err != nil {
  43536. return nil, err
  43537. }
  43538. ret := &TargetingTemplatesListResponse{
  43539. ServerResponse: googleapi.ServerResponse{
  43540. Header: res.Header,
  43541. HTTPStatusCode: res.StatusCode,
  43542. },
  43543. }
  43544. target := &ret
  43545. if err := gensupport.DecodeResponse(target, res); err != nil {
  43546. return nil, err
  43547. }
  43548. return ret, nil
  43549. // {
  43550. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  43551. // "httpMethod": "GET",
  43552. // "id": "dfareporting.targetingTemplates.list",
  43553. // "parameterOrder": [
  43554. // "profileId"
  43555. // ],
  43556. // "parameters": {
  43557. // "advertiserId": {
  43558. // "description": "Select only targeting templates with this advertiser ID.",
  43559. // "format": "int64",
  43560. // "location": "query",
  43561. // "type": "string"
  43562. // },
  43563. // "ids": {
  43564. // "description": "Select only targeting templates with these IDs.",
  43565. // "format": "int64",
  43566. // "location": "query",
  43567. // "repeated": true,
  43568. // "type": "string"
  43569. // },
  43570. // "maxResults": {
  43571. // "default": "1000",
  43572. // "description": "Maximum number of results to return.",
  43573. // "format": "int32",
  43574. // "location": "query",
  43575. // "maximum": "1000",
  43576. // "minimum": "0",
  43577. // "type": "integer"
  43578. // },
  43579. // "pageToken": {
  43580. // "description": "Value of the nextPageToken from the previous result page.",
  43581. // "location": "query",
  43582. // "type": "string"
  43583. // },
  43584. // "profileId": {
  43585. // "description": "User profile ID associated with this request.",
  43586. // "format": "int64",
  43587. // "location": "path",
  43588. // "required": true,
  43589. // "type": "string"
  43590. // },
  43591. // "searchString": {
  43592. // "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\".",
  43593. // "location": "query",
  43594. // "type": "string"
  43595. // },
  43596. // "sortField": {
  43597. // "default": "ID",
  43598. // "description": "Field by which to sort the list.",
  43599. // "enum": [
  43600. // "ID",
  43601. // "NAME"
  43602. // ],
  43603. // "enumDescriptions": [
  43604. // "",
  43605. // ""
  43606. // ],
  43607. // "location": "query",
  43608. // "type": "string"
  43609. // },
  43610. // "sortOrder": {
  43611. // "default": "ASCENDING",
  43612. // "description": "Order of sorted results.",
  43613. // "enum": [
  43614. // "ASCENDING",
  43615. // "DESCENDING"
  43616. // ],
  43617. // "enumDescriptions": [
  43618. // "",
  43619. // ""
  43620. // ],
  43621. // "location": "query",
  43622. // "type": "string"
  43623. // }
  43624. // },
  43625. // "path": "userprofiles/{profileId}/targetingTemplates",
  43626. // "response": {
  43627. // "$ref": "TargetingTemplatesListResponse"
  43628. // },
  43629. // "scopes": [
  43630. // "https://www.googleapis.com/auth/dfatrafficking"
  43631. // ]
  43632. // }
  43633. }
  43634. // Pages invokes f for each page of results.
  43635. // A non-nil error returned from f will halt the iteration.
  43636. // The provided context supersedes any context provided to the Context method.
  43637. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  43638. c.ctx_ = ctx
  43639. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43640. for {
  43641. x, err := c.Do()
  43642. if err != nil {
  43643. return err
  43644. }
  43645. if err := f(x); err != nil {
  43646. return err
  43647. }
  43648. if x.NextPageToken == "" {
  43649. return nil
  43650. }
  43651. c.PageToken(x.NextPageToken)
  43652. }
  43653. }
  43654. // method id "dfareporting.targetingTemplates.patch":
  43655. type TargetingTemplatesPatchCall struct {
  43656. s *Service
  43657. profileId int64
  43658. targetingtemplate *TargetingTemplate
  43659. urlParams_ gensupport.URLParams
  43660. ctx_ context.Context
  43661. header_ http.Header
  43662. }
  43663. // Patch: Updates an existing targeting template. This method supports
  43664. // patch semantics.
  43665. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  43666. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43667. c.profileId = profileId
  43668. c.urlParams_.Set("id", fmt.Sprint(id))
  43669. c.targetingtemplate = targetingtemplate
  43670. return c
  43671. }
  43672. // Fields allows partial responses to be retrieved. See
  43673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43674. // for more information.
  43675. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  43676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43677. return c
  43678. }
  43679. // Context sets the context to be used in this call's Do method. Any
  43680. // pending HTTP request will be aborted if the provided context is
  43681. // canceled.
  43682. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  43683. c.ctx_ = ctx
  43684. return c
  43685. }
  43686. // Header returns an http.Header that can be modified by the caller to
  43687. // add HTTP headers to the request.
  43688. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  43689. if c.header_ == nil {
  43690. c.header_ = make(http.Header)
  43691. }
  43692. return c.header_
  43693. }
  43694. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  43695. reqHeaders := make(http.Header)
  43696. for k, v := range c.header_ {
  43697. reqHeaders[k] = v
  43698. }
  43699. reqHeaders.Set("User-Agent", c.s.userAgent())
  43700. var body io.Reader = nil
  43701. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43702. if err != nil {
  43703. return nil, err
  43704. }
  43705. reqHeaders.Set("Content-Type", "application/json")
  43706. c.urlParams_.Set("alt", alt)
  43707. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43708. urls += "?" + c.urlParams_.Encode()
  43709. req, _ := http.NewRequest("PATCH", urls, body)
  43710. req.Header = reqHeaders
  43711. googleapi.Expand(req.URL, map[string]string{
  43712. "profileId": strconv.FormatInt(c.profileId, 10),
  43713. })
  43714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43715. }
  43716. // Do executes the "dfareporting.targetingTemplates.patch" call.
  43717. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43718. // non-2xx status code is an error. Response headers are in either
  43719. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43720. // returned at all) in error.(*googleapi.Error).Header. Use
  43721. // googleapi.IsNotModified to check whether the returned error was
  43722. // because http.StatusNotModified was returned.
  43723. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43724. gensupport.SetOptions(c.urlParams_, opts...)
  43725. res, err := c.doRequest("json")
  43726. if res != nil && res.StatusCode == http.StatusNotModified {
  43727. if res.Body != nil {
  43728. res.Body.Close()
  43729. }
  43730. return nil, &googleapi.Error{
  43731. Code: res.StatusCode,
  43732. Header: res.Header,
  43733. }
  43734. }
  43735. if err != nil {
  43736. return nil, err
  43737. }
  43738. defer googleapi.CloseBody(res)
  43739. if err := googleapi.CheckResponse(res); err != nil {
  43740. return nil, err
  43741. }
  43742. ret := &TargetingTemplate{
  43743. ServerResponse: googleapi.ServerResponse{
  43744. Header: res.Header,
  43745. HTTPStatusCode: res.StatusCode,
  43746. },
  43747. }
  43748. target := &ret
  43749. if err := gensupport.DecodeResponse(target, res); err != nil {
  43750. return nil, err
  43751. }
  43752. return ret, nil
  43753. // {
  43754. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  43755. // "httpMethod": "PATCH",
  43756. // "id": "dfareporting.targetingTemplates.patch",
  43757. // "parameterOrder": [
  43758. // "profileId",
  43759. // "id"
  43760. // ],
  43761. // "parameters": {
  43762. // "id": {
  43763. // "description": "Targeting template ID.",
  43764. // "format": "int64",
  43765. // "location": "query",
  43766. // "required": true,
  43767. // "type": "string"
  43768. // },
  43769. // "profileId": {
  43770. // "description": "User profile ID associated with this request.",
  43771. // "format": "int64",
  43772. // "location": "path",
  43773. // "required": true,
  43774. // "type": "string"
  43775. // }
  43776. // },
  43777. // "path": "userprofiles/{profileId}/targetingTemplates",
  43778. // "request": {
  43779. // "$ref": "TargetingTemplate"
  43780. // },
  43781. // "response": {
  43782. // "$ref": "TargetingTemplate"
  43783. // },
  43784. // "scopes": [
  43785. // "https://www.googleapis.com/auth/dfatrafficking"
  43786. // ]
  43787. // }
  43788. }
  43789. // method id "dfareporting.targetingTemplates.update":
  43790. type TargetingTemplatesUpdateCall struct {
  43791. s *Service
  43792. profileId int64
  43793. targetingtemplate *TargetingTemplate
  43794. urlParams_ gensupport.URLParams
  43795. ctx_ context.Context
  43796. header_ http.Header
  43797. }
  43798. // Update: Updates an existing targeting template.
  43799. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  43800. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43801. c.profileId = profileId
  43802. c.targetingtemplate = targetingtemplate
  43803. return c
  43804. }
  43805. // Fields allows partial responses to be retrieved. See
  43806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43807. // for more information.
  43808. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  43809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43810. return c
  43811. }
  43812. // Context sets the context to be used in this call's Do method. Any
  43813. // pending HTTP request will be aborted if the provided context is
  43814. // canceled.
  43815. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  43816. c.ctx_ = ctx
  43817. return c
  43818. }
  43819. // Header returns an http.Header that can be modified by the caller to
  43820. // add HTTP headers to the request.
  43821. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  43822. if c.header_ == nil {
  43823. c.header_ = make(http.Header)
  43824. }
  43825. return c.header_
  43826. }
  43827. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  43828. reqHeaders := make(http.Header)
  43829. for k, v := range c.header_ {
  43830. reqHeaders[k] = v
  43831. }
  43832. reqHeaders.Set("User-Agent", c.s.userAgent())
  43833. var body io.Reader = nil
  43834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43835. if err != nil {
  43836. return nil, err
  43837. }
  43838. reqHeaders.Set("Content-Type", "application/json")
  43839. c.urlParams_.Set("alt", alt)
  43840. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43841. urls += "?" + c.urlParams_.Encode()
  43842. req, _ := http.NewRequest("PUT", urls, body)
  43843. req.Header = reqHeaders
  43844. googleapi.Expand(req.URL, map[string]string{
  43845. "profileId": strconv.FormatInt(c.profileId, 10),
  43846. })
  43847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43848. }
  43849. // Do executes the "dfareporting.targetingTemplates.update" call.
  43850. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43851. // non-2xx status code is an error. Response headers are in either
  43852. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43853. // returned at all) in error.(*googleapi.Error).Header. Use
  43854. // googleapi.IsNotModified to check whether the returned error was
  43855. // because http.StatusNotModified was returned.
  43856. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43857. gensupport.SetOptions(c.urlParams_, opts...)
  43858. res, err := c.doRequest("json")
  43859. if res != nil && res.StatusCode == http.StatusNotModified {
  43860. if res.Body != nil {
  43861. res.Body.Close()
  43862. }
  43863. return nil, &googleapi.Error{
  43864. Code: res.StatusCode,
  43865. Header: res.Header,
  43866. }
  43867. }
  43868. if err != nil {
  43869. return nil, err
  43870. }
  43871. defer googleapi.CloseBody(res)
  43872. if err := googleapi.CheckResponse(res); err != nil {
  43873. return nil, err
  43874. }
  43875. ret := &TargetingTemplate{
  43876. ServerResponse: googleapi.ServerResponse{
  43877. Header: res.Header,
  43878. HTTPStatusCode: res.StatusCode,
  43879. },
  43880. }
  43881. target := &ret
  43882. if err := gensupport.DecodeResponse(target, res); err != nil {
  43883. return nil, err
  43884. }
  43885. return ret, nil
  43886. // {
  43887. // "description": "Updates an existing targeting template.",
  43888. // "httpMethod": "PUT",
  43889. // "id": "dfareporting.targetingTemplates.update",
  43890. // "parameterOrder": [
  43891. // "profileId"
  43892. // ],
  43893. // "parameters": {
  43894. // "profileId": {
  43895. // "description": "User profile ID associated with this request.",
  43896. // "format": "int64",
  43897. // "location": "path",
  43898. // "required": true,
  43899. // "type": "string"
  43900. // }
  43901. // },
  43902. // "path": "userprofiles/{profileId}/targetingTemplates",
  43903. // "request": {
  43904. // "$ref": "TargetingTemplate"
  43905. // },
  43906. // "response": {
  43907. // "$ref": "TargetingTemplate"
  43908. // },
  43909. // "scopes": [
  43910. // "https://www.googleapis.com/auth/dfatrafficking"
  43911. // ]
  43912. // }
  43913. }
  43914. // method id "dfareporting.userProfiles.get":
  43915. type UserProfilesGetCall struct {
  43916. s *Service
  43917. profileId int64
  43918. urlParams_ gensupport.URLParams
  43919. ifNoneMatch_ string
  43920. ctx_ context.Context
  43921. header_ http.Header
  43922. }
  43923. // Get: Gets one user profile by ID.
  43924. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  43925. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43926. c.profileId = profileId
  43927. return c
  43928. }
  43929. // Fields allows partial responses to be retrieved. See
  43930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43931. // for more information.
  43932. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  43933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43934. return c
  43935. }
  43936. // IfNoneMatch sets the optional parameter which makes the operation
  43937. // fail if the object's ETag matches the given value. This is useful for
  43938. // getting updates only after the object has changed since the last
  43939. // request. Use googleapi.IsNotModified to check whether the response
  43940. // error from Do is the result of In-None-Match.
  43941. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  43942. c.ifNoneMatch_ = entityTag
  43943. return c
  43944. }
  43945. // Context sets the context to be used in this call's Do method. Any
  43946. // pending HTTP request will be aborted if the provided context is
  43947. // canceled.
  43948. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  43949. c.ctx_ = ctx
  43950. return c
  43951. }
  43952. // Header returns an http.Header that can be modified by the caller to
  43953. // add HTTP headers to the request.
  43954. func (c *UserProfilesGetCall) Header() http.Header {
  43955. if c.header_ == nil {
  43956. c.header_ = make(http.Header)
  43957. }
  43958. return c.header_
  43959. }
  43960. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  43961. reqHeaders := make(http.Header)
  43962. for k, v := range c.header_ {
  43963. reqHeaders[k] = v
  43964. }
  43965. reqHeaders.Set("User-Agent", c.s.userAgent())
  43966. if c.ifNoneMatch_ != "" {
  43967. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43968. }
  43969. var body io.Reader = nil
  43970. c.urlParams_.Set("alt", alt)
  43971. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  43972. urls += "?" + c.urlParams_.Encode()
  43973. req, _ := http.NewRequest("GET", urls, body)
  43974. req.Header = reqHeaders
  43975. googleapi.Expand(req.URL, map[string]string{
  43976. "profileId": strconv.FormatInt(c.profileId, 10),
  43977. })
  43978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43979. }
  43980. // Do executes the "dfareporting.userProfiles.get" call.
  43981. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  43982. // status code is an error. Response headers are in either
  43983. // *UserProfile.ServerResponse.Header or (if a response was returned at
  43984. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43985. // to check whether the returned error was because
  43986. // http.StatusNotModified was returned.
  43987. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  43988. gensupport.SetOptions(c.urlParams_, opts...)
  43989. res, err := c.doRequest("json")
  43990. if res != nil && res.StatusCode == http.StatusNotModified {
  43991. if res.Body != nil {
  43992. res.Body.Close()
  43993. }
  43994. return nil, &googleapi.Error{
  43995. Code: res.StatusCode,
  43996. Header: res.Header,
  43997. }
  43998. }
  43999. if err != nil {
  44000. return nil, err
  44001. }
  44002. defer googleapi.CloseBody(res)
  44003. if err := googleapi.CheckResponse(res); err != nil {
  44004. return nil, err
  44005. }
  44006. ret := &UserProfile{
  44007. ServerResponse: googleapi.ServerResponse{
  44008. Header: res.Header,
  44009. HTTPStatusCode: res.StatusCode,
  44010. },
  44011. }
  44012. target := &ret
  44013. if err := gensupport.DecodeResponse(target, res); err != nil {
  44014. return nil, err
  44015. }
  44016. return ret, nil
  44017. // {
  44018. // "description": "Gets one user profile by ID.",
  44019. // "httpMethod": "GET",
  44020. // "id": "dfareporting.userProfiles.get",
  44021. // "parameterOrder": [
  44022. // "profileId"
  44023. // ],
  44024. // "parameters": {
  44025. // "profileId": {
  44026. // "description": "The user profile ID.",
  44027. // "format": "int64",
  44028. // "location": "path",
  44029. // "required": true,
  44030. // "type": "string"
  44031. // }
  44032. // },
  44033. // "path": "userprofiles/{profileId}",
  44034. // "response": {
  44035. // "$ref": "UserProfile"
  44036. // },
  44037. // "scopes": [
  44038. // "https://www.googleapis.com/auth/dfareporting",
  44039. // "https://www.googleapis.com/auth/dfatrafficking"
  44040. // ]
  44041. // }
  44042. }
  44043. // method id "dfareporting.userProfiles.list":
  44044. type UserProfilesListCall struct {
  44045. s *Service
  44046. urlParams_ gensupport.URLParams
  44047. ifNoneMatch_ string
  44048. ctx_ context.Context
  44049. header_ http.Header
  44050. }
  44051. // List: Retrieves list of user profiles for a user.
  44052. func (r *UserProfilesService) List() *UserProfilesListCall {
  44053. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44054. return c
  44055. }
  44056. // Fields allows partial responses to be retrieved. See
  44057. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44058. // for more information.
  44059. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  44060. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44061. return c
  44062. }
  44063. // IfNoneMatch sets the optional parameter which makes the operation
  44064. // fail if the object's ETag matches the given value. This is useful for
  44065. // getting updates only after the object has changed since the last
  44066. // request. Use googleapi.IsNotModified to check whether the response
  44067. // error from Do is the result of In-None-Match.
  44068. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  44069. c.ifNoneMatch_ = entityTag
  44070. return c
  44071. }
  44072. // Context sets the context to be used in this call's Do method. Any
  44073. // pending HTTP request will be aborted if the provided context is
  44074. // canceled.
  44075. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  44076. c.ctx_ = ctx
  44077. return c
  44078. }
  44079. // Header returns an http.Header that can be modified by the caller to
  44080. // add HTTP headers to the request.
  44081. func (c *UserProfilesListCall) Header() http.Header {
  44082. if c.header_ == nil {
  44083. c.header_ = make(http.Header)
  44084. }
  44085. return c.header_
  44086. }
  44087. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  44088. reqHeaders := make(http.Header)
  44089. for k, v := range c.header_ {
  44090. reqHeaders[k] = v
  44091. }
  44092. reqHeaders.Set("User-Agent", c.s.userAgent())
  44093. if c.ifNoneMatch_ != "" {
  44094. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44095. }
  44096. var body io.Reader = nil
  44097. c.urlParams_.Set("alt", alt)
  44098. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  44099. urls += "?" + c.urlParams_.Encode()
  44100. req, _ := http.NewRequest("GET", urls, body)
  44101. req.Header = reqHeaders
  44102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44103. }
  44104. // Do executes the "dfareporting.userProfiles.list" call.
  44105. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  44106. // status code is an error. Response headers are in either
  44107. // *UserProfileList.ServerResponse.Header or (if a response was returned
  44108. // at all) in error.(*googleapi.Error).Header. Use
  44109. // googleapi.IsNotModified to check whether the returned error was
  44110. // because http.StatusNotModified was returned.
  44111. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  44112. gensupport.SetOptions(c.urlParams_, opts...)
  44113. res, err := c.doRequest("json")
  44114. if res != nil && res.StatusCode == http.StatusNotModified {
  44115. if res.Body != nil {
  44116. res.Body.Close()
  44117. }
  44118. return nil, &googleapi.Error{
  44119. Code: res.StatusCode,
  44120. Header: res.Header,
  44121. }
  44122. }
  44123. if err != nil {
  44124. return nil, err
  44125. }
  44126. defer googleapi.CloseBody(res)
  44127. if err := googleapi.CheckResponse(res); err != nil {
  44128. return nil, err
  44129. }
  44130. ret := &UserProfileList{
  44131. ServerResponse: googleapi.ServerResponse{
  44132. Header: res.Header,
  44133. HTTPStatusCode: res.StatusCode,
  44134. },
  44135. }
  44136. target := &ret
  44137. if err := gensupport.DecodeResponse(target, res); err != nil {
  44138. return nil, err
  44139. }
  44140. return ret, nil
  44141. // {
  44142. // "description": "Retrieves list of user profiles for a user.",
  44143. // "httpMethod": "GET",
  44144. // "id": "dfareporting.userProfiles.list",
  44145. // "path": "userprofiles",
  44146. // "response": {
  44147. // "$ref": "UserProfileList"
  44148. // },
  44149. // "scopes": [
  44150. // "https://www.googleapis.com/auth/dfareporting",
  44151. // "https://www.googleapis.com/auth/dfatrafficking"
  44152. // ]
  44153. // }
  44154. }
  44155. // method id "dfareporting.userRolePermissionGroups.get":
  44156. type UserRolePermissionGroupsGetCall struct {
  44157. s *Service
  44158. profileId int64
  44159. id int64
  44160. urlParams_ gensupport.URLParams
  44161. ifNoneMatch_ string
  44162. ctx_ context.Context
  44163. header_ http.Header
  44164. }
  44165. // Get: Gets one user role permission group by ID.
  44166. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  44167. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44168. c.profileId = profileId
  44169. c.id = id
  44170. return c
  44171. }
  44172. // Fields allows partial responses to be retrieved. See
  44173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44174. // for more information.
  44175. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  44176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44177. return c
  44178. }
  44179. // IfNoneMatch sets the optional parameter which makes the operation
  44180. // fail if the object's ETag matches the given value. This is useful for
  44181. // getting updates only after the object has changed since the last
  44182. // request. Use googleapi.IsNotModified to check whether the response
  44183. // error from Do is the result of In-None-Match.
  44184. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  44185. c.ifNoneMatch_ = entityTag
  44186. return c
  44187. }
  44188. // Context sets the context to be used in this call's Do method. Any
  44189. // pending HTTP request will be aborted if the provided context is
  44190. // canceled.
  44191. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  44192. c.ctx_ = ctx
  44193. return c
  44194. }
  44195. // Header returns an http.Header that can be modified by the caller to
  44196. // add HTTP headers to the request.
  44197. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  44198. if c.header_ == nil {
  44199. c.header_ = make(http.Header)
  44200. }
  44201. return c.header_
  44202. }
  44203. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  44204. reqHeaders := make(http.Header)
  44205. for k, v := range c.header_ {
  44206. reqHeaders[k] = v
  44207. }
  44208. reqHeaders.Set("User-Agent", c.s.userAgent())
  44209. if c.ifNoneMatch_ != "" {
  44210. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44211. }
  44212. var body io.Reader = nil
  44213. c.urlParams_.Set("alt", alt)
  44214. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  44215. urls += "?" + c.urlParams_.Encode()
  44216. req, _ := http.NewRequest("GET", urls, body)
  44217. req.Header = reqHeaders
  44218. googleapi.Expand(req.URL, map[string]string{
  44219. "profileId": strconv.FormatInt(c.profileId, 10),
  44220. "id": strconv.FormatInt(c.id, 10),
  44221. })
  44222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44223. }
  44224. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  44225. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  44226. // non-2xx status code is an error. Response headers are in either
  44227. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  44228. // returned at all) in error.(*googleapi.Error).Header. Use
  44229. // googleapi.IsNotModified to check whether the returned error was
  44230. // because http.StatusNotModified was returned.
  44231. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  44232. gensupport.SetOptions(c.urlParams_, opts...)
  44233. res, err := c.doRequest("json")
  44234. if res != nil && res.StatusCode == http.StatusNotModified {
  44235. if res.Body != nil {
  44236. res.Body.Close()
  44237. }
  44238. return nil, &googleapi.Error{
  44239. Code: res.StatusCode,
  44240. Header: res.Header,
  44241. }
  44242. }
  44243. if err != nil {
  44244. return nil, err
  44245. }
  44246. defer googleapi.CloseBody(res)
  44247. if err := googleapi.CheckResponse(res); err != nil {
  44248. return nil, err
  44249. }
  44250. ret := &UserRolePermissionGroup{
  44251. ServerResponse: googleapi.ServerResponse{
  44252. Header: res.Header,
  44253. HTTPStatusCode: res.StatusCode,
  44254. },
  44255. }
  44256. target := &ret
  44257. if err := gensupport.DecodeResponse(target, res); err != nil {
  44258. return nil, err
  44259. }
  44260. return ret, nil
  44261. // {
  44262. // "description": "Gets one user role permission group by ID.",
  44263. // "httpMethod": "GET",
  44264. // "id": "dfareporting.userRolePermissionGroups.get",
  44265. // "parameterOrder": [
  44266. // "profileId",
  44267. // "id"
  44268. // ],
  44269. // "parameters": {
  44270. // "id": {
  44271. // "description": "User role permission group ID.",
  44272. // "format": "int64",
  44273. // "location": "path",
  44274. // "required": true,
  44275. // "type": "string"
  44276. // },
  44277. // "profileId": {
  44278. // "description": "User profile ID associated with this request.",
  44279. // "format": "int64",
  44280. // "location": "path",
  44281. // "required": true,
  44282. // "type": "string"
  44283. // }
  44284. // },
  44285. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  44286. // "response": {
  44287. // "$ref": "UserRolePermissionGroup"
  44288. // },
  44289. // "scopes": [
  44290. // "https://www.googleapis.com/auth/dfatrafficking"
  44291. // ]
  44292. // }
  44293. }
  44294. // method id "dfareporting.userRolePermissionGroups.list":
  44295. type UserRolePermissionGroupsListCall struct {
  44296. s *Service
  44297. profileId int64
  44298. urlParams_ gensupport.URLParams
  44299. ifNoneMatch_ string
  44300. ctx_ context.Context
  44301. header_ http.Header
  44302. }
  44303. // List: Gets a list of all supported user role permission groups.
  44304. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  44305. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44306. c.profileId = profileId
  44307. return c
  44308. }
  44309. // Fields allows partial responses to be retrieved. See
  44310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44311. // for more information.
  44312. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  44313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44314. return c
  44315. }
  44316. // IfNoneMatch sets the optional parameter which makes the operation
  44317. // fail if the object's ETag matches the given value. This is useful for
  44318. // getting updates only after the object has changed since the last
  44319. // request. Use googleapi.IsNotModified to check whether the response
  44320. // error from Do is the result of In-None-Match.
  44321. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  44322. c.ifNoneMatch_ = entityTag
  44323. return c
  44324. }
  44325. // Context sets the context to be used in this call's Do method. Any
  44326. // pending HTTP request will be aborted if the provided context is
  44327. // canceled.
  44328. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  44329. c.ctx_ = ctx
  44330. return c
  44331. }
  44332. // Header returns an http.Header that can be modified by the caller to
  44333. // add HTTP headers to the request.
  44334. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  44335. if c.header_ == nil {
  44336. c.header_ = make(http.Header)
  44337. }
  44338. return c.header_
  44339. }
  44340. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  44341. reqHeaders := make(http.Header)
  44342. for k, v := range c.header_ {
  44343. reqHeaders[k] = v
  44344. }
  44345. reqHeaders.Set("User-Agent", c.s.userAgent())
  44346. if c.ifNoneMatch_ != "" {
  44347. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44348. }
  44349. var body io.Reader = nil
  44350. c.urlParams_.Set("alt", alt)
  44351. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  44352. urls += "?" + c.urlParams_.Encode()
  44353. req, _ := http.NewRequest("GET", urls, body)
  44354. req.Header = reqHeaders
  44355. googleapi.Expand(req.URL, map[string]string{
  44356. "profileId": strconv.FormatInt(c.profileId, 10),
  44357. })
  44358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44359. }
  44360. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  44361. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  44362. // non-nil. Any non-2xx status code is an error. Response headers are in
  44363. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  44364. // (if a response was returned at all) in
  44365. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  44366. // whether the returned error was because http.StatusNotModified was
  44367. // returned.
  44368. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  44369. gensupport.SetOptions(c.urlParams_, opts...)
  44370. res, err := c.doRequest("json")
  44371. if res != nil && res.StatusCode == http.StatusNotModified {
  44372. if res.Body != nil {
  44373. res.Body.Close()
  44374. }
  44375. return nil, &googleapi.Error{
  44376. Code: res.StatusCode,
  44377. Header: res.Header,
  44378. }
  44379. }
  44380. if err != nil {
  44381. return nil, err
  44382. }
  44383. defer googleapi.CloseBody(res)
  44384. if err := googleapi.CheckResponse(res); err != nil {
  44385. return nil, err
  44386. }
  44387. ret := &UserRolePermissionGroupsListResponse{
  44388. ServerResponse: googleapi.ServerResponse{
  44389. Header: res.Header,
  44390. HTTPStatusCode: res.StatusCode,
  44391. },
  44392. }
  44393. target := &ret
  44394. if err := gensupport.DecodeResponse(target, res); err != nil {
  44395. return nil, err
  44396. }
  44397. return ret, nil
  44398. // {
  44399. // "description": "Gets a list of all supported user role permission groups.",
  44400. // "httpMethod": "GET",
  44401. // "id": "dfareporting.userRolePermissionGroups.list",
  44402. // "parameterOrder": [
  44403. // "profileId"
  44404. // ],
  44405. // "parameters": {
  44406. // "profileId": {
  44407. // "description": "User profile ID associated with this request.",
  44408. // "format": "int64",
  44409. // "location": "path",
  44410. // "required": true,
  44411. // "type": "string"
  44412. // }
  44413. // },
  44414. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  44415. // "response": {
  44416. // "$ref": "UserRolePermissionGroupsListResponse"
  44417. // },
  44418. // "scopes": [
  44419. // "https://www.googleapis.com/auth/dfatrafficking"
  44420. // ]
  44421. // }
  44422. }
  44423. // method id "dfareporting.userRolePermissions.get":
  44424. type UserRolePermissionsGetCall struct {
  44425. s *Service
  44426. profileId int64
  44427. id int64
  44428. urlParams_ gensupport.URLParams
  44429. ifNoneMatch_ string
  44430. ctx_ context.Context
  44431. header_ http.Header
  44432. }
  44433. // Get: Gets one user role permission by ID.
  44434. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  44435. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44436. c.profileId = profileId
  44437. c.id = id
  44438. return c
  44439. }
  44440. // Fields allows partial responses to be retrieved. See
  44441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44442. // for more information.
  44443. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  44444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44445. return c
  44446. }
  44447. // IfNoneMatch sets the optional parameter which makes the operation
  44448. // fail if the object's ETag matches the given value. This is useful for
  44449. // getting updates only after the object has changed since the last
  44450. // request. Use googleapi.IsNotModified to check whether the response
  44451. // error from Do is the result of In-None-Match.
  44452. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  44453. c.ifNoneMatch_ = entityTag
  44454. return c
  44455. }
  44456. // Context sets the context to be used in this call's Do method. Any
  44457. // pending HTTP request will be aborted if the provided context is
  44458. // canceled.
  44459. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  44460. c.ctx_ = ctx
  44461. return c
  44462. }
  44463. // Header returns an http.Header that can be modified by the caller to
  44464. // add HTTP headers to the request.
  44465. func (c *UserRolePermissionsGetCall) Header() http.Header {
  44466. if c.header_ == nil {
  44467. c.header_ = make(http.Header)
  44468. }
  44469. return c.header_
  44470. }
  44471. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  44472. reqHeaders := make(http.Header)
  44473. for k, v := range c.header_ {
  44474. reqHeaders[k] = v
  44475. }
  44476. reqHeaders.Set("User-Agent", c.s.userAgent())
  44477. if c.ifNoneMatch_ != "" {
  44478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44479. }
  44480. var body io.Reader = nil
  44481. c.urlParams_.Set("alt", alt)
  44482. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  44483. urls += "?" + c.urlParams_.Encode()
  44484. req, _ := http.NewRequest("GET", urls, body)
  44485. req.Header = reqHeaders
  44486. googleapi.Expand(req.URL, map[string]string{
  44487. "profileId": strconv.FormatInt(c.profileId, 10),
  44488. "id": strconv.FormatInt(c.id, 10),
  44489. })
  44490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44491. }
  44492. // Do executes the "dfareporting.userRolePermissions.get" call.
  44493. // Exactly one of *UserRolePermission or error will be non-nil. Any
  44494. // non-2xx status code is an error. Response headers are in either
  44495. // *UserRolePermission.ServerResponse.Header or (if a response was
  44496. // returned at all) in error.(*googleapi.Error).Header. Use
  44497. // googleapi.IsNotModified to check whether the returned error was
  44498. // because http.StatusNotModified was returned.
  44499. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  44500. gensupport.SetOptions(c.urlParams_, opts...)
  44501. res, err := c.doRequest("json")
  44502. if res != nil && res.StatusCode == http.StatusNotModified {
  44503. if res.Body != nil {
  44504. res.Body.Close()
  44505. }
  44506. return nil, &googleapi.Error{
  44507. Code: res.StatusCode,
  44508. Header: res.Header,
  44509. }
  44510. }
  44511. if err != nil {
  44512. return nil, err
  44513. }
  44514. defer googleapi.CloseBody(res)
  44515. if err := googleapi.CheckResponse(res); err != nil {
  44516. return nil, err
  44517. }
  44518. ret := &UserRolePermission{
  44519. ServerResponse: googleapi.ServerResponse{
  44520. Header: res.Header,
  44521. HTTPStatusCode: res.StatusCode,
  44522. },
  44523. }
  44524. target := &ret
  44525. if err := gensupport.DecodeResponse(target, res); err != nil {
  44526. return nil, err
  44527. }
  44528. return ret, nil
  44529. // {
  44530. // "description": "Gets one user role permission by ID.",
  44531. // "httpMethod": "GET",
  44532. // "id": "dfareporting.userRolePermissions.get",
  44533. // "parameterOrder": [
  44534. // "profileId",
  44535. // "id"
  44536. // ],
  44537. // "parameters": {
  44538. // "id": {
  44539. // "description": "User role permission ID.",
  44540. // "format": "int64",
  44541. // "location": "path",
  44542. // "required": true,
  44543. // "type": "string"
  44544. // },
  44545. // "profileId": {
  44546. // "description": "User profile ID associated with this request.",
  44547. // "format": "int64",
  44548. // "location": "path",
  44549. // "required": true,
  44550. // "type": "string"
  44551. // }
  44552. // },
  44553. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  44554. // "response": {
  44555. // "$ref": "UserRolePermission"
  44556. // },
  44557. // "scopes": [
  44558. // "https://www.googleapis.com/auth/dfatrafficking"
  44559. // ]
  44560. // }
  44561. }
  44562. // method id "dfareporting.userRolePermissions.list":
  44563. type UserRolePermissionsListCall struct {
  44564. s *Service
  44565. profileId int64
  44566. urlParams_ gensupport.URLParams
  44567. ifNoneMatch_ string
  44568. ctx_ context.Context
  44569. header_ http.Header
  44570. }
  44571. // List: Gets a list of user role permissions, possibly filtered.
  44572. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  44573. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44574. c.profileId = profileId
  44575. return c
  44576. }
  44577. // Ids sets the optional parameter "ids": Select only user role
  44578. // permissions with these IDs.
  44579. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  44580. var ids_ []string
  44581. for _, v := range ids {
  44582. ids_ = append(ids_, fmt.Sprint(v))
  44583. }
  44584. c.urlParams_.SetMulti("ids", ids_)
  44585. return c
  44586. }
  44587. // Fields allows partial responses to be retrieved. See
  44588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44589. // for more information.
  44590. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  44591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44592. return c
  44593. }
  44594. // IfNoneMatch sets the optional parameter which makes the operation
  44595. // fail if the object's ETag matches the given value. This is useful for
  44596. // getting updates only after the object has changed since the last
  44597. // request. Use googleapi.IsNotModified to check whether the response
  44598. // error from Do is the result of In-None-Match.
  44599. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  44600. c.ifNoneMatch_ = entityTag
  44601. return c
  44602. }
  44603. // Context sets the context to be used in this call's Do method. Any
  44604. // pending HTTP request will be aborted if the provided context is
  44605. // canceled.
  44606. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  44607. c.ctx_ = ctx
  44608. return c
  44609. }
  44610. // Header returns an http.Header that can be modified by the caller to
  44611. // add HTTP headers to the request.
  44612. func (c *UserRolePermissionsListCall) Header() http.Header {
  44613. if c.header_ == nil {
  44614. c.header_ = make(http.Header)
  44615. }
  44616. return c.header_
  44617. }
  44618. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  44619. reqHeaders := make(http.Header)
  44620. for k, v := range c.header_ {
  44621. reqHeaders[k] = v
  44622. }
  44623. reqHeaders.Set("User-Agent", c.s.userAgent())
  44624. if c.ifNoneMatch_ != "" {
  44625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44626. }
  44627. var body io.Reader = nil
  44628. c.urlParams_.Set("alt", alt)
  44629. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  44630. urls += "?" + c.urlParams_.Encode()
  44631. req, _ := http.NewRequest("GET", urls, body)
  44632. req.Header = reqHeaders
  44633. googleapi.Expand(req.URL, map[string]string{
  44634. "profileId": strconv.FormatInt(c.profileId, 10),
  44635. })
  44636. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44637. }
  44638. // Do executes the "dfareporting.userRolePermissions.list" call.
  44639. // Exactly one of *UserRolePermissionsListResponse or error will be
  44640. // non-nil. Any non-2xx status code is an error. Response headers are in
  44641. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  44642. // a response was returned at all) in error.(*googleapi.Error).Header.
  44643. // Use googleapi.IsNotModified to check whether the returned error was
  44644. // because http.StatusNotModified was returned.
  44645. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  44646. gensupport.SetOptions(c.urlParams_, opts...)
  44647. res, err := c.doRequest("json")
  44648. if res != nil && res.StatusCode == http.StatusNotModified {
  44649. if res.Body != nil {
  44650. res.Body.Close()
  44651. }
  44652. return nil, &googleapi.Error{
  44653. Code: res.StatusCode,
  44654. Header: res.Header,
  44655. }
  44656. }
  44657. if err != nil {
  44658. return nil, err
  44659. }
  44660. defer googleapi.CloseBody(res)
  44661. if err := googleapi.CheckResponse(res); err != nil {
  44662. return nil, err
  44663. }
  44664. ret := &UserRolePermissionsListResponse{
  44665. ServerResponse: googleapi.ServerResponse{
  44666. Header: res.Header,
  44667. HTTPStatusCode: res.StatusCode,
  44668. },
  44669. }
  44670. target := &ret
  44671. if err := gensupport.DecodeResponse(target, res); err != nil {
  44672. return nil, err
  44673. }
  44674. return ret, nil
  44675. // {
  44676. // "description": "Gets a list of user role permissions, possibly filtered.",
  44677. // "httpMethod": "GET",
  44678. // "id": "dfareporting.userRolePermissions.list",
  44679. // "parameterOrder": [
  44680. // "profileId"
  44681. // ],
  44682. // "parameters": {
  44683. // "ids": {
  44684. // "description": "Select only user role permissions with these IDs.",
  44685. // "format": "int64",
  44686. // "location": "query",
  44687. // "repeated": true,
  44688. // "type": "string"
  44689. // },
  44690. // "profileId": {
  44691. // "description": "User profile ID associated with this request.",
  44692. // "format": "int64",
  44693. // "location": "path",
  44694. // "required": true,
  44695. // "type": "string"
  44696. // }
  44697. // },
  44698. // "path": "userprofiles/{profileId}/userRolePermissions",
  44699. // "response": {
  44700. // "$ref": "UserRolePermissionsListResponse"
  44701. // },
  44702. // "scopes": [
  44703. // "https://www.googleapis.com/auth/dfatrafficking"
  44704. // ]
  44705. // }
  44706. }
  44707. // method id "dfareporting.userRoles.delete":
  44708. type UserRolesDeleteCall struct {
  44709. s *Service
  44710. profileId int64
  44711. id int64
  44712. urlParams_ gensupport.URLParams
  44713. ctx_ context.Context
  44714. header_ http.Header
  44715. }
  44716. // Delete: Deletes an existing user role.
  44717. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  44718. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44719. c.profileId = profileId
  44720. c.id = id
  44721. return c
  44722. }
  44723. // Fields allows partial responses to be retrieved. See
  44724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44725. // for more information.
  44726. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  44727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44728. return c
  44729. }
  44730. // Context sets the context to be used in this call's Do method. Any
  44731. // pending HTTP request will be aborted if the provided context is
  44732. // canceled.
  44733. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  44734. c.ctx_ = ctx
  44735. return c
  44736. }
  44737. // Header returns an http.Header that can be modified by the caller to
  44738. // add HTTP headers to the request.
  44739. func (c *UserRolesDeleteCall) Header() http.Header {
  44740. if c.header_ == nil {
  44741. c.header_ = make(http.Header)
  44742. }
  44743. return c.header_
  44744. }
  44745. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44746. reqHeaders := make(http.Header)
  44747. for k, v := range c.header_ {
  44748. reqHeaders[k] = v
  44749. }
  44750. reqHeaders.Set("User-Agent", c.s.userAgent())
  44751. var body io.Reader = nil
  44752. c.urlParams_.Set("alt", alt)
  44753. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  44754. urls += "?" + c.urlParams_.Encode()
  44755. req, _ := http.NewRequest("DELETE", urls, body)
  44756. req.Header = reqHeaders
  44757. googleapi.Expand(req.URL, map[string]string{
  44758. "profileId": strconv.FormatInt(c.profileId, 10),
  44759. "id": strconv.FormatInt(c.id, 10),
  44760. })
  44761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44762. }
  44763. // Do executes the "dfareporting.userRoles.delete" call.
  44764. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  44765. gensupport.SetOptions(c.urlParams_, opts...)
  44766. res, err := c.doRequest("json")
  44767. if err != nil {
  44768. return err
  44769. }
  44770. defer googleapi.CloseBody(res)
  44771. if err := googleapi.CheckResponse(res); err != nil {
  44772. return err
  44773. }
  44774. return nil
  44775. // {
  44776. // "description": "Deletes an existing user role.",
  44777. // "httpMethod": "DELETE",
  44778. // "id": "dfareporting.userRoles.delete",
  44779. // "parameterOrder": [
  44780. // "profileId",
  44781. // "id"
  44782. // ],
  44783. // "parameters": {
  44784. // "id": {
  44785. // "description": "User role ID.",
  44786. // "format": "int64",
  44787. // "location": "path",
  44788. // "required": true,
  44789. // "type": "string"
  44790. // },
  44791. // "profileId": {
  44792. // "description": "User profile ID associated with this request.",
  44793. // "format": "int64",
  44794. // "location": "path",
  44795. // "required": true,
  44796. // "type": "string"
  44797. // }
  44798. // },
  44799. // "path": "userprofiles/{profileId}/userRoles/{id}",
  44800. // "scopes": [
  44801. // "https://www.googleapis.com/auth/dfatrafficking"
  44802. // ]
  44803. // }
  44804. }
  44805. // method id "dfareporting.userRoles.get":
  44806. type UserRolesGetCall struct {
  44807. s *Service
  44808. profileId int64
  44809. id int64
  44810. urlParams_ gensupport.URLParams
  44811. ifNoneMatch_ string
  44812. ctx_ context.Context
  44813. header_ http.Header
  44814. }
  44815. // Get: Gets one user role by ID.
  44816. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  44817. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44818. c.profileId = profileId
  44819. c.id = id
  44820. return c
  44821. }
  44822. // Fields allows partial responses to be retrieved. See
  44823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44824. // for more information.
  44825. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  44826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44827. return c
  44828. }
  44829. // IfNoneMatch sets the optional parameter which makes the operation
  44830. // fail if the object's ETag matches the given value. This is useful for
  44831. // getting updates only after the object has changed since the last
  44832. // request. Use googleapi.IsNotModified to check whether the response
  44833. // error from Do is the result of In-None-Match.
  44834. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  44835. c.ifNoneMatch_ = entityTag
  44836. return c
  44837. }
  44838. // Context sets the context to be used in this call's Do method. Any
  44839. // pending HTTP request will be aborted if the provided context is
  44840. // canceled.
  44841. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  44842. c.ctx_ = ctx
  44843. return c
  44844. }
  44845. // Header returns an http.Header that can be modified by the caller to
  44846. // add HTTP headers to the request.
  44847. func (c *UserRolesGetCall) Header() http.Header {
  44848. if c.header_ == nil {
  44849. c.header_ = make(http.Header)
  44850. }
  44851. return c.header_
  44852. }
  44853. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  44854. reqHeaders := make(http.Header)
  44855. for k, v := range c.header_ {
  44856. reqHeaders[k] = v
  44857. }
  44858. reqHeaders.Set("User-Agent", c.s.userAgent())
  44859. if c.ifNoneMatch_ != "" {
  44860. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44861. }
  44862. var body io.Reader = nil
  44863. c.urlParams_.Set("alt", alt)
  44864. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  44865. urls += "?" + c.urlParams_.Encode()
  44866. req, _ := http.NewRequest("GET", urls, body)
  44867. req.Header = reqHeaders
  44868. googleapi.Expand(req.URL, map[string]string{
  44869. "profileId": strconv.FormatInt(c.profileId, 10),
  44870. "id": strconv.FormatInt(c.id, 10),
  44871. })
  44872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44873. }
  44874. // Do executes the "dfareporting.userRoles.get" call.
  44875. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44876. // code is an error. Response headers are in either
  44877. // *UserRole.ServerResponse.Header or (if a response was returned at
  44878. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44879. // to check whether the returned error was because
  44880. // http.StatusNotModified was returned.
  44881. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44882. gensupport.SetOptions(c.urlParams_, opts...)
  44883. res, err := c.doRequest("json")
  44884. if res != nil && res.StatusCode == http.StatusNotModified {
  44885. if res.Body != nil {
  44886. res.Body.Close()
  44887. }
  44888. return nil, &googleapi.Error{
  44889. Code: res.StatusCode,
  44890. Header: res.Header,
  44891. }
  44892. }
  44893. if err != nil {
  44894. return nil, err
  44895. }
  44896. defer googleapi.CloseBody(res)
  44897. if err := googleapi.CheckResponse(res); err != nil {
  44898. return nil, err
  44899. }
  44900. ret := &UserRole{
  44901. ServerResponse: googleapi.ServerResponse{
  44902. Header: res.Header,
  44903. HTTPStatusCode: res.StatusCode,
  44904. },
  44905. }
  44906. target := &ret
  44907. if err := gensupport.DecodeResponse(target, res); err != nil {
  44908. return nil, err
  44909. }
  44910. return ret, nil
  44911. // {
  44912. // "description": "Gets one user role by ID.",
  44913. // "httpMethod": "GET",
  44914. // "id": "dfareporting.userRoles.get",
  44915. // "parameterOrder": [
  44916. // "profileId",
  44917. // "id"
  44918. // ],
  44919. // "parameters": {
  44920. // "id": {
  44921. // "description": "User role ID.",
  44922. // "format": "int64",
  44923. // "location": "path",
  44924. // "required": true,
  44925. // "type": "string"
  44926. // },
  44927. // "profileId": {
  44928. // "description": "User profile ID associated with this request.",
  44929. // "format": "int64",
  44930. // "location": "path",
  44931. // "required": true,
  44932. // "type": "string"
  44933. // }
  44934. // },
  44935. // "path": "userprofiles/{profileId}/userRoles/{id}",
  44936. // "response": {
  44937. // "$ref": "UserRole"
  44938. // },
  44939. // "scopes": [
  44940. // "https://www.googleapis.com/auth/dfatrafficking"
  44941. // ]
  44942. // }
  44943. }
  44944. // method id "dfareporting.userRoles.insert":
  44945. type UserRolesInsertCall struct {
  44946. s *Service
  44947. profileId int64
  44948. userrole *UserRole
  44949. urlParams_ gensupport.URLParams
  44950. ctx_ context.Context
  44951. header_ http.Header
  44952. }
  44953. // Insert: Inserts a new user role.
  44954. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  44955. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44956. c.profileId = profileId
  44957. c.userrole = userrole
  44958. return c
  44959. }
  44960. // Fields allows partial responses to be retrieved. See
  44961. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44962. // for more information.
  44963. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  44964. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44965. return c
  44966. }
  44967. // Context sets the context to be used in this call's Do method. Any
  44968. // pending HTTP request will be aborted if the provided context is
  44969. // canceled.
  44970. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  44971. c.ctx_ = ctx
  44972. return c
  44973. }
  44974. // Header returns an http.Header that can be modified by the caller to
  44975. // add HTTP headers to the request.
  44976. func (c *UserRolesInsertCall) Header() http.Header {
  44977. if c.header_ == nil {
  44978. c.header_ = make(http.Header)
  44979. }
  44980. return c.header_
  44981. }
  44982. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  44983. reqHeaders := make(http.Header)
  44984. for k, v := range c.header_ {
  44985. reqHeaders[k] = v
  44986. }
  44987. reqHeaders.Set("User-Agent", c.s.userAgent())
  44988. var body io.Reader = nil
  44989. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44990. if err != nil {
  44991. return nil, err
  44992. }
  44993. reqHeaders.Set("Content-Type", "application/json")
  44994. c.urlParams_.Set("alt", alt)
  44995. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44996. urls += "?" + c.urlParams_.Encode()
  44997. req, _ := http.NewRequest("POST", urls, body)
  44998. req.Header = reqHeaders
  44999. googleapi.Expand(req.URL, map[string]string{
  45000. "profileId": strconv.FormatInt(c.profileId, 10),
  45001. })
  45002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45003. }
  45004. // Do executes the "dfareporting.userRoles.insert" call.
  45005. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45006. // code is an error. Response headers are in either
  45007. // *UserRole.ServerResponse.Header or (if a response was returned at
  45008. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45009. // to check whether the returned error was because
  45010. // http.StatusNotModified was returned.
  45011. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45012. gensupport.SetOptions(c.urlParams_, opts...)
  45013. res, err := c.doRequest("json")
  45014. if res != nil && res.StatusCode == http.StatusNotModified {
  45015. if res.Body != nil {
  45016. res.Body.Close()
  45017. }
  45018. return nil, &googleapi.Error{
  45019. Code: res.StatusCode,
  45020. Header: res.Header,
  45021. }
  45022. }
  45023. if err != nil {
  45024. return nil, err
  45025. }
  45026. defer googleapi.CloseBody(res)
  45027. if err := googleapi.CheckResponse(res); err != nil {
  45028. return nil, err
  45029. }
  45030. ret := &UserRole{
  45031. ServerResponse: googleapi.ServerResponse{
  45032. Header: res.Header,
  45033. HTTPStatusCode: res.StatusCode,
  45034. },
  45035. }
  45036. target := &ret
  45037. if err := gensupport.DecodeResponse(target, res); err != nil {
  45038. return nil, err
  45039. }
  45040. return ret, nil
  45041. // {
  45042. // "description": "Inserts a new user role.",
  45043. // "httpMethod": "POST",
  45044. // "id": "dfareporting.userRoles.insert",
  45045. // "parameterOrder": [
  45046. // "profileId"
  45047. // ],
  45048. // "parameters": {
  45049. // "profileId": {
  45050. // "description": "User profile ID associated with this request.",
  45051. // "format": "int64",
  45052. // "location": "path",
  45053. // "required": true,
  45054. // "type": "string"
  45055. // }
  45056. // },
  45057. // "path": "userprofiles/{profileId}/userRoles",
  45058. // "request": {
  45059. // "$ref": "UserRole"
  45060. // },
  45061. // "response": {
  45062. // "$ref": "UserRole"
  45063. // },
  45064. // "scopes": [
  45065. // "https://www.googleapis.com/auth/dfatrafficking"
  45066. // ]
  45067. // }
  45068. }
  45069. // method id "dfareporting.userRoles.list":
  45070. type UserRolesListCall struct {
  45071. s *Service
  45072. profileId int64
  45073. urlParams_ gensupport.URLParams
  45074. ifNoneMatch_ string
  45075. ctx_ context.Context
  45076. header_ http.Header
  45077. }
  45078. // List: Retrieves a list of user roles, possibly filtered. This method
  45079. // supports paging.
  45080. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  45081. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45082. c.profileId = profileId
  45083. return c
  45084. }
  45085. // AccountUserRoleOnly sets the optional parameter
  45086. // "accountUserRoleOnly": Select only account level user roles not
  45087. // associated with any specific subaccount.
  45088. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  45089. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  45090. return c
  45091. }
  45092. // Ids sets the optional parameter "ids": Select only user roles with
  45093. // the specified IDs.
  45094. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  45095. var ids_ []string
  45096. for _, v := range ids {
  45097. ids_ = append(ids_, fmt.Sprint(v))
  45098. }
  45099. c.urlParams_.SetMulti("ids", ids_)
  45100. return c
  45101. }
  45102. // MaxResults sets the optional parameter "maxResults": Maximum number
  45103. // of results to return.
  45104. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  45105. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45106. return c
  45107. }
  45108. // PageToken sets the optional parameter "pageToken": Value of the
  45109. // nextPageToken from the previous result page.
  45110. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  45111. c.urlParams_.Set("pageToken", pageToken)
  45112. return c
  45113. }
  45114. // SearchString sets the optional parameter "searchString": Allows
  45115. // searching for objects by name or ID. Wildcards (*) are allowed. For
  45116. // example, "userrole*2015" will return objects with names like
  45117. // "userrole June 2015", "userrole April 2015", or simply "userrole
  45118. // 2015". Most of the searches also add wildcards implicitly at the
  45119. // start and the end of the search string. For example, a search string
  45120. // of "userrole" will match objects with name "my userrole", "userrole
  45121. // 2015", or simply "userrole".
  45122. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  45123. c.urlParams_.Set("searchString", searchString)
  45124. return c
  45125. }
  45126. // SortField sets the optional parameter "sortField": Field by which to
  45127. // sort the list.
  45128. //
  45129. // Possible values:
  45130. // "ID" (default)
  45131. // "NAME"
  45132. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  45133. c.urlParams_.Set("sortField", sortField)
  45134. return c
  45135. }
  45136. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  45137. // results.
  45138. //
  45139. // Possible values:
  45140. // "ASCENDING" (default)
  45141. // "DESCENDING"
  45142. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  45143. c.urlParams_.Set("sortOrder", sortOrder)
  45144. return c
  45145. }
  45146. // SubaccountId sets the optional parameter "subaccountId": Select only
  45147. // user roles that belong to this subaccount.
  45148. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  45149. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  45150. return c
  45151. }
  45152. // Fields allows partial responses to be retrieved. See
  45153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45154. // for more information.
  45155. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  45156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45157. return c
  45158. }
  45159. // IfNoneMatch sets the optional parameter which makes the operation
  45160. // fail if the object's ETag matches the given value. This is useful for
  45161. // getting updates only after the object has changed since the last
  45162. // request. Use googleapi.IsNotModified to check whether the response
  45163. // error from Do is the result of In-None-Match.
  45164. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  45165. c.ifNoneMatch_ = entityTag
  45166. return c
  45167. }
  45168. // Context sets the context to be used in this call's Do method. Any
  45169. // pending HTTP request will be aborted if the provided context is
  45170. // canceled.
  45171. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  45172. c.ctx_ = ctx
  45173. return c
  45174. }
  45175. // Header returns an http.Header that can be modified by the caller to
  45176. // add HTTP headers to the request.
  45177. func (c *UserRolesListCall) Header() http.Header {
  45178. if c.header_ == nil {
  45179. c.header_ = make(http.Header)
  45180. }
  45181. return c.header_
  45182. }
  45183. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  45184. reqHeaders := make(http.Header)
  45185. for k, v := range c.header_ {
  45186. reqHeaders[k] = v
  45187. }
  45188. reqHeaders.Set("User-Agent", c.s.userAgent())
  45189. if c.ifNoneMatch_ != "" {
  45190. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45191. }
  45192. var body io.Reader = nil
  45193. c.urlParams_.Set("alt", alt)
  45194. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45195. urls += "?" + c.urlParams_.Encode()
  45196. req, _ := http.NewRequest("GET", urls, body)
  45197. req.Header = reqHeaders
  45198. googleapi.Expand(req.URL, map[string]string{
  45199. "profileId": strconv.FormatInt(c.profileId, 10),
  45200. })
  45201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45202. }
  45203. // Do executes the "dfareporting.userRoles.list" call.
  45204. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  45205. // non-2xx status code is an error. Response headers are in either
  45206. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  45207. // returned at all) in error.(*googleapi.Error).Header. Use
  45208. // googleapi.IsNotModified to check whether the returned error was
  45209. // because http.StatusNotModified was returned.
  45210. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  45211. gensupport.SetOptions(c.urlParams_, opts...)
  45212. res, err := c.doRequest("json")
  45213. if res != nil && res.StatusCode == http.StatusNotModified {
  45214. if res.Body != nil {
  45215. res.Body.Close()
  45216. }
  45217. return nil, &googleapi.Error{
  45218. Code: res.StatusCode,
  45219. Header: res.Header,
  45220. }
  45221. }
  45222. if err != nil {
  45223. return nil, err
  45224. }
  45225. defer googleapi.CloseBody(res)
  45226. if err := googleapi.CheckResponse(res); err != nil {
  45227. return nil, err
  45228. }
  45229. ret := &UserRolesListResponse{
  45230. ServerResponse: googleapi.ServerResponse{
  45231. Header: res.Header,
  45232. HTTPStatusCode: res.StatusCode,
  45233. },
  45234. }
  45235. target := &ret
  45236. if err := gensupport.DecodeResponse(target, res); err != nil {
  45237. return nil, err
  45238. }
  45239. return ret, nil
  45240. // {
  45241. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  45242. // "httpMethod": "GET",
  45243. // "id": "dfareporting.userRoles.list",
  45244. // "parameterOrder": [
  45245. // "profileId"
  45246. // ],
  45247. // "parameters": {
  45248. // "accountUserRoleOnly": {
  45249. // "description": "Select only account level user roles not associated with any specific subaccount.",
  45250. // "location": "query",
  45251. // "type": "boolean"
  45252. // },
  45253. // "ids": {
  45254. // "description": "Select only user roles with the specified IDs.",
  45255. // "format": "int64",
  45256. // "location": "query",
  45257. // "repeated": true,
  45258. // "type": "string"
  45259. // },
  45260. // "maxResults": {
  45261. // "default": "1000",
  45262. // "description": "Maximum number of results to return.",
  45263. // "format": "int32",
  45264. // "location": "query",
  45265. // "maximum": "1000",
  45266. // "minimum": "0",
  45267. // "type": "integer"
  45268. // },
  45269. // "pageToken": {
  45270. // "description": "Value of the nextPageToken from the previous result page.",
  45271. // "location": "query",
  45272. // "type": "string"
  45273. // },
  45274. // "profileId": {
  45275. // "description": "User profile ID associated with this request.",
  45276. // "format": "int64",
  45277. // "location": "path",
  45278. // "required": true,
  45279. // "type": "string"
  45280. // },
  45281. // "searchString": {
  45282. // "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\".",
  45283. // "location": "query",
  45284. // "type": "string"
  45285. // },
  45286. // "sortField": {
  45287. // "default": "ID",
  45288. // "description": "Field by which to sort the list.",
  45289. // "enum": [
  45290. // "ID",
  45291. // "NAME"
  45292. // ],
  45293. // "enumDescriptions": [
  45294. // "",
  45295. // ""
  45296. // ],
  45297. // "location": "query",
  45298. // "type": "string"
  45299. // },
  45300. // "sortOrder": {
  45301. // "default": "ASCENDING",
  45302. // "description": "Order of sorted results.",
  45303. // "enum": [
  45304. // "ASCENDING",
  45305. // "DESCENDING"
  45306. // ],
  45307. // "enumDescriptions": [
  45308. // "",
  45309. // ""
  45310. // ],
  45311. // "location": "query",
  45312. // "type": "string"
  45313. // },
  45314. // "subaccountId": {
  45315. // "description": "Select only user roles that belong to this subaccount.",
  45316. // "format": "int64",
  45317. // "location": "query",
  45318. // "type": "string"
  45319. // }
  45320. // },
  45321. // "path": "userprofiles/{profileId}/userRoles",
  45322. // "response": {
  45323. // "$ref": "UserRolesListResponse"
  45324. // },
  45325. // "scopes": [
  45326. // "https://www.googleapis.com/auth/dfatrafficking"
  45327. // ]
  45328. // }
  45329. }
  45330. // Pages invokes f for each page of results.
  45331. // A non-nil error returned from f will halt the iteration.
  45332. // The provided context supersedes any context provided to the Context method.
  45333. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  45334. c.ctx_ = ctx
  45335. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45336. for {
  45337. x, err := c.Do()
  45338. if err != nil {
  45339. return err
  45340. }
  45341. if err := f(x); err != nil {
  45342. return err
  45343. }
  45344. if x.NextPageToken == "" {
  45345. return nil
  45346. }
  45347. c.PageToken(x.NextPageToken)
  45348. }
  45349. }
  45350. // method id "dfareporting.userRoles.patch":
  45351. type UserRolesPatchCall struct {
  45352. s *Service
  45353. profileId int64
  45354. userrole *UserRole
  45355. urlParams_ gensupport.URLParams
  45356. ctx_ context.Context
  45357. header_ http.Header
  45358. }
  45359. // Patch: Updates an existing user role. This method supports patch
  45360. // semantics.
  45361. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  45362. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45363. c.profileId = profileId
  45364. c.urlParams_.Set("id", fmt.Sprint(id))
  45365. c.userrole = userrole
  45366. return c
  45367. }
  45368. // Fields allows partial responses to be retrieved. See
  45369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45370. // for more information.
  45371. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  45372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45373. return c
  45374. }
  45375. // Context sets the context to be used in this call's Do method. Any
  45376. // pending HTTP request will be aborted if the provided context is
  45377. // canceled.
  45378. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  45379. c.ctx_ = ctx
  45380. return c
  45381. }
  45382. // Header returns an http.Header that can be modified by the caller to
  45383. // add HTTP headers to the request.
  45384. func (c *UserRolesPatchCall) Header() http.Header {
  45385. if c.header_ == nil {
  45386. c.header_ = make(http.Header)
  45387. }
  45388. return c.header_
  45389. }
  45390. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  45391. reqHeaders := make(http.Header)
  45392. for k, v := range c.header_ {
  45393. reqHeaders[k] = v
  45394. }
  45395. reqHeaders.Set("User-Agent", c.s.userAgent())
  45396. var body io.Reader = nil
  45397. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45398. if err != nil {
  45399. return nil, err
  45400. }
  45401. reqHeaders.Set("Content-Type", "application/json")
  45402. c.urlParams_.Set("alt", alt)
  45403. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45404. urls += "?" + c.urlParams_.Encode()
  45405. req, _ := http.NewRequest("PATCH", urls, body)
  45406. req.Header = reqHeaders
  45407. googleapi.Expand(req.URL, map[string]string{
  45408. "profileId": strconv.FormatInt(c.profileId, 10),
  45409. })
  45410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45411. }
  45412. // Do executes the "dfareporting.userRoles.patch" call.
  45413. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45414. // code is an error. Response headers are in either
  45415. // *UserRole.ServerResponse.Header or (if a response was returned at
  45416. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45417. // to check whether the returned error was because
  45418. // http.StatusNotModified was returned.
  45419. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45420. gensupport.SetOptions(c.urlParams_, opts...)
  45421. res, err := c.doRequest("json")
  45422. if res != nil && res.StatusCode == http.StatusNotModified {
  45423. if res.Body != nil {
  45424. res.Body.Close()
  45425. }
  45426. return nil, &googleapi.Error{
  45427. Code: res.StatusCode,
  45428. Header: res.Header,
  45429. }
  45430. }
  45431. if err != nil {
  45432. return nil, err
  45433. }
  45434. defer googleapi.CloseBody(res)
  45435. if err := googleapi.CheckResponse(res); err != nil {
  45436. return nil, err
  45437. }
  45438. ret := &UserRole{
  45439. ServerResponse: googleapi.ServerResponse{
  45440. Header: res.Header,
  45441. HTTPStatusCode: res.StatusCode,
  45442. },
  45443. }
  45444. target := &ret
  45445. if err := gensupport.DecodeResponse(target, res); err != nil {
  45446. return nil, err
  45447. }
  45448. return ret, nil
  45449. // {
  45450. // "description": "Updates an existing user role. This method supports patch semantics.",
  45451. // "httpMethod": "PATCH",
  45452. // "id": "dfareporting.userRoles.patch",
  45453. // "parameterOrder": [
  45454. // "profileId",
  45455. // "id"
  45456. // ],
  45457. // "parameters": {
  45458. // "id": {
  45459. // "description": "User role ID.",
  45460. // "format": "int64",
  45461. // "location": "query",
  45462. // "required": true,
  45463. // "type": "string"
  45464. // },
  45465. // "profileId": {
  45466. // "description": "User profile ID associated with this request.",
  45467. // "format": "int64",
  45468. // "location": "path",
  45469. // "required": true,
  45470. // "type": "string"
  45471. // }
  45472. // },
  45473. // "path": "userprofiles/{profileId}/userRoles",
  45474. // "request": {
  45475. // "$ref": "UserRole"
  45476. // },
  45477. // "response": {
  45478. // "$ref": "UserRole"
  45479. // },
  45480. // "scopes": [
  45481. // "https://www.googleapis.com/auth/dfatrafficking"
  45482. // ]
  45483. // }
  45484. }
  45485. // method id "dfareporting.userRoles.update":
  45486. type UserRolesUpdateCall struct {
  45487. s *Service
  45488. profileId int64
  45489. userrole *UserRole
  45490. urlParams_ gensupport.URLParams
  45491. ctx_ context.Context
  45492. header_ http.Header
  45493. }
  45494. // Update: Updates an existing user role.
  45495. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  45496. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45497. c.profileId = profileId
  45498. c.userrole = userrole
  45499. return c
  45500. }
  45501. // Fields allows partial responses to be retrieved. See
  45502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45503. // for more information.
  45504. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  45505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45506. return c
  45507. }
  45508. // Context sets the context to be used in this call's Do method. Any
  45509. // pending HTTP request will be aborted if the provided context is
  45510. // canceled.
  45511. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  45512. c.ctx_ = ctx
  45513. return c
  45514. }
  45515. // Header returns an http.Header that can be modified by the caller to
  45516. // add HTTP headers to the request.
  45517. func (c *UserRolesUpdateCall) Header() http.Header {
  45518. if c.header_ == nil {
  45519. c.header_ = make(http.Header)
  45520. }
  45521. return c.header_
  45522. }
  45523. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  45524. reqHeaders := make(http.Header)
  45525. for k, v := range c.header_ {
  45526. reqHeaders[k] = v
  45527. }
  45528. reqHeaders.Set("User-Agent", c.s.userAgent())
  45529. var body io.Reader = nil
  45530. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45531. if err != nil {
  45532. return nil, err
  45533. }
  45534. reqHeaders.Set("Content-Type", "application/json")
  45535. c.urlParams_.Set("alt", alt)
  45536. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45537. urls += "?" + c.urlParams_.Encode()
  45538. req, _ := http.NewRequest("PUT", urls, body)
  45539. req.Header = reqHeaders
  45540. googleapi.Expand(req.URL, map[string]string{
  45541. "profileId": strconv.FormatInt(c.profileId, 10),
  45542. })
  45543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45544. }
  45545. // Do executes the "dfareporting.userRoles.update" call.
  45546. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45547. // code is an error. Response headers are in either
  45548. // *UserRole.ServerResponse.Header or (if a response was returned at
  45549. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45550. // to check whether the returned error was because
  45551. // http.StatusNotModified was returned.
  45552. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45553. gensupport.SetOptions(c.urlParams_, opts...)
  45554. res, err := c.doRequest("json")
  45555. if res != nil && res.StatusCode == http.StatusNotModified {
  45556. if res.Body != nil {
  45557. res.Body.Close()
  45558. }
  45559. return nil, &googleapi.Error{
  45560. Code: res.StatusCode,
  45561. Header: res.Header,
  45562. }
  45563. }
  45564. if err != nil {
  45565. return nil, err
  45566. }
  45567. defer googleapi.CloseBody(res)
  45568. if err := googleapi.CheckResponse(res); err != nil {
  45569. return nil, err
  45570. }
  45571. ret := &UserRole{
  45572. ServerResponse: googleapi.ServerResponse{
  45573. Header: res.Header,
  45574. HTTPStatusCode: res.StatusCode,
  45575. },
  45576. }
  45577. target := &ret
  45578. if err := gensupport.DecodeResponse(target, res); err != nil {
  45579. return nil, err
  45580. }
  45581. return ret, nil
  45582. // {
  45583. // "description": "Updates an existing user role.",
  45584. // "httpMethod": "PUT",
  45585. // "id": "dfareporting.userRoles.update",
  45586. // "parameterOrder": [
  45587. // "profileId"
  45588. // ],
  45589. // "parameters": {
  45590. // "profileId": {
  45591. // "description": "User profile ID associated with this request.",
  45592. // "format": "int64",
  45593. // "location": "path",
  45594. // "required": true,
  45595. // "type": "string"
  45596. // }
  45597. // },
  45598. // "path": "userprofiles/{profileId}/userRoles",
  45599. // "request": {
  45600. // "$ref": "UserRole"
  45601. // },
  45602. // "response": {
  45603. // "$ref": "UserRole"
  45604. // },
  45605. // "scopes": [
  45606. // "https://www.googleapis.com/auth/dfatrafficking"
  45607. // ]
  45608. // }
  45609. }
  45610. // method id "dfareporting.videoFormats.get":
  45611. type VideoFormatsGetCall struct {
  45612. s *Service
  45613. profileId int64
  45614. id int64
  45615. urlParams_ gensupport.URLParams
  45616. ifNoneMatch_ string
  45617. ctx_ context.Context
  45618. header_ http.Header
  45619. }
  45620. // Get: Gets one video format by ID.
  45621. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  45622. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45623. c.profileId = profileId
  45624. c.id = id
  45625. return c
  45626. }
  45627. // Fields allows partial responses to be retrieved. See
  45628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45629. // for more information.
  45630. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  45631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45632. return c
  45633. }
  45634. // IfNoneMatch sets the optional parameter which makes the operation
  45635. // fail if the object's ETag matches the given value. This is useful for
  45636. // getting updates only after the object has changed since the last
  45637. // request. Use googleapi.IsNotModified to check whether the response
  45638. // error from Do is the result of In-None-Match.
  45639. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  45640. c.ifNoneMatch_ = entityTag
  45641. return c
  45642. }
  45643. // Context sets the context to be used in this call's Do method. Any
  45644. // pending HTTP request will be aborted if the provided context is
  45645. // canceled.
  45646. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  45647. c.ctx_ = ctx
  45648. return c
  45649. }
  45650. // Header returns an http.Header that can be modified by the caller to
  45651. // add HTTP headers to the request.
  45652. func (c *VideoFormatsGetCall) Header() http.Header {
  45653. if c.header_ == nil {
  45654. c.header_ = make(http.Header)
  45655. }
  45656. return c.header_
  45657. }
  45658. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  45659. reqHeaders := make(http.Header)
  45660. for k, v := range c.header_ {
  45661. reqHeaders[k] = v
  45662. }
  45663. reqHeaders.Set("User-Agent", c.s.userAgent())
  45664. if c.ifNoneMatch_ != "" {
  45665. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45666. }
  45667. var body io.Reader = nil
  45668. c.urlParams_.Set("alt", alt)
  45669. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  45670. urls += "?" + c.urlParams_.Encode()
  45671. req, _ := http.NewRequest("GET", urls, body)
  45672. req.Header = reqHeaders
  45673. googleapi.Expand(req.URL, map[string]string{
  45674. "profileId": strconv.FormatInt(c.profileId, 10),
  45675. "id": strconv.FormatInt(c.id, 10),
  45676. })
  45677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45678. }
  45679. // Do executes the "dfareporting.videoFormats.get" call.
  45680. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  45681. // status code is an error. Response headers are in either
  45682. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  45683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45684. // to check whether the returned error was because
  45685. // http.StatusNotModified was returned.
  45686. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  45687. gensupport.SetOptions(c.urlParams_, opts...)
  45688. res, err := c.doRequest("json")
  45689. if res != nil && res.StatusCode == http.StatusNotModified {
  45690. if res.Body != nil {
  45691. res.Body.Close()
  45692. }
  45693. return nil, &googleapi.Error{
  45694. Code: res.StatusCode,
  45695. Header: res.Header,
  45696. }
  45697. }
  45698. if err != nil {
  45699. return nil, err
  45700. }
  45701. defer googleapi.CloseBody(res)
  45702. if err := googleapi.CheckResponse(res); err != nil {
  45703. return nil, err
  45704. }
  45705. ret := &VideoFormat{
  45706. ServerResponse: googleapi.ServerResponse{
  45707. Header: res.Header,
  45708. HTTPStatusCode: res.StatusCode,
  45709. },
  45710. }
  45711. target := &ret
  45712. if err := gensupport.DecodeResponse(target, res); err != nil {
  45713. return nil, err
  45714. }
  45715. return ret, nil
  45716. // {
  45717. // "description": "Gets one video format by ID.",
  45718. // "httpMethod": "GET",
  45719. // "id": "dfareporting.videoFormats.get",
  45720. // "parameterOrder": [
  45721. // "profileId",
  45722. // "id"
  45723. // ],
  45724. // "parameters": {
  45725. // "id": {
  45726. // "description": "Video format ID.",
  45727. // "format": "int32",
  45728. // "location": "path",
  45729. // "required": true,
  45730. // "type": "integer"
  45731. // },
  45732. // "profileId": {
  45733. // "description": "User profile ID associated with this request.",
  45734. // "format": "int64",
  45735. // "location": "path",
  45736. // "required": true,
  45737. // "type": "string"
  45738. // }
  45739. // },
  45740. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  45741. // "response": {
  45742. // "$ref": "VideoFormat"
  45743. // },
  45744. // "scopes": [
  45745. // "https://www.googleapis.com/auth/dfatrafficking"
  45746. // ]
  45747. // }
  45748. }
  45749. // method id "dfareporting.videoFormats.list":
  45750. type VideoFormatsListCall struct {
  45751. s *Service
  45752. profileId int64
  45753. urlParams_ gensupport.URLParams
  45754. ifNoneMatch_ string
  45755. ctx_ context.Context
  45756. header_ http.Header
  45757. }
  45758. // List: Lists available video formats.
  45759. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  45760. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45761. c.profileId = profileId
  45762. return c
  45763. }
  45764. // Fields allows partial responses to be retrieved. See
  45765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45766. // for more information.
  45767. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  45768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45769. return c
  45770. }
  45771. // IfNoneMatch sets the optional parameter which makes the operation
  45772. // fail if the object's ETag matches the given value. This is useful for
  45773. // getting updates only after the object has changed since the last
  45774. // request. Use googleapi.IsNotModified to check whether the response
  45775. // error from Do is the result of In-None-Match.
  45776. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  45777. c.ifNoneMatch_ = entityTag
  45778. return c
  45779. }
  45780. // Context sets the context to be used in this call's Do method. Any
  45781. // pending HTTP request will be aborted if the provided context is
  45782. // canceled.
  45783. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  45784. c.ctx_ = ctx
  45785. return c
  45786. }
  45787. // Header returns an http.Header that can be modified by the caller to
  45788. // add HTTP headers to the request.
  45789. func (c *VideoFormatsListCall) Header() http.Header {
  45790. if c.header_ == nil {
  45791. c.header_ = make(http.Header)
  45792. }
  45793. return c.header_
  45794. }
  45795. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  45796. reqHeaders := make(http.Header)
  45797. for k, v := range c.header_ {
  45798. reqHeaders[k] = v
  45799. }
  45800. reqHeaders.Set("User-Agent", c.s.userAgent())
  45801. if c.ifNoneMatch_ != "" {
  45802. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45803. }
  45804. var body io.Reader = nil
  45805. c.urlParams_.Set("alt", alt)
  45806. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  45807. urls += "?" + c.urlParams_.Encode()
  45808. req, _ := http.NewRequest("GET", urls, body)
  45809. req.Header = reqHeaders
  45810. googleapi.Expand(req.URL, map[string]string{
  45811. "profileId": strconv.FormatInt(c.profileId, 10),
  45812. })
  45813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45814. }
  45815. // Do executes the "dfareporting.videoFormats.list" call.
  45816. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  45817. // Any non-2xx status code is an error. Response headers are in either
  45818. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  45819. // returned at all) in error.(*googleapi.Error).Header. Use
  45820. // googleapi.IsNotModified to check whether the returned error was
  45821. // because http.StatusNotModified was returned.
  45822. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  45823. gensupport.SetOptions(c.urlParams_, opts...)
  45824. res, err := c.doRequest("json")
  45825. if res != nil && res.StatusCode == http.StatusNotModified {
  45826. if res.Body != nil {
  45827. res.Body.Close()
  45828. }
  45829. return nil, &googleapi.Error{
  45830. Code: res.StatusCode,
  45831. Header: res.Header,
  45832. }
  45833. }
  45834. if err != nil {
  45835. return nil, err
  45836. }
  45837. defer googleapi.CloseBody(res)
  45838. if err := googleapi.CheckResponse(res); err != nil {
  45839. return nil, err
  45840. }
  45841. ret := &VideoFormatsListResponse{
  45842. ServerResponse: googleapi.ServerResponse{
  45843. Header: res.Header,
  45844. HTTPStatusCode: res.StatusCode,
  45845. },
  45846. }
  45847. target := &ret
  45848. if err := gensupport.DecodeResponse(target, res); err != nil {
  45849. return nil, err
  45850. }
  45851. return ret, nil
  45852. // {
  45853. // "description": "Lists available video formats.",
  45854. // "httpMethod": "GET",
  45855. // "id": "dfareporting.videoFormats.list",
  45856. // "parameterOrder": [
  45857. // "profileId"
  45858. // ],
  45859. // "parameters": {
  45860. // "profileId": {
  45861. // "description": "User profile ID associated with this request.",
  45862. // "format": "int64",
  45863. // "location": "path",
  45864. // "required": true,
  45865. // "type": "string"
  45866. // }
  45867. // },
  45868. // "path": "userprofiles/{profileId}/videoFormats",
  45869. // "response": {
  45870. // "$ref": "VideoFormatsListResponse"
  45871. // },
  45872. // "scopes": [
  45873. // "https://www.googleapis.com/auth/dfatrafficking"
  45874. // ]
  45875. // }
  45876. }