25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

20114 satır
697 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package analytics provides access to the Google Analytics API.
  6. //
  7. // For product documentation, see: https://developers.google.com/analytics/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/analytics/v3"
  14. // ...
  15. // ctx := context.Background()
  16. // analyticsService, err := analytics.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // analyticsService, err := analytics.NewService(ctx, option.WithScopes(analytics.AnalyticsUserDeletionScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // analyticsService, err := analytics.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // analyticsService, err := analytics.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package analytics // import "google.golang.org/api/analytics/v3"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "analytics:v3"
  71. const apiName = "analytics"
  72. const apiVersion = "v3"
  73. const basePath = "https://www.googleapis.com/analytics/v3/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your Google Analytics data
  77. AnalyticsScope = "https://www.googleapis.com/auth/analytics"
  78. // Edit Google Analytics management entities
  79. AnalyticsEditScope = "https://www.googleapis.com/auth/analytics.edit"
  80. // Manage Google Analytics Account users by email address
  81. AnalyticsManageUsersScope = "https://www.googleapis.com/auth/analytics.manage.users"
  82. // View Google Analytics user permissions
  83. AnalyticsManageUsersReadonlyScope = "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  84. // Create a new Google Analytics account along with its default property
  85. // and view
  86. AnalyticsProvisionScope = "https://www.googleapis.com/auth/analytics.provision"
  87. // View your Google Analytics data
  88. AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly"
  89. // Manage Google Analytics user deletion requests
  90. AnalyticsUserDeletionScope = "https://www.googleapis.com/auth/analytics.user.deletion"
  91. )
  92. // NewService creates a new Service.
  93. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  94. scopesOption := option.WithScopes(
  95. "https://www.googleapis.com/auth/analytics",
  96. "https://www.googleapis.com/auth/analytics.edit",
  97. "https://www.googleapis.com/auth/analytics.manage.users",
  98. "https://www.googleapis.com/auth/analytics.manage.users.readonly",
  99. "https://www.googleapis.com/auth/analytics.provision",
  100. "https://www.googleapis.com/auth/analytics.readonly",
  101. "https://www.googleapis.com/auth/analytics.user.deletion",
  102. )
  103. // NOTE: prepend, so we don't override user-specified scopes.
  104. opts = append([]option.ClientOption{scopesOption}, opts...)
  105. client, endpoint, err := htransport.NewClient(ctx, opts...)
  106. if err != nil {
  107. return nil, err
  108. }
  109. s, err := New(client)
  110. if err != nil {
  111. return nil, err
  112. }
  113. if endpoint != "" {
  114. s.BasePath = endpoint
  115. }
  116. return s, nil
  117. }
  118. // New creates a new Service. It uses the provided http.Client for requests.
  119. //
  120. // Deprecated: please use NewService instead.
  121. // To provide a custom HTTP client, use option.WithHTTPClient.
  122. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  123. func New(client *http.Client) (*Service, error) {
  124. if client == nil {
  125. return nil, errors.New("client is nil")
  126. }
  127. s := &Service{client: client, BasePath: basePath}
  128. s.Data = NewDataService(s)
  129. s.Management = NewManagementService(s)
  130. s.Metadata = NewMetadataService(s)
  131. s.Provisioning = NewProvisioningService(s)
  132. s.UserDeletion = NewUserDeletionService(s)
  133. return s, nil
  134. }
  135. type Service struct {
  136. client *http.Client
  137. BasePath string // API endpoint base URL
  138. UserAgent string // optional additional User-Agent fragment
  139. Data *DataService
  140. Management *ManagementService
  141. Metadata *MetadataService
  142. Provisioning *ProvisioningService
  143. UserDeletion *UserDeletionService
  144. }
  145. func (s *Service) userAgent() string {
  146. if s.UserAgent == "" {
  147. return googleapi.UserAgent
  148. }
  149. return googleapi.UserAgent + " " + s.UserAgent
  150. }
  151. func NewDataService(s *Service) *DataService {
  152. rs := &DataService{s: s}
  153. rs.Ga = NewDataGaService(s)
  154. rs.Mcf = NewDataMcfService(s)
  155. rs.Realtime = NewDataRealtimeService(s)
  156. return rs
  157. }
  158. type DataService struct {
  159. s *Service
  160. Ga *DataGaService
  161. Mcf *DataMcfService
  162. Realtime *DataRealtimeService
  163. }
  164. func NewDataGaService(s *Service) *DataGaService {
  165. rs := &DataGaService{s: s}
  166. return rs
  167. }
  168. type DataGaService struct {
  169. s *Service
  170. }
  171. func NewDataMcfService(s *Service) *DataMcfService {
  172. rs := &DataMcfService{s: s}
  173. return rs
  174. }
  175. type DataMcfService struct {
  176. s *Service
  177. }
  178. func NewDataRealtimeService(s *Service) *DataRealtimeService {
  179. rs := &DataRealtimeService{s: s}
  180. return rs
  181. }
  182. type DataRealtimeService struct {
  183. s *Service
  184. }
  185. func NewManagementService(s *Service) *ManagementService {
  186. rs := &ManagementService{s: s}
  187. rs.AccountSummaries = NewManagementAccountSummariesService(s)
  188. rs.AccountUserLinks = NewManagementAccountUserLinksService(s)
  189. rs.Accounts = NewManagementAccountsService(s)
  190. rs.ClientId = NewManagementClientIdService(s)
  191. rs.CustomDataSources = NewManagementCustomDataSourcesService(s)
  192. rs.CustomDimensions = NewManagementCustomDimensionsService(s)
  193. rs.CustomMetrics = NewManagementCustomMetricsService(s)
  194. rs.Experiments = NewManagementExperimentsService(s)
  195. rs.Filters = NewManagementFiltersService(s)
  196. rs.Goals = NewManagementGoalsService(s)
  197. rs.ProfileFilterLinks = NewManagementProfileFilterLinksService(s)
  198. rs.ProfileUserLinks = NewManagementProfileUserLinksService(s)
  199. rs.Profiles = NewManagementProfilesService(s)
  200. rs.RemarketingAudience = NewManagementRemarketingAudienceService(s)
  201. rs.Segments = NewManagementSegmentsService(s)
  202. rs.UnsampledReports = NewManagementUnsampledReportsService(s)
  203. rs.Uploads = NewManagementUploadsService(s)
  204. rs.WebPropertyAdWordsLinks = NewManagementWebPropertyAdWordsLinksService(s)
  205. rs.Webproperties = NewManagementWebpropertiesService(s)
  206. rs.WebpropertyUserLinks = NewManagementWebpropertyUserLinksService(s)
  207. return rs
  208. }
  209. type ManagementService struct {
  210. s *Service
  211. AccountSummaries *ManagementAccountSummariesService
  212. AccountUserLinks *ManagementAccountUserLinksService
  213. Accounts *ManagementAccountsService
  214. ClientId *ManagementClientIdService
  215. CustomDataSources *ManagementCustomDataSourcesService
  216. CustomDimensions *ManagementCustomDimensionsService
  217. CustomMetrics *ManagementCustomMetricsService
  218. Experiments *ManagementExperimentsService
  219. Filters *ManagementFiltersService
  220. Goals *ManagementGoalsService
  221. ProfileFilterLinks *ManagementProfileFilterLinksService
  222. ProfileUserLinks *ManagementProfileUserLinksService
  223. Profiles *ManagementProfilesService
  224. RemarketingAudience *ManagementRemarketingAudienceService
  225. Segments *ManagementSegmentsService
  226. UnsampledReports *ManagementUnsampledReportsService
  227. Uploads *ManagementUploadsService
  228. WebPropertyAdWordsLinks *ManagementWebPropertyAdWordsLinksService
  229. Webproperties *ManagementWebpropertiesService
  230. WebpropertyUserLinks *ManagementWebpropertyUserLinksService
  231. }
  232. func NewManagementAccountSummariesService(s *Service) *ManagementAccountSummariesService {
  233. rs := &ManagementAccountSummariesService{s: s}
  234. return rs
  235. }
  236. type ManagementAccountSummariesService struct {
  237. s *Service
  238. }
  239. func NewManagementAccountUserLinksService(s *Service) *ManagementAccountUserLinksService {
  240. rs := &ManagementAccountUserLinksService{s: s}
  241. return rs
  242. }
  243. type ManagementAccountUserLinksService struct {
  244. s *Service
  245. }
  246. func NewManagementAccountsService(s *Service) *ManagementAccountsService {
  247. rs := &ManagementAccountsService{s: s}
  248. return rs
  249. }
  250. type ManagementAccountsService struct {
  251. s *Service
  252. }
  253. func NewManagementClientIdService(s *Service) *ManagementClientIdService {
  254. rs := &ManagementClientIdService{s: s}
  255. return rs
  256. }
  257. type ManagementClientIdService struct {
  258. s *Service
  259. }
  260. func NewManagementCustomDataSourcesService(s *Service) *ManagementCustomDataSourcesService {
  261. rs := &ManagementCustomDataSourcesService{s: s}
  262. return rs
  263. }
  264. type ManagementCustomDataSourcesService struct {
  265. s *Service
  266. }
  267. func NewManagementCustomDimensionsService(s *Service) *ManagementCustomDimensionsService {
  268. rs := &ManagementCustomDimensionsService{s: s}
  269. return rs
  270. }
  271. type ManagementCustomDimensionsService struct {
  272. s *Service
  273. }
  274. func NewManagementCustomMetricsService(s *Service) *ManagementCustomMetricsService {
  275. rs := &ManagementCustomMetricsService{s: s}
  276. return rs
  277. }
  278. type ManagementCustomMetricsService struct {
  279. s *Service
  280. }
  281. func NewManagementExperimentsService(s *Service) *ManagementExperimentsService {
  282. rs := &ManagementExperimentsService{s: s}
  283. return rs
  284. }
  285. type ManagementExperimentsService struct {
  286. s *Service
  287. }
  288. func NewManagementFiltersService(s *Service) *ManagementFiltersService {
  289. rs := &ManagementFiltersService{s: s}
  290. return rs
  291. }
  292. type ManagementFiltersService struct {
  293. s *Service
  294. }
  295. func NewManagementGoalsService(s *Service) *ManagementGoalsService {
  296. rs := &ManagementGoalsService{s: s}
  297. return rs
  298. }
  299. type ManagementGoalsService struct {
  300. s *Service
  301. }
  302. func NewManagementProfileFilterLinksService(s *Service) *ManagementProfileFilterLinksService {
  303. rs := &ManagementProfileFilterLinksService{s: s}
  304. return rs
  305. }
  306. type ManagementProfileFilterLinksService struct {
  307. s *Service
  308. }
  309. func NewManagementProfileUserLinksService(s *Service) *ManagementProfileUserLinksService {
  310. rs := &ManagementProfileUserLinksService{s: s}
  311. return rs
  312. }
  313. type ManagementProfileUserLinksService struct {
  314. s *Service
  315. }
  316. func NewManagementProfilesService(s *Service) *ManagementProfilesService {
  317. rs := &ManagementProfilesService{s: s}
  318. return rs
  319. }
  320. type ManagementProfilesService struct {
  321. s *Service
  322. }
  323. func NewManagementRemarketingAudienceService(s *Service) *ManagementRemarketingAudienceService {
  324. rs := &ManagementRemarketingAudienceService{s: s}
  325. return rs
  326. }
  327. type ManagementRemarketingAudienceService struct {
  328. s *Service
  329. }
  330. func NewManagementSegmentsService(s *Service) *ManagementSegmentsService {
  331. rs := &ManagementSegmentsService{s: s}
  332. return rs
  333. }
  334. type ManagementSegmentsService struct {
  335. s *Service
  336. }
  337. func NewManagementUnsampledReportsService(s *Service) *ManagementUnsampledReportsService {
  338. rs := &ManagementUnsampledReportsService{s: s}
  339. return rs
  340. }
  341. type ManagementUnsampledReportsService struct {
  342. s *Service
  343. }
  344. func NewManagementUploadsService(s *Service) *ManagementUploadsService {
  345. rs := &ManagementUploadsService{s: s}
  346. return rs
  347. }
  348. type ManagementUploadsService struct {
  349. s *Service
  350. }
  351. func NewManagementWebPropertyAdWordsLinksService(s *Service) *ManagementWebPropertyAdWordsLinksService {
  352. rs := &ManagementWebPropertyAdWordsLinksService{s: s}
  353. return rs
  354. }
  355. type ManagementWebPropertyAdWordsLinksService struct {
  356. s *Service
  357. }
  358. func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService {
  359. rs := &ManagementWebpropertiesService{s: s}
  360. return rs
  361. }
  362. type ManagementWebpropertiesService struct {
  363. s *Service
  364. }
  365. func NewManagementWebpropertyUserLinksService(s *Service) *ManagementWebpropertyUserLinksService {
  366. rs := &ManagementWebpropertyUserLinksService{s: s}
  367. return rs
  368. }
  369. type ManagementWebpropertyUserLinksService struct {
  370. s *Service
  371. }
  372. func NewMetadataService(s *Service) *MetadataService {
  373. rs := &MetadataService{s: s}
  374. rs.Columns = NewMetadataColumnsService(s)
  375. return rs
  376. }
  377. type MetadataService struct {
  378. s *Service
  379. Columns *MetadataColumnsService
  380. }
  381. func NewMetadataColumnsService(s *Service) *MetadataColumnsService {
  382. rs := &MetadataColumnsService{s: s}
  383. return rs
  384. }
  385. type MetadataColumnsService struct {
  386. s *Service
  387. }
  388. func NewProvisioningService(s *Service) *ProvisioningService {
  389. rs := &ProvisioningService{s: s}
  390. return rs
  391. }
  392. type ProvisioningService struct {
  393. s *Service
  394. }
  395. func NewUserDeletionService(s *Service) *UserDeletionService {
  396. rs := &UserDeletionService{s: s}
  397. rs.UserDeletionRequest = NewUserDeletionUserDeletionRequestService(s)
  398. return rs
  399. }
  400. type UserDeletionService struct {
  401. s *Service
  402. UserDeletionRequest *UserDeletionUserDeletionRequestService
  403. }
  404. func NewUserDeletionUserDeletionRequestService(s *Service) *UserDeletionUserDeletionRequestService {
  405. rs := &UserDeletionUserDeletionRequestService{s: s}
  406. return rs
  407. }
  408. type UserDeletionUserDeletionRequestService struct {
  409. s *Service
  410. }
  411. // Account: JSON template for Analytics account entry.
  412. type Account struct {
  413. // ChildLink: Child link for an account entry. Points to the list of web
  414. // properties for this account.
  415. ChildLink *AccountChildLink `json:"childLink,omitempty"`
  416. // Created: Time the account was created.
  417. Created string `json:"created,omitempty"`
  418. // Id: Account ID.
  419. Id string `json:"id,omitempty"`
  420. // Kind: Resource type for Analytics account.
  421. Kind string `json:"kind,omitempty"`
  422. // Name: Account name.
  423. Name string `json:"name,omitempty"`
  424. // Permissions: Permissions the user has for this account.
  425. Permissions *AccountPermissions `json:"permissions,omitempty"`
  426. // SelfLink: Link for this account.
  427. SelfLink string `json:"selfLink,omitempty"`
  428. // Starred: Indicates whether this account is starred or not.
  429. Starred bool `json:"starred,omitempty"`
  430. // Updated: Time the account was last modified.
  431. Updated string `json:"updated,omitempty"`
  432. // ForceSendFields is a list of field names (e.g. "ChildLink") to
  433. // unconditionally include in API requests. By default, fields with
  434. // empty values are omitted from API requests. However, any non-pointer,
  435. // non-interface field appearing in ForceSendFields will be sent to the
  436. // server regardless of whether the field is empty or not. This may be
  437. // used to include empty fields in Patch requests.
  438. ForceSendFields []string `json:"-"`
  439. // NullFields is a list of field names (e.g. "ChildLink") to include in
  440. // API requests with the JSON null value. By default, fields with empty
  441. // values are omitted from API requests. However, any field with an
  442. // empty value appearing in NullFields will be sent to the server as
  443. // null. It is an error if a field in this list has a non-empty value.
  444. // This may be used to include null fields in Patch requests.
  445. NullFields []string `json:"-"`
  446. }
  447. func (s *Account) MarshalJSON() ([]byte, error) {
  448. type NoMethod Account
  449. raw := NoMethod(*s)
  450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  451. }
  452. // AccountChildLink: Child link for an account entry. Points to the list
  453. // of web properties for this account.
  454. type AccountChildLink struct {
  455. // Href: Link to the list of web properties for this account.
  456. Href string `json:"href,omitempty"`
  457. // Type: Type of the child link. Its value is "analytics#webproperties".
  458. Type string `json:"type,omitempty"`
  459. // ForceSendFields is a list of field names (e.g. "Href") to
  460. // unconditionally include in API requests. By default, fields with
  461. // empty values are omitted from API requests. However, any non-pointer,
  462. // non-interface field appearing in ForceSendFields will be sent to the
  463. // server regardless of whether the field is empty or not. This may be
  464. // used to include empty fields in Patch requests.
  465. ForceSendFields []string `json:"-"`
  466. // NullFields is a list of field names (e.g. "Href") to include in API
  467. // requests with the JSON null value. By default, fields with empty
  468. // values are omitted from API requests. However, any field with an
  469. // empty value appearing in NullFields will be sent to the server as
  470. // null. It is an error if a field in this list has a non-empty value.
  471. // This may be used to include null fields in Patch requests.
  472. NullFields []string `json:"-"`
  473. }
  474. func (s *AccountChildLink) MarshalJSON() ([]byte, error) {
  475. type NoMethod AccountChildLink
  476. raw := NoMethod(*s)
  477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  478. }
  479. // AccountPermissions: Permissions the user has for this account.
  480. type AccountPermissions struct {
  481. // Effective: All the permissions that the user has for this account.
  482. // These include any implied permissions (e.g., EDIT implies VIEW).
  483. Effective []string `json:"effective,omitempty"`
  484. // ForceSendFields is a list of field names (e.g. "Effective") to
  485. // unconditionally include in API requests. By default, fields with
  486. // empty values are omitted from API requests. However, any non-pointer,
  487. // non-interface field appearing in ForceSendFields will be sent to the
  488. // server regardless of whether the field is empty or not. This may be
  489. // used to include empty fields in Patch requests.
  490. ForceSendFields []string `json:"-"`
  491. // NullFields is a list of field names (e.g. "Effective") to include in
  492. // API requests with the JSON null value. By default, fields with empty
  493. // values are omitted from API requests. However, any field with an
  494. // empty value appearing in NullFields will be sent to the server as
  495. // null. It is an error if a field in this list has a non-empty value.
  496. // This may be used to include null fields in Patch requests.
  497. NullFields []string `json:"-"`
  498. }
  499. func (s *AccountPermissions) MarshalJSON() ([]byte, error) {
  500. type NoMethod AccountPermissions
  501. raw := NoMethod(*s)
  502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  503. }
  504. // AccountRef: JSON template for a linked account.
  505. type AccountRef struct {
  506. // Href: Link for this account.
  507. Href string `json:"href,omitempty"`
  508. // Id: Account ID.
  509. Id string `json:"id,omitempty"`
  510. // Kind: Analytics account reference.
  511. Kind string `json:"kind,omitempty"`
  512. // Name: Account name.
  513. Name string `json:"name,omitempty"`
  514. // ForceSendFields is a list of field names (e.g. "Href") to
  515. // unconditionally include in API requests. By default, fields with
  516. // empty values are omitted from API requests. However, any non-pointer,
  517. // non-interface field appearing in ForceSendFields will be sent to the
  518. // server regardless of whether the field is empty or not. This may be
  519. // used to include empty fields in Patch requests.
  520. ForceSendFields []string `json:"-"`
  521. // NullFields is a list of field names (e.g. "Href") to include in API
  522. // requests with the JSON null value. By default, fields with empty
  523. // values are omitted from API requests. However, any field with an
  524. // empty value appearing in NullFields will be sent to the server as
  525. // null. It is an error if a field in this list has a non-empty value.
  526. // This may be used to include null fields in Patch requests.
  527. NullFields []string `json:"-"`
  528. }
  529. func (s *AccountRef) MarshalJSON() ([]byte, error) {
  530. type NoMethod AccountRef
  531. raw := NoMethod(*s)
  532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  533. }
  534. // AccountSummaries: An AccountSummary collection lists a summary of
  535. // accounts, properties and views (profiles) to which the user has
  536. // access. Each resource in the collection corresponds to a single
  537. // AccountSummary.
  538. type AccountSummaries struct {
  539. // Items: A list of AccountSummaries.
  540. Items []*AccountSummary `json:"items,omitempty"`
  541. // ItemsPerPage: The maximum number of resources the response can
  542. // contain, regardless of the actual number of resources returned. Its
  543. // value ranges from 1 to 1000 with a value of 1000 by default, or
  544. // otherwise specified by the max-results query parameter.
  545. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  546. // Kind: Collection type.
  547. Kind string `json:"kind,omitempty"`
  548. // NextLink: Link to next page for this AccountSummary collection.
  549. NextLink string `json:"nextLink,omitempty"`
  550. // PreviousLink: Link to previous page for this AccountSummary
  551. // collection.
  552. PreviousLink string `json:"previousLink,omitempty"`
  553. // StartIndex: The starting index of the resources, which is 1 by
  554. // default or otherwise specified by the start-index query parameter.
  555. StartIndex int64 `json:"startIndex,omitempty"`
  556. // TotalResults: The total number of results for the query, regardless
  557. // of the number of results in the response.
  558. TotalResults int64 `json:"totalResults,omitempty"`
  559. // Username: Email ID of the authenticated user
  560. Username string `json:"username,omitempty"`
  561. // ServerResponse contains the HTTP response code and headers from the
  562. // server.
  563. googleapi.ServerResponse `json:"-"`
  564. // ForceSendFields is a list of field names (e.g. "Items") to
  565. // unconditionally include in API requests. By default, fields with
  566. // empty values are omitted from API requests. However, any non-pointer,
  567. // non-interface field appearing in ForceSendFields will be sent to the
  568. // server regardless of whether the field is empty or not. This may be
  569. // used to include empty fields in Patch requests.
  570. ForceSendFields []string `json:"-"`
  571. // NullFields is a list of field names (e.g. "Items") to include in API
  572. // requests with the JSON null value. By default, fields with empty
  573. // values are omitted from API requests. However, any field with an
  574. // empty value appearing in NullFields will be sent to the server as
  575. // null. It is an error if a field in this list has a non-empty value.
  576. // This may be used to include null fields in Patch requests.
  577. NullFields []string `json:"-"`
  578. }
  579. func (s *AccountSummaries) MarshalJSON() ([]byte, error) {
  580. type NoMethod AccountSummaries
  581. raw := NoMethod(*s)
  582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  583. }
  584. // AccountSummary: JSON template for an Analytics AccountSummary. An
  585. // AccountSummary is a lightweight tree comprised of
  586. // properties/profiles.
  587. type AccountSummary struct {
  588. // Id: Account ID.
  589. Id string `json:"id,omitempty"`
  590. // Kind: Resource type for Analytics AccountSummary.
  591. Kind string `json:"kind,omitempty"`
  592. // Name: Account name.
  593. Name string `json:"name,omitempty"`
  594. // Starred: Indicates whether this account is starred or not.
  595. Starred bool `json:"starred,omitempty"`
  596. // WebProperties: List of web properties under this account.
  597. WebProperties []*WebPropertySummary `json:"webProperties,omitempty"`
  598. // ForceSendFields is a list of field names (e.g. "Id") to
  599. // unconditionally include in API requests. By default, fields with
  600. // empty values are omitted from API requests. However, any non-pointer,
  601. // non-interface field appearing in ForceSendFields will be sent to the
  602. // server regardless of whether the field is empty or not. This may be
  603. // used to include empty fields in Patch requests.
  604. ForceSendFields []string `json:"-"`
  605. // NullFields is a list of field names (e.g. "Id") to include in API
  606. // requests with the JSON null value. By default, fields with empty
  607. // values are omitted from API requests. However, any field with an
  608. // empty value appearing in NullFields will be sent to the server as
  609. // null. It is an error if a field in this list has a non-empty value.
  610. // This may be used to include null fields in Patch requests.
  611. NullFields []string `json:"-"`
  612. }
  613. func (s *AccountSummary) MarshalJSON() ([]byte, error) {
  614. type NoMethod AccountSummary
  615. raw := NoMethod(*s)
  616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  617. }
  618. // AccountTicket: JSON template for an Analytics account ticket. The
  619. // account ticket consists of the ticket ID and the basic information
  620. // for the account, property and profile.
  621. type AccountTicket struct {
  622. // Account: Account for this ticket.
  623. Account *Account `json:"account,omitempty"`
  624. // Id: Account ticket ID used to access the account ticket.
  625. Id string `json:"id,omitempty"`
  626. // Kind: Resource type for account ticket.
  627. Kind string `json:"kind,omitempty"`
  628. // Profile: View (Profile) for the account.
  629. Profile *Profile `json:"profile,omitempty"`
  630. // RedirectUri: Redirect URI where the user will be sent after accepting
  631. // Terms of Service. Must be configured in APIs console as a callback
  632. // URL.
  633. RedirectUri string `json:"redirectUri,omitempty"`
  634. // Webproperty: Web property for the account.
  635. Webproperty *Webproperty `json:"webproperty,omitempty"`
  636. // ServerResponse contains the HTTP response code and headers from the
  637. // server.
  638. googleapi.ServerResponse `json:"-"`
  639. // ForceSendFields is a list of field names (e.g. "Account") to
  640. // unconditionally include in API requests. By default, fields with
  641. // empty values are omitted from API requests. However, any non-pointer,
  642. // non-interface field appearing in ForceSendFields will be sent to the
  643. // server regardless of whether the field is empty or not. This may be
  644. // used to include empty fields in Patch requests.
  645. ForceSendFields []string `json:"-"`
  646. // NullFields is a list of field names (e.g. "Account") to include in
  647. // API requests with the JSON null value. By default, fields with empty
  648. // values are omitted from API requests. However, any field with an
  649. // empty value appearing in NullFields will be sent to the server as
  650. // null. It is an error if a field in this list has a non-empty value.
  651. // This may be used to include null fields in Patch requests.
  652. NullFields []string `json:"-"`
  653. }
  654. func (s *AccountTicket) MarshalJSON() ([]byte, error) {
  655. type NoMethod AccountTicket
  656. raw := NoMethod(*s)
  657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  658. }
  659. // AccountTreeRequest: JSON template for an Analytics account tree
  660. // requests. The account tree request is used in the provisioning api to
  661. // create an account, property, and view (profile). It contains the
  662. // basic information required to make these fields.
  663. type AccountTreeRequest struct {
  664. AccountName string `json:"accountName,omitempty"`
  665. // Kind: Resource type for account ticket.
  666. Kind string `json:"kind,omitempty"`
  667. ProfileName string `json:"profileName,omitempty"`
  668. Timezone string `json:"timezone,omitempty"`
  669. WebpropertyName string `json:"webpropertyName,omitempty"`
  670. WebsiteUrl string `json:"websiteUrl,omitempty"`
  671. // ForceSendFields is a list of field names (e.g. "AccountName") to
  672. // unconditionally include in API requests. By default, fields with
  673. // empty values are omitted from API requests. However, any non-pointer,
  674. // non-interface field appearing in ForceSendFields will be sent to the
  675. // server regardless of whether the field is empty or not. This may be
  676. // used to include empty fields in Patch requests.
  677. ForceSendFields []string `json:"-"`
  678. // NullFields is a list of field names (e.g. "AccountName") to include
  679. // in API requests with the JSON null value. By default, fields with
  680. // empty values are omitted from API requests. However, any field with
  681. // an empty value appearing in NullFields will be sent to the server as
  682. // null. It is an error if a field in this list has a non-empty value.
  683. // This may be used to include null fields in Patch requests.
  684. NullFields []string `json:"-"`
  685. }
  686. func (s *AccountTreeRequest) MarshalJSON() ([]byte, error) {
  687. type NoMethod AccountTreeRequest
  688. raw := NoMethod(*s)
  689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  690. }
  691. // AccountTreeResponse: JSON template for an Analytics account tree
  692. // response. The account tree response is used in the provisioning api
  693. // to return the result of creating an account, property, and view
  694. // (profile).
  695. type AccountTreeResponse struct {
  696. // Account: The account created.
  697. Account *Account `json:"account,omitempty"`
  698. // Kind: Resource type for account ticket.
  699. Kind string `json:"kind,omitempty"`
  700. // Profile: View (Profile) for the account.
  701. Profile *Profile `json:"profile,omitempty"`
  702. // Webproperty: Web property for the account.
  703. Webproperty *Webproperty `json:"webproperty,omitempty"`
  704. // ServerResponse contains the HTTP response code and headers from the
  705. // server.
  706. googleapi.ServerResponse `json:"-"`
  707. // ForceSendFields is a list of field names (e.g. "Account") to
  708. // unconditionally include in API requests. By default, fields with
  709. // empty values are omitted from API requests. However, any non-pointer,
  710. // non-interface field appearing in ForceSendFields will be sent to the
  711. // server regardless of whether the field is empty or not. This may be
  712. // used to include empty fields in Patch requests.
  713. ForceSendFields []string `json:"-"`
  714. // NullFields is a list of field names (e.g. "Account") to include in
  715. // API requests with the JSON null value. By default, fields with empty
  716. // values are omitted from API requests. However, any field with an
  717. // empty value appearing in NullFields will be sent to the server as
  718. // null. It is an error if a field in this list has a non-empty value.
  719. // This may be used to include null fields in Patch requests.
  720. NullFields []string `json:"-"`
  721. }
  722. func (s *AccountTreeResponse) MarshalJSON() ([]byte, error) {
  723. type NoMethod AccountTreeResponse
  724. raw := NoMethod(*s)
  725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  726. }
  727. // Accounts: An account collection provides a list of Analytics accounts
  728. // to which a user has access. The account collection is the entry point
  729. // to all management information. Each resource in the collection
  730. // corresponds to a single Analytics account.
  731. type Accounts struct {
  732. // Items: A list of accounts.
  733. Items []*Account `json:"items,omitempty"`
  734. // ItemsPerPage: The maximum number of entries the response can contain,
  735. // regardless of the actual number of entries returned. Its value ranges
  736. // from 1 to 1000 with a value of 1000 by default, or otherwise
  737. // specified by the max-results query parameter.
  738. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  739. // Kind: Collection type.
  740. Kind string `json:"kind,omitempty"`
  741. // NextLink: Next link for this account collection.
  742. NextLink string `json:"nextLink,omitempty"`
  743. // PreviousLink: Previous link for this account collection.
  744. PreviousLink string `json:"previousLink,omitempty"`
  745. // StartIndex: The starting index of the entries, which is 1 by default
  746. // or otherwise specified by the start-index query parameter.
  747. StartIndex int64 `json:"startIndex,omitempty"`
  748. // TotalResults: The total number of results for the query, regardless
  749. // of the number of results in the response.
  750. TotalResults int64 `json:"totalResults,omitempty"`
  751. // Username: Email ID of the authenticated user
  752. Username string `json:"username,omitempty"`
  753. // ServerResponse contains the HTTP response code and headers from the
  754. // server.
  755. googleapi.ServerResponse `json:"-"`
  756. // ForceSendFields is a list of field names (e.g. "Items") to
  757. // unconditionally include in API requests. By default, fields with
  758. // empty values are omitted from API requests. However, any non-pointer,
  759. // non-interface field appearing in ForceSendFields will be sent to the
  760. // server regardless of whether the field is empty or not. This may be
  761. // used to include empty fields in Patch requests.
  762. ForceSendFields []string `json:"-"`
  763. // NullFields is a list of field names (e.g. "Items") to include in API
  764. // requests with the JSON null value. By default, fields with empty
  765. // values are omitted from API requests. However, any field with an
  766. // empty value appearing in NullFields will be sent to the server as
  767. // null. It is an error if a field in this list has a non-empty value.
  768. // This may be used to include null fields in Patch requests.
  769. NullFields []string `json:"-"`
  770. }
  771. func (s *Accounts) MarshalJSON() ([]byte, error) {
  772. type NoMethod Accounts
  773. raw := NoMethod(*s)
  774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  775. }
  776. // AdWordsAccount: JSON template for an Google Ads account.
  777. type AdWordsAccount struct {
  778. // AutoTaggingEnabled: True if auto-tagging is enabled on the Google Ads
  779. // account. Read-only after the insert operation.
  780. AutoTaggingEnabled bool `json:"autoTaggingEnabled,omitempty"`
  781. // CustomerId: Customer ID. This field is required when creating a
  782. // Google Ads link.
  783. CustomerId string `json:"customerId,omitempty"`
  784. // Kind: Resource type for Google Ads account.
  785. Kind string `json:"kind,omitempty"`
  786. // ForceSendFields is a list of field names (e.g. "AutoTaggingEnabled")
  787. // to unconditionally include in API requests. By default, fields with
  788. // empty values are omitted from API requests. However, any non-pointer,
  789. // non-interface field appearing in ForceSendFields will be sent to the
  790. // server regardless of whether the field is empty or not. This may be
  791. // used to include empty fields in Patch requests.
  792. ForceSendFields []string `json:"-"`
  793. // NullFields is a list of field names (e.g. "AutoTaggingEnabled") to
  794. // include in API requests with the JSON null value. By default, fields
  795. // with empty values are omitted from API requests. However, any field
  796. // with an empty value appearing in NullFields will be sent to the
  797. // server as null. It is an error if a field in this list has a
  798. // non-empty value. This may be used to include null fields in Patch
  799. // requests.
  800. NullFields []string `json:"-"`
  801. }
  802. func (s *AdWordsAccount) MarshalJSON() ([]byte, error) {
  803. type NoMethod AdWordsAccount
  804. raw := NoMethod(*s)
  805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  806. }
  807. // AnalyticsDataimportDeleteUploadDataRequest: Request template for the
  808. // delete upload data request.
  809. type AnalyticsDataimportDeleteUploadDataRequest struct {
  810. // CustomDataImportUids: A list of upload UIDs.
  811. CustomDataImportUids []string `json:"customDataImportUids,omitempty"`
  812. // ForceSendFields is a list of field names (e.g.
  813. // "CustomDataImportUids") to unconditionally include in API requests.
  814. // By default, fields with empty values are omitted from API requests.
  815. // However, any non-pointer, non-interface field appearing in
  816. // ForceSendFields will be sent to the server regardless of whether the
  817. // field is empty or not. This may be used to include empty fields in
  818. // Patch requests.
  819. ForceSendFields []string `json:"-"`
  820. // NullFields is a list of field names (e.g. "CustomDataImportUids") to
  821. // include in API requests with the JSON null value. By default, fields
  822. // with empty values are omitted from API requests. However, any field
  823. // with an empty value appearing in NullFields will be sent to the
  824. // server as null. It is an error if a field in this list has a
  825. // non-empty value. This may be used to include null fields in Patch
  826. // requests.
  827. NullFields []string `json:"-"`
  828. }
  829. func (s *AnalyticsDataimportDeleteUploadDataRequest) MarshalJSON() ([]byte, error) {
  830. type NoMethod AnalyticsDataimportDeleteUploadDataRequest
  831. raw := NoMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  833. }
  834. // Column: JSON template for a metadata column.
  835. type Column struct {
  836. // Attributes: Map of attribute name and value for this column.
  837. Attributes map[string]string `json:"attributes,omitempty"`
  838. // Id: Column id.
  839. Id string `json:"id,omitempty"`
  840. // Kind: Resource type for Analytics column.
  841. Kind string `json:"kind,omitempty"`
  842. // ForceSendFields is a list of field names (e.g. "Attributes") to
  843. // unconditionally include in API requests. By default, fields with
  844. // empty values are omitted from API requests. However, any non-pointer,
  845. // non-interface field appearing in ForceSendFields will be sent to the
  846. // server regardless of whether the field is empty or not. This may be
  847. // used to include empty fields in Patch requests.
  848. ForceSendFields []string `json:"-"`
  849. // NullFields is a list of field names (e.g. "Attributes") to include in
  850. // API requests with the JSON null value. By default, fields with empty
  851. // values are omitted from API requests. However, any field with an
  852. // empty value appearing in NullFields will be sent to the server as
  853. // null. It is an error if a field in this list has a non-empty value.
  854. // This may be used to include null fields in Patch requests.
  855. NullFields []string `json:"-"`
  856. }
  857. func (s *Column) MarshalJSON() ([]byte, error) {
  858. type NoMethod Column
  859. raw := NoMethod(*s)
  860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  861. }
  862. // Columns: Lists columns (dimensions and metrics) for a particular
  863. // report type.
  864. type Columns struct {
  865. // AttributeNames: List of attributes names returned by columns.
  866. AttributeNames []string `json:"attributeNames,omitempty"`
  867. // Etag: Etag of collection. This etag can be compared with the last
  868. // response etag to check if response has changed.
  869. Etag string `json:"etag,omitempty"`
  870. // Items: List of columns for a report type.
  871. Items []*Column `json:"items,omitempty"`
  872. // Kind: Collection type.
  873. Kind string `json:"kind,omitempty"`
  874. // TotalResults: Total number of columns returned in the response.
  875. TotalResults int64 `json:"totalResults,omitempty"`
  876. // ServerResponse contains the HTTP response code and headers from the
  877. // server.
  878. googleapi.ServerResponse `json:"-"`
  879. // ForceSendFields is a list of field names (e.g. "AttributeNames") to
  880. // unconditionally include in API requests. By default, fields with
  881. // empty values are omitted from API requests. However, any non-pointer,
  882. // non-interface field appearing in ForceSendFields will be sent to the
  883. // server regardless of whether the field is empty or not. This may be
  884. // used to include empty fields in Patch requests.
  885. ForceSendFields []string `json:"-"`
  886. // NullFields is a list of field names (e.g. "AttributeNames") to
  887. // include in API requests with the JSON null value. By default, fields
  888. // with empty values are omitted from API requests. However, any field
  889. // with an empty value appearing in NullFields will be sent to the
  890. // server as null. It is an error if a field in this list has a
  891. // non-empty value. This may be used to include null fields in Patch
  892. // requests.
  893. NullFields []string `json:"-"`
  894. }
  895. func (s *Columns) MarshalJSON() ([]byte, error) {
  896. type NoMethod Columns
  897. raw := NoMethod(*s)
  898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  899. }
  900. // CustomDataSource: JSON template for an Analytics custom data source.
  901. type CustomDataSource struct {
  902. // AccountId: Account ID to which this custom data source belongs.
  903. AccountId string `json:"accountId,omitempty"`
  904. ChildLink *CustomDataSourceChildLink `json:"childLink,omitempty"`
  905. // Created: Time this custom data source was created.
  906. Created string `json:"created,omitempty"`
  907. // Description: Description of custom data source.
  908. Description string `json:"description,omitempty"`
  909. // Id: Custom data source ID.
  910. Id string `json:"id,omitempty"`
  911. ImportBehavior string `json:"importBehavior,omitempty"`
  912. // Kind: Resource type for Analytics custom data source.
  913. Kind string `json:"kind,omitempty"`
  914. // Name: Name of this custom data source.
  915. Name string `json:"name,omitempty"`
  916. // ParentLink: Parent link for this custom data source. Points to the
  917. // web property to which this custom data source belongs.
  918. ParentLink *CustomDataSourceParentLink `json:"parentLink,omitempty"`
  919. // ProfilesLinked: IDs of views (profiles) linked to the custom data
  920. // source.
  921. ProfilesLinked []string `json:"profilesLinked,omitempty"`
  922. // Schema: Collection of schema headers of the custom data source.
  923. Schema []string `json:"schema,omitempty"`
  924. // SelfLink: Link for this Analytics custom data source.
  925. SelfLink string `json:"selfLink,omitempty"`
  926. // Type: Type of the custom data source.
  927. Type string `json:"type,omitempty"`
  928. // Updated: Time this custom data source was last modified.
  929. Updated string `json:"updated,omitempty"`
  930. // UploadType: Upload type of the custom data source.
  931. UploadType string `json:"uploadType,omitempty"`
  932. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  933. // custom data source belongs.
  934. WebPropertyId string `json:"webPropertyId,omitempty"`
  935. // ForceSendFields is a list of field names (e.g. "AccountId") to
  936. // unconditionally include in API requests. By default, fields with
  937. // empty values are omitted from API requests. However, any non-pointer,
  938. // non-interface field appearing in ForceSendFields will be sent to the
  939. // server regardless of whether the field is empty or not. This may be
  940. // used to include empty fields in Patch requests.
  941. ForceSendFields []string `json:"-"`
  942. // NullFields is a list of field names (e.g. "AccountId") to include in
  943. // API requests with the JSON null value. By default, fields with empty
  944. // values are omitted from API requests. However, any field with an
  945. // empty value appearing in NullFields will be sent to the server as
  946. // null. It is an error if a field in this list has a non-empty value.
  947. // This may be used to include null fields in Patch requests.
  948. NullFields []string `json:"-"`
  949. }
  950. func (s *CustomDataSource) MarshalJSON() ([]byte, error) {
  951. type NoMethod CustomDataSource
  952. raw := NoMethod(*s)
  953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  954. }
  955. type CustomDataSourceChildLink struct {
  956. // Href: Link to the list of daily uploads for this custom data source.
  957. // Link to the list of uploads for this custom data source.
  958. Href string `json:"href,omitempty"`
  959. // Type: Value is "analytics#dailyUploads". Value is
  960. // "analytics#uploads".
  961. Type string `json:"type,omitempty"`
  962. // ForceSendFields is a list of field names (e.g. "Href") to
  963. // unconditionally include in API requests. By default, fields with
  964. // empty values are omitted from API requests. However, any non-pointer,
  965. // non-interface field appearing in ForceSendFields will be sent to the
  966. // server regardless of whether the field is empty or not. This may be
  967. // used to include empty fields in Patch requests.
  968. ForceSendFields []string `json:"-"`
  969. // NullFields is a list of field names (e.g. "Href") to include in API
  970. // requests with the JSON null value. By default, fields with empty
  971. // values are omitted from API requests. However, any field with an
  972. // empty value appearing in NullFields will be sent to the server as
  973. // null. It is an error if a field in this list has a non-empty value.
  974. // This may be used to include null fields in Patch requests.
  975. NullFields []string `json:"-"`
  976. }
  977. func (s *CustomDataSourceChildLink) MarshalJSON() ([]byte, error) {
  978. type NoMethod CustomDataSourceChildLink
  979. raw := NoMethod(*s)
  980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  981. }
  982. // CustomDataSourceParentLink: Parent link for this custom data source.
  983. // Points to the web property to which this custom data source belongs.
  984. type CustomDataSourceParentLink struct {
  985. // Href: Link to the web property to which this custom data source
  986. // belongs.
  987. Href string `json:"href,omitempty"`
  988. // Type: Value is "analytics#webproperty".
  989. Type string `json:"type,omitempty"`
  990. // ForceSendFields is a list of field names (e.g. "Href") to
  991. // unconditionally include in API requests. By default, fields with
  992. // empty values are omitted from API requests. However, any non-pointer,
  993. // non-interface field appearing in ForceSendFields will be sent to the
  994. // server regardless of whether the field is empty or not. This may be
  995. // used to include empty fields in Patch requests.
  996. ForceSendFields []string `json:"-"`
  997. // NullFields is a list of field names (e.g. "Href") to include in API
  998. // requests with the JSON null value. By default, fields with empty
  999. // values are omitted from API requests. However, any field with an
  1000. // empty value appearing in NullFields will be sent to the server as
  1001. // null. It is an error if a field in this list has a non-empty value.
  1002. // This may be used to include null fields in Patch requests.
  1003. NullFields []string `json:"-"`
  1004. }
  1005. func (s *CustomDataSourceParentLink) MarshalJSON() ([]byte, error) {
  1006. type NoMethod CustomDataSourceParentLink
  1007. raw := NoMethod(*s)
  1008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1009. }
  1010. // CustomDataSources: Lists Analytics custom data sources to which the
  1011. // user has access. Each resource in the collection corresponds to a
  1012. // single Analytics custom data source.
  1013. type CustomDataSources struct {
  1014. // Items: Collection of custom data sources.
  1015. Items []*CustomDataSource `json:"items,omitempty"`
  1016. // ItemsPerPage: The maximum number of resources the response can
  1017. // contain, regardless of the actual number of resources returned. Its
  1018. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1019. // otherwise specified by the max-results query parameter.
  1020. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1021. // Kind: Collection type.
  1022. Kind string `json:"kind,omitempty"`
  1023. // NextLink: Link to next page for this custom data source collection.
  1024. NextLink string `json:"nextLink,omitempty"`
  1025. // PreviousLink: Link to previous page for this custom data source
  1026. // collection.
  1027. PreviousLink string `json:"previousLink,omitempty"`
  1028. // StartIndex: The starting index of the resources, which is 1 by
  1029. // default or otherwise specified by the start-index query parameter.
  1030. StartIndex int64 `json:"startIndex,omitempty"`
  1031. // TotalResults: The total number of results for the query, regardless
  1032. // of the number of results in the response.
  1033. TotalResults int64 `json:"totalResults,omitempty"`
  1034. // Username: Email ID of the authenticated user
  1035. Username string `json:"username,omitempty"`
  1036. // ServerResponse contains the HTTP response code and headers from the
  1037. // server.
  1038. googleapi.ServerResponse `json:"-"`
  1039. // ForceSendFields is a list of field names (e.g. "Items") to
  1040. // unconditionally include in API requests. By default, fields with
  1041. // empty values are omitted from API requests. However, any non-pointer,
  1042. // non-interface field appearing in ForceSendFields will be sent to the
  1043. // server regardless of whether the field is empty or not. This may be
  1044. // used to include empty fields in Patch requests.
  1045. ForceSendFields []string `json:"-"`
  1046. // NullFields is a list of field names (e.g. "Items") to include in API
  1047. // requests with the JSON null value. By default, fields with empty
  1048. // values are omitted from API requests. However, any field with an
  1049. // empty value appearing in NullFields will be sent to the server as
  1050. // null. It is an error if a field in this list has a non-empty value.
  1051. // This may be used to include null fields in Patch requests.
  1052. NullFields []string `json:"-"`
  1053. }
  1054. func (s *CustomDataSources) MarshalJSON() ([]byte, error) {
  1055. type NoMethod CustomDataSources
  1056. raw := NoMethod(*s)
  1057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1058. }
  1059. // CustomDimension: JSON template for Analytics Custom Dimension.
  1060. type CustomDimension struct {
  1061. // AccountId: Account ID.
  1062. AccountId string `json:"accountId,omitempty"`
  1063. // Active: Boolean indicating whether the custom dimension is active.
  1064. Active bool `json:"active,omitempty"`
  1065. // Created: Time the custom dimension was created.
  1066. Created string `json:"created,omitempty"`
  1067. // Id: Custom dimension ID.
  1068. Id string `json:"id,omitempty"`
  1069. // Index: Index of the custom dimension.
  1070. Index int64 `json:"index,omitempty"`
  1071. // Kind: Kind value for a custom dimension. Set to
  1072. // "analytics#customDimension". It is a read-only field.
  1073. Kind string `json:"kind,omitempty"`
  1074. // Name: Name of the custom dimension.
  1075. Name string `json:"name,omitempty"`
  1076. // ParentLink: Parent link for the custom dimension. Points to the
  1077. // property to which the custom dimension belongs.
  1078. ParentLink *CustomDimensionParentLink `json:"parentLink,omitempty"`
  1079. // Scope: Scope of the custom dimension: HIT, SESSION, USER or PRODUCT.
  1080. Scope string `json:"scope,omitempty"`
  1081. // SelfLink: Link for the custom dimension
  1082. SelfLink string `json:"selfLink,omitempty"`
  1083. // Updated: Time the custom dimension was last modified.
  1084. Updated string `json:"updated,omitempty"`
  1085. // WebPropertyId: Property ID.
  1086. WebPropertyId string `json:"webPropertyId,omitempty"`
  1087. // ServerResponse contains the HTTP response code and headers from the
  1088. // server.
  1089. googleapi.ServerResponse `json:"-"`
  1090. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1091. // unconditionally include in API requests. By default, fields with
  1092. // empty values are omitted from API requests. However, any non-pointer,
  1093. // non-interface field appearing in ForceSendFields will be sent to the
  1094. // server regardless of whether the field is empty or not. This may be
  1095. // used to include empty fields in Patch requests.
  1096. ForceSendFields []string `json:"-"`
  1097. // NullFields is a list of field names (e.g. "AccountId") to include in
  1098. // API requests with the JSON null value. By default, fields with empty
  1099. // values are omitted from API requests. However, any field with an
  1100. // empty value appearing in NullFields will be sent to the server as
  1101. // null. It is an error if a field in this list has a non-empty value.
  1102. // This may be used to include null fields in Patch requests.
  1103. NullFields []string `json:"-"`
  1104. }
  1105. func (s *CustomDimension) MarshalJSON() ([]byte, error) {
  1106. type NoMethod CustomDimension
  1107. raw := NoMethod(*s)
  1108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1109. }
  1110. // CustomDimensionParentLink: Parent link for the custom dimension.
  1111. // Points to the property to which the custom dimension belongs.
  1112. type CustomDimensionParentLink struct {
  1113. // Href: Link to the property to which the custom dimension belongs.
  1114. Href string `json:"href,omitempty"`
  1115. // Type: Type of the parent link. Set to "analytics#webproperty".
  1116. Type string `json:"type,omitempty"`
  1117. // ForceSendFields is a list of field names (e.g. "Href") to
  1118. // unconditionally include in API requests. By default, fields with
  1119. // empty values are omitted from API requests. However, any non-pointer,
  1120. // non-interface field appearing in ForceSendFields will be sent to the
  1121. // server regardless of whether the field is empty or not. This may be
  1122. // used to include empty fields in Patch requests.
  1123. ForceSendFields []string `json:"-"`
  1124. // NullFields is a list of field names (e.g. "Href") to include in API
  1125. // requests with the JSON null value. By default, fields with empty
  1126. // values are omitted from API requests. However, any field with an
  1127. // empty value appearing in NullFields will be sent to the server as
  1128. // null. It is an error if a field in this list has a non-empty value.
  1129. // This may be used to include null fields in Patch requests.
  1130. NullFields []string `json:"-"`
  1131. }
  1132. func (s *CustomDimensionParentLink) MarshalJSON() ([]byte, error) {
  1133. type NoMethod CustomDimensionParentLink
  1134. raw := NoMethod(*s)
  1135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1136. }
  1137. // CustomDimensions: A custom dimension collection lists Analytics
  1138. // custom dimensions to which the user has access. Each resource in the
  1139. // collection corresponds to a single Analytics custom dimension.
  1140. type CustomDimensions struct {
  1141. // Items: Collection of custom dimensions.
  1142. Items []*CustomDimension `json:"items,omitempty"`
  1143. // ItemsPerPage: The maximum number of resources the response can
  1144. // contain, regardless of the actual number of resources returned. Its
  1145. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1146. // otherwise specified by the max-results query parameter.
  1147. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1148. // Kind: Collection type.
  1149. Kind string `json:"kind,omitempty"`
  1150. // NextLink: Link to next page for this custom dimension collection.
  1151. NextLink string `json:"nextLink,omitempty"`
  1152. // PreviousLink: Link to previous page for this custom dimension
  1153. // collection.
  1154. PreviousLink string `json:"previousLink,omitempty"`
  1155. // StartIndex: The starting index of the resources, which is 1 by
  1156. // default or otherwise specified by the start-index query parameter.
  1157. StartIndex int64 `json:"startIndex,omitempty"`
  1158. // TotalResults: The total number of results for the query, regardless
  1159. // of the number of results in the response.
  1160. TotalResults int64 `json:"totalResults,omitempty"`
  1161. // Username: Email ID of the authenticated user
  1162. Username string `json:"username,omitempty"`
  1163. // ServerResponse contains the HTTP response code and headers from the
  1164. // server.
  1165. googleapi.ServerResponse `json:"-"`
  1166. // ForceSendFields is a list of field names (e.g. "Items") to
  1167. // unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "Items") to include in API
  1174. // requests with the JSON null value. By default, fields with empty
  1175. // values are omitted from API requests. However, any field with an
  1176. // empty value appearing in NullFields will be sent to the server as
  1177. // null. It is an error if a field in this list has a non-empty value.
  1178. // This may be used to include null fields in Patch requests.
  1179. NullFields []string `json:"-"`
  1180. }
  1181. func (s *CustomDimensions) MarshalJSON() ([]byte, error) {
  1182. type NoMethod CustomDimensions
  1183. raw := NoMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1185. }
  1186. // CustomMetric: JSON template for Analytics Custom Metric.
  1187. type CustomMetric struct {
  1188. // AccountId: Account ID.
  1189. AccountId string `json:"accountId,omitempty"`
  1190. // Active: Boolean indicating whether the custom metric is active.
  1191. Active bool `json:"active,omitempty"`
  1192. // Created: Time the custom metric was created.
  1193. Created string `json:"created,omitempty"`
  1194. // Id: Custom metric ID.
  1195. Id string `json:"id,omitempty"`
  1196. // Index: Index of the custom metric.
  1197. Index int64 `json:"index,omitempty"`
  1198. // Kind: Kind value for a custom metric. Set to
  1199. // "analytics#customMetric". It is a read-only field.
  1200. Kind string `json:"kind,omitempty"`
  1201. // MaxValue: Max value of custom metric.
  1202. MaxValue string `json:"max_value,omitempty"`
  1203. // MinValue: Min value of custom metric.
  1204. MinValue string `json:"min_value,omitempty"`
  1205. // Name: Name of the custom metric.
  1206. Name string `json:"name,omitempty"`
  1207. // ParentLink: Parent link for the custom metric. Points to the property
  1208. // to which the custom metric belongs.
  1209. ParentLink *CustomMetricParentLink `json:"parentLink,omitempty"`
  1210. // Scope: Scope of the custom metric: HIT or PRODUCT.
  1211. Scope string `json:"scope,omitempty"`
  1212. // SelfLink: Link for the custom metric
  1213. SelfLink string `json:"selfLink,omitempty"`
  1214. // Type: Data type of custom metric.
  1215. Type string `json:"type,omitempty"`
  1216. // Updated: Time the custom metric was last modified.
  1217. Updated string `json:"updated,omitempty"`
  1218. // WebPropertyId: Property ID.
  1219. WebPropertyId string `json:"webPropertyId,omitempty"`
  1220. // ServerResponse contains the HTTP response code and headers from the
  1221. // server.
  1222. googleapi.ServerResponse `json:"-"`
  1223. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1224. // unconditionally include in API requests. By default, fields with
  1225. // empty values are omitted from API requests. However, any non-pointer,
  1226. // non-interface field appearing in ForceSendFields will be sent to the
  1227. // server regardless of whether the field is empty or not. This may be
  1228. // used to include empty fields in Patch requests.
  1229. ForceSendFields []string `json:"-"`
  1230. // NullFields is a list of field names (e.g. "AccountId") to include in
  1231. // API requests with the JSON null value. By default, fields with empty
  1232. // values are omitted from API requests. However, any field with an
  1233. // empty value appearing in NullFields will be sent to the server as
  1234. // null. It is an error if a field in this list has a non-empty value.
  1235. // This may be used to include null fields in Patch requests.
  1236. NullFields []string `json:"-"`
  1237. }
  1238. func (s *CustomMetric) MarshalJSON() ([]byte, error) {
  1239. type NoMethod CustomMetric
  1240. raw := NoMethod(*s)
  1241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1242. }
  1243. // CustomMetricParentLink: Parent link for the custom metric. Points to
  1244. // the property to which the custom metric belongs.
  1245. type CustomMetricParentLink struct {
  1246. // Href: Link to the property to which the custom metric belongs.
  1247. Href string `json:"href,omitempty"`
  1248. // Type: Type of the parent link. Set to "analytics#webproperty".
  1249. Type string `json:"type,omitempty"`
  1250. // ForceSendFields is a list of field names (e.g. "Href") to
  1251. // unconditionally include in API requests. By default, fields with
  1252. // empty values are omitted from API requests. However, any non-pointer,
  1253. // non-interface field appearing in ForceSendFields will be sent to the
  1254. // server regardless of whether the field is empty or not. This may be
  1255. // used to include empty fields in Patch requests.
  1256. ForceSendFields []string `json:"-"`
  1257. // NullFields is a list of field names (e.g. "Href") to include in API
  1258. // requests with the JSON null value. By default, fields with empty
  1259. // values are omitted from API requests. However, any field with an
  1260. // empty value appearing in NullFields will be sent to the server as
  1261. // null. It is an error if a field in this list has a non-empty value.
  1262. // This may be used to include null fields in Patch requests.
  1263. NullFields []string `json:"-"`
  1264. }
  1265. func (s *CustomMetricParentLink) MarshalJSON() ([]byte, error) {
  1266. type NoMethod CustomMetricParentLink
  1267. raw := NoMethod(*s)
  1268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1269. }
  1270. // CustomMetrics: A custom metric collection lists Analytics custom
  1271. // metrics to which the user has access. Each resource in the collection
  1272. // corresponds to a single Analytics custom metric.
  1273. type CustomMetrics struct {
  1274. // Items: Collection of custom metrics.
  1275. Items []*CustomMetric `json:"items,omitempty"`
  1276. // ItemsPerPage: The maximum number of resources the response can
  1277. // contain, regardless of the actual number of resources returned. Its
  1278. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1279. // otherwise specified by the max-results query parameter.
  1280. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1281. // Kind: Collection type.
  1282. Kind string `json:"kind,omitempty"`
  1283. // NextLink: Link to next page for this custom metric collection.
  1284. NextLink string `json:"nextLink,omitempty"`
  1285. // PreviousLink: Link to previous page for this custom metric
  1286. // collection.
  1287. PreviousLink string `json:"previousLink,omitempty"`
  1288. // StartIndex: The starting index of the resources, which is 1 by
  1289. // default or otherwise specified by the start-index query parameter.
  1290. StartIndex int64 `json:"startIndex,omitempty"`
  1291. // TotalResults: The total number of results for the query, regardless
  1292. // of the number of results in the response.
  1293. TotalResults int64 `json:"totalResults,omitempty"`
  1294. // Username: Email ID of the authenticated user
  1295. Username string `json:"username,omitempty"`
  1296. // ServerResponse contains the HTTP response code and headers from the
  1297. // server.
  1298. googleapi.ServerResponse `json:"-"`
  1299. // ForceSendFields is a list of field names (e.g. "Items") to
  1300. // unconditionally include in API requests. By default, fields with
  1301. // empty values are omitted from API requests. However, any non-pointer,
  1302. // non-interface field appearing in ForceSendFields will be sent to the
  1303. // server regardless of whether the field is empty or not. This may be
  1304. // used to include empty fields in Patch requests.
  1305. ForceSendFields []string `json:"-"`
  1306. // NullFields is a list of field names (e.g. "Items") to include in API
  1307. // requests with the JSON null value. By default, fields with empty
  1308. // values are omitted from API requests. However, any field with an
  1309. // empty value appearing in NullFields will be sent to the server as
  1310. // null. It is an error if a field in this list has a non-empty value.
  1311. // This may be used to include null fields in Patch requests.
  1312. NullFields []string `json:"-"`
  1313. }
  1314. func (s *CustomMetrics) MarshalJSON() ([]byte, error) {
  1315. type NoMethod CustomMetrics
  1316. raw := NoMethod(*s)
  1317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1318. }
  1319. // EntityAdWordsLink: JSON template for Analytics Entity Google Ads
  1320. // Link.
  1321. type EntityAdWordsLink struct {
  1322. // AdWordsAccounts: A list of Google Ads client accounts. These cannot
  1323. // be MCC accounts. This field is required when creating a Google Ads
  1324. // link. It cannot be empty.
  1325. AdWordsAccounts []*AdWordsAccount `json:"adWordsAccounts,omitempty"`
  1326. // Entity: Web property being linked.
  1327. Entity *EntityAdWordsLinkEntity `json:"entity,omitempty"`
  1328. // Id: Entity Google Ads link ID
  1329. Id string `json:"id,omitempty"`
  1330. // Kind: Resource type for entity Google Ads link.
  1331. Kind string `json:"kind,omitempty"`
  1332. // Name: Name of the link. This field is required when creating a Google
  1333. // Ads link.
  1334. Name string `json:"name,omitempty"`
  1335. // ProfileIds: IDs of linked Views (Profiles) represented as strings.
  1336. ProfileIds []string `json:"profileIds,omitempty"`
  1337. // SelfLink: URL link for this Google Analytics - Google Ads link.
  1338. SelfLink string `json:"selfLink,omitempty"`
  1339. // ServerResponse contains the HTTP response code and headers from the
  1340. // server.
  1341. googleapi.ServerResponse `json:"-"`
  1342. // ForceSendFields is a list of field names (e.g. "AdWordsAccounts") to
  1343. // unconditionally include in API requests. By default, fields with
  1344. // empty values are omitted from API requests. However, any non-pointer,
  1345. // non-interface field appearing in ForceSendFields will be sent to the
  1346. // server regardless of whether the field is empty or not. This may be
  1347. // used to include empty fields in Patch requests.
  1348. ForceSendFields []string `json:"-"`
  1349. // NullFields is a list of field names (e.g. "AdWordsAccounts") to
  1350. // include in API requests with the JSON null value. By default, fields
  1351. // with empty values are omitted from API requests. However, any field
  1352. // with an empty value appearing in NullFields will be sent to the
  1353. // server as null. It is an error if a field in this list has a
  1354. // non-empty value. This may be used to include null fields in Patch
  1355. // requests.
  1356. NullFields []string `json:"-"`
  1357. }
  1358. func (s *EntityAdWordsLink) MarshalJSON() ([]byte, error) {
  1359. type NoMethod EntityAdWordsLink
  1360. raw := NoMethod(*s)
  1361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1362. }
  1363. // EntityAdWordsLinkEntity: Web property being linked.
  1364. type EntityAdWordsLinkEntity struct {
  1365. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1366. // ForceSendFields is a list of field names (e.g. "WebPropertyRef") to
  1367. // unconditionally include in API requests. By default, fields with
  1368. // empty values are omitted from API requests. However, any non-pointer,
  1369. // non-interface field appearing in ForceSendFields will be sent to the
  1370. // server regardless of whether the field is empty or not. This may be
  1371. // used to include empty fields in Patch requests.
  1372. ForceSendFields []string `json:"-"`
  1373. // NullFields is a list of field names (e.g. "WebPropertyRef") to
  1374. // include in API requests with the JSON null value. By default, fields
  1375. // with empty values are omitted from API requests. However, any field
  1376. // with an empty value appearing in NullFields will be sent to the
  1377. // server as null. It is an error if a field in this list has a
  1378. // non-empty value. This may be used to include null fields in Patch
  1379. // requests.
  1380. NullFields []string `json:"-"`
  1381. }
  1382. func (s *EntityAdWordsLinkEntity) MarshalJSON() ([]byte, error) {
  1383. type NoMethod EntityAdWordsLinkEntity
  1384. raw := NoMethod(*s)
  1385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1386. }
  1387. // EntityAdWordsLinks: An entity Google Ads link collection provides a
  1388. // list of GA-Google Ads links Each resource in this collection
  1389. // corresponds to a single link.
  1390. type EntityAdWordsLinks struct {
  1391. // Items: A list of entity Google Ads links.
  1392. Items []*EntityAdWordsLink `json:"items,omitempty"`
  1393. // ItemsPerPage: The maximum number of entries the response can contain,
  1394. // regardless of the actual number of entries returned. Its value ranges
  1395. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1396. // specified by the max-results query parameter.
  1397. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1398. // Kind: Collection type.
  1399. Kind string `json:"kind,omitempty"`
  1400. // NextLink: Next link for this Google Ads link collection.
  1401. NextLink string `json:"nextLink,omitempty"`
  1402. // PreviousLink: Previous link for this Google Ads link collection.
  1403. PreviousLink string `json:"previousLink,omitempty"`
  1404. // StartIndex: The starting index of the entries, which is 1 by default
  1405. // or otherwise specified by the start-index query parameter.
  1406. StartIndex int64 `json:"startIndex,omitempty"`
  1407. // TotalResults: The total number of results for the query, regardless
  1408. // of the number of results in the response.
  1409. TotalResults int64 `json:"totalResults,omitempty"`
  1410. // ServerResponse contains the HTTP response code and headers from the
  1411. // server.
  1412. googleapi.ServerResponse `json:"-"`
  1413. // ForceSendFields is a list of field names (e.g. "Items") to
  1414. // unconditionally include in API requests. By default, fields with
  1415. // empty values are omitted from API requests. However, any non-pointer,
  1416. // non-interface field appearing in ForceSendFields will be sent to the
  1417. // server regardless of whether the field is empty or not. This may be
  1418. // used to include empty fields in Patch requests.
  1419. ForceSendFields []string `json:"-"`
  1420. // NullFields is a list of field names (e.g. "Items") to include in API
  1421. // requests with the JSON null value. By default, fields with empty
  1422. // values are omitted from API requests. However, any field with an
  1423. // empty value appearing in NullFields will be sent to the server as
  1424. // null. It is an error if a field in this list has a non-empty value.
  1425. // This may be used to include null fields in Patch requests.
  1426. NullFields []string `json:"-"`
  1427. }
  1428. func (s *EntityAdWordsLinks) MarshalJSON() ([]byte, error) {
  1429. type NoMethod EntityAdWordsLinks
  1430. raw := NoMethod(*s)
  1431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1432. }
  1433. // EntityUserLink: JSON template for an Analytics Entity-User Link.
  1434. // Returns permissions that a user has for an entity.
  1435. type EntityUserLink struct {
  1436. // Entity: Entity for this link. It can be an account, a web property,
  1437. // or a view (profile).
  1438. Entity *EntityUserLinkEntity `json:"entity,omitempty"`
  1439. // Id: Entity user link ID
  1440. Id string `json:"id,omitempty"`
  1441. // Kind: Resource type for entity user link.
  1442. Kind string `json:"kind,omitempty"`
  1443. // Permissions: Permissions the user has for this entity.
  1444. Permissions *EntityUserLinkPermissions `json:"permissions,omitempty"`
  1445. // SelfLink: Self link for this resource.
  1446. SelfLink string `json:"selfLink,omitempty"`
  1447. // UserRef: User reference.
  1448. UserRef *UserRef `json:"userRef,omitempty"`
  1449. // ServerResponse contains the HTTP response code and headers from the
  1450. // server.
  1451. googleapi.ServerResponse `json:"-"`
  1452. // ForceSendFields is a list of field names (e.g. "Entity") to
  1453. // unconditionally include in API requests. By default, fields with
  1454. // empty values are omitted from API requests. However, any non-pointer,
  1455. // non-interface field appearing in ForceSendFields will be sent to the
  1456. // server regardless of whether the field is empty or not. This may be
  1457. // used to include empty fields in Patch requests.
  1458. ForceSendFields []string `json:"-"`
  1459. // NullFields is a list of field names (e.g. "Entity") to include in API
  1460. // requests with the JSON null value. By default, fields with empty
  1461. // values are omitted from API requests. However, any field with an
  1462. // empty value appearing in NullFields will be sent to the server as
  1463. // null. It is an error if a field in this list has a non-empty value.
  1464. // This may be used to include null fields in Patch requests.
  1465. NullFields []string `json:"-"`
  1466. }
  1467. func (s *EntityUserLink) MarshalJSON() ([]byte, error) {
  1468. type NoMethod EntityUserLink
  1469. raw := NoMethod(*s)
  1470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1471. }
  1472. // EntityUserLinkEntity: Entity for this link. It can be an account, a
  1473. // web property, or a view (profile).
  1474. type EntityUserLinkEntity struct {
  1475. // AccountRef: Account for this link.
  1476. AccountRef *AccountRef `json:"accountRef,omitempty"`
  1477. // ProfileRef: View (Profile) for this link.
  1478. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  1479. // WebPropertyRef: Web property for this link.
  1480. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1481. // ForceSendFields is a list of field names (e.g. "AccountRef") to
  1482. // unconditionally include in API requests. By default, fields with
  1483. // empty values are omitted from API requests. However, any non-pointer,
  1484. // non-interface field appearing in ForceSendFields will be sent to the
  1485. // server regardless of whether the field is empty or not. This may be
  1486. // used to include empty fields in Patch requests.
  1487. ForceSendFields []string `json:"-"`
  1488. // NullFields is a list of field names (e.g. "AccountRef") to include in
  1489. // API requests with the JSON null value. By default, fields with empty
  1490. // values are omitted from API requests. However, any field with an
  1491. // empty value appearing in NullFields will be sent to the server as
  1492. // null. It is an error if a field in this list has a non-empty value.
  1493. // This may be used to include null fields in Patch requests.
  1494. NullFields []string `json:"-"`
  1495. }
  1496. func (s *EntityUserLinkEntity) MarshalJSON() ([]byte, error) {
  1497. type NoMethod EntityUserLinkEntity
  1498. raw := NoMethod(*s)
  1499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1500. }
  1501. // EntityUserLinkPermissions: Permissions the user has for this entity.
  1502. type EntityUserLinkPermissions struct {
  1503. // Effective: Effective permissions represent all the permissions that a
  1504. // user has for this entity. These include any implied permissions
  1505. // (e.g., EDIT implies VIEW) or inherited permissions from the parent
  1506. // entity. Effective permissions are read-only.
  1507. Effective []string `json:"effective,omitempty"`
  1508. // Local: Permissions that a user has been assigned at this very level.
  1509. // Does not include any implied or inherited permissions. Local
  1510. // permissions are modifiable.
  1511. Local []string `json:"local,omitempty"`
  1512. // ForceSendFields is a list of field names (e.g. "Effective") to
  1513. // unconditionally include in API requests. By default, fields with
  1514. // empty values are omitted from API requests. However, any non-pointer,
  1515. // non-interface field appearing in ForceSendFields will be sent to the
  1516. // server regardless of whether the field is empty or not. This may be
  1517. // used to include empty fields in Patch requests.
  1518. ForceSendFields []string `json:"-"`
  1519. // NullFields is a list of field names (e.g. "Effective") to include in
  1520. // API requests with the JSON null value. By default, fields with empty
  1521. // values are omitted from API requests. However, any field with an
  1522. // empty value appearing in NullFields will be sent to the server as
  1523. // null. It is an error if a field in this list has a non-empty value.
  1524. // This may be used to include null fields in Patch requests.
  1525. NullFields []string `json:"-"`
  1526. }
  1527. func (s *EntityUserLinkPermissions) MarshalJSON() ([]byte, error) {
  1528. type NoMethod EntityUserLinkPermissions
  1529. raw := NoMethod(*s)
  1530. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1531. }
  1532. // EntityUserLinks: An entity user link collection provides a list of
  1533. // Analytics ACL links Each resource in this collection corresponds to a
  1534. // single link.
  1535. type EntityUserLinks struct {
  1536. // Items: A list of entity user links.
  1537. Items []*EntityUserLink `json:"items,omitempty"`
  1538. // ItemsPerPage: The maximum number of entries the response can contain,
  1539. // regardless of the actual number of entries returned. Its value ranges
  1540. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1541. // specified by the max-results query parameter.
  1542. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1543. // Kind: Collection type.
  1544. Kind string `json:"kind,omitempty"`
  1545. // NextLink: Next link for this account collection.
  1546. NextLink string `json:"nextLink,omitempty"`
  1547. // PreviousLink: Previous link for this account collection.
  1548. PreviousLink string `json:"previousLink,omitempty"`
  1549. // StartIndex: The starting index of the entries, which is 1 by default
  1550. // or otherwise specified by the start-index query parameter.
  1551. StartIndex int64 `json:"startIndex,omitempty"`
  1552. // TotalResults: The total number of results for the query, regardless
  1553. // of the number of results in the response.
  1554. TotalResults int64 `json:"totalResults,omitempty"`
  1555. // ServerResponse contains the HTTP response code and headers from the
  1556. // server.
  1557. googleapi.ServerResponse `json:"-"`
  1558. // ForceSendFields is a list of field names (e.g. "Items") to
  1559. // unconditionally include in API requests. By default, fields with
  1560. // empty values are omitted from API requests. However, any non-pointer,
  1561. // non-interface field appearing in ForceSendFields will be sent to the
  1562. // server regardless of whether the field is empty or not. This may be
  1563. // used to include empty fields in Patch requests.
  1564. ForceSendFields []string `json:"-"`
  1565. // NullFields is a list of field names (e.g. "Items") to include in API
  1566. // requests with the JSON null value. By default, fields with empty
  1567. // values are omitted from API requests. However, any field with an
  1568. // empty value appearing in NullFields will be sent to the server as
  1569. // null. It is an error if a field in this list has a non-empty value.
  1570. // This may be used to include null fields in Patch requests.
  1571. NullFields []string `json:"-"`
  1572. }
  1573. func (s *EntityUserLinks) MarshalJSON() ([]byte, error) {
  1574. type NoMethod EntityUserLinks
  1575. raw := NoMethod(*s)
  1576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1577. }
  1578. // Experiment: JSON template for Analytics experiment resource.
  1579. type Experiment struct {
  1580. // AccountId: Account ID to which this experiment belongs. This field is
  1581. // read-only.
  1582. AccountId string `json:"accountId,omitempty"`
  1583. // Created: Time the experiment was created. This field is read-only.
  1584. Created string `json:"created,omitempty"`
  1585. // Description: Notes about this experiment.
  1586. Description string `json:"description,omitempty"`
  1587. // EditableInGaUi: If true, the end user will be able to edit the
  1588. // experiment via the Google Analytics user interface.
  1589. EditableInGaUi bool `json:"editableInGaUi,omitempty"`
  1590. // EndTime: The ending time of the experiment (the time the status
  1591. // changed from RUNNING to ENDED). This field is present only if the
  1592. // experiment has ended. This field is read-only.
  1593. EndTime string `json:"endTime,omitempty"`
  1594. // EqualWeighting: Boolean specifying whether to distribute traffic
  1595. // evenly across all variations. If the value is False, content
  1596. // experiments follows the default behavior of adjusting traffic
  1597. // dynamically based on variation performance. Optional -- defaults to
  1598. // False. This field may not be changed for an experiment whose status
  1599. // is ENDED.
  1600. EqualWeighting bool `json:"equalWeighting,omitempty"`
  1601. // Id: Experiment ID. Required for patch and update. Disallowed for
  1602. // create.
  1603. Id string `json:"id,omitempty"`
  1604. // InternalWebPropertyId: Internal ID for the web property to which this
  1605. // experiment belongs. This field is read-only.
  1606. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  1607. // Kind: Resource type for an Analytics experiment. This field is
  1608. // read-only.
  1609. Kind string `json:"kind,omitempty"`
  1610. // MinimumExperimentLengthInDays: An integer number in [3, 90].
  1611. // Specifies the minimum length of the experiment. Can be changed for a
  1612. // running experiment. This field may not be changed for an experiments
  1613. // whose status is ENDED.
  1614. MinimumExperimentLengthInDays int64 `json:"minimumExperimentLengthInDays,omitempty"`
  1615. // Name: Experiment name. This field may not be changed for an
  1616. // experiment whose status is ENDED. This field is required when
  1617. // creating an experiment.
  1618. Name string `json:"name,omitempty"`
  1619. // ObjectiveMetric: The metric that the experiment is optimizing. Valid
  1620. // values: "ga:goal(n)Completions", "ga:adsenseAdsClicks",
  1621. // "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces",
  1622. // "ga:pageviews", "ga:sessionDuration", "ga:transactions",
  1623. // "ga:transactionRevenue". This field is required if status is
  1624. // "RUNNING" and servingFramework is one of "REDIRECT" or "API".
  1625. ObjectiveMetric string `json:"objectiveMetric,omitempty"`
  1626. // OptimizationType: Whether the objectiveMetric should be minimized or
  1627. // maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults
  1628. // to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be
  1629. // modified when status is "RUNNING" or "ENDED".
  1630. OptimizationType string `json:"optimizationType,omitempty"`
  1631. // ParentLink: Parent link for an experiment. Points to the view
  1632. // (profile) to which this experiment belongs.
  1633. ParentLink *ExperimentParentLink `json:"parentLink,omitempty"`
  1634. // ProfileId: View (Profile) ID to which this experiment belongs. This
  1635. // field is read-only.
  1636. ProfileId string `json:"profileId,omitempty"`
  1637. // ReasonExperimentEnded: Why the experiment ended. Possible values:
  1638. // "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED",
  1639. // "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED".
  1640. // "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no
  1641. // winner was projected to be found. If the experiment status is changed
  1642. // via the API to ENDED this field is set to STOPPED_BY_USER. This field
  1643. // is read-only.
  1644. ReasonExperimentEnded string `json:"reasonExperimentEnded,omitempty"`
  1645. // RewriteVariationUrlsAsOriginal: Boolean specifying whether variations
  1646. // URLS are rewritten to match those of the original. This field may not
  1647. // be changed for an experiments whose status is ENDED.
  1648. RewriteVariationUrlsAsOriginal bool `json:"rewriteVariationUrlsAsOriginal,omitempty"`
  1649. // SelfLink: Link for this experiment. This field is read-only.
  1650. SelfLink string `json:"selfLink,omitempty"`
  1651. // ServingFramework: The framework used to serve the experiment
  1652. // variations and evaluate the results. One of:
  1653. // - REDIRECT: Google Analytics redirects traffic to different variation
  1654. // pages, reports the chosen variation and evaluates the results.
  1655. // - API: Google Analytics chooses and reports the variation to serve
  1656. // and evaluates the results; the caller is responsible for serving the
  1657. // selected variation.
  1658. // - EXTERNAL: The variations will be served externally and the chosen
  1659. // variation reported to Google Analytics. The caller is responsible for
  1660. // serving the selected variation and evaluating the results.
  1661. ServingFramework string `json:"servingFramework,omitempty"`
  1662. // Snippet: The snippet of code to include on the control page(s). This
  1663. // field is read-only.
  1664. Snippet string `json:"snippet,omitempty"`
  1665. // StartTime: The starting time of the experiment (the time the status
  1666. // changed from READY_TO_RUN to RUNNING). This field is present only if
  1667. // the experiment has started. This field is read-only.
  1668. StartTime string `json:"startTime,omitempty"`
  1669. // Status: Experiment status. Possible values: "DRAFT", "READY_TO_RUN",
  1670. // "RUNNING", "ENDED". Experiments can be created in the "DRAFT",
  1671. // "READY_TO_RUN" or "RUNNING" state. This field is required when
  1672. // creating an experiment.
  1673. Status string `json:"status,omitempty"`
  1674. // TrafficCoverage: A floating-point number in (0, 1]. Specifies the
  1675. // fraction of the traffic that participates in the experiment. Can be
  1676. // changed for a running experiment. This field may not be changed for
  1677. // an experiments whose status is ENDED.
  1678. TrafficCoverage float64 `json:"trafficCoverage,omitempty"`
  1679. // Updated: Time the experiment was last modified. This field is
  1680. // read-only.
  1681. Updated string `json:"updated,omitempty"`
  1682. // Variations: Array of variations. The first variation in the array is
  1683. // the original. The number of variations may not change once an
  1684. // experiment is in the RUNNING state. At least two variations are
  1685. // required before status can be set to RUNNING.
  1686. Variations []*ExperimentVariations `json:"variations,omitempty"`
  1687. // WebPropertyId: Web property ID to which this experiment belongs. The
  1688. // web property ID is of the form UA-XXXXX-YY. This field is read-only.
  1689. WebPropertyId string `json:"webPropertyId,omitempty"`
  1690. // WinnerConfidenceLevel: A floating-point number in (0, 1). Specifies
  1691. // the necessary confidence level to choose a winner. This field may not
  1692. // be changed for an experiments whose status is ENDED.
  1693. WinnerConfidenceLevel float64 `json:"winnerConfidenceLevel,omitempty"`
  1694. // WinnerFound: Boolean specifying whether a winner has been found for
  1695. // this experiment. This field is read-only.
  1696. WinnerFound bool `json:"winnerFound,omitempty"`
  1697. // ServerResponse contains the HTTP response code and headers from the
  1698. // server.
  1699. googleapi.ServerResponse `json:"-"`
  1700. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1701. // unconditionally include in API requests. By default, fields with
  1702. // empty values are omitted from API requests. However, any non-pointer,
  1703. // non-interface field appearing in ForceSendFields will be sent to the
  1704. // server regardless of whether the field is empty or not. This may be
  1705. // used to include empty fields in Patch requests.
  1706. ForceSendFields []string `json:"-"`
  1707. // NullFields is a list of field names (e.g. "AccountId") to include in
  1708. // API requests with the JSON null value. By default, fields with empty
  1709. // values are omitted from API requests. However, any field with an
  1710. // empty value appearing in NullFields will be sent to the server as
  1711. // null. It is an error if a field in this list has a non-empty value.
  1712. // This may be used to include null fields in Patch requests.
  1713. NullFields []string `json:"-"`
  1714. }
  1715. func (s *Experiment) MarshalJSON() ([]byte, error) {
  1716. type NoMethod Experiment
  1717. raw := NoMethod(*s)
  1718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1719. }
  1720. func (s *Experiment) UnmarshalJSON(data []byte) error {
  1721. type NoMethod Experiment
  1722. var s1 struct {
  1723. TrafficCoverage gensupport.JSONFloat64 `json:"trafficCoverage"`
  1724. WinnerConfidenceLevel gensupport.JSONFloat64 `json:"winnerConfidenceLevel"`
  1725. *NoMethod
  1726. }
  1727. s1.NoMethod = (*NoMethod)(s)
  1728. if err := json.Unmarshal(data, &s1); err != nil {
  1729. return err
  1730. }
  1731. s.TrafficCoverage = float64(s1.TrafficCoverage)
  1732. s.WinnerConfidenceLevel = float64(s1.WinnerConfidenceLevel)
  1733. return nil
  1734. }
  1735. // ExperimentParentLink: Parent link for an experiment. Points to the
  1736. // view (profile) to which this experiment belongs.
  1737. type ExperimentParentLink struct {
  1738. // Href: Link to the view (profile) to which this experiment belongs.
  1739. // This field is read-only.
  1740. Href string `json:"href,omitempty"`
  1741. // Type: Value is "analytics#profile". This field is read-only.
  1742. Type string `json:"type,omitempty"`
  1743. // ForceSendFields is a list of field names (e.g. "Href") to
  1744. // unconditionally include in API requests. By default, fields with
  1745. // empty values are omitted from API requests. However, any non-pointer,
  1746. // non-interface field appearing in ForceSendFields will be sent to the
  1747. // server regardless of whether the field is empty or not. This may be
  1748. // used to include empty fields in Patch requests.
  1749. ForceSendFields []string `json:"-"`
  1750. // NullFields is a list of field names (e.g. "Href") to include in API
  1751. // requests with the JSON null value. By default, fields with empty
  1752. // values are omitted from API requests. However, any field with an
  1753. // empty value appearing in NullFields will be sent to the server as
  1754. // null. It is an error if a field in this list has a non-empty value.
  1755. // This may be used to include null fields in Patch requests.
  1756. NullFields []string `json:"-"`
  1757. }
  1758. func (s *ExperimentParentLink) MarshalJSON() ([]byte, error) {
  1759. type NoMethod ExperimentParentLink
  1760. raw := NoMethod(*s)
  1761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1762. }
  1763. type ExperimentVariations struct {
  1764. // Name: The name of the variation. This field is required when creating
  1765. // an experiment. This field may not be changed for an experiment whose
  1766. // status is ENDED.
  1767. Name string `json:"name,omitempty"`
  1768. // Status: Status of the variation. Possible values: "ACTIVE",
  1769. // "INACTIVE". INACTIVE variations are not served. This field may not be
  1770. // changed for an experiment whose status is ENDED.
  1771. Status string `json:"status,omitempty"`
  1772. // Url: The URL of the variation. This field may not be changed for an
  1773. // experiment whose status is RUNNING or ENDED.
  1774. Url string `json:"url,omitempty"`
  1775. // Weight: Weight that this variation should receive. Only present if
  1776. // the experiment is running. This field is read-only.
  1777. Weight float64 `json:"weight,omitempty"`
  1778. // Won: True if the experiment has ended and this variation performed
  1779. // (statistically) significantly better than the original. This field is
  1780. // read-only.
  1781. Won bool `json:"won,omitempty"`
  1782. // ForceSendFields is a list of field names (e.g. "Name") to
  1783. // unconditionally include in API requests. By default, fields with
  1784. // empty values are omitted from API requests. However, any non-pointer,
  1785. // non-interface field appearing in ForceSendFields will be sent to the
  1786. // server regardless of whether the field is empty or not. This may be
  1787. // used to include empty fields in Patch requests.
  1788. ForceSendFields []string `json:"-"`
  1789. // NullFields is a list of field names (e.g. "Name") to include in API
  1790. // requests with the JSON null value. By default, fields with empty
  1791. // values are omitted from API requests. However, any field with an
  1792. // empty value appearing in NullFields will be sent to the server as
  1793. // null. It is an error if a field in this list has a non-empty value.
  1794. // This may be used to include null fields in Patch requests.
  1795. NullFields []string `json:"-"`
  1796. }
  1797. func (s *ExperimentVariations) MarshalJSON() ([]byte, error) {
  1798. type NoMethod ExperimentVariations
  1799. raw := NoMethod(*s)
  1800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1801. }
  1802. func (s *ExperimentVariations) UnmarshalJSON(data []byte) error {
  1803. type NoMethod ExperimentVariations
  1804. var s1 struct {
  1805. Weight gensupport.JSONFloat64 `json:"weight"`
  1806. *NoMethod
  1807. }
  1808. s1.NoMethod = (*NoMethod)(s)
  1809. if err := json.Unmarshal(data, &s1); err != nil {
  1810. return err
  1811. }
  1812. s.Weight = float64(s1.Weight)
  1813. return nil
  1814. }
  1815. // Experiments: An experiment collection lists Analytics experiments to
  1816. // which the user has access. Each view (profile) can have a set of
  1817. // experiments. Each resource in the Experiment collection corresponds
  1818. // to a single Analytics experiment.
  1819. type Experiments struct {
  1820. // Items: A list of experiments.
  1821. Items []*Experiment `json:"items,omitempty"`
  1822. // ItemsPerPage: The maximum number of resources the response can
  1823. // contain, regardless of the actual number of resources returned. Its
  1824. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1825. // otherwise specified by the max-results query parameter.
  1826. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1827. // Kind: Collection type.
  1828. Kind string `json:"kind,omitempty"`
  1829. // NextLink: Link to next page for this experiment collection.
  1830. NextLink string `json:"nextLink,omitempty"`
  1831. // PreviousLink: Link to previous page for this experiment collection.
  1832. PreviousLink string `json:"previousLink,omitempty"`
  1833. // StartIndex: The starting index of the resources, which is 1 by
  1834. // default or otherwise specified by the start-index query parameter.
  1835. StartIndex int64 `json:"startIndex,omitempty"`
  1836. // TotalResults: The total number of results for the query, regardless
  1837. // of the number of resources in the result.
  1838. TotalResults int64 `json:"totalResults,omitempty"`
  1839. // Username: Email ID of the authenticated user
  1840. Username string `json:"username,omitempty"`
  1841. // ServerResponse contains the HTTP response code and headers from the
  1842. // server.
  1843. googleapi.ServerResponse `json:"-"`
  1844. // ForceSendFields is a list of field names (e.g. "Items") to
  1845. // unconditionally include in API requests. By default, fields with
  1846. // empty values are omitted from API requests. However, any non-pointer,
  1847. // non-interface field appearing in ForceSendFields will be sent to the
  1848. // server regardless of whether the field is empty or not. This may be
  1849. // used to include empty fields in Patch requests.
  1850. ForceSendFields []string `json:"-"`
  1851. // NullFields is a list of field names (e.g. "Items") to include in API
  1852. // requests with the JSON null value. By default, fields with empty
  1853. // values are omitted from API requests. However, any field with an
  1854. // empty value appearing in NullFields will be sent to the server as
  1855. // null. It is an error if a field in this list has a non-empty value.
  1856. // This may be used to include null fields in Patch requests.
  1857. NullFields []string `json:"-"`
  1858. }
  1859. func (s *Experiments) MarshalJSON() ([]byte, error) {
  1860. type NoMethod Experiments
  1861. raw := NoMethod(*s)
  1862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1863. }
  1864. // Filter: JSON template for an Analytics account filter.
  1865. type Filter struct {
  1866. // AccountId: Account ID to which this filter belongs.
  1867. AccountId string `json:"accountId,omitempty"`
  1868. // AdvancedDetails: Details for the filter of the type ADVANCED.
  1869. AdvancedDetails *FilterAdvancedDetails `json:"advancedDetails,omitempty"`
  1870. // Created: Time this filter was created.
  1871. Created string `json:"created,omitempty"`
  1872. // ExcludeDetails: Details for the filter of the type EXCLUDE.
  1873. ExcludeDetails *FilterExpression `json:"excludeDetails,omitempty"`
  1874. // Id: Filter ID.
  1875. Id string `json:"id,omitempty"`
  1876. // IncludeDetails: Details for the filter of the type INCLUDE.
  1877. IncludeDetails *FilterExpression `json:"includeDetails,omitempty"`
  1878. // Kind: Resource type for Analytics filter.
  1879. Kind string `json:"kind,omitempty"`
  1880. // LowercaseDetails: Details for the filter of the type LOWER.
  1881. LowercaseDetails *FilterLowercaseDetails `json:"lowercaseDetails,omitempty"`
  1882. // Name: Name of this filter.
  1883. Name string `json:"name,omitempty"`
  1884. // ParentLink: Parent link for this filter. Points to the account to
  1885. // which this filter belongs.
  1886. ParentLink *FilterParentLink `json:"parentLink,omitempty"`
  1887. // SearchAndReplaceDetails: Details for the filter of the type
  1888. // SEARCH_AND_REPLACE.
  1889. SearchAndReplaceDetails *FilterSearchAndReplaceDetails `json:"searchAndReplaceDetails,omitempty"`
  1890. // SelfLink: Link for this filter.
  1891. SelfLink string `json:"selfLink,omitempty"`
  1892. // Type: Type of this filter. Possible values are INCLUDE, EXCLUDE,
  1893. // LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED.
  1894. Type string `json:"type,omitempty"`
  1895. // Updated: Time this filter was last modified.
  1896. Updated string `json:"updated,omitempty"`
  1897. // UppercaseDetails: Details for the filter of the type UPPER.
  1898. UppercaseDetails *FilterUppercaseDetails `json:"uppercaseDetails,omitempty"`
  1899. // ServerResponse contains the HTTP response code and headers from the
  1900. // server.
  1901. googleapi.ServerResponse `json:"-"`
  1902. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1903. // unconditionally include in API requests. By default, fields with
  1904. // empty values are omitted from API requests. However, any non-pointer,
  1905. // non-interface field appearing in ForceSendFields will be sent to the
  1906. // server regardless of whether the field is empty or not. This may be
  1907. // used to include empty fields in Patch requests.
  1908. ForceSendFields []string `json:"-"`
  1909. // NullFields is a list of field names (e.g. "AccountId") to include in
  1910. // API requests with the JSON null value. By default, fields with empty
  1911. // values are omitted from API requests. However, any field with an
  1912. // empty value appearing in NullFields will be sent to the server as
  1913. // null. It is an error if a field in this list has a non-empty value.
  1914. // This may be used to include null fields in Patch requests.
  1915. NullFields []string `json:"-"`
  1916. }
  1917. func (s *Filter) MarshalJSON() ([]byte, error) {
  1918. type NoMethod Filter
  1919. raw := NoMethod(*s)
  1920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1921. }
  1922. // FilterAdvancedDetails: Details for the filter of the type ADVANCED.
  1923. type FilterAdvancedDetails struct {
  1924. // CaseSensitive: Indicates if the filter expressions are case
  1925. // sensitive.
  1926. CaseSensitive bool `json:"caseSensitive,omitempty"`
  1927. // ExtractA: Expression to extract from field A.
  1928. ExtractA string `json:"extractA,omitempty"`
  1929. // ExtractB: Expression to extract from field B.
  1930. ExtractB string `json:"extractB,omitempty"`
  1931. // FieldA: Field A.
  1932. FieldA string `json:"fieldA,omitempty"`
  1933. // FieldAIndex: The Index of the custom dimension. Required if field is
  1934. // a CUSTOM_DIMENSION.
  1935. FieldAIndex int64 `json:"fieldAIndex,omitempty"`
  1936. // FieldARequired: Indicates if field A is required to match.
  1937. FieldARequired bool `json:"fieldARequired,omitempty"`
  1938. // FieldB: Field B.
  1939. FieldB string `json:"fieldB,omitempty"`
  1940. // FieldBIndex: The Index of the custom dimension. Required if field is
  1941. // a CUSTOM_DIMENSION.
  1942. FieldBIndex int64 `json:"fieldBIndex,omitempty"`
  1943. // FieldBRequired: Indicates if field B is required to match.
  1944. FieldBRequired bool `json:"fieldBRequired,omitempty"`
  1945. // OutputConstructor: Expression used to construct the output value.
  1946. OutputConstructor string `json:"outputConstructor,omitempty"`
  1947. // OutputToField: Output field.
  1948. OutputToField string `json:"outputToField,omitempty"`
  1949. // OutputToFieldIndex: The Index of the custom dimension. Required if
  1950. // field is a CUSTOM_DIMENSION.
  1951. OutputToFieldIndex int64 `json:"outputToFieldIndex,omitempty"`
  1952. // OverrideOutputField: Indicates if the existing value of the output
  1953. // field, if any, should be overridden by the output expression.
  1954. OverrideOutputField bool `json:"overrideOutputField,omitempty"`
  1955. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  1956. // unconditionally include in API requests. By default, fields with
  1957. // empty values are omitted from API requests. However, any non-pointer,
  1958. // non-interface field appearing in ForceSendFields will be sent to the
  1959. // server regardless of whether the field is empty or not. This may be
  1960. // used to include empty fields in Patch requests.
  1961. ForceSendFields []string `json:"-"`
  1962. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  1963. // in API requests with the JSON null value. By default, fields with
  1964. // empty values are omitted from API requests. However, any field with
  1965. // an empty value appearing in NullFields will be sent to the server as
  1966. // null. It is an error if a field in this list has a non-empty value.
  1967. // This may be used to include null fields in Patch requests.
  1968. NullFields []string `json:"-"`
  1969. }
  1970. func (s *FilterAdvancedDetails) MarshalJSON() ([]byte, error) {
  1971. type NoMethod FilterAdvancedDetails
  1972. raw := NoMethod(*s)
  1973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1974. }
  1975. // FilterLowercaseDetails: Details for the filter of the type LOWER.
  1976. type FilterLowercaseDetails struct {
  1977. // Field: Field to use in the filter.
  1978. Field string `json:"field,omitempty"`
  1979. // FieldIndex: The Index of the custom dimension. Required if field is a
  1980. // CUSTOM_DIMENSION.
  1981. FieldIndex int64 `json:"fieldIndex,omitempty"`
  1982. // ForceSendFields is a list of field names (e.g. "Field") to
  1983. // unconditionally include in API requests. By default, fields with
  1984. // empty values are omitted from API requests. However, any non-pointer,
  1985. // non-interface field appearing in ForceSendFields will be sent to the
  1986. // server regardless of whether the field is empty or not. This may be
  1987. // used to include empty fields in Patch requests.
  1988. ForceSendFields []string `json:"-"`
  1989. // NullFields is a list of field names (e.g. "Field") to include in API
  1990. // requests with the JSON null value. By default, fields with empty
  1991. // values are omitted from API requests. However, any field with an
  1992. // empty value appearing in NullFields will be sent to the server as
  1993. // null. It is an error if a field in this list has a non-empty value.
  1994. // This may be used to include null fields in Patch requests.
  1995. NullFields []string `json:"-"`
  1996. }
  1997. func (s *FilterLowercaseDetails) MarshalJSON() ([]byte, error) {
  1998. type NoMethod FilterLowercaseDetails
  1999. raw := NoMethod(*s)
  2000. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2001. }
  2002. // FilterParentLink: Parent link for this filter. Points to the account
  2003. // to which this filter belongs.
  2004. type FilterParentLink struct {
  2005. // Href: Link to the account to which this filter belongs.
  2006. Href string `json:"href,omitempty"`
  2007. // Type: Value is "analytics#account".
  2008. Type string `json:"type,omitempty"`
  2009. // ForceSendFields is a list of field names (e.g. "Href") to
  2010. // unconditionally include in API requests. By default, fields with
  2011. // empty values are omitted from API requests. However, any non-pointer,
  2012. // non-interface field appearing in ForceSendFields will be sent to the
  2013. // server regardless of whether the field is empty or not. This may be
  2014. // used to include empty fields in Patch requests.
  2015. ForceSendFields []string `json:"-"`
  2016. // NullFields is a list of field names (e.g. "Href") to include in API
  2017. // requests with the JSON null value. By default, fields with empty
  2018. // values are omitted from API requests. However, any field with an
  2019. // empty value appearing in NullFields will be sent to the server as
  2020. // null. It is an error if a field in this list has a non-empty value.
  2021. // This may be used to include null fields in Patch requests.
  2022. NullFields []string `json:"-"`
  2023. }
  2024. func (s *FilterParentLink) MarshalJSON() ([]byte, error) {
  2025. type NoMethod FilterParentLink
  2026. raw := NoMethod(*s)
  2027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2028. }
  2029. // FilterSearchAndReplaceDetails: Details for the filter of the type
  2030. // SEARCH_AND_REPLACE.
  2031. type FilterSearchAndReplaceDetails struct {
  2032. // CaseSensitive: Determines if the filter is case sensitive.
  2033. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2034. // Field: Field to use in the filter.
  2035. Field string `json:"field,omitempty"`
  2036. // FieldIndex: The Index of the custom dimension. Required if field is a
  2037. // CUSTOM_DIMENSION.
  2038. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2039. // ReplaceString: Term to replace the search term with.
  2040. ReplaceString string `json:"replaceString,omitempty"`
  2041. // SearchString: Term to search.
  2042. SearchString string `json:"searchString,omitempty"`
  2043. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2044. // unconditionally include in API requests. By default, fields with
  2045. // empty values are omitted from API requests. However, any non-pointer,
  2046. // non-interface field appearing in ForceSendFields will be sent to the
  2047. // server regardless of whether the field is empty or not. This may be
  2048. // used to include empty fields in Patch requests.
  2049. ForceSendFields []string `json:"-"`
  2050. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2051. // in API requests with the JSON null value. By default, fields with
  2052. // empty values are omitted from API requests. However, any field with
  2053. // an empty value appearing in NullFields will be sent to the server as
  2054. // null. It is an error if a field in this list has a non-empty value.
  2055. // This may be used to include null fields in Patch requests.
  2056. NullFields []string `json:"-"`
  2057. }
  2058. func (s *FilterSearchAndReplaceDetails) MarshalJSON() ([]byte, error) {
  2059. type NoMethod FilterSearchAndReplaceDetails
  2060. raw := NoMethod(*s)
  2061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2062. }
  2063. // FilterUppercaseDetails: Details for the filter of the type UPPER.
  2064. type FilterUppercaseDetails struct {
  2065. // Field: Field to use in the filter.
  2066. Field string `json:"field,omitempty"`
  2067. // FieldIndex: The Index of the custom dimension. Required if field is a
  2068. // CUSTOM_DIMENSION.
  2069. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2070. // ForceSendFields is a list of field names (e.g. "Field") to
  2071. // unconditionally include in API requests. By default, fields with
  2072. // empty values are omitted from API requests. However, any non-pointer,
  2073. // non-interface field appearing in ForceSendFields will be sent to the
  2074. // server regardless of whether the field is empty or not. This may be
  2075. // used to include empty fields in Patch requests.
  2076. ForceSendFields []string `json:"-"`
  2077. // NullFields is a list of field names (e.g. "Field") to include in API
  2078. // requests with the JSON null value. By default, fields with empty
  2079. // values are omitted from API requests. However, any field with an
  2080. // empty value appearing in NullFields will be sent to the server as
  2081. // null. It is an error if a field in this list has a non-empty value.
  2082. // This may be used to include null fields in Patch requests.
  2083. NullFields []string `json:"-"`
  2084. }
  2085. func (s *FilterUppercaseDetails) MarshalJSON() ([]byte, error) {
  2086. type NoMethod FilterUppercaseDetails
  2087. raw := NoMethod(*s)
  2088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2089. }
  2090. // FilterExpression: JSON template for an Analytics filter expression.
  2091. type FilterExpression struct {
  2092. // CaseSensitive: Determines if the filter is case sensitive.
  2093. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2094. // ExpressionValue: Filter expression value
  2095. ExpressionValue string `json:"expressionValue,omitempty"`
  2096. // Field: Field to filter. Possible values:
  2097. // - Content and Traffic
  2098. // - PAGE_REQUEST_URI,
  2099. // - PAGE_HOSTNAME,
  2100. // - PAGE_TITLE,
  2101. // - REFERRAL,
  2102. // - COST_DATA_URI (Campaign target URL),
  2103. // - HIT_TYPE,
  2104. // - INTERNAL_SEARCH_TERM,
  2105. // - INTERNAL_SEARCH_TYPE,
  2106. // - SOURCE_PROPERTY_TRACKING_ID,
  2107. // - Campaign or AdGroup
  2108. // - CAMPAIGN_SOURCE,
  2109. // - CAMPAIGN_MEDIUM,
  2110. // - CAMPAIGN_NAME,
  2111. // - CAMPAIGN_AD_GROUP,
  2112. // - CAMPAIGN_TERM,
  2113. // - CAMPAIGN_CONTENT,
  2114. // - CAMPAIGN_CODE,
  2115. // - CAMPAIGN_REFERRAL_PATH,
  2116. // - E-Commerce
  2117. // - TRANSACTION_COUNTRY,
  2118. // - TRANSACTION_REGION,
  2119. // - TRANSACTION_CITY,
  2120. // - TRANSACTION_AFFILIATION (Store or order location),
  2121. // - ITEM_NAME,
  2122. // - ITEM_CODE,
  2123. // - ITEM_VARIATION,
  2124. // - TRANSACTION_ID,
  2125. // - TRANSACTION_CURRENCY_CODE,
  2126. // - PRODUCT_ACTION_TYPE,
  2127. // - Audience/Users
  2128. // - BROWSER,
  2129. // - BROWSER_VERSION,
  2130. // - BROWSER_SIZE,
  2131. // - PLATFORM,
  2132. // - PLATFORM_VERSION,
  2133. // - LANGUAGE,
  2134. // - SCREEN_RESOLUTION,
  2135. // - SCREEN_COLORS,
  2136. // - JAVA_ENABLED (Boolean Field),
  2137. // - FLASH_VERSION,
  2138. // - GEO_SPEED (Connection speed),
  2139. // - VISITOR_TYPE,
  2140. // - GEO_ORGANIZATION (ISP organization),
  2141. // - GEO_DOMAIN,
  2142. // - GEO_IP_ADDRESS,
  2143. // - GEO_IP_VERSION,
  2144. // - Location
  2145. // - GEO_COUNTRY,
  2146. // - GEO_REGION,
  2147. // - GEO_CITY,
  2148. // - Event
  2149. // - EVENT_CATEGORY,
  2150. // - EVENT_ACTION,
  2151. // - EVENT_LABEL,
  2152. // - Other
  2153. // - CUSTOM_FIELD_1,
  2154. // - CUSTOM_FIELD_2,
  2155. // - USER_DEFINED_VALUE,
  2156. // - Application
  2157. // - APP_ID,
  2158. // - APP_INSTALLER_ID,
  2159. // - APP_NAME,
  2160. // - APP_VERSION,
  2161. // - SCREEN,
  2162. // - IS_APP (Boolean Field),
  2163. // - IS_FATAL_EXCEPTION (Boolean Field),
  2164. // - EXCEPTION_DESCRIPTION,
  2165. // - Mobile device
  2166. // - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile),
  2167. //
  2168. // - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet),
  2169. //
  2170. // - DEVICE_CATEGORY,
  2171. // - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field),
  2172. // - MOBILE_HAS_NFC_SUPPORT (Boolean Field),
  2173. // - MOBILE_HAS_CELLULAR_RADIO (Boolean Field),
  2174. // - MOBILE_HAS_WIFI_SUPPORT (Boolean Field),
  2175. // - MOBILE_BRAND_NAME,
  2176. // - MOBILE_MODEL_NAME,
  2177. // - MOBILE_MARKETING_NAME,
  2178. // - MOBILE_POINTING_METHOD,
  2179. // - Social
  2180. // - SOCIAL_NETWORK,
  2181. // - SOCIAL_ACTION,
  2182. // - SOCIAL_ACTION_TARGET,
  2183. // - Custom dimension
  2184. // - CUSTOM_DIMENSION (See accompanying field index),
  2185. Field string `json:"field,omitempty"`
  2186. // FieldIndex: The Index of the custom dimension. Set only if the field
  2187. // is a is CUSTOM_DIMENSION.
  2188. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2189. // Kind: Kind value for filter expression
  2190. Kind string `json:"kind,omitempty"`
  2191. // MatchType: Match type for this filter. Possible values are
  2192. // BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN,
  2193. // GEO_IP_ADDRESS, PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use
  2194. // any match type; all other filters must use MATCHES.
  2195. MatchType string `json:"matchType,omitempty"`
  2196. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2197. // unconditionally include in API requests. By default, fields with
  2198. // empty values are omitted from API requests. However, any non-pointer,
  2199. // non-interface field appearing in ForceSendFields will be sent to the
  2200. // server regardless of whether the field is empty or not. This may be
  2201. // used to include empty fields in Patch requests.
  2202. ForceSendFields []string `json:"-"`
  2203. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2204. // in API requests with the JSON null value. By default, fields with
  2205. // empty values are omitted from API requests. However, any field with
  2206. // an empty value appearing in NullFields will be sent to the server as
  2207. // null. It is an error if a field in this list has a non-empty value.
  2208. // This may be used to include null fields in Patch requests.
  2209. NullFields []string `json:"-"`
  2210. }
  2211. func (s *FilterExpression) MarshalJSON() ([]byte, error) {
  2212. type NoMethod FilterExpression
  2213. raw := NoMethod(*s)
  2214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2215. }
  2216. // FilterRef: JSON template for a profile filter link.
  2217. type FilterRef struct {
  2218. // AccountId: Account ID to which this filter belongs.
  2219. AccountId string `json:"accountId,omitempty"`
  2220. // Href: Link for this filter.
  2221. Href string `json:"href,omitempty"`
  2222. // Id: Filter ID.
  2223. Id string `json:"id,omitempty"`
  2224. // Kind: Kind value for filter reference.
  2225. Kind string `json:"kind,omitempty"`
  2226. // Name: Name of this filter.
  2227. Name string `json:"name,omitempty"`
  2228. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2229. // unconditionally include in API requests. By default, fields with
  2230. // empty values are omitted from API requests. However, any non-pointer,
  2231. // non-interface field appearing in ForceSendFields will be sent to the
  2232. // server regardless of whether the field is empty or not. This may be
  2233. // used to include empty fields in Patch requests.
  2234. ForceSendFields []string `json:"-"`
  2235. // NullFields is a list of field names (e.g. "AccountId") to include in
  2236. // API requests with the JSON null value. By default, fields with empty
  2237. // values are omitted from API requests. However, any field with an
  2238. // empty value appearing in NullFields will be sent to the server as
  2239. // null. It is an error if a field in this list has a non-empty value.
  2240. // This may be used to include null fields in Patch requests.
  2241. NullFields []string `json:"-"`
  2242. }
  2243. func (s *FilterRef) MarshalJSON() ([]byte, error) {
  2244. type NoMethod FilterRef
  2245. raw := NoMethod(*s)
  2246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2247. }
  2248. // Filters: A filter collection lists filters created by users in an
  2249. // Analytics account. Each resource in the collection corresponds to a
  2250. // filter.
  2251. type Filters struct {
  2252. // Items: A list of filters.
  2253. Items []*Filter `json:"items,omitempty"`
  2254. // ItemsPerPage: The maximum number of resources the response can
  2255. // contain, regardless of the actual number of resources returned. Its
  2256. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  2257. // otherwise specified by the max-results query parameter.
  2258. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2259. // Kind: Collection type.
  2260. Kind string `json:"kind,omitempty"`
  2261. // NextLink: Link to next page for this filter collection.
  2262. NextLink string `json:"nextLink,omitempty"`
  2263. // PreviousLink: Link to previous page for this filter collection.
  2264. PreviousLink string `json:"previousLink,omitempty"`
  2265. // StartIndex: The starting index of the resources, which is 1 by
  2266. // default or otherwise specified by the start-index query parameter.
  2267. StartIndex int64 `json:"startIndex,omitempty"`
  2268. // TotalResults: The total number of results for the query, regardless
  2269. // of the number of results in the response.
  2270. TotalResults int64 `json:"totalResults,omitempty"`
  2271. // Username: Email ID of the authenticated user
  2272. Username string `json:"username,omitempty"`
  2273. // ServerResponse contains the HTTP response code and headers from the
  2274. // server.
  2275. googleapi.ServerResponse `json:"-"`
  2276. // ForceSendFields is a list of field names (e.g. "Items") to
  2277. // unconditionally include in API requests. By default, fields with
  2278. // empty values are omitted from API requests. However, any non-pointer,
  2279. // non-interface field appearing in ForceSendFields will be sent to the
  2280. // server regardless of whether the field is empty or not. This may be
  2281. // used to include empty fields in Patch requests.
  2282. ForceSendFields []string `json:"-"`
  2283. // NullFields is a list of field names (e.g. "Items") to include in API
  2284. // requests with the JSON null value. By default, fields with empty
  2285. // values are omitted from API requests. However, any field with an
  2286. // empty value appearing in NullFields will be sent to the server as
  2287. // null. It is an error if a field in this list has a non-empty value.
  2288. // This may be used to include null fields in Patch requests.
  2289. NullFields []string `json:"-"`
  2290. }
  2291. func (s *Filters) MarshalJSON() ([]byte, error) {
  2292. type NoMethod Filters
  2293. raw := NoMethod(*s)
  2294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2295. }
  2296. // GaData: Analytics data for a given view (profile).
  2297. type GaData struct {
  2298. // ColumnHeaders: Column headers that list dimension names followed by
  2299. // the metric names. The order of dimensions and metrics is same as
  2300. // specified in the request.
  2301. ColumnHeaders []*GaDataColumnHeaders `json:"columnHeaders,omitempty"`
  2302. // ContainsSampledData: Determines if Analytics data contains samples.
  2303. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  2304. // DataLastRefreshed: The last refreshed time in seconds for Analytics
  2305. // data.
  2306. DataLastRefreshed int64 `json:"dataLastRefreshed,omitempty,string"`
  2307. DataTable *GaDataDataTable `json:"dataTable,omitempty"`
  2308. // Id: Unique ID for this data response.
  2309. Id string `json:"id,omitempty"`
  2310. // ItemsPerPage: The maximum number of rows the response can contain,
  2311. // regardless of the actual number of rows returned. Its value ranges
  2312. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  2313. // specified by the max-results query parameter.
  2314. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2315. // Kind: Resource type.
  2316. Kind string `json:"kind,omitempty"`
  2317. // NextLink: Link to next page for this Analytics data query.
  2318. NextLink string `json:"nextLink,omitempty"`
  2319. // PreviousLink: Link to previous page for this Analytics data query.
  2320. PreviousLink string `json:"previousLink,omitempty"`
  2321. // ProfileInfo: Information for the view (profile), for which the
  2322. // Analytics data was requested.
  2323. ProfileInfo *GaDataProfileInfo `json:"profileInfo,omitempty"`
  2324. // Query: Analytics data request query parameters.
  2325. Query *GaDataQuery `json:"query,omitempty"`
  2326. // Rows: Analytics data rows, where each row contains a list of
  2327. // dimension values followed by the metric values. The order of
  2328. // dimensions and metrics is same as specified in the request.
  2329. Rows [][]string `json:"rows,omitempty"`
  2330. // SampleSize: The number of samples used to calculate the result.
  2331. SampleSize int64 `json:"sampleSize,omitempty,string"`
  2332. // SampleSpace: Total size of the sample space from which the samples
  2333. // were selected.
  2334. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  2335. // SelfLink: Link to this page.
  2336. SelfLink string `json:"selfLink,omitempty"`
  2337. // TotalResults: The total number of rows for the query, regardless of
  2338. // the number of rows in the response.
  2339. TotalResults int64 `json:"totalResults,omitempty"`
  2340. // TotalsForAllResults: Total values for the requested metrics over all
  2341. // the results, not just the results returned in this response. The
  2342. // order of the metric totals is same as the metric order specified in
  2343. // the request.
  2344. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  2345. // ServerResponse contains the HTTP response code and headers from the
  2346. // server.
  2347. googleapi.ServerResponse `json:"-"`
  2348. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  2349. // unconditionally include in API requests. By default, fields with
  2350. // empty values are omitted from API requests. However, any non-pointer,
  2351. // non-interface field appearing in ForceSendFields will be sent to the
  2352. // server regardless of whether the field is empty or not. This may be
  2353. // used to include empty fields in Patch requests.
  2354. ForceSendFields []string `json:"-"`
  2355. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  2356. // in API requests with the JSON null value. By default, fields with
  2357. // empty values are omitted from API requests. However, any field with
  2358. // an empty value appearing in NullFields will be sent to the server as
  2359. // null. It is an error if a field in this list has a non-empty value.
  2360. // This may be used to include null fields in Patch requests.
  2361. NullFields []string `json:"-"`
  2362. }
  2363. func (s *GaData) MarshalJSON() ([]byte, error) {
  2364. type NoMethod GaData
  2365. raw := NoMethod(*s)
  2366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2367. }
  2368. type GaDataColumnHeaders struct {
  2369. // ColumnType: Column Type. Either DIMENSION or METRIC.
  2370. ColumnType string `json:"columnType,omitempty"`
  2371. // DataType: Data type. Dimension column headers have only STRING as the
  2372. // data type. Metric column headers have data types for metric values
  2373. // such as INTEGER, DOUBLE, CURRENCY etc.
  2374. DataType string `json:"dataType,omitempty"`
  2375. // Name: Column name.
  2376. Name string `json:"name,omitempty"`
  2377. // ForceSendFields is a list of field names (e.g. "ColumnType") 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. "ColumnType") to include in
  2385. // API requests with the JSON null value. By default, fields with empty
  2386. // values are omitted from API requests. However, any field with an
  2387. // empty value appearing in NullFields will be sent to the server as
  2388. // null. It is an error if a field in this list has a non-empty value.
  2389. // This may be used to include null fields in Patch requests.
  2390. NullFields []string `json:"-"`
  2391. }
  2392. func (s *GaDataColumnHeaders) MarshalJSON() ([]byte, error) {
  2393. type NoMethod GaDataColumnHeaders
  2394. raw := NoMethod(*s)
  2395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2396. }
  2397. type GaDataDataTable struct {
  2398. Cols []*GaDataDataTableCols `json:"cols,omitempty"`
  2399. Rows []*GaDataDataTableRows `json:"rows,omitempty"`
  2400. // ForceSendFields is a list of field names (e.g. "Cols") to
  2401. // unconditionally include in API requests. By default, fields with
  2402. // empty values are omitted from API requests. However, any non-pointer,
  2403. // non-interface field appearing in ForceSendFields will be sent to the
  2404. // server regardless of whether the field is empty or not. This may be
  2405. // used to include empty fields in Patch requests.
  2406. ForceSendFields []string `json:"-"`
  2407. // NullFields is a list of field names (e.g. "Cols") to include in API
  2408. // requests with the JSON null value. By default, fields with empty
  2409. // values are omitted from API requests. However, any field with an
  2410. // empty value appearing in NullFields will be sent to the server as
  2411. // null. It is an error if a field in this list has a non-empty value.
  2412. // This may be used to include null fields in Patch requests.
  2413. NullFields []string `json:"-"`
  2414. }
  2415. func (s *GaDataDataTable) MarshalJSON() ([]byte, error) {
  2416. type NoMethod GaDataDataTable
  2417. raw := NoMethod(*s)
  2418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2419. }
  2420. type GaDataDataTableCols struct {
  2421. Id string `json:"id,omitempty"`
  2422. Label string `json:"label,omitempty"`
  2423. Type string `json:"type,omitempty"`
  2424. // ForceSendFields is a list of field names (e.g. "Id") to
  2425. // unconditionally include in API requests. By default, fields with
  2426. // empty values are omitted from API requests. However, any non-pointer,
  2427. // non-interface field appearing in ForceSendFields will be sent to the
  2428. // server regardless of whether the field is empty or not. This may be
  2429. // used to include empty fields in Patch requests.
  2430. ForceSendFields []string `json:"-"`
  2431. // NullFields is a list of field names (e.g. "Id") to include in API
  2432. // requests with the JSON null value. By default, fields with empty
  2433. // values are omitted from API requests. However, any field with an
  2434. // empty value appearing in NullFields will be sent to the server as
  2435. // null. It is an error if a field in this list has a non-empty value.
  2436. // This may be used to include null fields in Patch requests.
  2437. NullFields []string `json:"-"`
  2438. }
  2439. func (s *GaDataDataTableCols) MarshalJSON() ([]byte, error) {
  2440. type NoMethod GaDataDataTableCols
  2441. raw := NoMethod(*s)
  2442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2443. }
  2444. type GaDataDataTableRows struct {
  2445. C []*GaDataDataTableRowsC `json:"c,omitempty"`
  2446. // ForceSendFields is a list of field names (e.g. "C") to
  2447. // unconditionally include in API requests. By default, fields with
  2448. // empty values are omitted from API requests. However, any non-pointer,
  2449. // non-interface field appearing in ForceSendFields will be sent to the
  2450. // server regardless of whether the field is empty or not. This may be
  2451. // used to include empty fields in Patch requests.
  2452. ForceSendFields []string `json:"-"`
  2453. // NullFields is a list of field names (e.g. "C") to include in API
  2454. // requests with the JSON null value. By default, fields with empty
  2455. // values are omitted from API requests. However, any field with an
  2456. // empty value appearing in NullFields will be sent to the server as
  2457. // null. It is an error if a field in this list has a non-empty value.
  2458. // This may be used to include null fields in Patch requests.
  2459. NullFields []string `json:"-"`
  2460. }
  2461. func (s *GaDataDataTableRows) MarshalJSON() ([]byte, error) {
  2462. type NoMethod GaDataDataTableRows
  2463. raw := NoMethod(*s)
  2464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2465. }
  2466. type GaDataDataTableRowsC struct {
  2467. V string `json:"v,omitempty"`
  2468. // ForceSendFields is a list of field names (e.g. "V") to
  2469. // unconditionally include in API requests. By default, fields with
  2470. // empty values are omitted from API requests. However, any non-pointer,
  2471. // non-interface field appearing in ForceSendFields will be sent to the
  2472. // server regardless of whether the field is empty or not. This may be
  2473. // used to include empty fields in Patch requests.
  2474. ForceSendFields []string `json:"-"`
  2475. // NullFields is a list of field names (e.g. "V") to include in API
  2476. // requests with the JSON null value. By default, fields with empty
  2477. // values are omitted from API requests. However, any field with an
  2478. // empty value appearing in NullFields will be sent to the server as
  2479. // null. It is an error if a field in this list has a non-empty value.
  2480. // This may be used to include null fields in Patch requests.
  2481. NullFields []string `json:"-"`
  2482. }
  2483. func (s *GaDataDataTableRowsC) MarshalJSON() ([]byte, error) {
  2484. type NoMethod GaDataDataTableRowsC
  2485. raw := NoMethod(*s)
  2486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2487. }
  2488. // GaDataProfileInfo: Information for the view (profile), for which the
  2489. // Analytics data was requested.
  2490. type GaDataProfileInfo struct {
  2491. // AccountId: Account ID to which this view (profile) belongs.
  2492. AccountId string `json:"accountId,omitempty"`
  2493. // InternalWebPropertyId: Internal ID for the web property to which this
  2494. // view (profile) belongs.
  2495. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2496. // ProfileId: View (Profile) ID.
  2497. ProfileId string `json:"profileId,omitempty"`
  2498. // ProfileName: View (Profile) name.
  2499. ProfileName string `json:"profileName,omitempty"`
  2500. // TableId: Table ID for view (profile).
  2501. TableId string `json:"tableId,omitempty"`
  2502. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  2503. WebPropertyId string `json:"webPropertyId,omitempty"`
  2504. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2505. // unconditionally include in API requests. By default, fields with
  2506. // empty values are omitted from API requests. However, any non-pointer,
  2507. // non-interface field appearing in ForceSendFields will be sent to the
  2508. // server regardless of whether the field is empty or not. This may be
  2509. // used to include empty fields in Patch requests.
  2510. ForceSendFields []string `json:"-"`
  2511. // NullFields is a list of field names (e.g. "AccountId") to include in
  2512. // API requests with the JSON null value. By default, fields with empty
  2513. // values are omitted from API requests. However, any field with an
  2514. // empty value appearing in NullFields will be sent to the server as
  2515. // null. It is an error if a field in this list has a non-empty value.
  2516. // This may be used to include null fields in Patch requests.
  2517. NullFields []string `json:"-"`
  2518. }
  2519. func (s *GaDataProfileInfo) MarshalJSON() ([]byte, error) {
  2520. type NoMethod GaDataProfileInfo
  2521. raw := NoMethod(*s)
  2522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2523. }
  2524. // GaDataQuery: Analytics data request query parameters.
  2525. type GaDataQuery struct {
  2526. // Dimensions: List of analytics dimensions.
  2527. Dimensions string `json:"dimensions,omitempty"`
  2528. // EndDate: End date.
  2529. EndDate string `json:"end-date,omitempty"`
  2530. // Filters: Comma-separated list of dimension or metric filters.
  2531. Filters string `json:"filters,omitempty"`
  2532. // Ids: Unique table ID.
  2533. Ids string `json:"ids,omitempty"`
  2534. // MaxResults: Maximum results per page.
  2535. MaxResults int64 `json:"max-results,omitempty"`
  2536. // Metrics: List of analytics metrics.
  2537. Metrics []string `json:"metrics,omitempty"`
  2538. // SamplingLevel: Desired sampling level
  2539. SamplingLevel string `json:"samplingLevel,omitempty"`
  2540. // Segment: Analytics advanced segment.
  2541. Segment string `json:"segment,omitempty"`
  2542. // Sort: List of dimensions or metrics based on which Analytics data is
  2543. // sorted.
  2544. Sort []string `json:"sort,omitempty"`
  2545. // StartDate: Start date.
  2546. StartDate string `json:"start-date,omitempty"`
  2547. // StartIndex: Start index.
  2548. StartIndex int64 `json:"start-index,omitempty"`
  2549. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  2550. // unconditionally include in API requests. By default, fields with
  2551. // empty values are omitted from API requests. However, any non-pointer,
  2552. // non-interface field appearing in ForceSendFields will be sent to the
  2553. // server regardless of whether the field is empty or not. This may be
  2554. // used to include empty fields in Patch requests.
  2555. ForceSendFields []string `json:"-"`
  2556. // NullFields is a list of field names (e.g. "Dimensions") to include in
  2557. // API requests with the JSON null value. By default, fields with empty
  2558. // values are omitted from API requests. However, any field with an
  2559. // empty value appearing in NullFields will be sent to the server as
  2560. // null. It is an error if a field in this list has a non-empty value.
  2561. // This may be used to include null fields in Patch requests.
  2562. NullFields []string `json:"-"`
  2563. }
  2564. func (s *GaDataQuery) MarshalJSON() ([]byte, error) {
  2565. type NoMethod GaDataQuery
  2566. raw := NoMethod(*s)
  2567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2568. }
  2569. // Goal: JSON template for Analytics goal resource.
  2570. type Goal struct {
  2571. // AccountId: Account ID to which this goal belongs.
  2572. AccountId string `json:"accountId,omitempty"`
  2573. // Active: Determines whether this goal is active.
  2574. Active bool `json:"active,omitempty"`
  2575. // Created: Time this goal was created.
  2576. Created string `json:"created,omitempty"`
  2577. // EventDetails: Details for the goal of the type EVENT.
  2578. EventDetails *GoalEventDetails `json:"eventDetails,omitempty"`
  2579. // Id: Goal ID.
  2580. Id string `json:"id,omitempty"`
  2581. // InternalWebPropertyId: Internal ID for the web property to which this
  2582. // goal belongs.
  2583. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2584. // Kind: Resource type for an Analytics goal.
  2585. Kind string `json:"kind,omitempty"`
  2586. // Name: Goal name.
  2587. Name string `json:"name,omitempty"`
  2588. // ParentLink: Parent link for a goal. Points to the view (profile) to
  2589. // which this goal belongs.
  2590. ParentLink *GoalParentLink `json:"parentLink,omitempty"`
  2591. // ProfileId: View (Profile) ID to which this goal belongs.
  2592. ProfileId string `json:"profileId,omitempty"`
  2593. // SelfLink: Link for this goal.
  2594. SelfLink string `json:"selfLink,omitempty"`
  2595. // Type: Goal type. Possible values are URL_DESTINATION,
  2596. // VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT.
  2597. Type string `json:"type,omitempty"`
  2598. // Updated: Time this goal was last modified.
  2599. Updated string `json:"updated,omitempty"`
  2600. // UrlDestinationDetails: Details for the goal of the type
  2601. // URL_DESTINATION.
  2602. UrlDestinationDetails *GoalUrlDestinationDetails `json:"urlDestinationDetails,omitempty"`
  2603. // Value: Goal value.
  2604. Value float64 `json:"value,omitempty"`
  2605. // VisitNumPagesDetails: Details for the goal of the type
  2606. // VISIT_NUM_PAGES.
  2607. VisitNumPagesDetails *GoalVisitNumPagesDetails `json:"visitNumPagesDetails,omitempty"`
  2608. // VisitTimeOnSiteDetails: Details for the goal of the type
  2609. // VISIT_TIME_ON_SITE.
  2610. VisitTimeOnSiteDetails *GoalVisitTimeOnSiteDetails `json:"visitTimeOnSiteDetails,omitempty"`
  2611. // WebPropertyId: Web property ID to which this goal belongs. The web
  2612. // property ID is of the form UA-XXXXX-YY.
  2613. WebPropertyId string `json:"webPropertyId,omitempty"`
  2614. // ServerResponse contains the HTTP response code and headers from the
  2615. // server.
  2616. googleapi.ServerResponse `json:"-"`
  2617. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2618. // unconditionally include in API requests. By default, fields with
  2619. // empty values are omitted from API requests. However, any non-pointer,
  2620. // non-interface field appearing in ForceSendFields will be sent to the
  2621. // server regardless of whether the field is empty or not. This may be
  2622. // used to include empty fields in Patch requests.
  2623. ForceSendFields []string `json:"-"`
  2624. // NullFields is a list of field names (e.g. "AccountId") to include in
  2625. // API requests with the JSON null value. By default, fields with empty
  2626. // values are omitted from API requests. However, any field with an
  2627. // empty value appearing in NullFields will be sent to the server as
  2628. // null. It is an error if a field in this list has a non-empty value.
  2629. // This may be used to include null fields in Patch requests.
  2630. NullFields []string `json:"-"`
  2631. }
  2632. func (s *Goal) MarshalJSON() ([]byte, error) {
  2633. type NoMethod Goal
  2634. raw := NoMethod(*s)
  2635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2636. }
  2637. func (s *Goal) UnmarshalJSON(data []byte) error {
  2638. type NoMethod Goal
  2639. var s1 struct {
  2640. Value gensupport.JSONFloat64 `json:"value"`
  2641. *NoMethod
  2642. }
  2643. s1.NoMethod = (*NoMethod)(s)
  2644. if err := json.Unmarshal(data, &s1); err != nil {
  2645. return err
  2646. }
  2647. s.Value = float64(s1.Value)
  2648. return nil
  2649. }
  2650. // GoalEventDetails: Details for the goal of the type EVENT.
  2651. type GoalEventDetails struct {
  2652. // EventConditions: List of event conditions.
  2653. EventConditions []*GoalEventDetailsEventConditions `json:"eventConditions,omitempty"`
  2654. // UseEventValue: Determines if the event value should be used as the
  2655. // value for this goal.
  2656. UseEventValue bool `json:"useEventValue,omitempty"`
  2657. // ForceSendFields is a list of field names (e.g. "EventConditions") to
  2658. // unconditionally include in API requests. By default, fields with
  2659. // empty values are omitted from API requests. However, any non-pointer,
  2660. // non-interface field appearing in ForceSendFields will be sent to the
  2661. // server regardless of whether the field is empty or not. This may be
  2662. // used to include empty fields in Patch requests.
  2663. ForceSendFields []string `json:"-"`
  2664. // NullFields is a list of field names (e.g. "EventConditions") to
  2665. // include in API requests with the JSON null value. By default, fields
  2666. // with empty values are omitted from API requests. However, any field
  2667. // with an empty value appearing in NullFields will be sent to the
  2668. // server as null. It is an error if a field in this list has a
  2669. // non-empty value. This may be used to include null fields in Patch
  2670. // requests.
  2671. NullFields []string `json:"-"`
  2672. }
  2673. func (s *GoalEventDetails) MarshalJSON() ([]byte, error) {
  2674. type NoMethod GoalEventDetails
  2675. raw := NoMethod(*s)
  2676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2677. }
  2678. type GoalEventDetailsEventConditions struct {
  2679. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2680. // GREATER_THAN or EQUAL.
  2681. ComparisonType string `json:"comparisonType,omitempty"`
  2682. // ComparisonValue: Value used for this comparison.
  2683. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2684. // Expression: Expression used for this match.
  2685. Expression string `json:"expression,omitempty"`
  2686. // MatchType: Type of the match to be performed. Possible values are
  2687. // REGEXP, BEGINS_WITH, or EXACT.
  2688. MatchType string `json:"matchType,omitempty"`
  2689. // Type: Type of this event condition. Possible values are CATEGORY,
  2690. // ACTION, LABEL, or VALUE.
  2691. Type string `json:"type,omitempty"`
  2692. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2693. // unconditionally include in API requests. By default, fields with
  2694. // empty values are omitted from API requests. However, any non-pointer,
  2695. // non-interface field appearing in ForceSendFields will be sent to the
  2696. // server regardless of whether the field is empty or not. This may be
  2697. // used to include empty fields in Patch requests.
  2698. ForceSendFields []string `json:"-"`
  2699. // NullFields is a list of field names (e.g. "ComparisonType") to
  2700. // include in API requests with the JSON null value. By default, fields
  2701. // with empty values are omitted from API requests. However, any field
  2702. // with an empty value appearing in NullFields will be sent to the
  2703. // server as null. It is an error if a field in this list has a
  2704. // non-empty value. This may be used to include null fields in Patch
  2705. // requests.
  2706. NullFields []string `json:"-"`
  2707. }
  2708. func (s *GoalEventDetailsEventConditions) MarshalJSON() ([]byte, error) {
  2709. type NoMethod GoalEventDetailsEventConditions
  2710. raw := NoMethod(*s)
  2711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2712. }
  2713. // GoalParentLink: Parent link for a goal. Points to the view (profile)
  2714. // to which this goal belongs.
  2715. type GoalParentLink struct {
  2716. // Href: Link to the view (profile) to which this goal belongs.
  2717. Href string `json:"href,omitempty"`
  2718. // Type: Value is "analytics#profile".
  2719. Type string `json:"type,omitempty"`
  2720. // ForceSendFields is a list of field names (e.g. "Href") to
  2721. // unconditionally include in API requests. By default, fields with
  2722. // empty values are omitted from API requests. However, any non-pointer,
  2723. // non-interface field appearing in ForceSendFields will be sent to the
  2724. // server regardless of whether the field is empty or not. This may be
  2725. // used to include empty fields in Patch requests.
  2726. ForceSendFields []string `json:"-"`
  2727. // NullFields is a list of field names (e.g. "Href") to include in API
  2728. // requests with the JSON null value. By default, fields with empty
  2729. // values are omitted from API requests. However, any field with an
  2730. // empty value appearing in NullFields will be sent to the server as
  2731. // null. It is an error if a field in this list has a non-empty value.
  2732. // This may be used to include null fields in Patch requests.
  2733. NullFields []string `json:"-"`
  2734. }
  2735. func (s *GoalParentLink) MarshalJSON() ([]byte, error) {
  2736. type NoMethod GoalParentLink
  2737. raw := NoMethod(*s)
  2738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2739. }
  2740. // GoalUrlDestinationDetails: Details for the goal of the type
  2741. // URL_DESTINATION.
  2742. type GoalUrlDestinationDetails struct {
  2743. // CaseSensitive: Determines if the goal URL must exactly match the
  2744. // capitalization of visited URLs.
  2745. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2746. // FirstStepRequired: Determines if the first step in this goal is
  2747. // required.
  2748. FirstStepRequired bool `json:"firstStepRequired,omitempty"`
  2749. // MatchType: Match type for the goal URL. Possible values are HEAD,
  2750. // EXACT, or REGEX.
  2751. MatchType string `json:"matchType,omitempty"`
  2752. // Steps: List of steps configured for this goal funnel.
  2753. Steps []*GoalUrlDestinationDetailsSteps `json:"steps,omitempty"`
  2754. // Url: URL for this goal.
  2755. Url string `json:"url,omitempty"`
  2756. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2757. // unconditionally include in API requests. By default, fields with
  2758. // empty values are omitted from API requests. However, any non-pointer,
  2759. // non-interface field appearing in ForceSendFields will be sent to the
  2760. // server regardless of whether the field is empty or not. This may be
  2761. // used to include empty fields in Patch requests.
  2762. ForceSendFields []string `json:"-"`
  2763. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2764. // in API requests with the JSON null value. By default, fields with
  2765. // empty values are omitted from API requests. However, any field with
  2766. // an empty value appearing in NullFields will be sent to the server as
  2767. // null. It is an error if a field in this list has a non-empty value.
  2768. // This may be used to include null fields in Patch requests.
  2769. NullFields []string `json:"-"`
  2770. }
  2771. func (s *GoalUrlDestinationDetails) MarshalJSON() ([]byte, error) {
  2772. type NoMethod GoalUrlDestinationDetails
  2773. raw := NoMethod(*s)
  2774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2775. }
  2776. type GoalUrlDestinationDetailsSteps struct {
  2777. // Name: Step name.
  2778. Name string `json:"name,omitempty"`
  2779. // Number: Step number.
  2780. Number int64 `json:"number,omitempty"`
  2781. // Url: URL for this step.
  2782. Url string `json:"url,omitempty"`
  2783. // ForceSendFields is a list of field names (e.g. "Name") to
  2784. // unconditionally include in API requests. By default, fields with
  2785. // empty values are omitted from API requests. However, any non-pointer,
  2786. // non-interface field appearing in ForceSendFields will be sent to the
  2787. // server regardless of whether the field is empty or not. This may be
  2788. // used to include empty fields in Patch requests.
  2789. ForceSendFields []string `json:"-"`
  2790. // NullFields is a list of field names (e.g. "Name") to include in API
  2791. // requests with the JSON null value. By default, fields with empty
  2792. // values are omitted from API requests. However, any field with an
  2793. // empty value appearing in NullFields will be sent to the server as
  2794. // null. It is an error if a field in this list has a non-empty value.
  2795. // This may be used to include null fields in Patch requests.
  2796. NullFields []string `json:"-"`
  2797. }
  2798. func (s *GoalUrlDestinationDetailsSteps) MarshalJSON() ([]byte, error) {
  2799. type NoMethod GoalUrlDestinationDetailsSteps
  2800. raw := NoMethod(*s)
  2801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2802. }
  2803. // GoalVisitNumPagesDetails: Details for the goal of the type
  2804. // VISIT_NUM_PAGES.
  2805. type GoalVisitNumPagesDetails struct {
  2806. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2807. // GREATER_THAN, or EQUAL.
  2808. ComparisonType string `json:"comparisonType,omitempty"`
  2809. // ComparisonValue: Value used for this comparison.
  2810. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2811. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2812. // unconditionally include in API requests. By default, fields with
  2813. // empty values are omitted from API requests. However, any non-pointer,
  2814. // non-interface field appearing in ForceSendFields will be sent to the
  2815. // server regardless of whether the field is empty or not. This may be
  2816. // used to include empty fields in Patch requests.
  2817. ForceSendFields []string `json:"-"`
  2818. // NullFields is a list of field names (e.g. "ComparisonType") to
  2819. // include in API requests with the JSON null value. By default, fields
  2820. // with empty values are omitted from API requests. However, any field
  2821. // with an empty value appearing in NullFields will be sent to the
  2822. // server as null. It is an error if a field in this list has a
  2823. // non-empty value. This may be used to include null fields in Patch
  2824. // requests.
  2825. NullFields []string `json:"-"`
  2826. }
  2827. func (s *GoalVisitNumPagesDetails) MarshalJSON() ([]byte, error) {
  2828. type NoMethod GoalVisitNumPagesDetails
  2829. raw := NoMethod(*s)
  2830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2831. }
  2832. // GoalVisitTimeOnSiteDetails: Details for the goal of the type
  2833. // VISIT_TIME_ON_SITE.
  2834. type GoalVisitTimeOnSiteDetails struct {
  2835. // ComparisonType: Type of comparison. Possible values are LESS_THAN or
  2836. // GREATER_THAN.
  2837. ComparisonType string `json:"comparisonType,omitempty"`
  2838. // ComparisonValue: Value used for this comparison.
  2839. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2840. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2841. // unconditionally include in API requests. By default, fields with
  2842. // empty values are omitted from API requests. However, any non-pointer,
  2843. // non-interface field appearing in ForceSendFields will be sent to the
  2844. // server regardless of whether the field is empty or not. This may be
  2845. // used to include empty fields in Patch requests.
  2846. ForceSendFields []string `json:"-"`
  2847. // NullFields is a list of field names (e.g. "ComparisonType") to
  2848. // include in API requests with the JSON null value. By default, fields
  2849. // with empty values are omitted from API requests. However, any field
  2850. // with an empty value appearing in NullFields will be sent to the
  2851. // server as null. It is an error if a field in this list has a
  2852. // non-empty value. This may be used to include null fields in Patch
  2853. // requests.
  2854. NullFields []string `json:"-"`
  2855. }
  2856. func (s *GoalVisitTimeOnSiteDetails) MarshalJSON() ([]byte, error) {
  2857. type NoMethod GoalVisitTimeOnSiteDetails
  2858. raw := NoMethod(*s)
  2859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2860. }
  2861. // Goals: A goal collection lists Analytics goals to which the user has
  2862. // access. Each view (profile) can have a set of goals. Each resource in
  2863. // the Goal collection corresponds to a single Analytics goal.
  2864. type Goals struct {
  2865. // Items: A list of goals.
  2866. Items []*Goal `json:"items,omitempty"`
  2867. // ItemsPerPage: The maximum number of resources the response can
  2868. // contain, regardless of the actual number of resources returned. Its
  2869. // value ranges from 1 to 1000 with a value of 1000 by default, or
  2870. // otherwise specified by the max-results query parameter.
  2871. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2872. // Kind: Collection type.
  2873. Kind string `json:"kind,omitempty"`
  2874. // NextLink: Link to next page for this goal collection.
  2875. NextLink string `json:"nextLink,omitempty"`
  2876. // PreviousLink: Link to previous page for this goal collection.
  2877. PreviousLink string `json:"previousLink,omitempty"`
  2878. // StartIndex: The starting index of the resources, which is 1 by
  2879. // default or otherwise specified by the start-index query parameter.
  2880. StartIndex int64 `json:"startIndex,omitempty"`
  2881. // TotalResults: The total number of results for the query, regardless
  2882. // of the number of resources in the result.
  2883. TotalResults int64 `json:"totalResults,omitempty"`
  2884. // Username: Email ID of the authenticated user
  2885. Username string `json:"username,omitempty"`
  2886. // ServerResponse contains the HTTP response code and headers from the
  2887. // server.
  2888. googleapi.ServerResponse `json:"-"`
  2889. // ForceSendFields is a list of field names (e.g. "Items") to
  2890. // unconditionally include in API requests. By default, fields with
  2891. // empty values are omitted from API requests. However, any non-pointer,
  2892. // non-interface field appearing in ForceSendFields will be sent to the
  2893. // server regardless of whether the field is empty or not. This may be
  2894. // used to include empty fields in Patch requests.
  2895. ForceSendFields []string `json:"-"`
  2896. // NullFields is a list of field names (e.g. "Items") to include in API
  2897. // requests with the JSON null value. By default, fields with empty
  2898. // values are omitted from API requests. However, any field with an
  2899. // empty value appearing in NullFields will be sent to the server as
  2900. // null. It is an error if a field in this list has a non-empty value.
  2901. // This may be used to include null fields in Patch requests.
  2902. NullFields []string `json:"-"`
  2903. }
  2904. func (s *Goals) MarshalJSON() ([]byte, error) {
  2905. type NoMethod Goals
  2906. raw := NoMethod(*s)
  2907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2908. }
  2909. // HashClientIdRequest: JSON template for a hash Client Id request
  2910. // resource.
  2911. type HashClientIdRequest struct {
  2912. ClientId string `json:"clientId,omitempty"`
  2913. Kind string `json:"kind,omitempty"`
  2914. WebPropertyId string `json:"webPropertyId,omitempty"`
  2915. // ForceSendFields is a list of field names (e.g. "ClientId") 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. "ClientId") 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 *HashClientIdRequest) MarshalJSON() ([]byte, error) {
  2931. type NoMethod HashClientIdRequest
  2932. raw := NoMethod(*s)
  2933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2934. }
  2935. // HashClientIdResponse: JSON template for a hash Client Id response
  2936. // resource.
  2937. type HashClientIdResponse struct {
  2938. ClientId string `json:"clientId,omitempty"`
  2939. HashedClientId string `json:"hashedClientId,omitempty"`
  2940. Kind string `json:"kind,omitempty"`
  2941. WebPropertyId string `json:"webPropertyId,omitempty"`
  2942. // ServerResponse contains the HTTP response code and headers from the
  2943. // server.
  2944. googleapi.ServerResponse `json:"-"`
  2945. // ForceSendFields is a list of field names (e.g. "ClientId") to
  2946. // unconditionally include in API requests. By default, fields with
  2947. // empty values are omitted from API requests. However, any non-pointer,
  2948. // non-interface field appearing in ForceSendFields will be sent to the
  2949. // server regardless of whether the field is empty or not. This may be
  2950. // used to include empty fields in Patch requests.
  2951. ForceSendFields []string `json:"-"`
  2952. // NullFields is a list of field names (e.g. "ClientId") to include in
  2953. // API requests with the JSON null value. By default, fields with empty
  2954. // values are omitted from API requests. However, any field with an
  2955. // empty value appearing in NullFields will be sent to the server as
  2956. // null. It is an error if a field in this list has a non-empty value.
  2957. // This may be used to include null fields in Patch requests.
  2958. NullFields []string `json:"-"`
  2959. }
  2960. func (s *HashClientIdResponse) MarshalJSON() ([]byte, error) {
  2961. type NoMethod HashClientIdResponse
  2962. raw := NoMethod(*s)
  2963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2964. }
  2965. // IncludeConditions: JSON template for an Analytics Remarketing Include
  2966. // Conditions.
  2967. type IncludeConditions struct {
  2968. // DaysToLookBack: The look-back window lets you specify a time frame
  2969. // for evaluating the behavior that qualifies users for your audience.
  2970. // For example, if your filters include users from Central Asia, and
  2971. // Transactions Greater than 2, and you set the look-back window to 14
  2972. // days, then any user from Central Asia whose cumulative transactions
  2973. // exceed 2 during the last 14 days is added to the audience.
  2974. DaysToLookBack int64 `json:"daysToLookBack,omitempty"`
  2975. // IsSmartList: Boolean indicating whether this segment is a smart list.
  2976. // https://support.google.com/analytics/answer/4628577
  2977. IsSmartList bool `json:"isSmartList,omitempty"`
  2978. // Kind: Resource type for include conditions.
  2979. Kind string `json:"kind,omitempty"`
  2980. // MembershipDurationDays: Number of days (in the range 1 to 540) a user
  2981. // remains in the audience.
  2982. MembershipDurationDays int64 `json:"membershipDurationDays,omitempty"`
  2983. // Segment: The segment condition that will cause a user to be added to
  2984. // an audience.
  2985. Segment string `json:"segment,omitempty"`
  2986. // ForceSendFields is a list of field names (e.g. "DaysToLookBack") to
  2987. // unconditionally include in API requests. By default, fields with
  2988. // empty values are omitted from API requests. However, any non-pointer,
  2989. // non-interface field appearing in ForceSendFields will be sent to the
  2990. // server regardless of whether the field is empty or not. This may be
  2991. // used to include empty fields in Patch requests.
  2992. ForceSendFields []string `json:"-"`
  2993. // NullFields is a list of field names (e.g. "DaysToLookBack") to
  2994. // include in API requests with the JSON null value. By default, fields
  2995. // with empty values are omitted from API requests. However, any field
  2996. // with an empty value appearing in NullFields will be sent to the
  2997. // server as null. It is an error if a field in this list has a
  2998. // non-empty value. This may be used to include null fields in Patch
  2999. // requests.
  3000. NullFields []string `json:"-"`
  3001. }
  3002. func (s *IncludeConditions) MarshalJSON() ([]byte, error) {
  3003. type NoMethod IncludeConditions
  3004. raw := NoMethod(*s)
  3005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3006. }
  3007. // LinkedForeignAccount: JSON template for an Analytics Remarketing
  3008. // Audience Foreign Link.
  3009. type LinkedForeignAccount struct {
  3010. // AccountId: Account ID to which this linked foreign account belongs.
  3011. AccountId string `json:"accountId,omitempty"`
  3012. // EligibleForSearch: Boolean indicating whether this is eligible for
  3013. // search.
  3014. EligibleForSearch bool `json:"eligibleForSearch,omitempty"`
  3015. // Id: Entity ad account link ID.
  3016. Id string `json:"id,omitempty"`
  3017. // InternalWebPropertyId: Internal ID for the web property to which this
  3018. // linked foreign account belongs.
  3019. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3020. // Kind: Resource type for linked foreign account.
  3021. Kind string `json:"kind,omitempty"`
  3022. // LinkedAccountId: The foreign account ID. For example the an Google
  3023. // Ads `linkedAccountId` has the following format XXX-XXX-XXXX.
  3024. LinkedAccountId string `json:"linkedAccountId,omitempty"`
  3025. // RemarketingAudienceId: Remarketing audience ID to which this linked
  3026. // foreign account belongs.
  3027. RemarketingAudienceId string `json:"remarketingAudienceId,omitempty"`
  3028. // Status: The status of this foreign account link.
  3029. Status string `json:"status,omitempty"`
  3030. // Type: The type of the foreign account. For example, `ADWORDS_LINKS`,
  3031. // `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`.
  3032. Type string `json:"type,omitempty"`
  3033. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3034. // linked foreign account belongs.
  3035. WebPropertyId string `json:"webPropertyId,omitempty"`
  3036. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3037. // unconditionally include in API requests. By default, fields with
  3038. // empty values are omitted from API requests. However, any non-pointer,
  3039. // non-interface field appearing in ForceSendFields will be sent to the
  3040. // server regardless of whether the field is empty or not. This may be
  3041. // used to include empty fields in Patch requests.
  3042. ForceSendFields []string `json:"-"`
  3043. // NullFields is a list of field names (e.g. "AccountId") to include in
  3044. // API requests with the JSON null value. By default, fields with empty
  3045. // values are omitted from API requests. However, any field with an
  3046. // empty value appearing in NullFields will be sent to the server as
  3047. // null. It is an error if a field in this list has a non-empty value.
  3048. // This may be used to include null fields in Patch requests.
  3049. NullFields []string `json:"-"`
  3050. }
  3051. func (s *LinkedForeignAccount) MarshalJSON() ([]byte, error) {
  3052. type NoMethod LinkedForeignAccount
  3053. raw := NoMethod(*s)
  3054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3055. }
  3056. // McfData: Multi-Channel Funnels data for a given view (profile).
  3057. type McfData struct {
  3058. // ColumnHeaders: Column headers that list dimension names followed by
  3059. // the metric names. The order of dimensions and metrics is same as
  3060. // specified in the request.
  3061. ColumnHeaders []*McfDataColumnHeaders `json:"columnHeaders,omitempty"`
  3062. // ContainsSampledData: Determines if the Analytics data contains
  3063. // sampled data.
  3064. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  3065. // Id: Unique ID for this data response.
  3066. Id string `json:"id,omitempty"`
  3067. // ItemsPerPage: The maximum number of rows the response can contain,
  3068. // regardless of the actual number of rows returned. Its value ranges
  3069. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  3070. // specified by the max-results query parameter.
  3071. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3072. // Kind: Resource type.
  3073. Kind string `json:"kind,omitempty"`
  3074. // NextLink: Link to next page for this Analytics data query.
  3075. NextLink string `json:"nextLink,omitempty"`
  3076. // PreviousLink: Link to previous page for this Analytics data query.
  3077. PreviousLink string `json:"previousLink,omitempty"`
  3078. // ProfileInfo: Information for the view (profile), for which the
  3079. // Analytics data was requested.
  3080. ProfileInfo *McfDataProfileInfo `json:"profileInfo,omitempty"`
  3081. // Query: Analytics data request query parameters.
  3082. Query *McfDataQuery `json:"query,omitempty"`
  3083. // Rows: Analytics data rows, where each row contains a list of
  3084. // dimension values followed by the metric values. The order of
  3085. // dimensions and metrics is same as specified in the request.
  3086. Rows [][]*McfDataRowsItem `json:"rows,omitempty"`
  3087. // SampleSize: The number of samples used to calculate the result.
  3088. SampleSize int64 `json:"sampleSize,omitempty,string"`
  3089. // SampleSpace: Total size of the sample space from which the samples
  3090. // were selected.
  3091. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  3092. // SelfLink: Link to this page.
  3093. SelfLink string `json:"selfLink,omitempty"`
  3094. // TotalResults: The total number of rows for the query, regardless of
  3095. // the number of rows in the response.
  3096. TotalResults int64 `json:"totalResults,omitempty"`
  3097. // TotalsForAllResults: Total values for the requested metrics over all
  3098. // the results, not just the results returned in this response. The
  3099. // order of the metric totals is same as the metric order specified in
  3100. // the request.
  3101. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  3102. // ServerResponse contains the HTTP response code and headers from the
  3103. // server.
  3104. googleapi.ServerResponse `json:"-"`
  3105. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  3106. // unconditionally include in API requests. By default, fields with
  3107. // empty values are omitted from API requests. However, any non-pointer,
  3108. // non-interface field appearing in ForceSendFields will be sent to the
  3109. // server regardless of whether the field is empty or not. This may be
  3110. // used to include empty fields in Patch requests.
  3111. ForceSendFields []string `json:"-"`
  3112. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  3113. // in API requests with the JSON null value. By default, fields with
  3114. // empty values are omitted from API requests. However, any field with
  3115. // an empty value appearing in NullFields will be sent to the server as
  3116. // null. It is an error if a field in this list has a non-empty value.
  3117. // This may be used to include null fields in Patch requests.
  3118. NullFields []string `json:"-"`
  3119. }
  3120. func (s *McfData) MarshalJSON() ([]byte, error) {
  3121. type NoMethod McfData
  3122. raw := NoMethod(*s)
  3123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3124. }
  3125. type McfDataColumnHeaders struct {
  3126. // ColumnType: Column Type. Either DIMENSION or METRIC.
  3127. ColumnType string `json:"columnType,omitempty"`
  3128. // DataType: Data type. Dimension and metric values data types such as
  3129. // INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc.
  3130. DataType string `json:"dataType,omitempty"`
  3131. // Name: Column name.
  3132. Name string `json:"name,omitempty"`
  3133. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  3134. // unconditionally include in API requests. By default, fields with
  3135. // empty values are omitted from API requests. However, any non-pointer,
  3136. // non-interface field appearing in ForceSendFields will be sent to the
  3137. // server regardless of whether the field is empty or not. This may be
  3138. // used to include empty fields in Patch requests.
  3139. ForceSendFields []string `json:"-"`
  3140. // NullFields is a list of field names (e.g. "ColumnType") to include in
  3141. // API requests with the JSON null value. By default, fields with empty
  3142. // values are omitted from API requests. However, any field with an
  3143. // empty value appearing in NullFields will be sent to the server as
  3144. // null. It is an error if a field in this list has a non-empty value.
  3145. // This may be used to include null fields in Patch requests.
  3146. NullFields []string `json:"-"`
  3147. }
  3148. func (s *McfDataColumnHeaders) MarshalJSON() ([]byte, error) {
  3149. type NoMethod McfDataColumnHeaders
  3150. raw := NoMethod(*s)
  3151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3152. }
  3153. // McfDataProfileInfo: Information for the view (profile), for which the
  3154. // Analytics data was requested.
  3155. type McfDataProfileInfo struct {
  3156. // AccountId: Account ID to which this view (profile) belongs.
  3157. AccountId string `json:"accountId,omitempty"`
  3158. // InternalWebPropertyId: Internal ID for the web property to which this
  3159. // view (profile) belongs.
  3160. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3161. // ProfileId: View (Profile) ID.
  3162. ProfileId string `json:"profileId,omitempty"`
  3163. // ProfileName: View (Profile) name.
  3164. ProfileName string `json:"profileName,omitempty"`
  3165. // TableId: Table ID for view (profile).
  3166. TableId string `json:"tableId,omitempty"`
  3167. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  3168. WebPropertyId string `json:"webPropertyId,omitempty"`
  3169. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3170. // unconditionally include in API requests. By default, fields with
  3171. // empty values are omitted from API requests. However, any non-pointer,
  3172. // non-interface field appearing in ForceSendFields will be sent to the
  3173. // server regardless of whether the field is empty or not. This may be
  3174. // used to include empty fields in Patch requests.
  3175. ForceSendFields []string `json:"-"`
  3176. // NullFields is a list of field names (e.g. "AccountId") to include in
  3177. // API requests with the JSON null value. By default, fields with empty
  3178. // values are omitted from API requests. However, any field with an
  3179. // empty value appearing in NullFields will be sent to the server as
  3180. // null. It is an error if a field in this list has a non-empty value.
  3181. // This may be used to include null fields in Patch requests.
  3182. NullFields []string `json:"-"`
  3183. }
  3184. func (s *McfDataProfileInfo) MarshalJSON() ([]byte, error) {
  3185. type NoMethod McfDataProfileInfo
  3186. raw := NoMethod(*s)
  3187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3188. }
  3189. // McfDataQuery: Analytics data request query parameters.
  3190. type McfDataQuery struct {
  3191. // Dimensions: List of analytics dimensions.
  3192. Dimensions string `json:"dimensions,omitempty"`
  3193. // EndDate: End date.
  3194. EndDate string `json:"end-date,omitempty"`
  3195. // Filters: Comma-separated list of dimension or metric filters.
  3196. Filters string `json:"filters,omitempty"`
  3197. // Ids: Unique table ID.
  3198. Ids string `json:"ids,omitempty"`
  3199. // MaxResults: Maximum results per page.
  3200. MaxResults int64 `json:"max-results,omitempty"`
  3201. // Metrics: List of analytics metrics.
  3202. Metrics []string `json:"metrics,omitempty"`
  3203. // SamplingLevel: Desired sampling level
  3204. SamplingLevel string `json:"samplingLevel,omitempty"`
  3205. // Segment: Analytics advanced segment.
  3206. Segment string `json:"segment,omitempty"`
  3207. // Sort: List of dimensions or metrics based on which Analytics data is
  3208. // sorted.
  3209. Sort []string `json:"sort,omitempty"`
  3210. // StartDate: Start date.
  3211. StartDate string `json:"start-date,omitempty"`
  3212. // StartIndex: Start index.
  3213. StartIndex int64 `json:"start-index,omitempty"`
  3214. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  3215. // unconditionally include in API requests. By default, fields with
  3216. // empty values are omitted from API requests. However, any non-pointer,
  3217. // non-interface field appearing in ForceSendFields will be sent to the
  3218. // server regardless of whether the field is empty or not. This may be
  3219. // used to include empty fields in Patch requests.
  3220. ForceSendFields []string `json:"-"`
  3221. // NullFields is a list of field names (e.g. "Dimensions") to include in
  3222. // API requests with the JSON null value. By default, fields with empty
  3223. // values are omitted from API requests. However, any field with an
  3224. // empty value appearing in NullFields will be sent to the server as
  3225. // null. It is an error if a field in this list has a non-empty value.
  3226. // This may be used to include null fields in Patch requests.
  3227. NullFields []string `json:"-"`
  3228. }
  3229. func (s *McfDataQuery) MarshalJSON() ([]byte, error) {
  3230. type NoMethod McfDataQuery
  3231. raw := NoMethod(*s)
  3232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3233. }
  3234. // McfDataRowsItem: A union object representing a dimension or metric
  3235. // value. Only one of "primitiveValue" or "conversionPathValue"
  3236. // attribute will be populated.
  3237. type McfDataRowsItem struct {
  3238. // ConversionPathValue: A conversion path dimension value, containing a
  3239. // list of interactions with their attributes.
  3240. ConversionPathValue []*McfDataRowsItemConversionPathValue `json:"conversionPathValue,omitempty"`
  3241. // PrimitiveValue: A primitive dimension value. A primitive metric
  3242. // value.
  3243. PrimitiveValue string `json:"primitiveValue,omitempty"`
  3244. // ForceSendFields is a list of field names (e.g. "ConversionPathValue")
  3245. // to unconditionally include in API requests. By default, fields with
  3246. // empty values are omitted from API requests. However, any non-pointer,
  3247. // non-interface field appearing in ForceSendFields will be sent to the
  3248. // server regardless of whether the field is empty or not. This may be
  3249. // used to include empty fields in Patch requests.
  3250. ForceSendFields []string `json:"-"`
  3251. // NullFields is a list of field names (e.g. "ConversionPathValue") to
  3252. // include in API requests with the JSON null value. By default, fields
  3253. // with empty values are omitted from API requests. However, any field
  3254. // with an empty value appearing in NullFields will be sent to the
  3255. // server as null. It is an error if a field in this list has a
  3256. // non-empty value. This may be used to include null fields in Patch
  3257. // requests.
  3258. NullFields []string `json:"-"`
  3259. }
  3260. func (s *McfDataRowsItem) MarshalJSON() ([]byte, error) {
  3261. type NoMethod McfDataRowsItem
  3262. raw := NoMethod(*s)
  3263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3264. }
  3265. type McfDataRowsItemConversionPathValue struct {
  3266. // InteractionType: Type of an interaction on conversion path. Such as
  3267. // CLICK, IMPRESSION etc.
  3268. InteractionType string `json:"interactionType,omitempty"`
  3269. // NodeValue: Node value of an interaction on conversion path. Such as
  3270. // source, medium etc.
  3271. NodeValue string `json:"nodeValue,omitempty"`
  3272. // ForceSendFields is a list of field names (e.g. "InteractionType") to
  3273. // unconditionally include in API requests. By default, fields with
  3274. // empty values are omitted from API requests. However, any non-pointer,
  3275. // non-interface field appearing in ForceSendFields will be sent to the
  3276. // server regardless of whether the field is empty or not. This may be
  3277. // used to include empty fields in Patch requests.
  3278. ForceSendFields []string `json:"-"`
  3279. // NullFields is a list of field names (e.g. "InteractionType") to
  3280. // include in API requests with the JSON null value. By default, fields
  3281. // with empty values are omitted from API requests. However, any field
  3282. // with an empty value appearing in NullFields will be sent to the
  3283. // server as null. It is an error if a field in this list has a
  3284. // non-empty value. This may be used to include null fields in Patch
  3285. // requests.
  3286. NullFields []string `json:"-"`
  3287. }
  3288. func (s *McfDataRowsItemConversionPathValue) MarshalJSON() ([]byte, error) {
  3289. type NoMethod McfDataRowsItemConversionPathValue
  3290. raw := NoMethod(*s)
  3291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3292. }
  3293. // Profile: JSON template for an Analytics view (profile).
  3294. type Profile struct {
  3295. // AccountId: Account ID to which this view (profile) belongs.
  3296. AccountId string `json:"accountId,omitempty"`
  3297. // BotFilteringEnabled: Indicates whether bot filtering is enabled for
  3298. // this view (profile).
  3299. BotFilteringEnabled bool `json:"botFilteringEnabled,omitempty"`
  3300. // ChildLink: Child link for this view (profile). Points to the list of
  3301. // goals for this view (profile).
  3302. ChildLink *ProfileChildLink `json:"childLink,omitempty"`
  3303. // Created: Time this view (profile) was created.
  3304. Created string `json:"created,omitempty"`
  3305. // Currency: The currency type associated with this view (profile),
  3306. // defaults to USD. The supported values are:
  3307. // USD, JPY, EUR, GBP, AUD, KRW, BRL, CNY, DKK, RUB, SEK, NOK, PLN, TRY,
  3308. // TWD, HKD, THB, IDR, ARS, MXN, VND, PHP, INR, CHF, CAD, CZK, NZD, HUF,
  3309. // BGN, LTL, ZAR, UAH, AED, BOB, CLP, COP, EGP, HRK, ILS, MAD, MYR, PEN,
  3310. // PKR, RON, RSD, SAR, SGD, VEF, LVL
  3311. Currency string `json:"currency,omitempty"`
  3312. // DefaultPage: Default page for this view (profile).
  3313. DefaultPage string `json:"defaultPage,omitempty"`
  3314. // ECommerceTracking: Indicates whether ecommerce tracking is enabled
  3315. // for this view (profile).
  3316. ECommerceTracking bool `json:"eCommerceTracking,omitempty"`
  3317. // EnhancedECommerceTracking: Indicates whether enhanced ecommerce
  3318. // tracking is enabled for this view (profile). This property can only
  3319. // be enabled if ecommerce tracking is enabled.
  3320. EnhancedECommerceTracking bool `json:"enhancedECommerceTracking,omitempty"`
  3321. // ExcludeQueryParameters: The query parameters that are excluded from
  3322. // this view (profile).
  3323. ExcludeQueryParameters string `json:"excludeQueryParameters,omitempty"`
  3324. // Id: View (Profile) ID.
  3325. Id string `json:"id,omitempty"`
  3326. // InternalWebPropertyId: Internal ID for the web property to which this
  3327. // view (profile) belongs.
  3328. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3329. // Kind: Resource type for Analytics view (profile).
  3330. Kind string `json:"kind,omitempty"`
  3331. // Name: Name of this view (profile).
  3332. Name string `json:"name,omitempty"`
  3333. // ParentLink: Parent link for this view (profile). Points to the web
  3334. // property to which this view (profile) belongs.
  3335. ParentLink *ProfileParentLink `json:"parentLink,omitempty"`
  3336. // Permissions: Permissions the user has for this view (profile).
  3337. Permissions *ProfilePermissions `json:"permissions,omitempty"`
  3338. // SelfLink: Link for this view (profile).
  3339. SelfLink string `json:"selfLink,omitempty"`
  3340. // SiteSearchCategoryParameters: Site search category parameters for
  3341. // this view (profile).
  3342. SiteSearchCategoryParameters string `json:"siteSearchCategoryParameters,omitempty"`
  3343. // SiteSearchQueryParameters: The site search query parameters for this
  3344. // view (profile).
  3345. SiteSearchQueryParameters string `json:"siteSearchQueryParameters,omitempty"`
  3346. // Starred: Indicates whether this view (profile) is starred or not.
  3347. Starred bool `json:"starred,omitempty"`
  3348. // StripSiteSearchCategoryParameters: Whether or not Analytics will
  3349. // strip search category parameters from the URLs in your reports.
  3350. StripSiteSearchCategoryParameters bool `json:"stripSiteSearchCategoryParameters,omitempty"`
  3351. // StripSiteSearchQueryParameters: Whether or not Analytics will strip
  3352. // search query parameters from the URLs in your reports.
  3353. StripSiteSearchQueryParameters bool `json:"stripSiteSearchQueryParameters,omitempty"`
  3354. // Timezone: Time zone for which this view (profile) has been
  3355. // configured. Time zones are identified by strings from the TZ
  3356. // database.
  3357. Timezone string `json:"timezone,omitempty"`
  3358. // Type: View (Profile) type. Supported types: WEB or APP.
  3359. Type string `json:"type,omitempty"`
  3360. // Updated: Time this view (profile) was last modified.
  3361. Updated string `json:"updated,omitempty"`
  3362. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3363. // view (profile) belongs.
  3364. WebPropertyId string `json:"webPropertyId,omitempty"`
  3365. // WebsiteUrl: Website URL for this view (profile).
  3366. WebsiteUrl string `json:"websiteUrl,omitempty"`
  3367. // ServerResponse contains the HTTP response code and headers from the
  3368. // server.
  3369. googleapi.ServerResponse `json:"-"`
  3370. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3371. // unconditionally include in API requests. By default, fields with
  3372. // empty values are omitted from API requests. However, any non-pointer,
  3373. // non-interface field appearing in ForceSendFields will be sent to the
  3374. // server regardless of whether the field is empty or not. This may be
  3375. // used to include empty fields in Patch requests.
  3376. ForceSendFields []string `json:"-"`
  3377. // NullFields is a list of field names (e.g. "AccountId") to include in
  3378. // API requests with the JSON null value. By default, fields with empty
  3379. // values are omitted from API requests. However, any field with an
  3380. // empty value appearing in NullFields will be sent to the server as
  3381. // null. It is an error if a field in this list has a non-empty value.
  3382. // This may be used to include null fields in Patch requests.
  3383. NullFields []string `json:"-"`
  3384. }
  3385. func (s *Profile) MarshalJSON() ([]byte, error) {
  3386. type NoMethod Profile
  3387. raw := NoMethod(*s)
  3388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3389. }
  3390. // ProfileChildLink: Child link for this view (profile). Points to the
  3391. // list of goals for this view (profile).
  3392. type ProfileChildLink struct {
  3393. // Href: Link to the list of goals for this view (profile).
  3394. Href string `json:"href,omitempty"`
  3395. // Type: Value is "analytics#goals".
  3396. Type string `json:"type,omitempty"`
  3397. // ForceSendFields is a list of field names (e.g. "Href") to
  3398. // unconditionally include in API requests. By default, fields with
  3399. // empty values are omitted from API requests. However, any non-pointer,
  3400. // non-interface field appearing in ForceSendFields will be sent to the
  3401. // server regardless of whether the field is empty or not. This may be
  3402. // used to include empty fields in Patch requests.
  3403. ForceSendFields []string `json:"-"`
  3404. // NullFields is a list of field names (e.g. "Href") to include in API
  3405. // requests with the JSON null value. By default, fields with empty
  3406. // values are omitted from API requests. However, any field with an
  3407. // empty value appearing in NullFields will be sent to the server as
  3408. // null. It is an error if a field in this list has a non-empty value.
  3409. // This may be used to include null fields in Patch requests.
  3410. NullFields []string `json:"-"`
  3411. }
  3412. func (s *ProfileChildLink) MarshalJSON() ([]byte, error) {
  3413. type NoMethod ProfileChildLink
  3414. raw := NoMethod(*s)
  3415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3416. }
  3417. // ProfileParentLink: Parent link for this view (profile). Points to the
  3418. // web property to which this view (profile) belongs.
  3419. type ProfileParentLink struct {
  3420. // Href: Link to the web property to which this view (profile) belongs.
  3421. Href string `json:"href,omitempty"`
  3422. // Type: Value is "analytics#webproperty".
  3423. Type string `json:"type,omitempty"`
  3424. // ForceSendFields is a list of field names (e.g. "Href") to
  3425. // unconditionally include in API requests. By default, fields with
  3426. // empty values are omitted from API requests. However, any non-pointer,
  3427. // non-interface field appearing in ForceSendFields will be sent to the
  3428. // server regardless of whether the field is empty or not. This may be
  3429. // used to include empty fields in Patch requests.
  3430. ForceSendFields []string `json:"-"`
  3431. // NullFields is a list of field names (e.g. "Href") to include in API
  3432. // requests with the JSON null value. By default, fields with empty
  3433. // values are omitted from API requests. However, any field with an
  3434. // empty value appearing in NullFields will be sent to the server as
  3435. // null. It is an error if a field in this list has a non-empty value.
  3436. // This may be used to include null fields in Patch requests.
  3437. NullFields []string `json:"-"`
  3438. }
  3439. func (s *ProfileParentLink) MarshalJSON() ([]byte, error) {
  3440. type NoMethod ProfileParentLink
  3441. raw := NoMethod(*s)
  3442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3443. }
  3444. // ProfilePermissions: Permissions the user has for this view (profile).
  3445. type ProfilePermissions struct {
  3446. // Effective: All the permissions that the user has for this view
  3447. // (profile). These include any implied permissions (e.g., EDIT implies
  3448. // VIEW) or inherited permissions from the parent web property.
  3449. Effective []string `json:"effective,omitempty"`
  3450. // ForceSendFields is a list of field names (e.g. "Effective") to
  3451. // unconditionally include in API requests. By default, fields with
  3452. // empty values are omitted from API requests. However, any non-pointer,
  3453. // non-interface field appearing in ForceSendFields will be sent to the
  3454. // server regardless of whether the field is empty or not. This may be
  3455. // used to include empty fields in Patch requests.
  3456. ForceSendFields []string `json:"-"`
  3457. // NullFields is a list of field names (e.g. "Effective") to include in
  3458. // API requests with the JSON null value. By default, fields with empty
  3459. // values are omitted from API requests. However, any field with an
  3460. // empty value appearing in NullFields will be sent to the server as
  3461. // null. It is an error if a field in this list has a non-empty value.
  3462. // This may be used to include null fields in Patch requests.
  3463. NullFields []string `json:"-"`
  3464. }
  3465. func (s *ProfilePermissions) MarshalJSON() ([]byte, error) {
  3466. type NoMethod ProfilePermissions
  3467. raw := NoMethod(*s)
  3468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3469. }
  3470. // ProfileFilterLink: JSON template for an Analytics profile filter
  3471. // link.
  3472. type ProfileFilterLink struct {
  3473. // FilterRef: Filter for this link.
  3474. FilterRef *FilterRef `json:"filterRef,omitempty"`
  3475. // Id: Profile filter link ID.
  3476. Id string `json:"id,omitempty"`
  3477. // Kind: Resource type for Analytics filter.
  3478. Kind string `json:"kind,omitempty"`
  3479. // ProfileRef: View (Profile) for this link.
  3480. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  3481. // Rank: The rank of this profile filter link relative to the other
  3482. // filters linked to the same profile.
  3483. // For readonly (i.e., list and get) operations, the rank always starts
  3484. // at 1.
  3485. // For write (i.e., create, update, or delete) operations, you may
  3486. // specify a value between 0 and 255 inclusively, [0, 255]. In order to
  3487. // insert a link at the end of the list, either don't specify a rank or
  3488. // set a rank to a number greater than the largest rank in the list. In
  3489. // order to insert a link to the beginning of the list specify a rank
  3490. // that is less than or equal to 1. The new link will move all existing
  3491. // filters with the same or lower rank down the list. After the link is
  3492. // inserted/updated/deleted all profile filter links will be renumbered
  3493. // starting at 1.
  3494. Rank int64 `json:"rank,omitempty"`
  3495. // SelfLink: Link for this profile filter link.
  3496. SelfLink string `json:"selfLink,omitempty"`
  3497. // ServerResponse contains the HTTP response code and headers from the
  3498. // server.
  3499. googleapi.ServerResponse `json:"-"`
  3500. // ForceSendFields is a list of field names (e.g. "FilterRef") to
  3501. // unconditionally include in API requests. By default, fields with
  3502. // empty values are omitted from API requests. However, any non-pointer,
  3503. // non-interface field appearing in ForceSendFields will be sent to the
  3504. // server regardless of whether the field is empty or not. This may be
  3505. // used to include empty fields in Patch requests.
  3506. ForceSendFields []string `json:"-"`
  3507. // NullFields is a list of field names (e.g. "FilterRef") to include in
  3508. // API requests with the JSON null value. By default, fields with empty
  3509. // values are omitted from API requests. However, any field with an
  3510. // empty value appearing in NullFields will be sent to the server as
  3511. // null. It is an error if a field in this list has a non-empty value.
  3512. // This may be used to include null fields in Patch requests.
  3513. NullFields []string `json:"-"`
  3514. }
  3515. func (s *ProfileFilterLink) MarshalJSON() ([]byte, error) {
  3516. type NoMethod ProfileFilterLink
  3517. raw := NoMethod(*s)
  3518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3519. }
  3520. // ProfileFilterLinks: A profile filter link collection lists profile
  3521. // filter links between profiles and filters. Each resource in the
  3522. // collection corresponds to a profile filter link.
  3523. type ProfileFilterLinks struct {
  3524. // Items: A list of profile filter links.
  3525. Items []*ProfileFilterLink `json:"items,omitempty"`
  3526. // ItemsPerPage: The maximum number of resources the response can
  3527. // contain, regardless of the actual number of resources returned. Its
  3528. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  3529. // otherwise specified by the max-results query parameter.
  3530. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3531. // Kind: Collection type.
  3532. Kind string `json:"kind,omitempty"`
  3533. // NextLink: Link to next page for this profile filter link collection.
  3534. NextLink string `json:"nextLink,omitempty"`
  3535. // PreviousLink: Link to previous page for this profile filter link
  3536. // collection.
  3537. PreviousLink string `json:"previousLink,omitempty"`
  3538. // StartIndex: The starting index of the resources, which is 1 by
  3539. // default or otherwise specified by the start-index query parameter.
  3540. StartIndex int64 `json:"startIndex,omitempty"`
  3541. // TotalResults: The total number of results for the query, regardless
  3542. // of the number of results in the response.
  3543. TotalResults int64 `json:"totalResults,omitempty"`
  3544. // Username: Email ID of the authenticated user
  3545. Username string `json:"username,omitempty"`
  3546. // ServerResponse contains the HTTP response code and headers from the
  3547. // server.
  3548. googleapi.ServerResponse `json:"-"`
  3549. // ForceSendFields is a list of field names (e.g. "Items") to
  3550. // unconditionally include in API requests. By default, fields with
  3551. // empty values are omitted from API requests. However, any non-pointer,
  3552. // non-interface field appearing in ForceSendFields will be sent to the
  3553. // server regardless of whether the field is empty or not. This may be
  3554. // used to include empty fields in Patch requests.
  3555. ForceSendFields []string `json:"-"`
  3556. // NullFields is a list of field names (e.g. "Items") to include in API
  3557. // requests with the JSON null value. By default, fields with empty
  3558. // values are omitted from API requests. However, any field with an
  3559. // empty value appearing in NullFields will be sent to the server as
  3560. // null. It is an error if a field in this list has a non-empty value.
  3561. // This may be used to include null fields in Patch requests.
  3562. NullFields []string `json:"-"`
  3563. }
  3564. func (s *ProfileFilterLinks) MarshalJSON() ([]byte, error) {
  3565. type NoMethod ProfileFilterLinks
  3566. raw := NoMethod(*s)
  3567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3568. }
  3569. // ProfileRef: JSON template for a linked view (profile).
  3570. type ProfileRef struct {
  3571. // AccountId: Account ID to which this view (profile) belongs.
  3572. AccountId string `json:"accountId,omitempty"`
  3573. // Href: Link for this view (profile).
  3574. Href string `json:"href,omitempty"`
  3575. // Id: View (Profile) ID.
  3576. Id string `json:"id,omitempty"`
  3577. // InternalWebPropertyId: Internal ID for the web property to which this
  3578. // view (profile) belongs.
  3579. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3580. // Kind: Analytics view (profile) reference.
  3581. Kind string `json:"kind,omitempty"`
  3582. // Name: Name of this view (profile).
  3583. Name string `json:"name,omitempty"`
  3584. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3585. // view (profile) belongs.
  3586. WebPropertyId string `json:"webPropertyId,omitempty"`
  3587. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3588. // unconditionally include in API requests. By default, fields with
  3589. // empty values are omitted from API requests. However, any non-pointer,
  3590. // non-interface field appearing in ForceSendFields will be sent to the
  3591. // server regardless of whether the field is empty or not. This may be
  3592. // used to include empty fields in Patch requests.
  3593. ForceSendFields []string `json:"-"`
  3594. // NullFields is a list of field names (e.g. "AccountId") to include in
  3595. // API requests with the JSON null value. By default, fields with empty
  3596. // values are omitted from API requests. However, any field with an
  3597. // empty value appearing in NullFields will be sent to the server as
  3598. // null. It is an error if a field in this list has a non-empty value.
  3599. // This may be used to include null fields in Patch requests.
  3600. NullFields []string `json:"-"`
  3601. }
  3602. func (s *ProfileRef) MarshalJSON() ([]byte, error) {
  3603. type NoMethod ProfileRef
  3604. raw := NoMethod(*s)
  3605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3606. }
  3607. // ProfileSummary: JSON template for an Analytics ProfileSummary.
  3608. // ProfileSummary returns basic information (i.e., summary) for a
  3609. // profile.
  3610. type ProfileSummary struct {
  3611. // Id: View (profile) ID.
  3612. Id string `json:"id,omitempty"`
  3613. // Kind: Resource type for Analytics ProfileSummary.
  3614. Kind string `json:"kind,omitempty"`
  3615. // Name: View (profile) name.
  3616. Name string `json:"name,omitempty"`
  3617. // Starred: Indicates whether this view (profile) is starred or not.
  3618. Starred bool `json:"starred,omitempty"`
  3619. // Type: View (Profile) type. Supported types: WEB or APP.
  3620. Type string `json:"type,omitempty"`
  3621. // ForceSendFields is a list of field names (e.g. "Id") to
  3622. // unconditionally include in API requests. By default, fields with
  3623. // empty values are omitted from API requests. However, any non-pointer,
  3624. // non-interface field appearing in ForceSendFields will be sent to the
  3625. // server regardless of whether the field is empty or not. This may be
  3626. // used to include empty fields in Patch requests.
  3627. ForceSendFields []string `json:"-"`
  3628. // NullFields is a list of field names (e.g. "Id") to include in API
  3629. // requests with the JSON null value. By default, fields with empty
  3630. // values are omitted from API requests. However, any field with an
  3631. // empty value appearing in NullFields will be sent to the server as
  3632. // null. It is an error if a field in this list has a non-empty value.
  3633. // This may be used to include null fields in Patch requests.
  3634. NullFields []string `json:"-"`
  3635. }
  3636. func (s *ProfileSummary) MarshalJSON() ([]byte, error) {
  3637. type NoMethod ProfileSummary
  3638. raw := NoMethod(*s)
  3639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3640. }
  3641. // Profiles: A view (profile) collection lists Analytics views
  3642. // (profiles) to which the user has access. Each resource in the
  3643. // collection corresponds to a single Analytics view (profile).
  3644. type Profiles struct {
  3645. // Items: A list of views (profiles).
  3646. Items []*Profile `json:"items,omitempty"`
  3647. // ItemsPerPage: The maximum number of resources the response can
  3648. // contain, regardless of the actual number of resources returned. Its
  3649. // value ranges from 1 to 1000 with a value of 1000 by default, or
  3650. // otherwise specified by the max-results query parameter.
  3651. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3652. // Kind: Collection type.
  3653. Kind string `json:"kind,omitempty"`
  3654. // NextLink: Link to next page for this view (profile) collection.
  3655. NextLink string `json:"nextLink,omitempty"`
  3656. // PreviousLink: Link to previous page for this view (profile)
  3657. // collection.
  3658. PreviousLink string `json:"previousLink,omitempty"`
  3659. // StartIndex: The starting index of the resources, which is 1 by
  3660. // default or otherwise specified by the start-index query parameter.
  3661. StartIndex int64 `json:"startIndex,omitempty"`
  3662. // TotalResults: The total number of results for the query, regardless
  3663. // of the number of results in the response.
  3664. TotalResults int64 `json:"totalResults,omitempty"`
  3665. // Username: Email ID of the authenticated user
  3666. Username string `json:"username,omitempty"`
  3667. // ServerResponse contains the HTTP response code and headers from the
  3668. // server.
  3669. googleapi.ServerResponse `json:"-"`
  3670. // ForceSendFields is a list of field names (e.g. "Items") to
  3671. // unconditionally include in API requests. By default, fields with
  3672. // empty values are omitted from API requests. However, any non-pointer,
  3673. // non-interface field appearing in ForceSendFields will be sent to the
  3674. // server regardless of whether the field is empty or not. This may be
  3675. // used to include empty fields in Patch requests.
  3676. ForceSendFields []string `json:"-"`
  3677. // NullFields is a list of field names (e.g. "Items") to include in API
  3678. // requests with the JSON null value. By default, fields with empty
  3679. // values are omitted from API requests. However, any field with an
  3680. // empty value appearing in NullFields will be sent to the server as
  3681. // null. It is an error if a field in this list has a non-empty value.
  3682. // This may be used to include null fields in Patch requests.
  3683. NullFields []string `json:"-"`
  3684. }
  3685. func (s *Profiles) MarshalJSON() ([]byte, error) {
  3686. type NoMethod Profiles
  3687. raw := NoMethod(*s)
  3688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3689. }
  3690. // RealtimeData: Real time data for a given view (profile).
  3691. type RealtimeData struct {
  3692. // ColumnHeaders: Column headers that list dimension names followed by
  3693. // the metric names. The order of dimensions and metrics is same as
  3694. // specified in the request.
  3695. ColumnHeaders []*RealtimeDataColumnHeaders `json:"columnHeaders,omitempty"`
  3696. // Id: Unique ID for this data response.
  3697. Id string `json:"id,omitempty"`
  3698. // Kind: Resource type.
  3699. Kind string `json:"kind,omitempty"`
  3700. // ProfileInfo: Information for the view (profile), for which the real
  3701. // time data was requested.
  3702. ProfileInfo *RealtimeDataProfileInfo `json:"profileInfo,omitempty"`
  3703. // Query: Real time data request query parameters.
  3704. Query *RealtimeDataQuery `json:"query,omitempty"`
  3705. // Rows: Real time data rows, where each row contains a list of
  3706. // dimension values followed by the metric values. The order of
  3707. // dimensions and metrics is same as specified in the request.
  3708. Rows [][]string `json:"rows,omitempty"`
  3709. // SelfLink: Link to this page.
  3710. SelfLink string `json:"selfLink,omitempty"`
  3711. // TotalResults: The total number of rows for the query, regardless of
  3712. // the number of rows in the response.
  3713. TotalResults int64 `json:"totalResults,omitempty"`
  3714. // TotalsForAllResults: Total values for the requested metrics over all
  3715. // the results, not just the results returned in this response. The
  3716. // order of the metric totals is same as the metric order specified in
  3717. // the request.
  3718. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  3719. // ServerResponse contains the HTTP response code and headers from the
  3720. // server.
  3721. googleapi.ServerResponse `json:"-"`
  3722. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  3723. // unconditionally include in API requests. By default, fields with
  3724. // empty values are omitted from API requests. However, any non-pointer,
  3725. // non-interface field appearing in ForceSendFields will be sent to the
  3726. // server regardless of whether the field is empty or not. This may be
  3727. // used to include empty fields in Patch requests.
  3728. ForceSendFields []string `json:"-"`
  3729. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  3730. // in API requests with the JSON null value. By default, fields with
  3731. // empty values are omitted from API requests. However, any field with
  3732. // an empty value appearing in NullFields will be sent to the server as
  3733. // null. It is an error if a field in this list has a non-empty value.
  3734. // This may be used to include null fields in Patch requests.
  3735. NullFields []string `json:"-"`
  3736. }
  3737. func (s *RealtimeData) MarshalJSON() ([]byte, error) {
  3738. type NoMethod RealtimeData
  3739. raw := NoMethod(*s)
  3740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3741. }
  3742. type RealtimeDataColumnHeaders struct {
  3743. // ColumnType: Column Type. Either DIMENSION or METRIC.
  3744. ColumnType string `json:"columnType,omitempty"`
  3745. // DataType: Data type. Dimension column headers have only STRING as the
  3746. // data type. Metric column headers have data types for metric values
  3747. // such as INTEGER, DOUBLE, CURRENCY etc.
  3748. DataType string `json:"dataType,omitempty"`
  3749. // Name: Column name.
  3750. Name string `json:"name,omitempty"`
  3751. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  3752. // unconditionally include in API requests. By default, fields with
  3753. // empty values are omitted from API requests. However, any non-pointer,
  3754. // non-interface field appearing in ForceSendFields will be sent to the
  3755. // server regardless of whether the field is empty or not. This may be
  3756. // used to include empty fields in Patch requests.
  3757. ForceSendFields []string `json:"-"`
  3758. // NullFields is a list of field names (e.g. "ColumnType") to include in
  3759. // API requests with the JSON null value. By default, fields with empty
  3760. // values are omitted from API requests. However, any field with an
  3761. // empty value appearing in NullFields will be sent to the server as
  3762. // null. It is an error if a field in this list has a non-empty value.
  3763. // This may be used to include null fields in Patch requests.
  3764. NullFields []string `json:"-"`
  3765. }
  3766. func (s *RealtimeDataColumnHeaders) MarshalJSON() ([]byte, error) {
  3767. type NoMethod RealtimeDataColumnHeaders
  3768. raw := NoMethod(*s)
  3769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3770. }
  3771. // RealtimeDataProfileInfo: Information for the view (profile), for
  3772. // which the real time data was requested.
  3773. type RealtimeDataProfileInfo struct {
  3774. // AccountId: Account ID to which this view (profile) belongs.
  3775. AccountId string `json:"accountId,omitempty"`
  3776. // InternalWebPropertyId: Internal ID for the web property to which this
  3777. // view (profile) belongs.
  3778. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3779. // ProfileId: View (Profile) ID.
  3780. ProfileId string `json:"profileId,omitempty"`
  3781. // ProfileName: View (Profile) name.
  3782. ProfileName string `json:"profileName,omitempty"`
  3783. // TableId: Table ID for view (profile).
  3784. TableId string `json:"tableId,omitempty"`
  3785. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  3786. WebPropertyId string `json:"webPropertyId,omitempty"`
  3787. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3788. // unconditionally include in API requests. By default, fields with
  3789. // empty values are omitted from API requests. However, any non-pointer,
  3790. // non-interface field appearing in ForceSendFields will be sent to the
  3791. // server regardless of whether the field is empty or not. This may be
  3792. // used to include empty fields in Patch requests.
  3793. ForceSendFields []string `json:"-"`
  3794. // NullFields is a list of field names (e.g. "AccountId") to include in
  3795. // API requests with the JSON null value. By default, fields with empty
  3796. // values are omitted from API requests. However, any field with an
  3797. // empty value appearing in NullFields will be sent to the server as
  3798. // null. It is an error if a field in this list has a non-empty value.
  3799. // This may be used to include null fields in Patch requests.
  3800. NullFields []string `json:"-"`
  3801. }
  3802. func (s *RealtimeDataProfileInfo) MarshalJSON() ([]byte, error) {
  3803. type NoMethod RealtimeDataProfileInfo
  3804. raw := NoMethod(*s)
  3805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3806. }
  3807. // RealtimeDataQuery: Real time data request query parameters.
  3808. type RealtimeDataQuery struct {
  3809. // Dimensions: List of real time dimensions.
  3810. Dimensions string `json:"dimensions,omitempty"`
  3811. // Filters: Comma-separated list of dimension or metric filters.
  3812. Filters string `json:"filters,omitempty"`
  3813. // Ids: Unique table ID.
  3814. Ids string `json:"ids,omitempty"`
  3815. // MaxResults: Maximum results per page.
  3816. MaxResults int64 `json:"max-results,omitempty"`
  3817. // Metrics: List of real time metrics.
  3818. Metrics []string `json:"metrics,omitempty"`
  3819. // Sort: List of dimensions or metrics based on which real time data is
  3820. // sorted.
  3821. Sort []string `json:"sort,omitempty"`
  3822. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  3823. // unconditionally include in API requests. By default, fields with
  3824. // empty values are omitted from API requests. However, any non-pointer,
  3825. // non-interface field appearing in ForceSendFields will be sent to the
  3826. // server regardless of whether the field is empty or not. This may be
  3827. // used to include empty fields in Patch requests.
  3828. ForceSendFields []string `json:"-"`
  3829. // NullFields is a list of field names (e.g. "Dimensions") to include in
  3830. // API requests with the JSON null value. By default, fields with empty
  3831. // values are omitted from API requests. However, any field with an
  3832. // empty value appearing in NullFields will be sent to the server as
  3833. // null. It is an error if a field in this list has a non-empty value.
  3834. // This may be used to include null fields in Patch requests.
  3835. NullFields []string `json:"-"`
  3836. }
  3837. func (s *RealtimeDataQuery) MarshalJSON() ([]byte, error) {
  3838. type NoMethod RealtimeDataQuery
  3839. raw := NoMethod(*s)
  3840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3841. }
  3842. // RemarketingAudience: JSON template for an Analytics remarketing
  3843. // audience.
  3844. type RemarketingAudience struct {
  3845. // AccountId: Account ID to which this remarketing audience belongs.
  3846. AccountId string `json:"accountId,omitempty"`
  3847. // AudienceDefinition: The simple audience definition that will cause a
  3848. // user to be added to an audience.
  3849. AudienceDefinition *RemarketingAudienceAudienceDefinition `json:"audienceDefinition,omitempty"`
  3850. // AudienceType: The type of audience, either SIMPLE or STATE_BASED.
  3851. AudienceType string `json:"audienceType,omitempty"`
  3852. // Created: Time this remarketing audience was created.
  3853. Created string `json:"created,omitempty"`
  3854. // Description: The description of this remarketing audience.
  3855. Description string `json:"description,omitempty"`
  3856. // Id: Remarketing Audience ID.
  3857. Id string `json:"id,omitempty"`
  3858. // InternalWebPropertyId: Internal ID for the web property to which this
  3859. // remarketing audience belongs.
  3860. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3861. // Kind: Collection type.
  3862. Kind string `json:"kind,omitempty"`
  3863. // LinkedAdAccounts: The linked ad accounts associated with this
  3864. // remarketing audience. A remarketing audience can have only one
  3865. // linkedAdAccount currently.
  3866. LinkedAdAccounts []*LinkedForeignAccount `json:"linkedAdAccounts,omitempty"`
  3867. // LinkedViews: The views (profiles) that this remarketing audience is
  3868. // linked to.
  3869. LinkedViews []string `json:"linkedViews,omitempty"`
  3870. // Name: The name of this remarketing audience.
  3871. Name string `json:"name,omitempty"`
  3872. // StateBasedAudienceDefinition: A state based audience definition that
  3873. // will cause a user to be added or removed from an audience.
  3874. StateBasedAudienceDefinition *RemarketingAudienceStateBasedAudienceDefinition `json:"stateBasedAudienceDefinition,omitempty"`
  3875. // Updated: Time this remarketing audience was last modified.
  3876. Updated string `json:"updated,omitempty"`
  3877. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3878. // remarketing audience belongs.
  3879. WebPropertyId string `json:"webPropertyId,omitempty"`
  3880. // ServerResponse contains the HTTP response code and headers from the
  3881. // server.
  3882. googleapi.ServerResponse `json:"-"`
  3883. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3884. // unconditionally include in API requests. By default, fields with
  3885. // empty values are omitted from API requests. However, any non-pointer,
  3886. // non-interface field appearing in ForceSendFields will be sent to the
  3887. // server regardless of whether the field is empty or not. This may be
  3888. // used to include empty fields in Patch requests.
  3889. ForceSendFields []string `json:"-"`
  3890. // NullFields is a list of field names (e.g. "AccountId") to include in
  3891. // API requests with the JSON null value. By default, fields with empty
  3892. // values are omitted from API requests. However, any field with an
  3893. // empty value appearing in NullFields will be sent to the server as
  3894. // null. It is an error if a field in this list has a non-empty value.
  3895. // This may be used to include null fields in Patch requests.
  3896. NullFields []string `json:"-"`
  3897. }
  3898. func (s *RemarketingAudience) MarshalJSON() ([]byte, error) {
  3899. type NoMethod RemarketingAudience
  3900. raw := NoMethod(*s)
  3901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3902. }
  3903. // RemarketingAudienceAudienceDefinition: The simple audience definition
  3904. // that will cause a user to be added to an audience.
  3905. type RemarketingAudienceAudienceDefinition struct {
  3906. // IncludeConditions: Defines the conditions to include users to the
  3907. // audience.
  3908. IncludeConditions *IncludeConditions `json:"includeConditions,omitempty"`
  3909. // ForceSendFields is a list of field names (e.g. "IncludeConditions")
  3910. // to unconditionally include in API requests. By default, fields with
  3911. // empty values are omitted from API requests. However, any non-pointer,
  3912. // non-interface field appearing in ForceSendFields will be sent to the
  3913. // server regardless of whether the field is empty or not. This may be
  3914. // used to include empty fields in Patch requests.
  3915. ForceSendFields []string `json:"-"`
  3916. // NullFields is a list of field names (e.g. "IncludeConditions") to
  3917. // include in API requests with the JSON null value. By default, fields
  3918. // with empty values are omitted from API requests. However, any field
  3919. // with an empty value appearing in NullFields will be sent to the
  3920. // server as null. It is an error if a field in this list has a
  3921. // non-empty value. This may be used to include null fields in Patch
  3922. // requests.
  3923. NullFields []string `json:"-"`
  3924. }
  3925. func (s *RemarketingAudienceAudienceDefinition) MarshalJSON() ([]byte, error) {
  3926. type NoMethod RemarketingAudienceAudienceDefinition
  3927. raw := NoMethod(*s)
  3928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3929. }
  3930. // RemarketingAudienceStateBasedAudienceDefinition: A state based
  3931. // audience definition that will cause a user to be added or removed
  3932. // from an audience.
  3933. type RemarketingAudienceStateBasedAudienceDefinition struct {
  3934. // ExcludeConditions: Defines the conditions to exclude users from the
  3935. // audience.
  3936. ExcludeConditions *RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions `json:"excludeConditions,omitempty"`
  3937. // IncludeConditions: Defines the conditions to include users to the
  3938. // audience.
  3939. IncludeConditions *IncludeConditions `json:"includeConditions,omitempty"`
  3940. // ForceSendFields is a list of field names (e.g. "ExcludeConditions")
  3941. // to unconditionally include in API requests. By default, fields with
  3942. // empty values are omitted from API requests. However, any non-pointer,
  3943. // non-interface field appearing in ForceSendFields will be sent to the
  3944. // server regardless of whether the field is empty or not. This may be
  3945. // used to include empty fields in Patch requests.
  3946. ForceSendFields []string `json:"-"`
  3947. // NullFields is a list of field names (e.g. "ExcludeConditions") to
  3948. // include in API requests with the JSON null value. By default, fields
  3949. // with empty values are omitted from API requests. However, any field
  3950. // with an empty value appearing in NullFields will be sent to the
  3951. // server as null. It is an error if a field in this list has a
  3952. // non-empty value. This may be used to include null fields in Patch
  3953. // requests.
  3954. NullFields []string `json:"-"`
  3955. }
  3956. func (s *RemarketingAudienceStateBasedAudienceDefinition) MarshalJSON() ([]byte, error) {
  3957. type NoMethod RemarketingAudienceStateBasedAudienceDefinition
  3958. raw := NoMethod(*s)
  3959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3960. }
  3961. // RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions:
  3962. // Defines the conditions to exclude users from the audience.
  3963. type RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions struct {
  3964. // ExclusionDuration: Whether to make the exclusion TEMPORARY or
  3965. // PERMANENT.
  3966. ExclusionDuration string `json:"exclusionDuration,omitempty"`
  3967. // Segment: The segment condition that will cause a user to be removed
  3968. // from an audience.
  3969. Segment string `json:"segment,omitempty"`
  3970. // ForceSendFields is a list of field names (e.g. "ExclusionDuration")
  3971. // to unconditionally include in API requests. By default, fields with
  3972. // empty values are omitted from API requests. However, any non-pointer,
  3973. // non-interface field appearing in ForceSendFields will be sent to the
  3974. // server regardless of whether the field is empty or not. This may be
  3975. // used to include empty fields in Patch requests.
  3976. ForceSendFields []string `json:"-"`
  3977. // NullFields is a list of field names (e.g. "ExclusionDuration") to
  3978. // include in API requests with the JSON null value. By default, fields
  3979. // with empty values are omitted from API requests. However, any field
  3980. // with an empty value appearing in NullFields will be sent to the
  3981. // server as null. It is an error if a field in this list has a
  3982. // non-empty value. This may be used to include null fields in Patch
  3983. // requests.
  3984. NullFields []string `json:"-"`
  3985. }
  3986. func (s *RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions) MarshalJSON() ([]byte, error) {
  3987. type NoMethod RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions
  3988. raw := NoMethod(*s)
  3989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3990. }
  3991. // RemarketingAudiences: A remarketing audience collection lists
  3992. // Analytics remarketing audiences to which the user has access. Each
  3993. // resource in the collection corresponds to a single Analytics
  3994. // remarketing audience.
  3995. type RemarketingAudiences struct {
  3996. // Items: A list of remarketing audiences.
  3997. Items []*RemarketingAudience `json:"items,omitempty"`
  3998. // ItemsPerPage: The maximum number of resources the response can
  3999. // contain, regardless of the actual number of resources returned. Its
  4000. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4001. // otherwise specified by the max-results query parameter.
  4002. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4003. // Kind: Collection type.
  4004. Kind string `json:"kind,omitempty"`
  4005. // NextLink: Link to next page for this remarketing audience collection.
  4006. NextLink string `json:"nextLink,omitempty"`
  4007. // PreviousLink: Link to previous page for this view (profile)
  4008. // collection.
  4009. PreviousLink string `json:"previousLink,omitempty"`
  4010. // StartIndex: The starting index of the resources, which is 1 by
  4011. // default or otherwise specified by the start-index query parameter.
  4012. StartIndex int64 `json:"startIndex,omitempty"`
  4013. // TotalResults: The total number of results for the query, regardless
  4014. // of the number of results in the response.
  4015. TotalResults int64 `json:"totalResults,omitempty"`
  4016. // Username: Email ID of the authenticated user
  4017. Username string `json:"username,omitempty"`
  4018. // ServerResponse contains the HTTP response code and headers from the
  4019. // server.
  4020. googleapi.ServerResponse `json:"-"`
  4021. // ForceSendFields is a list of field names (e.g. "Items") to
  4022. // unconditionally include in API requests. By default, fields with
  4023. // empty values are omitted from API requests. However, any non-pointer,
  4024. // non-interface field appearing in ForceSendFields will be sent to the
  4025. // server regardless of whether the field is empty or not. This may be
  4026. // used to include empty fields in Patch requests.
  4027. ForceSendFields []string `json:"-"`
  4028. // NullFields is a list of field names (e.g. "Items") to include in API
  4029. // requests with the JSON null value. By default, fields with empty
  4030. // values are omitted from API requests. However, any field with an
  4031. // empty value appearing in NullFields will be sent to the server as
  4032. // null. It is an error if a field in this list has a non-empty value.
  4033. // This may be used to include null fields in Patch requests.
  4034. NullFields []string `json:"-"`
  4035. }
  4036. func (s *RemarketingAudiences) MarshalJSON() ([]byte, error) {
  4037. type NoMethod RemarketingAudiences
  4038. raw := NoMethod(*s)
  4039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4040. }
  4041. // Segment: JSON template for an Analytics segment.
  4042. type Segment struct {
  4043. // Created: Time the segment was created.
  4044. Created string `json:"created,omitempty"`
  4045. // Definition: Segment definition.
  4046. Definition string `json:"definition,omitempty"`
  4047. // Id: Segment ID.
  4048. Id string `json:"id,omitempty"`
  4049. // Kind: Resource type for Analytics segment.
  4050. Kind string `json:"kind,omitempty"`
  4051. // Name: Segment name.
  4052. Name string `json:"name,omitempty"`
  4053. // SegmentId: Segment ID. Can be used with the 'segment' parameter in
  4054. // Core Reporting API.
  4055. SegmentId string `json:"segmentId,omitempty"`
  4056. // SelfLink: Link for this segment.
  4057. SelfLink string `json:"selfLink,omitempty"`
  4058. // Type: Type for a segment. Possible values are "BUILT_IN" or "CUSTOM".
  4059. Type string `json:"type,omitempty"`
  4060. // Updated: Time the segment was last modified.
  4061. Updated string `json:"updated,omitempty"`
  4062. // ForceSendFields is a list of field names (e.g. "Created") to
  4063. // unconditionally include in API requests. By default, fields with
  4064. // empty values are omitted from API requests. However, any non-pointer,
  4065. // non-interface field appearing in ForceSendFields will be sent to the
  4066. // server regardless of whether the field is empty or not. This may be
  4067. // used to include empty fields in Patch requests.
  4068. ForceSendFields []string `json:"-"`
  4069. // NullFields is a list of field names (e.g. "Created") to include in
  4070. // API requests with the JSON null value. By default, fields with empty
  4071. // values are omitted from API requests. However, any field with an
  4072. // empty value appearing in NullFields will be sent to the server as
  4073. // null. It is an error if a field in this list has a non-empty value.
  4074. // This may be used to include null fields in Patch requests.
  4075. NullFields []string `json:"-"`
  4076. }
  4077. func (s *Segment) MarshalJSON() ([]byte, error) {
  4078. type NoMethod Segment
  4079. raw := NoMethod(*s)
  4080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4081. }
  4082. // Segments: An segment collection lists Analytics segments that the
  4083. // user has access to. Each resource in the collection corresponds to a
  4084. // single Analytics segment.
  4085. type Segments struct {
  4086. // Items: A list of segments.
  4087. Items []*Segment `json:"items,omitempty"`
  4088. // ItemsPerPage: The maximum number of resources the response can
  4089. // contain, regardless of the actual number of resources returned. Its
  4090. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4091. // otherwise specified by the max-results query parameter.
  4092. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4093. // Kind: Collection type for segments.
  4094. Kind string `json:"kind,omitempty"`
  4095. // NextLink: Link to next page for this segment collection.
  4096. NextLink string `json:"nextLink,omitempty"`
  4097. // PreviousLink: Link to previous page for this segment collection.
  4098. PreviousLink string `json:"previousLink,omitempty"`
  4099. // StartIndex: The starting index of the resources, which is 1 by
  4100. // default or otherwise specified by the start-index query parameter.
  4101. StartIndex int64 `json:"startIndex,omitempty"`
  4102. // TotalResults: The total number of results for the query, regardless
  4103. // of the number of results in the response.
  4104. TotalResults int64 `json:"totalResults,omitempty"`
  4105. // Username: Email ID of the authenticated user
  4106. Username string `json:"username,omitempty"`
  4107. // ServerResponse contains the HTTP response code and headers from the
  4108. // server.
  4109. googleapi.ServerResponse `json:"-"`
  4110. // ForceSendFields is a list of field names (e.g. "Items") to
  4111. // unconditionally include in API requests. By default, fields with
  4112. // empty values are omitted from API requests. However, any non-pointer,
  4113. // non-interface field appearing in ForceSendFields will be sent to the
  4114. // server regardless of whether the field is empty or not. This may be
  4115. // used to include empty fields in Patch requests.
  4116. ForceSendFields []string `json:"-"`
  4117. // NullFields is a list of field names (e.g. "Items") to include in API
  4118. // requests with the JSON null value. By default, fields with empty
  4119. // values are omitted from API requests. However, any field with an
  4120. // empty value appearing in NullFields will be sent to the server as
  4121. // null. It is an error if a field in this list has a non-empty value.
  4122. // This may be used to include null fields in Patch requests.
  4123. NullFields []string `json:"-"`
  4124. }
  4125. func (s *Segments) MarshalJSON() ([]byte, error) {
  4126. type NoMethod Segments
  4127. raw := NoMethod(*s)
  4128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4129. }
  4130. // UnsampledReport: JSON template for Analytics unsampled report
  4131. // resource.
  4132. type UnsampledReport struct {
  4133. // AccountId: Account ID to which this unsampled report belongs.
  4134. AccountId string `json:"accountId,omitempty"`
  4135. // CloudStorageDownloadDetails: Download details for a file stored in
  4136. // Google Cloud Storage.
  4137. CloudStorageDownloadDetails *UnsampledReportCloudStorageDownloadDetails `json:"cloudStorageDownloadDetails,omitempty"`
  4138. // Created: Time this unsampled report was created.
  4139. Created string `json:"created,omitempty"`
  4140. // Dimensions: The dimensions for the unsampled report.
  4141. Dimensions string `json:"dimensions,omitempty"`
  4142. // DownloadType: The type of download you need to use for the report
  4143. // data file. Possible values include `GOOGLE_DRIVE` and
  4144. // `GOOGLE_CLOUD_STORAGE`. If the value is `GOOGLE_DRIVE`, see the
  4145. // `driveDownloadDetails` field. If the value is `GOOGLE_CLOUD_STORAGE`,
  4146. // see the `cloudStorageDownloadDetails` field.
  4147. DownloadType string `json:"downloadType,omitempty"`
  4148. // DriveDownloadDetails: Download details for a file stored in Google
  4149. // Drive.
  4150. DriveDownloadDetails *UnsampledReportDriveDownloadDetails `json:"driveDownloadDetails,omitempty"`
  4151. // EndDate: The end date for the unsampled report.
  4152. EndDate string `json:"end-date,omitempty"`
  4153. // Filters: The filters for the unsampled report.
  4154. Filters string `json:"filters,omitempty"`
  4155. // Id: Unsampled report ID.
  4156. Id string `json:"id,omitempty"`
  4157. // Kind: Resource type for an Analytics unsampled report.
  4158. Kind string `json:"kind,omitempty"`
  4159. // Metrics: The metrics for the unsampled report.
  4160. Metrics string `json:"metrics,omitempty"`
  4161. // ProfileId: View (Profile) ID to which this unsampled report belongs.
  4162. ProfileId string `json:"profileId,omitempty"`
  4163. // Segment: The segment for the unsampled report.
  4164. Segment string `json:"segment,omitempty"`
  4165. // SelfLink: Link for this unsampled report.
  4166. SelfLink string `json:"selfLink,omitempty"`
  4167. // StartDate: The start date for the unsampled report.
  4168. StartDate string `json:"start-date,omitempty"`
  4169. // Status: Status of this unsampled report. Possible values are PENDING,
  4170. // COMPLETED, or FAILED.
  4171. Status string `json:"status,omitempty"`
  4172. // Title: Title of the unsampled report.
  4173. Title string `json:"title,omitempty"`
  4174. // Updated: Time this unsampled report was last modified.
  4175. Updated string `json:"updated,omitempty"`
  4176. // WebPropertyId: Web property ID to which this unsampled report
  4177. // belongs. The web property ID is of the form UA-XXXXX-YY.
  4178. WebPropertyId string `json:"webPropertyId,omitempty"`
  4179. // ServerResponse contains the HTTP response code and headers from the
  4180. // server.
  4181. googleapi.ServerResponse `json:"-"`
  4182. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4183. // unconditionally include in API requests. By default, fields with
  4184. // empty values are omitted from API requests. However, any non-pointer,
  4185. // non-interface field appearing in ForceSendFields will be sent to the
  4186. // server regardless of whether the field is empty or not. This may be
  4187. // used to include empty fields in Patch requests.
  4188. ForceSendFields []string `json:"-"`
  4189. // NullFields is a list of field names (e.g. "AccountId") to include in
  4190. // API requests with the JSON null value. By default, fields with empty
  4191. // values are omitted from API requests. However, any field with an
  4192. // empty value appearing in NullFields will be sent to the server as
  4193. // null. It is an error if a field in this list has a non-empty value.
  4194. // This may be used to include null fields in Patch requests.
  4195. NullFields []string `json:"-"`
  4196. }
  4197. func (s *UnsampledReport) MarshalJSON() ([]byte, error) {
  4198. type NoMethod UnsampledReport
  4199. raw := NoMethod(*s)
  4200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4201. }
  4202. // UnsampledReportCloudStorageDownloadDetails: Download details for a
  4203. // file stored in Google Cloud Storage.
  4204. type UnsampledReportCloudStorageDownloadDetails struct {
  4205. // BucketId: Id of the bucket the file object is stored in.
  4206. BucketId string `json:"bucketId,omitempty"`
  4207. // ObjectId: Id of the file object containing the report data.
  4208. ObjectId string `json:"objectId,omitempty"`
  4209. // ForceSendFields is a list of field names (e.g. "BucketId") to
  4210. // unconditionally include in API requests. By default, fields with
  4211. // empty values are omitted from API requests. However, any non-pointer,
  4212. // non-interface field appearing in ForceSendFields will be sent to the
  4213. // server regardless of whether the field is empty or not. This may be
  4214. // used to include empty fields in Patch requests.
  4215. ForceSendFields []string `json:"-"`
  4216. // NullFields is a list of field names (e.g. "BucketId") to include in
  4217. // API requests with the JSON null value. By default, fields with empty
  4218. // values are omitted from API requests. However, any field with an
  4219. // empty value appearing in NullFields will be sent to the server as
  4220. // null. It is an error if a field in this list has a non-empty value.
  4221. // This may be used to include null fields in Patch requests.
  4222. NullFields []string `json:"-"`
  4223. }
  4224. func (s *UnsampledReportCloudStorageDownloadDetails) MarshalJSON() ([]byte, error) {
  4225. type NoMethod UnsampledReportCloudStorageDownloadDetails
  4226. raw := NoMethod(*s)
  4227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4228. }
  4229. // UnsampledReportDriveDownloadDetails: Download details for a file
  4230. // stored in Google Drive.
  4231. type UnsampledReportDriveDownloadDetails struct {
  4232. // DocumentId: Id of the document/file containing the report data.
  4233. DocumentId string `json:"documentId,omitempty"`
  4234. // ForceSendFields is a list of field names (e.g. "DocumentId") to
  4235. // unconditionally include in API requests. By default, fields with
  4236. // empty values are omitted from API requests. However, any non-pointer,
  4237. // non-interface field appearing in ForceSendFields will be sent to the
  4238. // server regardless of whether the field is empty or not. This may be
  4239. // used to include empty fields in Patch requests.
  4240. ForceSendFields []string `json:"-"`
  4241. // NullFields is a list of field names (e.g. "DocumentId") to include in
  4242. // API requests with the JSON null value. By default, fields with empty
  4243. // values are omitted from API requests. However, any field with an
  4244. // empty value appearing in NullFields will be sent to the server as
  4245. // null. It is an error if a field in this list has a non-empty value.
  4246. // This may be used to include null fields in Patch requests.
  4247. NullFields []string `json:"-"`
  4248. }
  4249. func (s *UnsampledReportDriveDownloadDetails) MarshalJSON() ([]byte, error) {
  4250. type NoMethod UnsampledReportDriveDownloadDetails
  4251. raw := NoMethod(*s)
  4252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4253. }
  4254. // UnsampledReports: An unsampled report collection lists Analytics
  4255. // unsampled reports to which the user has access. Each view (profile)
  4256. // can have a set of unsampled reports. Each resource in the unsampled
  4257. // report collection corresponds to a single Analytics unsampled report.
  4258. type UnsampledReports struct {
  4259. // Items: A list of unsampled reports.
  4260. Items []*UnsampledReport `json:"items,omitempty"`
  4261. // ItemsPerPage: The maximum number of resources the response can
  4262. // contain, regardless of the actual number of resources returned. Its
  4263. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4264. // otherwise specified by the max-results query parameter.
  4265. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4266. // Kind: Collection type.
  4267. Kind string `json:"kind,omitempty"`
  4268. // NextLink: Link to next page for this unsampled report collection.
  4269. NextLink string `json:"nextLink,omitempty"`
  4270. // PreviousLink: Link to previous page for this unsampled report
  4271. // collection.
  4272. PreviousLink string `json:"previousLink,omitempty"`
  4273. // StartIndex: The starting index of the resources, which is 1 by
  4274. // default or otherwise specified by the start-index query parameter.
  4275. StartIndex int64 `json:"startIndex,omitempty"`
  4276. // TotalResults: The total number of results for the query, regardless
  4277. // of the number of resources in the result.
  4278. TotalResults int64 `json:"totalResults,omitempty"`
  4279. // Username: Email ID of the authenticated user
  4280. Username string `json:"username,omitempty"`
  4281. // ServerResponse contains the HTTP response code and headers from the
  4282. // server.
  4283. googleapi.ServerResponse `json:"-"`
  4284. // ForceSendFields is a list of field names (e.g. "Items") to
  4285. // unconditionally include in API requests. By default, fields with
  4286. // empty values are omitted from API requests. However, any non-pointer,
  4287. // non-interface field appearing in ForceSendFields will be sent to the
  4288. // server regardless of whether the field is empty or not. This may be
  4289. // used to include empty fields in Patch requests.
  4290. ForceSendFields []string `json:"-"`
  4291. // NullFields is a list of field names (e.g. "Items") to include in API
  4292. // requests with the JSON null value. By default, fields with empty
  4293. // values are omitted from API requests. However, any field with an
  4294. // empty value appearing in NullFields will be sent to the server as
  4295. // null. It is an error if a field in this list has a non-empty value.
  4296. // This may be used to include null fields in Patch requests.
  4297. NullFields []string `json:"-"`
  4298. }
  4299. func (s *UnsampledReports) MarshalJSON() ([]byte, error) {
  4300. type NoMethod UnsampledReports
  4301. raw := NoMethod(*s)
  4302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4303. }
  4304. // Upload: Metadata returned for an upload operation.
  4305. type Upload struct {
  4306. // AccountId: Account Id to which this upload belongs.
  4307. AccountId int64 `json:"accountId,omitempty,string"`
  4308. // CustomDataSourceId: Custom data source Id to which this data import
  4309. // belongs.
  4310. CustomDataSourceId string `json:"customDataSourceId,omitempty"`
  4311. // Errors: Data import errors collection.
  4312. Errors []string `json:"errors,omitempty"`
  4313. // Id: A unique ID for this upload.
  4314. Id string `json:"id,omitempty"`
  4315. // Kind: Resource type for Analytics upload.
  4316. Kind string `json:"kind,omitempty"`
  4317. // Status: Upload status. Possible values: PENDING, COMPLETED, FAILED,
  4318. // DELETING, DELETED.
  4319. Status string `json:"status,omitempty"`
  4320. // UploadTime: Time this file is uploaded.
  4321. UploadTime string `json:"uploadTime,omitempty"`
  4322. // ServerResponse contains the HTTP response code and headers from the
  4323. // server.
  4324. googleapi.ServerResponse `json:"-"`
  4325. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4326. // unconditionally include in API requests. By default, fields with
  4327. // empty values are omitted from API requests. However, any non-pointer,
  4328. // non-interface field appearing in ForceSendFields will be sent to the
  4329. // server regardless of whether the field is empty or not. This may be
  4330. // used to include empty fields in Patch requests.
  4331. ForceSendFields []string `json:"-"`
  4332. // NullFields is a list of field names (e.g. "AccountId") to include in
  4333. // API requests with the JSON null value. By default, fields with empty
  4334. // values are omitted from API requests. However, any field with an
  4335. // empty value appearing in NullFields will be sent to the server as
  4336. // null. It is an error if a field in this list has a non-empty value.
  4337. // This may be used to include null fields in Patch requests.
  4338. NullFields []string `json:"-"`
  4339. }
  4340. func (s *Upload) MarshalJSON() ([]byte, error) {
  4341. type NoMethod Upload
  4342. raw := NoMethod(*s)
  4343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4344. }
  4345. // Uploads: Upload collection lists Analytics uploads to which the user
  4346. // has access. Each custom data source can have a set of uploads. Each
  4347. // resource in the upload collection corresponds to a single Analytics
  4348. // data upload.
  4349. type Uploads struct {
  4350. // Items: A list of uploads.
  4351. Items []*Upload `json:"items,omitempty"`
  4352. // ItemsPerPage: The maximum number of resources the response can
  4353. // contain, regardless of the actual number of resources returned. Its
  4354. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4355. // otherwise specified by the max-results query parameter.
  4356. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4357. // Kind: Collection type.
  4358. Kind string `json:"kind,omitempty"`
  4359. // NextLink: Link to next page for this upload collection.
  4360. NextLink string `json:"nextLink,omitempty"`
  4361. // PreviousLink: Link to previous page for this upload collection.
  4362. PreviousLink string `json:"previousLink,omitempty"`
  4363. // StartIndex: The starting index of the resources, which is 1 by
  4364. // default or otherwise specified by the start-index query parameter.
  4365. StartIndex int64 `json:"startIndex,omitempty"`
  4366. // TotalResults: The total number of results for the query, regardless
  4367. // of the number of resources in the result.
  4368. TotalResults int64 `json:"totalResults,omitempty"`
  4369. // ServerResponse contains the HTTP response code and headers from the
  4370. // server.
  4371. googleapi.ServerResponse `json:"-"`
  4372. // ForceSendFields is a list of field names (e.g. "Items") to
  4373. // unconditionally include in API requests. By default, fields with
  4374. // empty values are omitted from API requests. However, any non-pointer,
  4375. // non-interface field appearing in ForceSendFields will be sent to the
  4376. // server regardless of whether the field is empty or not. This may be
  4377. // used to include empty fields in Patch requests.
  4378. ForceSendFields []string `json:"-"`
  4379. // NullFields is a list of field names (e.g. "Items") to include in API
  4380. // requests with the JSON null value. By default, fields with empty
  4381. // values are omitted from API requests. However, any field with an
  4382. // empty value appearing in NullFields will be sent to the server as
  4383. // null. It is an error if a field in this list has a non-empty value.
  4384. // This may be used to include null fields in Patch requests.
  4385. NullFields []string `json:"-"`
  4386. }
  4387. func (s *Uploads) MarshalJSON() ([]byte, error) {
  4388. type NoMethod Uploads
  4389. raw := NoMethod(*s)
  4390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4391. }
  4392. // UserDeletionRequest: JSON template for a user deletion request
  4393. // resource.
  4394. type UserDeletionRequest struct {
  4395. // DeletionRequestTime: This marks the point in time for which all user
  4396. // data before should be deleted
  4397. DeletionRequestTime string `json:"deletionRequestTime,omitempty"`
  4398. // FirebaseProjectId: Firebase Project Id
  4399. FirebaseProjectId string `json:"firebaseProjectId,omitempty"`
  4400. // Id: User ID.
  4401. Id *UserDeletionRequestId `json:"id,omitempty"`
  4402. // Kind: Value is "analytics#userDeletionRequest".
  4403. Kind string `json:"kind,omitempty"`
  4404. // WebPropertyId: Web property ID of the form UA-XXXXX-YY.
  4405. WebPropertyId string `json:"webPropertyId,omitempty"`
  4406. // ServerResponse contains the HTTP response code and headers from the
  4407. // server.
  4408. googleapi.ServerResponse `json:"-"`
  4409. // ForceSendFields is a list of field names (e.g. "DeletionRequestTime")
  4410. // to unconditionally include in API requests. By default, fields with
  4411. // empty values are omitted from API requests. However, any non-pointer,
  4412. // non-interface field appearing in ForceSendFields will be sent to the
  4413. // server regardless of whether the field is empty or not. This may be
  4414. // used to include empty fields in Patch requests.
  4415. ForceSendFields []string `json:"-"`
  4416. // NullFields is a list of field names (e.g. "DeletionRequestTime") to
  4417. // include in API requests with the JSON null value. By default, fields
  4418. // with empty values are omitted from API requests. However, any field
  4419. // with an empty value appearing in NullFields will be sent to the
  4420. // server as null. It is an error if a field in this list has a
  4421. // non-empty value. This may be used to include null fields in Patch
  4422. // requests.
  4423. NullFields []string `json:"-"`
  4424. }
  4425. func (s *UserDeletionRequest) MarshalJSON() ([]byte, error) {
  4426. type NoMethod UserDeletionRequest
  4427. raw := NoMethod(*s)
  4428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4429. }
  4430. // UserDeletionRequestId: User ID.
  4431. type UserDeletionRequestId struct {
  4432. // Type: Type of user
  4433. Type string `json:"type,omitempty"`
  4434. // UserId: The User's id
  4435. UserId string `json:"userId,omitempty"`
  4436. // ForceSendFields is a list of field names (e.g. "Type") to
  4437. // unconditionally include in API requests. By default, fields with
  4438. // empty values are omitted from API requests. However, any non-pointer,
  4439. // non-interface field appearing in ForceSendFields will be sent to the
  4440. // server regardless of whether the field is empty or not. This may be
  4441. // used to include empty fields in Patch requests.
  4442. ForceSendFields []string `json:"-"`
  4443. // NullFields is a list of field names (e.g. "Type") to include in API
  4444. // requests with the JSON null value. By default, fields with empty
  4445. // values are omitted from API requests. However, any field with an
  4446. // empty value appearing in NullFields will be sent to the server as
  4447. // null. It is an error if a field in this list has a non-empty value.
  4448. // This may be used to include null fields in Patch requests.
  4449. NullFields []string `json:"-"`
  4450. }
  4451. func (s *UserDeletionRequestId) MarshalJSON() ([]byte, error) {
  4452. type NoMethod UserDeletionRequestId
  4453. raw := NoMethod(*s)
  4454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4455. }
  4456. // UserRef: JSON template for a user reference.
  4457. type UserRef struct {
  4458. // Email: Email ID of this user.
  4459. Email string `json:"email,omitempty"`
  4460. // Id: User ID.
  4461. Id string `json:"id,omitempty"`
  4462. Kind string `json:"kind,omitempty"`
  4463. // ForceSendFields is a list of field names (e.g. "Email") to
  4464. // unconditionally include in API requests. By default, fields with
  4465. // empty values are omitted from API requests. However, any non-pointer,
  4466. // non-interface field appearing in ForceSendFields will be sent to the
  4467. // server regardless of whether the field is empty or not. This may be
  4468. // used to include empty fields in Patch requests.
  4469. ForceSendFields []string `json:"-"`
  4470. // NullFields is a list of field names (e.g. "Email") to include in API
  4471. // requests with the JSON null value. By default, fields with empty
  4472. // values are omitted from API requests. However, any field with an
  4473. // empty value appearing in NullFields will be sent to the server as
  4474. // null. It is an error if a field in this list has a non-empty value.
  4475. // This may be used to include null fields in Patch requests.
  4476. NullFields []string `json:"-"`
  4477. }
  4478. func (s *UserRef) MarshalJSON() ([]byte, error) {
  4479. type NoMethod UserRef
  4480. raw := NoMethod(*s)
  4481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4482. }
  4483. // WebPropertyRef: JSON template for a web property reference.
  4484. type WebPropertyRef struct {
  4485. // AccountId: Account ID to which this web property belongs.
  4486. AccountId string `json:"accountId,omitempty"`
  4487. // Href: Link for this web property.
  4488. Href string `json:"href,omitempty"`
  4489. // Id: Web property ID of the form UA-XXXXX-YY.
  4490. Id string `json:"id,omitempty"`
  4491. // InternalWebPropertyId: Internal ID for this web property.
  4492. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4493. // Kind: Analytics web property reference.
  4494. Kind string `json:"kind,omitempty"`
  4495. // Name: Name of this web property.
  4496. Name string `json:"name,omitempty"`
  4497. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4498. // unconditionally include in API requests. By default, fields with
  4499. // empty values are omitted from API requests. However, any non-pointer,
  4500. // non-interface field appearing in ForceSendFields will be sent to the
  4501. // server regardless of whether the field is empty or not. This may be
  4502. // used to include empty fields in Patch requests.
  4503. ForceSendFields []string `json:"-"`
  4504. // NullFields is a list of field names (e.g. "AccountId") to include in
  4505. // API requests with the JSON null value. By default, fields with empty
  4506. // values are omitted from API requests. However, any field with an
  4507. // empty value appearing in NullFields will be sent to the server as
  4508. // null. It is an error if a field in this list has a non-empty value.
  4509. // This may be used to include null fields in Patch requests.
  4510. NullFields []string `json:"-"`
  4511. }
  4512. func (s *WebPropertyRef) MarshalJSON() ([]byte, error) {
  4513. type NoMethod WebPropertyRef
  4514. raw := NoMethod(*s)
  4515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4516. }
  4517. // WebPropertySummary: JSON template for an Analytics
  4518. // WebPropertySummary. WebPropertySummary returns basic information
  4519. // (i.e., summary) for a web property.
  4520. type WebPropertySummary struct {
  4521. // Id: Web property ID of the form UA-XXXXX-YY.
  4522. Id string `json:"id,omitempty"`
  4523. // InternalWebPropertyId: Internal ID for this web property.
  4524. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4525. // Kind: Resource type for Analytics WebPropertySummary.
  4526. Kind string `json:"kind,omitempty"`
  4527. // Level: Level for this web property. Possible values are STANDARD or
  4528. // PREMIUM.
  4529. Level string `json:"level,omitempty"`
  4530. // Name: Web property name.
  4531. Name string `json:"name,omitempty"`
  4532. // Profiles: List of profiles under this web property.
  4533. Profiles []*ProfileSummary `json:"profiles,omitempty"`
  4534. // Starred: Indicates whether this web property is starred or not.
  4535. Starred bool `json:"starred,omitempty"`
  4536. // WebsiteUrl: Website url for this web property.
  4537. WebsiteUrl string `json:"websiteUrl,omitempty"`
  4538. // ForceSendFields is a list of field names (e.g. "Id") to
  4539. // unconditionally include in API requests. By default, fields with
  4540. // empty values are omitted from API requests. However, any non-pointer,
  4541. // non-interface field appearing in ForceSendFields will be sent to the
  4542. // server regardless of whether the field is empty or not. This may be
  4543. // used to include empty fields in Patch requests.
  4544. ForceSendFields []string `json:"-"`
  4545. // NullFields is a list of field names (e.g. "Id") to include in API
  4546. // requests with the JSON null value. By default, fields with empty
  4547. // values are omitted from API requests. However, any field with an
  4548. // empty value appearing in NullFields will be sent to the server as
  4549. // null. It is an error if a field in this list has a non-empty value.
  4550. // This may be used to include null fields in Patch requests.
  4551. NullFields []string `json:"-"`
  4552. }
  4553. func (s *WebPropertySummary) MarshalJSON() ([]byte, error) {
  4554. type NoMethod WebPropertySummary
  4555. raw := NoMethod(*s)
  4556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4557. }
  4558. // Webproperties: A web property collection lists Analytics web
  4559. // properties to which the user has access. Each resource in the
  4560. // collection corresponds to a single Analytics web property.
  4561. type Webproperties struct {
  4562. // Items: A list of web properties.
  4563. Items []*Webproperty `json:"items,omitempty"`
  4564. // ItemsPerPage: The maximum number of resources the response can
  4565. // contain, regardless of the actual number of resources returned. Its
  4566. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4567. // otherwise specified by the max-results query parameter.
  4568. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4569. // Kind: Collection type.
  4570. Kind string `json:"kind,omitempty"`
  4571. // NextLink: Link to next page for this web property collection.
  4572. NextLink string `json:"nextLink,omitempty"`
  4573. // PreviousLink: Link to previous page for this web property collection.
  4574. PreviousLink string `json:"previousLink,omitempty"`
  4575. // StartIndex: The starting index of the resources, which is 1 by
  4576. // default or otherwise specified by the start-index query parameter.
  4577. StartIndex int64 `json:"startIndex,omitempty"`
  4578. // TotalResults: The total number of results for the query, regardless
  4579. // of the number of results in the response.
  4580. TotalResults int64 `json:"totalResults,omitempty"`
  4581. // Username: Email ID of the authenticated user
  4582. Username string `json:"username,omitempty"`
  4583. // ServerResponse contains the HTTP response code and headers from the
  4584. // server.
  4585. googleapi.ServerResponse `json:"-"`
  4586. // ForceSendFields is a list of field names (e.g. "Items") to
  4587. // unconditionally include in API requests. By default, fields with
  4588. // empty values are omitted from API requests. However, any non-pointer,
  4589. // non-interface field appearing in ForceSendFields will be sent to the
  4590. // server regardless of whether the field is empty or not. This may be
  4591. // used to include empty fields in Patch requests.
  4592. ForceSendFields []string `json:"-"`
  4593. // NullFields is a list of field names (e.g. "Items") to include in API
  4594. // requests with the JSON null value. By default, fields with empty
  4595. // values are omitted from API requests. However, any field with an
  4596. // empty value appearing in NullFields will be sent to the server as
  4597. // null. It is an error if a field in this list has a non-empty value.
  4598. // This may be used to include null fields in Patch requests.
  4599. NullFields []string `json:"-"`
  4600. }
  4601. func (s *Webproperties) MarshalJSON() ([]byte, error) {
  4602. type NoMethod Webproperties
  4603. raw := NoMethod(*s)
  4604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4605. }
  4606. // Webproperty: JSON template for an Analytics web property.
  4607. type Webproperty struct {
  4608. // AccountId: Account ID to which this web property belongs.
  4609. AccountId string `json:"accountId,omitempty"`
  4610. // ChildLink: Child link for this web property. Points to the list of
  4611. // views (profiles) for this web property.
  4612. ChildLink *WebpropertyChildLink `json:"childLink,omitempty"`
  4613. // Created: Time this web property was created.
  4614. Created string `json:"created,omitempty"`
  4615. // DataRetentionResetOnNewActivity: Set to true to reset the retention
  4616. // period of the user identifier with each new event from that user
  4617. // (thus setting the expiration date to current time plus retention
  4618. // period).
  4619. // Set to false to delete data associated with the user identifer
  4620. // automatically after the rentention period.
  4621. // This property cannot be set on insert.
  4622. DataRetentionResetOnNewActivity bool `json:"dataRetentionResetOnNewActivity,omitempty"`
  4623. // DataRetentionTtl: The length of time for which user and event data is
  4624. // retained.
  4625. // This property cannot be set on insert.
  4626. DataRetentionTtl string `json:"dataRetentionTtl,omitempty"`
  4627. // DefaultProfileId: Default view (profile) ID.
  4628. DefaultProfileId int64 `json:"defaultProfileId,omitempty,string"`
  4629. // Id: Web property ID of the form UA-XXXXX-YY.
  4630. Id string `json:"id,omitempty"`
  4631. // IndustryVertical: The industry vertical/category selected for this
  4632. // web property.
  4633. IndustryVertical string `json:"industryVertical,omitempty"`
  4634. // InternalWebPropertyId: Internal ID for this web property.
  4635. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4636. // Kind: Resource type for Analytics WebProperty.
  4637. Kind string `json:"kind,omitempty"`
  4638. // Level: Level for this web property. Possible values are STANDARD or
  4639. // PREMIUM.
  4640. Level string `json:"level,omitempty"`
  4641. // Name: Name of this web property.
  4642. Name string `json:"name,omitempty"`
  4643. // ParentLink: Parent link for this web property. Points to the account
  4644. // to which this web property belongs.
  4645. ParentLink *WebpropertyParentLink `json:"parentLink,omitempty"`
  4646. // Permissions: Permissions the user has for this web property.
  4647. Permissions *WebpropertyPermissions `json:"permissions,omitempty"`
  4648. // ProfileCount: View (Profile) count for this web property.
  4649. ProfileCount int64 `json:"profileCount,omitempty"`
  4650. // SelfLink: Link for this web property.
  4651. SelfLink string `json:"selfLink,omitempty"`
  4652. // Starred: Indicates whether this web property is starred or not.
  4653. Starred bool `json:"starred,omitempty"`
  4654. // Updated: Time this web property was last modified.
  4655. Updated string `json:"updated,omitempty"`
  4656. // WebsiteUrl: Website url for this web property.
  4657. WebsiteUrl string `json:"websiteUrl,omitempty"`
  4658. // ServerResponse contains the HTTP response code and headers from the
  4659. // server.
  4660. googleapi.ServerResponse `json:"-"`
  4661. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4662. // unconditionally include in API requests. By default, fields with
  4663. // empty values are omitted from API requests. However, any non-pointer,
  4664. // non-interface field appearing in ForceSendFields will be sent to the
  4665. // server regardless of whether the field is empty or not. This may be
  4666. // used to include empty fields in Patch requests.
  4667. ForceSendFields []string `json:"-"`
  4668. // NullFields is a list of field names (e.g. "AccountId") to include in
  4669. // API requests with the JSON null value. By default, fields with empty
  4670. // values are omitted from API requests. However, any field with an
  4671. // empty value appearing in NullFields will be sent to the server as
  4672. // null. It is an error if a field in this list has a non-empty value.
  4673. // This may be used to include null fields in Patch requests.
  4674. NullFields []string `json:"-"`
  4675. }
  4676. func (s *Webproperty) MarshalJSON() ([]byte, error) {
  4677. type NoMethod Webproperty
  4678. raw := NoMethod(*s)
  4679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4680. }
  4681. // WebpropertyChildLink: Child link for this web property. Points to the
  4682. // list of views (profiles) for this web property.
  4683. type WebpropertyChildLink struct {
  4684. // Href: Link to the list of views (profiles) for this web property.
  4685. Href string `json:"href,omitempty"`
  4686. // Type: Type of the parent link. Its value is "analytics#profiles".
  4687. Type string `json:"type,omitempty"`
  4688. // ForceSendFields is a list of field names (e.g. "Href") to
  4689. // unconditionally include in API requests. By default, fields with
  4690. // empty values are omitted from API requests. However, any non-pointer,
  4691. // non-interface field appearing in ForceSendFields will be sent to the
  4692. // server regardless of whether the field is empty or not. This may be
  4693. // used to include empty fields in Patch requests.
  4694. ForceSendFields []string `json:"-"`
  4695. // NullFields is a list of field names (e.g. "Href") to include in API
  4696. // requests with the JSON null value. By default, fields with empty
  4697. // values are omitted from API requests. However, any field with an
  4698. // empty value appearing in NullFields will be sent to the server as
  4699. // null. It is an error if a field in this list has a non-empty value.
  4700. // This may be used to include null fields in Patch requests.
  4701. NullFields []string `json:"-"`
  4702. }
  4703. func (s *WebpropertyChildLink) MarshalJSON() ([]byte, error) {
  4704. type NoMethod WebpropertyChildLink
  4705. raw := NoMethod(*s)
  4706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4707. }
  4708. // WebpropertyParentLink: Parent link for this web property. Points to
  4709. // the account to which this web property belongs.
  4710. type WebpropertyParentLink struct {
  4711. // Href: Link to the account for this web property.
  4712. Href string `json:"href,omitempty"`
  4713. // Type: Type of the parent link. Its value is "analytics#account".
  4714. Type string `json:"type,omitempty"`
  4715. // ForceSendFields is a list of field names (e.g. "Href") to
  4716. // unconditionally include in API requests. By default, fields with
  4717. // empty values are omitted from API requests. However, any non-pointer,
  4718. // non-interface field appearing in ForceSendFields will be sent to the
  4719. // server regardless of whether the field is empty or not. This may be
  4720. // used to include empty fields in Patch requests.
  4721. ForceSendFields []string `json:"-"`
  4722. // NullFields is a list of field names (e.g. "Href") to include in API
  4723. // requests with the JSON null value. By default, fields with empty
  4724. // values are omitted from API requests. However, any field with an
  4725. // empty value appearing in NullFields will be sent to the server as
  4726. // null. It is an error if a field in this list has a non-empty value.
  4727. // This may be used to include null fields in Patch requests.
  4728. NullFields []string `json:"-"`
  4729. }
  4730. func (s *WebpropertyParentLink) MarshalJSON() ([]byte, error) {
  4731. type NoMethod WebpropertyParentLink
  4732. raw := NoMethod(*s)
  4733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4734. }
  4735. // WebpropertyPermissions: Permissions the user has for this web
  4736. // property.
  4737. type WebpropertyPermissions struct {
  4738. // Effective: All the permissions that the user has for this web
  4739. // property. These include any implied permissions (e.g., EDIT implies
  4740. // VIEW) or inherited permissions from the parent account.
  4741. Effective []string `json:"effective,omitempty"`
  4742. // ForceSendFields is a list of field names (e.g. "Effective") to
  4743. // unconditionally include in API requests. By default, fields with
  4744. // empty values are omitted from API requests. However, any non-pointer,
  4745. // non-interface field appearing in ForceSendFields will be sent to the
  4746. // server regardless of whether the field is empty or not. This may be
  4747. // used to include empty fields in Patch requests.
  4748. ForceSendFields []string `json:"-"`
  4749. // NullFields is a list of field names (e.g. "Effective") to include in
  4750. // API requests with the JSON null value. By default, fields with empty
  4751. // values are omitted from API requests. However, any field with an
  4752. // empty value appearing in NullFields will be sent to the server as
  4753. // null. It is an error if a field in this list has a non-empty value.
  4754. // This may be used to include null fields in Patch requests.
  4755. NullFields []string `json:"-"`
  4756. }
  4757. func (s *WebpropertyPermissions) MarshalJSON() ([]byte, error) {
  4758. type NoMethod WebpropertyPermissions
  4759. raw := NoMethod(*s)
  4760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4761. }
  4762. // method id "analytics.data.ga.get":
  4763. type DataGaGetCall struct {
  4764. s *Service
  4765. urlParams_ gensupport.URLParams
  4766. ifNoneMatch_ string
  4767. ctx_ context.Context
  4768. header_ http.Header
  4769. }
  4770. // Get: Returns Analytics data for a view (profile).
  4771. func (r *DataGaService) Get(ids string, startDate string, endDate string, metrics string) *DataGaGetCall {
  4772. c := &DataGaGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4773. c.urlParams_.Set("ids", ids)
  4774. c.urlParams_.Set("start-date", startDate)
  4775. c.urlParams_.Set("end-date", endDate)
  4776. c.urlParams_.Set("metrics", metrics)
  4777. return c
  4778. }
  4779. // Dimensions sets the optional parameter "dimensions": A
  4780. // comma-separated list of Analytics dimensions. E.g.,
  4781. // 'ga:browser,ga:city'.
  4782. func (c *DataGaGetCall) Dimensions(dimensions string) *DataGaGetCall {
  4783. c.urlParams_.Set("dimensions", dimensions)
  4784. return c
  4785. }
  4786. // Filters sets the optional parameter "filters": A comma-separated list
  4787. // of dimension or metric filters to be applied to Analytics data.
  4788. func (c *DataGaGetCall) Filters(filters string) *DataGaGetCall {
  4789. c.urlParams_.Set("filters", filters)
  4790. return c
  4791. }
  4792. // IncludeEmptyRows sets the optional parameter "include-empty-rows":
  4793. // The response will include empty rows if this parameter is set to
  4794. // true, the default is true
  4795. func (c *DataGaGetCall) IncludeEmptyRows(includeEmptyRows bool) *DataGaGetCall {
  4796. c.urlParams_.Set("include-empty-rows", fmt.Sprint(includeEmptyRows))
  4797. return c
  4798. }
  4799. // MaxResults sets the optional parameter "max-results": The maximum
  4800. // number of entries to include in this feed.
  4801. func (c *DataGaGetCall) MaxResults(maxResults int64) *DataGaGetCall {
  4802. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  4803. return c
  4804. }
  4805. // Output sets the optional parameter "output": The selected format for
  4806. // the response. Default format is JSON.
  4807. //
  4808. // Possible values:
  4809. // "dataTable" - Returns the response in Google Charts Data Table
  4810. // format. This is useful in creating visualization using Google Charts.
  4811. // "json" - Returns the response in standard JSON format.
  4812. func (c *DataGaGetCall) Output(output string) *DataGaGetCall {
  4813. c.urlParams_.Set("output", output)
  4814. return c
  4815. }
  4816. // SamplingLevel sets the optional parameter "samplingLevel": The
  4817. // desired sampling level.
  4818. //
  4819. // Possible values:
  4820. // "DEFAULT" - Returns response with a sample size that balances speed
  4821. // and accuracy.
  4822. // "FASTER" - Returns a fast response with a smaller sample size.
  4823. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  4824. // sample size, but this may result in the response being slower.
  4825. func (c *DataGaGetCall) SamplingLevel(samplingLevel string) *DataGaGetCall {
  4826. c.urlParams_.Set("samplingLevel", samplingLevel)
  4827. return c
  4828. }
  4829. // Segment sets the optional parameter "segment": An Analytics segment
  4830. // to be applied to data.
  4831. func (c *DataGaGetCall) Segment(segment string) *DataGaGetCall {
  4832. c.urlParams_.Set("segment", segment)
  4833. return c
  4834. }
  4835. // Sort sets the optional parameter "sort": A comma-separated list of
  4836. // dimensions or metrics that determine the sort order for Analytics
  4837. // data.
  4838. func (c *DataGaGetCall) Sort(sort string) *DataGaGetCall {
  4839. c.urlParams_.Set("sort", sort)
  4840. return c
  4841. }
  4842. // StartIndex sets the optional parameter "start-index": An index of the
  4843. // first entity to retrieve. Use this parameter as a pagination
  4844. // mechanism along with the max-results parameter.
  4845. func (c *DataGaGetCall) StartIndex(startIndex int64) *DataGaGetCall {
  4846. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  4847. return c
  4848. }
  4849. // Fields allows partial responses to be retrieved. See
  4850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4851. // for more information.
  4852. func (c *DataGaGetCall) Fields(s ...googleapi.Field) *DataGaGetCall {
  4853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4854. return c
  4855. }
  4856. // IfNoneMatch sets the optional parameter which makes the operation
  4857. // fail if the object's ETag matches the given value. This is useful for
  4858. // getting updates only after the object has changed since the last
  4859. // request. Use googleapi.IsNotModified to check whether the response
  4860. // error from Do is the result of In-None-Match.
  4861. func (c *DataGaGetCall) IfNoneMatch(entityTag string) *DataGaGetCall {
  4862. c.ifNoneMatch_ = entityTag
  4863. return c
  4864. }
  4865. // Context sets the context to be used in this call's Do method. Any
  4866. // pending HTTP request will be aborted if the provided context is
  4867. // canceled.
  4868. func (c *DataGaGetCall) Context(ctx context.Context) *DataGaGetCall {
  4869. c.ctx_ = ctx
  4870. return c
  4871. }
  4872. // Header returns an http.Header that can be modified by the caller to
  4873. // add HTTP headers to the request.
  4874. func (c *DataGaGetCall) Header() http.Header {
  4875. if c.header_ == nil {
  4876. c.header_ = make(http.Header)
  4877. }
  4878. return c.header_
  4879. }
  4880. func (c *DataGaGetCall) doRequest(alt string) (*http.Response, error) {
  4881. reqHeaders := make(http.Header)
  4882. for k, v := range c.header_ {
  4883. reqHeaders[k] = v
  4884. }
  4885. reqHeaders.Set("User-Agent", c.s.userAgent())
  4886. if c.ifNoneMatch_ != "" {
  4887. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4888. }
  4889. var body io.Reader = nil
  4890. c.urlParams_.Set("alt", alt)
  4891. c.urlParams_.Set("prettyPrint", "false")
  4892. urls := googleapi.ResolveRelative(c.s.BasePath, "data/ga")
  4893. urls += "?" + c.urlParams_.Encode()
  4894. req, err := http.NewRequest("GET", urls, body)
  4895. if err != nil {
  4896. return nil, err
  4897. }
  4898. req.Header = reqHeaders
  4899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4900. }
  4901. // Do executes the "analytics.data.ga.get" call.
  4902. // Exactly one of *GaData or error will be non-nil. Any non-2xx status
  4903. // code is an error. Response headers are in either
  4904. // *GaData.ServerResponse.Header or (if a response was returned at all)
  4905. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4906. // check whether the returned error was because http.StatusNotModified
  4907. // was returned.
  4908. func (c *DataGaGetCall) Do(opts ...googleapi.CallOption) (*GaData, error) {
  4909. gensupport.SetOptions(c.urlParams_, opts...)
  4910. res, err := c.doRequest("json")
  4911. if res != nil && res.StatusCode == http.StatusNotModified {
  4912. if res.Body != nil {
  4913. res.Body.Close()
  4914. }
  4915. return nil, &googleapi.Error{
  4916. Code: res.StatusCode,
  4917. Header: res.Header,
  4918. }
  4919. }
  4920. if err != nil {
  4921. return nil, err
  4922. }
  4923. defer googleapi.CloseBody(res)
  4924. if err := googleapi.CheckResponse(res); err != nil {
  4925. return nil, err
  4926. }
  4927. ret := &GaData{
  4928. ServerResponse: googleapi.ServerResponse{
  4929. Header: res.Header,
  4930. HTTPStatusCode: res.StatusCode,
  4931. },
  4932. }
  4933. target := &ret
  4934. if err := gensupport.DecodeResponse(target, res); err != nil {
  4935. return nil, err
  4936. }
  4937. return ret, nil
  4938. // {
  4939. // "description": "Returns Analytics data for a view (profile).",
  4940. // "httpMethod": "GET",
  4941. // "id": "analytics.data.ga.get",
  4942. // "parameterOrder": [
  4943. // "ids",
  4944. // "start-date",
  4945. // "end-date",
  4946. // "metrics"
  4947. // ],
  4948. // "parameters": {
  4949. // "dimensions": {
  4950. // "description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.",
  4951. // "location": "query",
  4952. // "pattern": "(ga:.+)?",
  4953. // "type": "string"
  4954. // },
  4955. // "end-date": {
  4956. // "description": "End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday.",
  4957. // "location": "query",
  4958. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  4959. // "required": true,
  4960. // "type": "string"
  4961. // },
  4962. // "filters": {
  4963. // "description": "A comma-separated list of dimension or metric filters to be applied to Analytics data.",
  4964. // "location": "query",
  4965. // "pattern": "ga:.+",
  4966. // "type": "string"
  4967. // },
  4968. // "ids": {
  4969. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  4970. // "location": "query",
  4971. // "pattern": "ga:[0-9]+",
  4972. // "required": true,
  4973. // "type": "string"
  4974. // },
  4975. // "include-empty-rows": {
  4976. // "description": "The response will include empty rows if this parameter is set to true, the default is true",
  4977. // "location": "query",
  4978. // "type": "boolean"
  4979. // },
  4980. // "max-results": {
  4981. // "description": "The maximum number of entries to include in this feed.",
  4982. // "format": "int32",
  4983. // "location": "query",
  4984. // "type": "integer"
  4985. // },
  4986. // "metrics": {
  4987. // "description": "A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified.",
  4988. // "location": "query",
  4989. // "pattern": "ga:.+",
  4990. // "required": true,
  4991. // "type": "string"
  4992. // },
  4993. // "output": {
  4994. // "description": "The selected format for the response. Default format is JSON.",
  4995. // "enum": [
  4996. // "dataTable",
  4997. // "json"
  4998. // ],
  4999. // "enumDescriptions": [
  5000. // "Returns the response in Google Charts Data Table format. This is useful in creating visualization using Google Charts.",
  5001. // "Returns the response in standard JSON format."
  5002. // ],
  5003. // "location": "query",
  5004. // "type": "string"
  5005. // },
  5006. // "samplingLevel": {
  5007. // "description": "The desired sampling level.",
  5008. // "enum": [
  5009. // "DEFAULT",
  5010. // "FASTER",
  5011. // "HIGHER_PRECISION"
  5012. // ],
  5013. // "enumDescriptions": [
  5014. // "Returns response with a sample size that balances speed and accuracy.",
  5015. // "Returns a fast response with a smaller sample size.",
  5016. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  5017. // ],
  5018. // "location": "query",
  5019. // "type": "string"
  5020. // },
  5021. // "segment": {
  5022. // "description": "An Analytics segment to be applied to data.",
  5023. // "location": "query",
  5024. // "type": "string"
  5025. // },
  5026. // "sort": {
  5027. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.",
  5028. // "location": "query",
  5029. // "pattern": "(-)?ga:.+",
  5030. // "type": "string"
  5031. // },
  5032. // "start-date": {
  5033. // "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.",
  5034. // "location": "query",
  5035. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5036. // "required": true,
  5037. // "type": "string"
  5038. // },
  5039. // "start-index": {
  5040. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5041. // "format": "int32",
  5042. // "location": "query",
  5043. // "minimum": "1",
  5044. // "type": "integer"
  5045. // }
  5046. // },
  5047. // "path": "data/ga",
  5048. // "response": {
  5049. // "$ref": "GaData"
  5050. // },
  5051. // "scopes": [
  5052. // "https://www.googleapis.com/auth/analytics",
  5053. // "https://www.googleapis.com/auth/analytics.readonly"
  5054. // ]
  5055. // }
  5056. }
  5057. // method id "analytics.data.mcf.get":
  5058. type DataMcfGetCall struct {
  5059. s *Service
  5060. urlParams_ gensupport.URLParams
  5061. ifNoneMatch_ string
  5062. ctx_ context.Context
  5063. header_ http.Header
  5064. }
  5065. // Get: Returns Analytics Multi-Channel Funnels data for a view
  5066. // (profile).
  5067. func (r *DataMcfService) Get(ids string, startDate string, endDate string, metrics string) *DataMcfGetCall {
  5068. c := &DataMcfGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5069. c.urlParams_.Set("ids", ids)
  5070. c.urlParams_.Set("start-date", startDate)
  5071. c.urlParams_.Set("end-date", endDate)
  5072. c.urlParams_.Set("metrics", metrics)
  5073. return c
  5074. }
  5075. // Dimensions sets the optional parameter "dimensions": A
  5076. // comma-separated list of Multi-Channel Funnels dimensions. E.g.,
  5077. // 'mcf:source,mcf:medium'.
  5078. func (c *DataMcfGetCall) Dimensions(dimensions string) *DataMcfGetCall {
  5079. c.urlParams_.Set("dimensions", dimensions)
  5080. return c
  5081. }
  5082. // Filters sets the optional parameter "filters": A comma-separated list
  5083. // of dimension or metric filters to be applied to the Analytics data.
  5084. func (c *DataMcfGetCall) Filters(filters string) *DataMcfGetCall {
  5085. c.urlParams_.Set("filters", filters)
  5086. return c
  5087. }
  5088. // MaxResults sets the optional parameter "max-results": The maximum
  5089. // number of entries to include in this feed.
  5090. func (c *DataMcfGetCall) MaxResults(maxResults int64) *DataMcfGetCall {
  5091. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5092. return c
  5093. }
  5094. // SamplingLevel sets the optional parameter "samplingLevel": The
  5095. // desired sampling level.
  5096. //
  5097. // Possible values:
  5098. // "DEFAULT" - Returns response with a sample size that balances speed
  5099. // and accuracy.
  5100. // "FASTER" - Returns a fast response with a smaller sample size.
  5101. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  5102. // sample size, but this may result in the response being slower.
  5103. func (c *DataMcfGetCall) SamplingLevel(samplingLevel string) *DataMcfGetCall {
  5104. c.urlParams_.Set("samplingLevel", samplingLevel)
  5105. return c
  5106. }
  5107. // Sort sets the optional parameter "sort": A comma-separated list of
  5108. // dimensions or metrics that determine the sort order for the Analytics
  5109. // data.
  5110. func (c *DataMcfGetCall) Sort(sort string) *DataMcfGetCall {
  5111. c.urlParams_.Set("sort", sort)
  5112. return c
  5113. }
  5114. // StartIndex sets the optional parameter "start-index": An index of the
  5115. // first entity to retrieve. Use this parameter as a pagination
  5116. // mechanism along with the max-results parameter.
  5117. func (c *DataMcfGetCall) StartIndex(startIndex int64) *DataMcfGetCall {
  5118. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5119. return c
  5120. }
  5121. // Fields allows partial responses to be retrieved. See
  5122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5123. // for more information.
  5124. func (c *DataMcfGetCall) Fields(s ...googleapi.Field) *DataMcfGetCall {
  5125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5126. return c
  5127. }
  5128. // IfNoneMatch sets the optional parameter which makes the operation
  5129. // fail if the object's ETag matches the given value. This is useful for
  5130. // getting updates only after the object has changed since the last
  5131. // request. Use googleapi.IsNotModified to check whether the response
  5132. // error from Do is the result of In-None-Match.
  5133. func (c *DataMcfGetCall) IfNoneMatch(entityTag string) *DataMcfGetCall {
  5134. c.ifNoneMatch_ = entityTag
  5135. return c
  5136. }
  5137. // Context sets the context to be used in this call's Do method. Any
  5138. // pending HTTP request will be aborted if the provided context is
  5139. // canceled.
  5140. func (c *DataMcfGetCall) Context(ctx context.Context) *DataMcfGetCall {
  5141. c.ctx_ = ctx
  5142. return c
  5143. }
  5144. // Header returns an http.Header that can be modified by the caller to
  5145. // add HTTP headers to the request.
  5146. func (c *DataMcfGetCall) Header() http.Header {
  5147. if c.header_ == nil {
  5148. c.header_ = make(http.Header)
  5149. }
  5150. return c.header_
  5151. }
  5152. func (c *DataMcfGetCall) doRequest(alt string) (*http.Response, error) {
  5153. reqHeaders := make(http.Header)
  5154. for k, v := range c.header_ {
  5155. reqHeaders[k] = v
  5156. }
  5157. reqHeaders.Set("User-Agent", c.s.userAgent())
  5158. if c.ifNoneMatch_ != "" {
  5159. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5160. }
  5161. var body io.Reader = nil
  5162. c.urlParams_.Set("alt", alt)
  5163. c.urlParams_.Set("prettyPrint", "false")
  5164. urls := googleapi.ResolveRelative(c.s.BasePath, "data/mcf")
  5165. urls += "?" + c.urlParams_.Encode()
  5166. req, err := http.NewRequest("GET", urls, body)
  5167. if err != nil {
  5168. return nil, err
  5169. }
  5170. req.Header = reqHeaders
  5171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5172. }
  5173. // Do executes the "analytics.data.mcf.get" call.
  5174. // Exactly one of *McfData or error will be non-nil. Any non-2xx status
  5175. // code is an error. Response headers are in either
  5176. // *McfData.ServerResponse.Header or (if a response was returned at all)
  5177. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5178. // check whether the returned error was because http.StatusNotModified
  5179. // was returned.
  5180. func (c *DataMcfGetCall) Do(opts ...googleapi.CallOption) (*McfData, error) {
  5181. gensupport.SetOptions(c.urlParams_, opts...)
  5182. res, err := c.doRequest("json")
  5183. if res != nil && res.StatusCode == http.StatusNotModified {
  5184. if res.Body != nil {
  5185. res.Body.Close()
  5186. }
  5187. return nil, &googleapi.Error{
  5188. Code: res.StatusCode,
  5189. Header: res.Header,
  5190. }
  5191. }
  5192. if err != nil {
  5193. return nil, err
  5194. }
  5195. defer googleapi.CloseBody(res)
  5196. if err := googleapi.CheckResponse(res); err != nil {
  5197. return nil, err
  5198. }
  5199. ret := &McfData{
  5200. ServerResponse: googleapi.ServerResponse{
  5201. Header: res.Header,
  5202. HTTPStatusCode: res.StatusCode,
  5203. },
  5204. }
  5205. target := &ret
  5206. if err := gensupport.DecodeResponse(target, res); err != nil {
  5207. return nil, err
  5208. }
  5209. return ret, nil
  5210. // {
  5211. // "description": "Returns Analytics Multi-Channel Funnels data for a view (profile).",
  5212. // "httpMethod": "GET",
  5213. // "id": "analytics.data.mcf.get",
  5214. // "parameterOrder": [
  5215. // "ids",
  5216. // "start-date",
  5217. // "end-date",
  5218. // "metrics"
  5219. // ],
  5220. // "parameters": {
  5221. // "dimensions": {
  5222. // "description": "A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'.",
  5223. // "location": "query",
  5224. // "pattern": "(mcf:.+)?",
  5225. // "type": "string"
  5226. // },
  5227. // "end-date": {
  5228. // "description": "End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.",
  5229. // "location": "query",
  5230. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5231. // "required": true,
  5232. // "type": "string"
  5233. // },
  5234. // "filters": {
  5235. // "description": "A comma-separated list of dimension or metric filters to be applied to the Analytics data.",
  5236. // "location": "query",
  5237. // "pattern": "mcf:.+",
  5238. // "type": "string"
  5239. // },
  5240. // "ids": {
  5241. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  5242. // "location": "query",
  5243. // "pattern": "ga:[0-9]+",
  5244. // "required": true,
  5245. // "type": "string"
  5246. // },
  5247. // "max-results": {
  5248. // "description": "The maximum number of entries to include in this feed.",
  5249. // "format": "int32",
  5250. // "location": "query",
  5251. // "type": "integer"
  5252. // },
  5253. // "metrics": {
  5254. // "description": "A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified.",
  5255. // "location": "query",
  5256. // "pattern": "mcf:.+",
  5257. // "required": true,
  5258. // "type": "string"
  5259. // },
  5260. // "samplingLevel": {
  5261. // "description": "The desired sampling level.",
  5262. // "enum": [
  5263. // "DEFAULT",
  5264. // "FASTER",
  5265. // "HIGHER_PRECISION"
  5266. // ],
  5267. // "enumDescriptions": [
  5268. // "Returns response with a sample size that balances speed and accuracy.",
  5269. // "Returns a fast response with a smaller sample size.",
  5270. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  5271. // ],
  5272. // "location": "query",
  5273. // "type": "string"
  5274. // },
  5275. // "sort": {
  5276. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data.",
  5277. // "location": "query",
  5278. // "pattern": "(-)?mcf:.+",
  5279. // "type": "string"
  5280. // },
  5281. // "start-date": {
  5282. // "description": "Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.",
  5283. // "location": "query",
  5284. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5285. // "required": true,
  5286. // "type": "string"
  5287. // },
  5288. // "start-index": {
  5289. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5290. // "format": "int32",
  5291. // "location": "query",
  5292. // "minimum": "1",
  5293. // "type": "integer"
  5294. // }
  5295. // },
  5296. // "path": "data/mcf",
  5297. // "response": {
  5298. // "$ref": "McfData"
  5299. // },
  5300. // "scopes": [
  5301. // "https://www.googleapis.com/auth/analytics",
  5302. // "https://www.googleapis.com/auth/analytics.readonly"
  5303. // ]
  5304. // }
  5305. }
  5306. // method id "analytics.data.realtime.get":
  5307. type DataRealtimeGetCall struct {
  5308. s *Service
  5309. urlParams_ gensupport.URLParams
  5310. ifNoneMatch_ string
  5311. ctx_ context.Context
  5312. header_ http.Header
  5313. }
  5314. // Get: Returns real time data for a view (profile).
  5315. func (r *DataRealtimeService) Get(ids string, metrics string) *DataRealtimeGetCall {
  5316. c := &DataRealtimeGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5317. c.urlParams_.Set("ids", ids)
  5318. c.urlParams_.Set("metrics", metrics)
  5319. return c
  5320. }
  5321. // Dimensions sets the optional parameter "dimensions": A
  5322. // comma-separated list of real time dimensions. E.g.,
  5323. // 'rt:medium,rt:city'.
  5324. func (c *DataRealtimeGetCall) Dimensions(dimensions string) *DataRealtimeGetCall {
  5325. c.urlParams_.Set("dimensions", dimensions)
  5326. return c
  5327. }
  5328. // Filters sets the optional parameter "filters": A comma-separated list
  5329. // of dimension or metric filters to be applied to real time data.
  5330. func (c *DataRealtimeGetCall) Filters(filters string) *DataRealtimeGetCall {
  5331. c.urlParams_.Set("filters", filters)
  5332. return c
  5333. }
  5334. // MaxResults sets the optional parameter "max-results": The maximum
  5335. // number of entries to include in this feed.
  5336. func (c *DataRealtimeGetCall) MaxResults(maxResults int64) *DataRealtimeGetCall {
  5337. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5338. return c
  5339. }
  5340. // Sort sets the optional parameter "sort": A comma-separated list of
  5341. // dimensions or metrics that determine the sort order for real time
  5342. // data.
  5343. func (c *DataRealtimeGetCall) Sort(sort string) *DataRealtimeGetCall {
  5344. c.urlParams_.Set("sort", sort)
  5345. return c
  5346. }
  5347. // Fields allows partial responses to be retrieved. See
  5348. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5349. // for more information.
  5350. func (c *DataRealtimeGetCall) Fields(s ...googleapi.Field) *DataRealtimeGetCall {
  5351. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5352. return c
  5353. }
  5354. // IfNoneMatch sets the optional parameter which makes the operation
  5355. // fail if the object's ETag matches the given value. This is useful for
  5356. // getting updates only after the object has changed since the last
  5357. // request. Use googleapi.IsNotModified to check whether the response
  5358. // error from Do is the result of In-None-Match.
  5359. func (c *DataRealtimeGetCall) IfNoneMatch(entityTag string) *DataRealtimeGetCall {
  5360. c.ifNoneMatch_ = entityTag
  5361. return c
  5362. }
  5363. // Context sets the context to be used in this call's Do method. Any
  5364. // pending HTTP request will be aborted if the provided context is
  5365. // canceled.
  5366. func (c *DataRealtimeGetCall) Context(ctx context.Context) *DataRealtimeGetCall {
  5367. c.ctx_ = ctx
  5368. return c
  5369. }
  5370. // Header returns an http.Header that can be modified by the caller to
  5371. // add HTTP headers to the request.
  5372. func (c *DataRealtimeGetCall) Header() http.Header {
  5373. if c.header_ == nil {
  5374. c.header_ = make(http.Header)
  5375. }
  5376. return c.header_
  5377. }
  5378. func (c *DataRealtimeGetCall) doRequest(alt string) (*http.Response, error) {
  5379. reqHeaders := make(http.Header)
  5380. for k, v := range c.header_ {
  5381. reqHeaders[k] = v
  5382. }
  5383. reqHeaders.Set("User-Agent", c.s.userAgent())
  5384. if c.ifNoneMatch_ != "" {
  5385. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5386. }
  5387. var body io.Reader = nil
  5388. c.urlParams_.Set("alt", alt)
  5389. c.urlParams_.Set("prettyPrint", "false")
  5390. urls := googleapi.ResolveRelative(c.s.BasePath, "data/realtime")
  5391. urls += "?" + c.urlParams_.Encode()
  5392. req, err := http.NewRequest("GET", urls, body)
  5393. if err != nil {
  5394. return nil, err
  5395. }
  5396. req.Header = reqHeaders
  5397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5398. }
  5399. // Do executes the "analytics.data.realtime.get" call.
  5400. // Exactly one of *RealtimeData or error will be non-nil. Any non-2xx
  5401. // status code is an error. Response headers are in either
  5402. // *RealtimeData.ServerResponse.Header or (if a response was returned at
  5403. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5404. // to check whether the returned error was because
  5405. // http.StatusNotModified was returned.
  5406. func (c *DataRealtimeGetCall) Do(opts ...googleapi.CallOption) (*RealtimeData, error) {
  5407. gensupport.SetOptions(c.urlParams_, opts...)
  5408. res, err := c.doRequest("json")
  5409. if res != nil && res.StatusCode == http.StatusNotModified {
  5410. if res.Body != nil {
  5411. res.Body.Close()
  5412. }
  5413. return nil, &googleapi.Error{
  5414. Code: res.StatusCode,
  5415. Header: res.Header,
  5416. }
  5417. }
  5418. if err != nil {
  5419. return nil, err
  5420. }
  5421. defer googleapi.CloseBody(res)
  5422. if err := googleapi.CheckResponse(res); err != nil {
  5423. return nil, err
  5424. }
  5425. ret := &RealtimeData{
  5426. ServerResponse: googleapi.ServerResponse{
  5427. Header: res.Header,
  5428. HTTPStatusCode: res.StatusCode,
  5429. },
  5430. }
  5431. target := &ret
  5432. if err := gensupport.DecodeResponse(target, res); err != nil {
  5433. return nil, err
  5434. }
  5435. return ret, nil
  5436. // {
  5437. // "description": "Returns real time data for a view (profile).",
  5438. // "httpMethod": "GET",
  5439. // "id": "analytics.data.realtime.get",
  5440. // "parameterOrder": [
  5441. // "ids",
  5442. // "metrics"
  5443. // ],
  5444. // "parameters": {
  5445. // "dimensions": {
  5446. // "description": "A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'.",
  5447. // "location": "query",
  5448. // "pattern": "(ga:.+)|(rt:.+)",
  5449. // "type": "string"
  5450. // },
  5451. // "filters": {
  5452. // "description": "A comma-separated list of dimension or metric filters to be applied to real time data.",
  5453. // "location": "query",
  5454. // "pattern": "(ga:.+)|(rt:.+)",
  5455. // "type": "string"
  5456. // },
  5457. // "ids": {
  5458. // "description": "Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  5459. // "location": "query",
  5460. // "pattern": "ga:[0-9]+",
  5461. // "required": true,
  5462. // "type": "string"
  5463. // },
  5464. // "max-results": {
  5465. // "description": "The maximum number of entries to include in this feed.",
  5466. // "format": "int32",
  5467. // "location": "query",
  5468. // "type": "integer"
  5469. // },
  5470. // "metrics": {
  5471. // "description": "A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified.",
  5472. // "location": "query",
  5473. // "pattern": "(ga:.+)|(rt:.+)",
  5474. // "required": true,
  5475. // "type": "string"
  5476. // },
  5477. // "sort": {
  5478. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for real time data.",
  5479. // "location": "query",
  5480. // "pattern": "(-)?((ga:.+)|(rt:.+))",
  5481. // "type": "string"
  5482. // }
  5483. // },
  5484. // "path": "data/realtime",
  5485. // "response": {
  5486. // "$ref": "RealtimeData"
  5487. // },
  5488. // "scopes": [
  5489. // "https://www.googleapis.com/auth/analytics",
  5490. // "https://www.googleapis.com/auth/analytics.readonly"
  5491. // ]
  5492. // }
  5493. }
  5494. // method id "analytics.management.accountSummaries.list":
  5495. type ManagementAccountSummariesListCall struct {
  5496. s *Service
  5497. urlParams_ gensupport.URLParams
  5498. ifNoneMatch_ string
  5499. ctx_ context.Context
  5500. header_ http.Header
  5501. }
  5502. // List: Lists account summaries (lightweight tree comprised of
  5503. // accounts/properties/profiles) to which the user has access.
  5504. func (r *ManagementAccountSummariesService) List() *ManagementAccountSummariesListCall {
  5505. c := &ManagementAccountSummariesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5506. return c
  5507. }
  5508. // MaxResults sets the optional parameter "max-results": The maximum
  5509. // number of account summaries to include in this response, where the
  5510. // largest acceptable value is 1000.
  5511. func (c *ManagementAccountSummariesListCall) MaxResults(maxResults int64) *ManagementAccountSummariesListCall {
  5512. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5513. return c
  5514. }
  5515. // StartIndex sets the optional parameter "start-index": An index of the
  5516. // first entity to retrieve. Use this parameter as a pagination
  5517. // mechanism along with the max-results parameter.
  5518. func (c *ManagementAccountSummariesListCall) StartIndex(startIndex int64) *ManagementAccountSummariesListCall {
  5519. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5520. return c
  5521. }
  5522. // Fields allows partial responses to be retrieved. See
  5523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5524. // for more information.
  5525. func (c *ManagementAccountSummariesListCall) Fields(s ...googleapi.Field) *ManagementAccountSummariesListCall {
  5526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5527. return c
  5528. }
  5529. // IfNoneMatch sets the optional parameter which makes the operation
  5530. // fail if the object's ETag matches the given value. This is useful for
  5531. // getting updates only after the object has changed since the last
  5532. // request. Use googleapi.IsNotModified to check whether the response
  5533. // error from Do is the result of In-None-Match.
  5534. func (c *ManagementAccountSummariesListCall) IfNoneMatch(entityTag string) *ManagementAccountSummariesListCall {
  5535. c.ifNoneMatch_ = entityTag
  5536. return c
  5537. }
  5538. // Context sets the context to be used in this call's Do method. Any
  5539. // pending HTTP request will be aborted if the provided context is
  5540. // canceled.
  5541. func (c *ManagementAccountSummariesListCall) Context(ctx context.Context) *ManagementAccountSummariesListCall {
  5542. c.ctx_ = ctx
  5543. return c
  5544. }
  5545. // Header returns an http.Header that can be modified by the caller to
  5546. // add HTTP headers to the request.
  5547. func (c *ManagementAccountSummariesListCall) Header() http.Header {
  5548. if c.header_ == nil {
  5549. c.header_ = make(http.Header)
  5550. }
  5551. return c.header_
  5552. }
  5553. func (c *ManagementAccountSummariesListCall) doRequest(alt string) (*http.Response, error) {
  5554. reqHeaders := make(http.Header)
  5555. for k, v := range c.header_ {
  5556. reqHeaders[k] = v
  5557. }
  5558. reqHeaders.Set("User-Agent", c.s.userAgent())
  5559. if c.ifNoneMatch_ != "" {
  5560. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5561. }
  5562. var body io.Reader = nil
  5563. c.urlParams_.Set("alt", alt)
  5564. c.urlParams_.Set("prettyPrint", "false")
  5565. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accountSummaries")
  5566. urls += "?" + c.urlParams_.Encode()
  5567. req, err := http.NewRequest("GET", urls, body)
  5568. if err != nil {
  5569. return nil, err
  5570. }
  5571. req.Header = reqHeaders
  5572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5573. }
  5574. // Do executes the "analytics.management.accountSummaries.list" call.
  5575. // Exactly one of *AccountSummaries or error will be non-nil. Any
  5576. // non-2xx status code is an error. Response headers are in either
  5577. // *AccountSummaries.ServerResponse.Header or (if a response was
  5578. // returned at all) in error.(*googleapi.Error).Header. Use
  5579. // googleapi.IsNotModified to check whether the returned error was
  5580. // because http.StatusNotModified was returned.
  5581. func (c *ManagementAccountSummariesListCall) Do(opts ...googleapi.CallOption) (*AccountSummaries, error) {
  5582. gensupport.SetOptions(c.urlParams_, opts...)
  5583. res, err := c.doRequest("json")
  5584. if res != nil && res.StatusCode == http.StatusNotModified {
  5585. if res.Body != nil {
  5586. res.Body.Close()
  5587. }
  5588. return nil, &googleapi.Error{
  5589. Code: res.StatusCode,
  5590. Header: res.Header,
  5591. }
  5592. }
  5593. if err != nil {
  5594. return nil, err
  5595. }
  5596. defer googleapi.CloseBody(res)
  5597. if err := googleapi.CheckResponse(res); err != nil {
  5598. return nil, err
  5599. }
  5600. ret := &AccountSummaries{
  5601. ServerResponse: googleapi.ServerResponse{
  5602. Header: res.Header,
  5603. HTTPStatusCode: res.StatusCode,
  5604. },
  5605. }
  5606. target := &ret
  5607. if err := gensupport.DecodeResponse(target, res); err != nil {
  5608. return nil, err
  5609. }
  5610. return ret, nil
  5611. // {
  5612. // "description": "Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.",
  5613. // "httpMethod": "GET",
  5614. // "id": "analytics.management.accountSummaries.list",
  5615. // "parameters": {
  5616. // "max-results": {
  5617. // "description": "The maximum number of account summaries to include in this response, where the largest acceptable value is 1000.",
  5618. // "format": "int32",
  5619. // "location": "query",
  5620. // "type": "integer"
  5621. // },
  5622. // "start-index": {
  5623. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5624. // "format": "int32",
  5625. // "location": "query",
  5626. // "minimum": "1",
  5627. // "type": "integer"
  5628. // }
  5629. // },
  5630. // "path": "management/accountSummaries",
  5631. // "response": {
  5632. // "$ref": "AccountSummaries"
  5633. // },
  5634. // "scopes": [
  5635. // "https://www.googleapis.com/auth/analytics.edit",
  5636. // "https://www.googleapis.com/auth/analytics.readonly"
  5637. // ]
  5638. // }
  5639. }
  5640. // method id "analytics.management.accountUserLinks.delete":
  5641. type ManagementAccountUserLinksDeleteCall struct {
  5642. s *Service
  5643. accountId string
  5644. linkId string
  5645. urlParams_ gensupport.URLParams
  5646. ctx_ context.Context
  5647. header_ http.Header
  5648. }
  5649. // Delete: Removes a user from the given account.
  5650. func (r *ManagementAccountUserLinksService) Delete(accountId string, linkId string) *ManagementAccountUserLinksDeleteCall {
  5651. c := &ManagementAccountUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5652. c.accountId = accountId
  5653. c.linkId = linkId
  5654. return c
  5655. }
  5656. // Fields allows partial responses to be retrieved. See
  5657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5658. // for more information.
  5659. func (c *ManagementAccountUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksDeleteCall {
  5660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5661. return c
  5662. }
  5663. // Context sets the context to be used in this call's Do method. Any
  5664. // pending HTTP request will be aborted if the provided context is
  5665. // canceled.
  5666. func (c *ManagementAccountUserLinksDeleteCall) Context(ctx context.Context) *ManagementAccountUserLinksDeleteCall {
  5667. c.ctx_ = ctx
  5668. return c
  5669. }
  5670. // Header returns an http.Header that can be modified by the caller to
  5671. // add HTTP headers to the request.
  5672. func (c *ManagementAccountUserLinksDeleteCall) Header() http.Header {
  5673. if c.header_ == nil {
  5674. c.header_ = make(http.Header)
  5675. }
  5676. return c.header_
  5677. }
  5678. func (c *ManagementAccountUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  5679. reqHeaders := make(http.Header)
  5680. for k, v := range c.header_ {
  5681. reqHeaders[k] = v
  5682. }
  5683. reqHeaders.Set("User-Agent", c.s.userAgent())
  5684. var body io.Reader = nil
  5685. c.urlParams_.Set("alt", alt)
  5686. c.urlParams_.Set("prettyPrint", "false")
  5687. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  5688. urls += "?" + c.urlParams_.Encode()
  5689. req, err := http.NewRequest("DELETE", urls, body)
  5690. if err != nil {
  5691. return nil, err
  5692. }
  5693. req.Header = reqHeaders
  5694. googleapi.Expand(req.URL, map[string]string{
  5695. "accountId": c.accountId,
  5696. "linkId": c.linkId,
  5697. })
  5698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5699. }
  5700. // Do executes the "analytics.management.accountUserLinks.delete" call.
  5701. func (c *ManagementAccountUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  5702. gensupport.SetOptions(c.urlParams_, opts...)
  5703. res, err := c.doRequest("json")
  5704. if err != nil {
  5705. return err
  5706. }
  5707. defer googleapi.CloseBody(res)
  5708. if err := googleapi.CheckResponse(res); err != nil {
  5709. return err
  5710. }
  5711. return nil
  5712. // {
  5713. // "description": "Removes a user from the given account.",
  5714. // "httpMethod": "DELETE",
  5715. // "id": "analytics.management.accountUserLinks.delete",
  5716. // "parameterOrder": [
  5717. // "accountId",
  5718. // "linkId"
  5719. // ],
  5720. // "parameters": {
  5721. // "accountId": {
  5722. // "description": "Account ID to delete the user link for.",
  5723. // "location": "path",
  5724. // "required": true,
  5725. // "type": "string"
  5726. // },
  5727. // "linkId": {
  5728. // "description": "Link ID to delete the user link for.",
  5729. // "location": "path",
  5730. // "required": true,
  5731. // "type": "string"
  5732. // }
  5733. // },
  5734. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  5735. // "scopes": [
  5736. // "https://www.googleapis.com/auth/analytics.manage.users"
  5737. // ]
  5738. // }
  5739. }
  5740. // method id "analytics.management.accountUserLinks.insert":
  5741. type ManagementAccountUserLinksInsertCall struct {
  5742. s *Service
  5743. accountId string
  5744. entityuserlink *EntityUserLink
  5745. urlParams_ gensupport.URLParams
  5746. ctx_ context.Context
  5747. header_ http.Header
  5748. }
  5749. // Insert: Adds a new user to the given account.
  5750. func (r *ManagementAccountUserLinksService) Insert(accountId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksInsertCall {
  5751. c := &ManagementAccountUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5752. c.accountId = accountId
  5753. c.entityuserlink = entityuserlink
  5754. return c
  5755. }
  5756. // Fields allows partial responses to be retrieved. See
  5757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5758. // for more information.
  5759. func (c *ManagementAccountUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksInsertCall {
  5760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5761. return c
  5762. }
  5763. // Context sets the context to be used in this call's Do method. Any
  5764. // pending HTTP request will be aborted if the provided context is
  5765. // canceled.
  5766. func (c *ManagementAccountUserLinksInsertCall) Context(ctx context.Context) *ManagementAccountUserLinksInsertCall {
  5767. c.ctx_ = ctx
  5768. return c
  5769. }
  5770. // Header returns an http.Header that can be modified by the caller to
  5771. // add HTTP headers to the request.
  5772. func (c *ManagementAccountUserLinksInsertCall) Header() http.Header {
  5773. if c.header_ == nil {
  5774. c.header_ = make(http.Header)
  5775. }
  5776. return c.header_
  5777. }
  5778. func (c *ManagementAccountUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  5779. reqHeaders := make(http.Header)
  5780. for k, v := range c.header_ {
  5781. reqHeaders[k] = v
  5782. }
  5783. reqHeaders.Set("User-Agent", c.s.userAgent())
  5784. var body io.Reader = nil
  5785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  5786. if err != nil {
  5787. return nil, err
  5788. }
  5789. reqHeaders.Set("Content-Type", "application/json")
  5790. c.urlParams_.Set("alt", alt)
  5791. c.urlParams_.Set("prettyPrint", "false")
  5792. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  5793. urls += "?" + c.urlParams_.Encode()
  5794. req, err := http.NewRequest("POST", urls, body)
  5795. if err != nil {
  5796. return nil, err
  5797. }
  5798. req.Header = reqHeaders
  5799. googleapi.Expand(req.URL, map[string]string{
  5800. "accountId": c.accountId,
  5801. })
  5802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5803. }
  5804. // Do executes the "analytics.management.accountUserLinks.insert" call.
  5805. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  5806. // status code is an error. Response headers are in either
  5807. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  5808. // at all) in error.(*googleapi.Error).Header. Use
  5809. // googleapi.IsNotModified to check whether the returned error was
  5810. // because http.StatusNotModified was returned.
  5811. func (c *ManagementAccountUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  5812. gensupport.SetOptions(c.urlParams_, opts...)
  5813. res, err := c.doRequest("json")
  5814. if res != nil && res.StatusCode == http.StatusNotModified {
  5815. if res.Body != nil {
  5816. res.Body.Close()
  5817. }
  5818. return nil, &googleapi.Error{
  5819. Code: res.StatusCode,
  5820. Header: res.Header,
  5821. }
  5822. }
  5823. if err != nil {
  5824. return nil, err
  5825. }
  5826. defer googleapi.CloseBody(res)
  5827. if err := googleapi.CheckResponse(res); err != nil {
  5828. return nil, err
  5829. }
  5830. ret := &EntityUserLink{
  5831. ServerResponse: googleapi.ServerResponse{
  5832. Header: res.Header,
  5833. HTTPStatusCode: res.StatusCode,
  5834. },
  5835. }
  5836. target := &ret
  5837. if err := gensupport.DecodeResponse(target, res); err != nil {
  5838. return nil, err
  5839. }
  5840. return ret, nil
  5841. // {
  5842. // "description": "Adds a new user to the given account.",
  5843. // "httpMethod": "POST",
  5844. // "id": "analytics.management.accountUserLinks.insert",
  5845. // "parameterOrder": [
  5846. // "accountId"
  5847. // ],
  5848. // "parameters": {
  5849. // "accountId": {
  5850. // "description": "Account ID to create the user link for.",
  5851. // "location": "path",
  5852. // "required": true,
  5853. // "type": "string"
  5854. // }
  5855. // },
  5856. // "path": "management/accounts/{accountId}/entityUserLinks",
  5857. // "request": {
  5858. // "$ref": "EntityUserLink"
  5859. // },
  5860. // "response": {
  5861. // "$ref": "EntityUserLink"
  5862. // },
  5863. // "scopes": [
  5864. // "https://www.googleapis.com/auth/analytics.manage.users"
  5865. // ]
  5866. // }
  5867. }
  5868. // method id "analytics.management.accountUserLinks.list":
  5869. type ManagementAccountUserLinksListCall struct {
  5870. s *Service
  5871. accountId string
  5872. urlParams_ gensupport.URLParams
  5873. ifNoneMatch_ string
  5874. ctx_ context.Context
  5875. header_ http.Header
  5876. }
  5877. // List: Lists account-user links for a given account.
  5878. func (r *ManagementAccountUserLinksService) List(accountId string) *ManagementAccountUserLinksListCall {
  5879. c := &ManagementAccountUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5880. c.accountId = accountId
  5881. return c
  5882. }
  5883. // MaxResults sets the optional parameter "max-results": The maximum
  5884. // number of account-user links to include in this response.
  5885. func (c *ManagementAccountUserLinksListCall) MaxResults(maxResults int64) *ManagementAccountUserLinksListCall {
  5886. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5887. return c
  5888. }
  5889. // StartIndex sets the optional parameter "start-index": An index of the
  5890. // first account-user link to retrieve. Use this parameter as a
  5891. // pagination mechanism along with the max-results parameter.
  5892. func (c *ManagementAccountUserLinksListCall) StartIndex(startIndex int64) *ManagementAccountUserLinksListCall {
  5893. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5894. return c
  5895. }
  5896. // Fields allows partial responses to be retrieved. See
  5897. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5898. // for more information.
  5899. func (c *ManagementAccountUserLinksListCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksListCall {
  5900. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5901. return c
  5902. }
  5903. // IfNoneMatch sets the optional parameter which makes the operation
  5904. // fail if the object's ETag matches the given value. This is useful for
  5905. // getting updates only after the object has changed since the last
  5906. // request. Use googleapi.IsNotModified to check whether the response
  5907. // error from Do is the result of In-None-Match.
  5908. func (c *ManagementAccountUserLinksListCall) IfNoneMatch(entityTag string) *ManagementAccountUserLinksListCall {
  5909. c.ifNoneMatch_ = entityTag
  5910. return c
  5911. }
  5912. // Context sets the context to be used in this call's Do method. Any
  5913. // pending HTTP request will be aborted if the provided context is
  5914. // canceled.
  5915. func (c *ManagementAccountUserLinksListCall) Context(ctx context.Context) *ManagementAccountUserLinksListCall {
  5916. c.ctx_ = ctx
  5917. return c
  5918. }
  5919. // Header returns an http.Header that can be modified by the caller to
  5920. // add HTTP headers to the request.
  5921. func (c *ManagementAccountUserLinksListCall) Header() http.Header {
  5922. if c.header_ == nil {
  5923. c.header_ = make(http.Header)
  5924. }
  5925. return c.header_
  5926. }
  5927. func (c *ManagementAccountUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  5928. reqHeaders := make(http.Header)
  5929. for k, v := range c.header_ {
  5930. reqHeaders[k] = v
  5931. }
  5932. reqHeaders.Set("User-Agent", c.s.userAgent())
  5933. if c.ifNoneMatch_ != "" {
  5934. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5935. }
  5936. var body io.Reader = nil
  5937. c.urlParams_.Set("alt", alt)
  5938. c.urlParams_.Set("prettyPrint", "false")
  5939. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  5940. urls += "?" + c.urlParams_.Encode()
  5941. req, err := http.NewRequest("GET", urls, body)
  5942. if err != nil {
  5943. return nil, err
  5944. }
  5945. req.Header = reqHeaders
  5946. googleapi.Expand(req.URL, map[string]string{
  5947. "accountId": c.accountId,
  5948. })
  5949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5950. }
  5951. // Do executes the "analytics.management.accountUserLinks.list" call.
  5952. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  5953. // status code is an error. Response headers are in either
  5954. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  5955. // at all) in error.(*googleapi.Error).Header. Use
  5956. // googleapi.IsNotModified to check whether the returned error was
  5957. // because http.StatusNotModified was returned.
  5958. func (c *ManagementAccountUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  5959. gensupport.SetOptions(c.urlParams_, opts...)
  5960. res, err := c.doRequest("json")
  5961. if res != nil && res.StatusCode == http.StatusNotModified {
  5962. if res.Body != nil {
  5963. res.Body.Close()
  5964. }
  5965. return nil, &googleapi.Error{
  5966. Code: res.StatusCode,
  5967. Header: res.Header,
  5968. }
  5969. }
  5970. if err != nil {
  5971. return nil, err
  5972. }
  5973. defer googleapi.CloseBody(res)
  5974. if err := googleapi.CheckResponse(res); err != nil {
  5975. return nil, err
  5976. }
  5977. ret := &EntityUserLinks{
  5978. ServerResponse: googleapi.ServerResponse{
  5979. Header: res.Header,
  5980. HTTPStatusCode: res.StatusCode,
  5981. },
  5982. }
  5983. target := &ret
  5984. if err := gensupport.DecodeResponse(target, res); err != nil {
  5985. return nil, err
  5986. }
  5987. return ret, nil
  5988. // {
  5989. // "description": "Lists account-user links for a given account.",
  5990. // "httpMethod": "GET",
  5991. // "id": "analytics.management.accountUserLinks.list",
  5992. // "parameterOrder": [
  5993. // "accountId"
  5994. // ],
  5995. // "parameters": {
  5996. // "accountId": {
  5997. // "description": "Account ID to retrieve the user links for.",
  5998. // "location": "path",
  5999. // "required": true,
  6000. // "type": "string"
  6001. // },
  6002. // "max-results": {
  6003. // "description": "The maximum number of account-user links to include in this response.",
  6004. // "format": "int32",
  6005. // "location": "query",
  6006. // "type": "integer"
  6007. // },
  6008. // "start-index": {
  6009. // "description": "An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6010. // "format": "int32",
  6011. // "location": "query",
  6012. // "minimum": "1",
  6013. // "type": "integer"
  6014. // }
  6015. // },
  6016. // "path": "management/accounts/{accountId}/entityUserLinks",
  6017. // "response": {
  6018. // "$ref": "EntityUserLinks"
  6019. // },
  6020. // "scopes": [
  6021. // "https://www.googleapis.com/auth/analytics.manage.users",
  6022. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  6023. // ]
  6024. // }
  6025. }
  6026. // method id "analytics.management.accountUserLinks.update":
  6027. type ManagementAccountUserLinksUpdateCall struct {
  6028. s *Service
  6029. accountId string
  6030. linkId string
  6031. entityuserlink *EntityUserLink
  6032. urlParams_ gensupport.URLParams
  6033. ctx_ context.Context
  6034. header_ http.Header
  6035. }
  6036. // Update: Updates permissions for an existing user on the given
  6037. // account.
  6038. func (r *ManagementAccountUserLinksService) Update(accountId string, linkId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksUpdateCall {
  6039. c := &ManagementAccountUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6040. c.accountId = accountId
  6041. c.linkId = linkId
  6042. c.entityuserlink = entityuserlink
  6043. return c
  6044. }
  6045. // Fields allows partial responses to be retrieved. See
  6046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6047. // for more information.
  6048. func (c *ManagementAccountUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksUpdateCall {
  6049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6050. return c
  6051. }
  6052. // Context sets the context to be used in this call's Do method. Any
  6053. // pending HTTP request will be aborted if the provided context is
  6054. // canceled.
  6055. func (c *ManagementAccountUserLinksUpdateCall) Context(ctx context.Context) *ManagementAccountUserLinksUpdateCall {
  6056. c.ctx_ = ctx
  6057. return c
  6058. }
  6059. // Header returns an http.Header that can be modified by the caller to
  6060. // add HTTP headers to the request.
  6061. func (c *ManagementAccountUserLinksUpdateCall) Header() http.Header {
  6062. if c.header_ == nil {
  6063. c.header_ = make(http.Header)
  6064. }
  6065. return c.header_
  6066. }
  6067. func (c *ManagementAccountUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  6068. reqHeaders := make(http.Header)
  6069. for k, v := range c.header_ {
  6070. reqHeaders[k] = v
  6071. }
  6072. reqHeaders.Set("User-Agent", c.s.userAgent())
  6073. var body io.Reader = nil
  6074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  6075. if err != nil {
  6076. return nil, err
  6077. }
  6078. reqHeaders.Set("Content-Type", "application/json")
  6079. c.urlParams_.Set("alt", alt)
  6080. c.urlParams_.Set("prettyPrint", "false")
  6081. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  6082. urls += "?" + c.urlParams_.Encode()
  6083. req, err := http.NewRequest("PUT", urls, body)
  6084. if err != nil {
  6085. return nil, err
  6086. }
  6087. req.Header = reqHeaders
  6088. googleapi.Expand(req.URL, map[string]string{
  6089. "accountId": c.accountId,
  6090. "linkId": c.linkId,
  6091. })
  6092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6093. }
  6094. // Do executes the "analytics.management.accountUserLinks.update" call.
  6095. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  6096. // status code is an error. Response headers are in either
  6097. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  6098. // at all) in error.(*googleapi.Error).Header. Use
  6099. // googleapi.IsNotModified to check whether the returned error was
  6100. // because http.StatusNotModified was returned.
  6101. func (c *ManagementAccountUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  6102. gensupport.SetOptions(c.urlParams_, opts...)
  6103. res, err := c.doRequest("json")
  6104. if res != nil && res.StatusCode == http.StatusNotModified {
  6105. if res.Body != nil {
  6106. res.Body.Close()
  6107. }
  6108. return nil, &googleapi.Error{
  6109. Code: res.StatusCode,
  6110. Header: res.Header,
  6111. }
  6112. }
  6113. if err != nil {
  6114. return nil, err
  6115. }
  6116. defer googleapi.CloseBody(res)
  6117. if err := googleapi.CheckResponse(res); err != nil {
  6118. return nil, err
  6119. }
  6120. ret := &EntityUserLink{
  6121. ServerResponse: googleapi.ServerResponse{
  6122. Header: res.Header,
  6123. HTTPStatusCode: res.StatusCode,
  6124. },
  6125. }
  6126. target := &ret
  6127. if err := gensupport.DecodeResponse(target, res); err != nil {
  6128. return nil, err
  6129. }
  6130. return ret, nil
  6131. // {
  6132. // "description": "Updates permissions for an existing user on the given account.",
  6133. // "httpMethod": "PUT",
  6134. // "id": "analytics.management.accountUserLinks.update",
  6135. // "parameterOrder": [
  6136. // "accountId",
  6137. // "linkId"
  6138. // ],
  6139. // "parameters": {
  6140. // "accountId": {
  6141. // "description": "Account ID to update the account-user link for.",
  6142. // "location": "path",
  6143. // "required": true,
  6144. // "type": "string"
  6145. // },
  6146. // "linkId": {
  6147. // "description": "Link ID to update the account-user link for.",
  6148. // "location": "path",
  6149. // "required": true,
  6150. // "type": "string"
  6151. // }
  6152. // },
  6153. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  6154. // "request": {
  6155. // "$ref": "EntityUserLink"
  6156. // },
  6157. // "response": {
  6158. // "$ref": "EntityUserLink"
  6159. // },
  6160. // "scopes": [
  6161. // "https://www.googleapis.com/auth/analytics.manage.users"
  6162. // ]
  6163. // }
  6164. }
  6165. // method id "analytics.management.accounts.list":
  6166. type ManagementAccountsListCall struct {
  6167. s *Service
  6168. urlParams_ gensupport.URLParams
  6169. ifNoneMatch_ string
  6170. ctx_ context.Context
  6171. header_ http.Header
  6172. }
  6173. // List: Lists all accounts to which the user has access.
  6174. func (r *ManagementAccountsService) List() *ManagementAccountsListCall {
  6175. c := &ManagementAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6176. return c
  6177. }
  6178. // MaxResults sets the optional parameter "max-results": The maximum
  6179. // number of accounts to include in this response.
  6180. func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall {
  6181. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6182. return c
  6183. }
  6184. // StartIndex sets the optional parameter "start-index": An index of the
  6185. // first account to retrieve. Use this parameter as a pagination
  6186. // mechanism along with the max-results parameter.
  6187. func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall {
  6188. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6189. return c
  6190. }
  6191. // Fields allows partial responses to be retrieved. See
  6192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6193. // for more information.
  6194. func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall {
  6195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6196. return c
  6197. }
  6198. // IfNoneMatch sets the optional parameter which makes the operation
  6199. // fail if the object's ETag matches the given value. This is useful for
  6200. // getting updates only after the object has changed since the last
  6201. // request. Use googleapi.IsNotModified to check whether the response
  6202. // error from Do is the result of In-None-Match.
  6203. func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall {
  6204. c.ifNoneMatch_ = entityTag
  6205. return c
  6206. }
  6207. // Context sets the context to be used in this call's Do method. Any
  6208. // pending HTTP request will be aborted if the provided context is
  6209. // canceled.
  6210. func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall {
  6211. c.ctx_ = ctx
  6212. return c
  6213. }
  6214. // Header returns an http.Header that can be modified by the caller to
  6215. // add HTTP headers to the request.
  6216. func (c *ManagementAccountsListCall) Header() http.Header {
  6217. if c.header_ == nil {
  6218. c.header_ = make(http.Header)
  6219. }
  6220. return c.header_
  6221. }
  6222. func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, error) {
  6223. reqHeaders := make(http.Header)
  6224. for k, v := range c.header_ {
  6225. reqHeaders[k] = v
  6226. }
  6227. reqHeaders.Set("User-Agent", c.s.userAgent())
  6228. if c.ifNoneMatch_ != "" {
  6229. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6230. }
  6231. var body io.Reader = nil
  6232. c.urlParams_.Set("alt", alt)
  6233. c.urlParams_.Set("prettyPrint", "false")
  6234. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts")
  6235. urls += "?" + c.urlParams_.Encode()
  6236. req, err := http.NewRequest("GET", urls, body)
  6237. if err != nil {
  6238. return nil, err
  6239. }
  6240. req.Header = reqHeaders
  6241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6242. }
  6243. // Do executes the "analytics.management.accounts.list" call.
  6244. // Exactly one of *Accounts or error will be non-nil. Any non-2xx status
  6245. // code is an error. Response headers are in either
  6246. // *Accounts.ServerResponse.Header or (if a response was returned at
  6247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6248. // to check whether the returned error was because
  6249. // http.StatusNotModified was returned.
  6250. func (c *ManagementAccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
  6251. gensupport.SetOptions(c.urlParams_, opts...)
  6252. res, err := c.doRequest("json")
  6253. if res != nil && res.StatusCode == http.StatusNotModified {
  6254. if res.Body != nil {
  6255. res.Body.Close()
  6256. }
  6257. return nil, &googleapi.Error{
  6258. Code: res.StatusCode,
  6259. Header: res.Header,
  6260. }
  6261. }
  6262. if err != nil {
  6263. return nil, err
  6264. }
  6265. defer googleapi.CloseBody(res)
  6266. if err := googleapi.CheckResponse(res); err != nil {
  6267. return nil, err
  6268. }
  6269. ret := &Accounts{
  6270. ServerResponse: googleapi.ServerResponse{
  6271. Header: res.Header,
  6272. HTTPStatusCode: res.StatusCode,
  6273. },
  6274. }
  6275. target := &ret
  6276. if err := gensupport.DecodeResponse(target, res); err != nil {
  6277. return nil, err
  6278. }
  6279. return ret, nil
  6280. // {
  6281. // "description": "Lists all accounts to which the user has access.",
  6282. // "httpMethod": "GET",
  6283. // "id": "analytics.management.accounts.list",
  6284. // "parameters": {
  6285. // "max-results": {
  6286. // "description": "The maximum number of accounts to include in this response.",
  6287. // "format": "int32",
  6288. // "location": "query",
  6289. // "type": "integer"
  6290. // },
  6291. // "start-index": {
  6292. // "description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6293. // "format": "int32",
  6294. // "location": "query",
  6295. // "minimum": "1",
  6296. // "type": "integer"
  6297. // }
  6298. // },
  6299. // "path": "management/accounts",
  6300. // "response": {
  6301. // "$ref": "Accounts"
  6302. // },
  6303. // "scopes": [
  6304. // "https://www.googleapis.com/auth/analytics",
  6305. // "https://www.googleapis.com/auth/analytics.edit",
  6306. // "https://www.googleapis.com/auth/analytics.readonly"
  6307. // ]
  6308. // }
  6309. }
  6310. // method id "analytics.management.clientId.hashClientId":
  6311. type ManagementClientIdHashClientIdCall struct {
  6312. s *Service
  6313. hashclientidrequest *HashClientIdRequest
  6314. urlParams_ gensupport.URLParams
  6315. ctx_ context.Context
  6316. header_ http.Header
  6317. }
  6318. // HashClientId: Hashes the given Client ID.
  6319. func (r *ManagementClientIdService) HashClientId(hashclientidrequest *HashClientIdRequest) *ManagementClientIdHashClientIdCall {
  6320. c := &ManagementClientIdHashClientIdCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6321. c.hashclientidrequest = hashclientidrequest
  6322. return c
  6323. }
  6324. // Fields allows partial responses to be retrieved. See
  6325. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6326. // for more information.
  6327. func (c *ManagementClientIdHashClientIdCall) Fields(s ...googleapi.Field) *ManagementClientIdHashClientIdCall {
  6328. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6329. return c
  6330. }
  6331. // Context sets the context to be used in this call's Do method. Any
  6332. // pending HTTP request will be aborted if the provided context is
  6333. // canceled.
  6334. func (c *ManagementClientIdHashClientIdCall) Context(ctx context.Context) *ManagementClientIdHashClientIdCall {
  6335. c.ctx_ = ctx
  6336. return c
  6337. }
  6338. // Header returns an http.Header that can be modified by the caller to
  6339. // add HTTP headers to the request.
  6340. func (c *ManagementClientIdHashClientIdCall) Header() http.Header {
  6341. if c.header_ == nil {
  6342. c.header_ = make(http.Header)
  6343. }
  6344. return c.header_
  6345. }
  6346. func (c *ManagementClientIdHashClientIdCall) doRequest(alt string) (*http.Response, error) {
  6347. reqHeaders := make(http.Header)
  6348. for k, v := range c.header_ {
  6349. reqHeaders[k] = v
  6350. }
  6351. reqHeaders.Set("User-Agent", c.s.userAgent())
  6352. var body io.Reader = nil
  6353. body, err := googleapi.WithoutDataWrapper.JSONReader(c.hashclientidrequest)
  6354. if err != nil {
  6355. return nil, err
  6356. }
  6357. reqHeaders.Set("Content-Type", "application/json")
  6358. c.urlParams_.Set("alt", alt)
  6359. c.urlParams_.Set("prettyPrint", "false")
  6360. urls := googleapi.ResolveRelative(c.s.BasePath, "management/clientId:hashClientId")
  6361. urls += "?" + c.urlParams_.Encode()
  6362. req, err := http.NewRequest("POST", urls, body)
  6363. if err != nil {
  6364. return nil, err
  6365. }
  6366. req.Header = reqHeaders
  6367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6368. }
  6369. // Do executes the "analytics.management.clientId.hashClientId" call.
  6370. // Exactly one of *HashClientIdResponse or error will be non-nil. Any
  6371. // non-2xx status code is an error. Response headers are in either
  6372. // *HashClientIdResponse.ServerResponse.Header or (if a response was
  6373. // returned at all) in error.(*googleapi.Error).Header. Use
  6374. // googleapi.IsNotModified to check whether the returned error was
  6375. // because http.StatusNotModified was returned.
  6376. func (c *ManagementClientIdHashClientIdCall) Do(opts ...googleapi.CallOption) (*HashClientIdResponse, error) {
  6377. gensupport.SetOptions(c.urlParams_, opts...)
  6378. res, err := c.doRequest("json")
  6379. if res != nil && res.StatusCode == http.StatusNotModified {
  6380. if res.Body != nil {
  6381. res.Body.Close()
  6382. }
  6383. return nil, &googleapi.Error{
  6384. Code: res.StatusCode,
  6385. Header: res.Header,
  6386. }
  6387. }
  6388. if err != nil {
  6389. return nil, err
  6390. }
  6391. defer googleapi.CloseBody(res)
  6392. if err := googleapi.CheckResponse(res); err != nil {
  6393. return nil, err
  6394. }
  6395. ret := &HashClientIdResponse{
  6396. ServerResponse: googleapi.ServerResponse{
  6397. Header: res.Header,
  6398. HTTPStatusCode: res.StatusCode,
  6399. },
  6400. }
  6401. target := &ret
  6402. if err := gensupport.DecodeResponse(target, res); err != nil {
  6403. return nil, err
  6404. }
  6405. return ret, nil
  6406. // {
  6407. // "description": "Hashes the given Client ID.",
  6408. // "httpMethod": "POST",
  6409. // "id": "analytics.management.clientId.hashClientId",
  6410. // "path": "management/clientId:hashClientId",
  6411. // "request": {
  6412. // "$ref": "HashClientIdRequest"
  6413. // },
  6414. // "response": {
  6415. // "$ref": "HashClientIdResponse"
  6416. // },
  6417. // "scopes": [
  6418. // "https://www.googleapis.com/auth/analytics.edit",
  6419. // "https://www.googleapis.com/auth/analytics.readonly"
  6420. // ]
  6421. // }
  6422. }
  6423. // method id "analytics.management.customDataSources.list":
  6424. type ManagementCustomDataSourcesListCall struct {
  6425. s *Service
  6426. accountId string
  6427. webPropertyId string
  6428. urlParams_ gensupport.URLParams
  6429. ifNoneMatch_ string
  6430. ctx_ context.Context
  6431. header_ http.Header
  6432. }
  6433. // List: List custom data sources to which the user has access.
  6434. func (r *ManagementCustomDataSourcesService) List(accountId string, webPropertyId string) *ManagementCustomDataSourcesListCall {
  6435. c := &ManagementCustomDataSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6436. c.accountId = accountId
  6437. c.webPropertyId = webPropertyId
  6438. return c
  6439. }
  6440. // MaxResults sets the optional parameter "max-results": The maximum
  6441. // number of custom data sources to include in this response.
  6442. func (c *ManagementCustomDataSourcesListCall) MaxResults(maxResults int64) *ManagementCustomDataSourcesListCall {
  6443. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6444. return c
  6445. }
  6446. // StartIndex sets the optional parameter "start-index": A 1-based index
  6447. // of the first custom data source to retrieve. Use this parameter as a
  6448. // pagination mechanism along with the max-results parameter.
  6449. func (c *ManagementCustomDataSourcesListCall) StartIndex(startIndex int64) *ManagementCustomDataSourcesListCall {
  6450. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6451. return c
  6452. }
  6453. // Fields allows partial responses to be retrieved. See
  6454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6455. // for more information.
  6456. func (c *ManagementCustomDataSourcesListCall) Fields(s ...googleapi.Field) *ManagementCustomDataSourcesListCall {
  6457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6458. return c
  6459. }
  6460. // IfNoneMatch sets the optional parameter which makes the operation
  6461. // fail if the object's ETag matches the given value. This is useful for
  6462. // getting updates only after the object has changed since the last
  6463. // request. Use googleapi.IsNotModified to check whether the response
  6464. // error from Do is the result of In-None-Match.
  6465. func (c *ManagementCustomDataSourcesListCall) IfNoneMatch(entityTag string) *ManagementCustomDataSourcesListCall {
  6466. c.ifNoneMatch_ = entityTag
  6467. return c
  6468. }
  6469. // Context sets the context to be used in this call's Do method. Any
  6470. // pending HTTP request will be aborted if the provided context is
  6471. // canceled.
  6472. func (c *ManagementCustomDataSourcesListCall) Context(ctx context.Context) *ManagementCustomDataSourcesListCall {
  6473. c.ctx_ = ctx
  6474. return c
  6475. }
  6476. // Header returns an http.Header that can be modified by the caller to
  6477. // add HTTP headers to the request.
  6478. func (c *ManagementCustomDataSourcesListCall) Header() http.Header {
  6479. if c.header_ == nil {
  6480. c.header_ = make(http.Header)
  6481. }
  6482. return c.header_
  6483. }
  6484. func (c *ManagementCustomDataSourcesListCall) doRequest(alt string) (*http.Response, error) {
  6485. reqHeaders := make(http.Header)
  6486. for k, v := range c.header_ {
  6487. reqHeaders[k] = v
  6488. }
  6489. reqHeaders.Set("User-Agent", c.s.userAgent())
  6490. if c.ifNoneMatch_ != "" {
  6491. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6492. }
  6493. var body io.Reader = nil
  6494. c.urlParams_.Set("alt", alt)
  6495. c.urlParams_.Set("prettyPrint", "false")
  6496. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources")
  6497. urls += "?" + c.urlParams_.Encode()
  6498. req, err := http.NewRequest("GET", urls, body)
  6499. if err != nil {
  6500. return nil, err
  6501. }
  6502. req.Header = reqHeaders
  6503. googleapi.Expand(req.URL, map[string]string{
  6504. "accountId": c.accountId,
  6505. "webPropertyId": c.webPropertyId,
  6506. })
  6507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6508. }
  6509. // Do executes the "analytics.management.customDataSources.list" call.
  6510. // Exactly one of *CustomDataSources or error will be non-nil. Any
  6511. // non-2xx status code is an error. Response headers are in either
  6512. // *CustomDataSources.ServerResponse.Header or (if a response was
  6513. // returned at all) in error.(*googleapi.Error).Header. Use
  6514. // googleapi.IsNotModified to check whether the returned error was
  6515. // because http.StatusNotModified was returned.
  6516. func (c *ManagementCustomDataSourcesListCall) Do(opts ...googleapi.CallOption) (*CustomDataSources, error) {
  6517. gensupport.SetOptions(c.urlParams_, opts...)
  6518. res, err := c.doRequest("json")
  6519. if res != nil && res.StatusCode == http.StatusNotModified {
  6520. if res.Body != nil {
  6521. res.Body.Close()
  6522. }
  6523. return nil, &googleapi.Error{
  6524. Code: res.StatusCode,
  6525. Header: res.Header,
  6526. }
  6527. }
  6528. if err != nil {
  6529. return nil, err
  6530. }
  6531. defer googleapi.CloseBody(res)
  6532. if err := googleapi.CheckResponse(res); err != nil {
  6533. return nil, err
  6534. }
  6535. ret := &CustomDataSources{
  6536. ServerResponse: googleapi.ServerResponse{
  6537. Header: res.Header,
  6538. HTTPStatusCode: res.StatusCode,
  6539. },
  6540. }
  6541. target := &ret
  6542. if err := gensupport.DecodeResponse(target, res); err != nil {
  6543. return nil, err
  6544. }
  6545. return ret, nil
  6546. // {
  6547. // "description": "List custom data sources to which the user has access.",
  6548. // "httpMethod": "GET",
  6549. // "id": "analytics.management.customDataSources.list",
  6550. // "parameterOrder": [
  6551. // "accountId",
  6552. // "webPropertyId"
  6553. // ],
  6554. // "parameters": {
  6555. // "accountId": {
  6556. // "description": "Account Id for the custom data sources to retrieve.",
  6557. // "location": "path",
  6558. // "pattern": "\\d+",
  6559. // "required": true,
  6560. // "type": "string"
  6561. // },
  6562. // "max-results": {
  6563. // "description": "The maximum number of custom data sources to include in this response.",
  6564. // "format": "int32",
  6565. // "location": "query",
  6566. // "minimum": "1",
  6567. // "type": "integer"
  6568. // },
  6569. // "start-index": {
  6570. // "description": "A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6571. // "format": "int32",
  6572. // "location": "query",
  6573. // "minimum": "1",
  6574. // "type": "integer"
  6575. // },
  6576. // "webPropertyId": {
  6577. // "description": "Web property Id for the custom data sources to retrieve.",
  6578. // "location": "path",
  6579. // "pattern": "UA-(\\d+)-(\\d+)",
  6580. // "required": true,
  6581. // "type": "string"
  6582. // }
  6583. // },
  6584. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources",
  6585. // "response": {
  6586. // "$ref": "CustomDataSources"
  6587. // },
  6588. // "scopes": [
  6589. // "https://www.googleapis.com/auth/analytics",
  6590. // "https://www.googleapis.com/auth/analytics.edit",
  6591. // "https://www.googleapis.com/auth/analytics.readonly"
  6592. // ]
  6593. // }
  6594. }
  6595. // method id "analytics.management.customDimensions.get":
  6596. type ManagementCustomDimensionsGetCall struct {
  6597. s *Service
  6598. accountId string
  6599. webPropertyId string
  6600. customDimensionId string
  6601. urlParams_ gensupport.URLParams
  6602. ifNoneMatch_ string
  6603. ctx_ context.Context
  6604. header_ http.Header
  6605. }
  6606. // Get: Get a custom dimension to which the user has access.
  6607. func (r *ManagementCustomDimensionsService) Get(accountId string, webPropertyId string, customDimensionId string) *ManagementCustomDimensionsGetCall {
  6608. c := &ManagementCustomDimensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6609. c.accountId = accountId
  6610. c.webPropertyId = webPropertyId
  6611. c.customDimensionId = customDimensionId
  6612. return c
  6613. }
  6614. // Fields allows partial responses to be retrieved. See
  6615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6616. // for more information.
  6617. func (c *ManagementCustomDimensionsGetCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsGetCall {
  6618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6619. return c
  6620. }
  6621. // IfNoneMatch sets the optional parameter which makes the operation
  6622. // fail if the object's ETag matches the given value. This is useful for
  6623. // getting updates only after the object has changed since the last
  6624. // request. Use googleapi.IsNotModified to check whether the response
  6625. // error from Do is the result of In-None-Match.
  6626. func (c *ManagementCustomDimensionsGetCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsGetCall {
  6627. c.ifNoneMatch_ = entityTag
  6628. return c
  6629. }
  6630. // Context sets the context to be used in this call's Do method. Any
  6631. // pending HTTP request will be aborted if the provided context is
  6632. // canceled.
  6633. func (c *ManagementCustomDimensionsGetCall) Context(ctx context.Context) *ManagementCustomDimensionsGetCall {
  6634. c.ctx_ = ctx
  6635. return c
  6636. }
  6637. // Header returns an http.Header that can be modified by the caller to
  6638. // add HTTP headers to the request.
  6639. func (c *ManagementCustomDimensionsGetCall) Header() http.Header {
  6640. if c.header_ == nil {
  6641. c.header_ = make(http.Header)
  6642. }
  6643. return c.header_
  6644. }
  6645. func (c *ManagementCustomDimensionsGetCall) doRequest(alt string) (*http.Response, error) {
  6646. reqHeaders := make(http.Header)
  6647. for k, v := range c.header_ {
  6648. reqHeaders[k] = v
  6649. }
  6650. reqHeaders.Set("User-Agent", c.s.userAgent())
  6651. if c.ifNoneMatch_ != "" {
  6652. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6653. }
  6654. var body io.Reader = nil
  6655. c.urlParams_.Set("alt", alt)
  6656. c.urlParams_.Set("prettyPrint", "false")
  6657. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  6658. urls += "?" + c.urlParams_.Encode()
  6659. req, err := http.NewRequest("GET", urls, body)
  6660. if err != nil {
  6661. return nil, err
  6662. }
  6663. req.Header = reqHeaders
  6664. googleapi.Expand(req.URL, map[string]string{
  6665. "accountId": c.accountId,
  6666. "webPropertyId": c.webPropertyId,
  6667. "customDimensionId": c.customDimensionId,
  6668. })
  6669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6670. }
  6671. // Do executes the "analytics.management.customDimensions.get" call.
  6672. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  6673. // status code is an error. Response headers are in either
  6674. // *CustomDimension.ServerResponse.Header or (if a response was returned
  6675. // at all) in error.(*googleapi.Error).Header. Use
  6676. // googleapi.IsNotModified to check whether the returned error was
  6677. // because http.StatusNotModified was returned.
  6678. func (c *ManagementCustomDimensionsGetCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  6679. gensupport.SetOptions(c.urlParams_, opts...)
  6680. res, err := c.doRequest("json")
  6681. if res != nil && res.StatusCode == http.StatusNotModified {
  6682. if res.Body != nil {
  6683. res.Body.Close()
  6684. }
  6685. return nil, &googleapi.Error{
  6686. Code: res.StatusCode,
  6687. Header: res.Header,
  6688. }
  6689. }
  6690. if err != nil {
  6691. return nil, err
  6692. }
  6693. defer googleapi.CloseBody(res)
  6694. if err := googleapi.CheckResponse(res); err != nil {
  6695. return nil, err
  6696. }
  6697. ret := &CustomDimension{
  6698. ServerResponse: googleapi.ServerResponse{
  6699. Header: res.Header,
  6700. HTTPStatusCode: res.StatusCode,
  6701. },
  6702. }
  6703. target := &ret
  6704. if err := gensupport.DecodeResponse(target, res); err != nil {
  6705. return nil, err
  6706. }
  6707. return ret, nil
  6708. // {
  6709. // "description": "Get a custom dimension to which the user has access.",
  6710. // "httpMethod": "GET",
  6711. // "id": "analytics.management.customDimensions.get",
  6712. // "parameterOrder": [
  6713. // "accountId",
  6714. // "webPropertyId",
  6715. // "customDimensionId"
  6716. // ],
  6717. // "parameters": {
  6718. // "accountId": {
  6719. // "description": "Account ID for the custom dimension to retrieve.",
  6720. // "location": "path",
  6721. // "required": true,
  6722. // "type": "string"
  6723. // },
  6724. // "customDimensionId": {
  6725. // "description": "The ID of the custom dimension to retrieve.",
  6726. // "location": "path",
  6727. // "required": true,
  6728. // "type": "string"
  6729. // },
  6730. // "webPropertyId": {
  6731. // "description": "Web property ID for the custom dimension to retrieve.",
  6732. // "location": "path",
  6733. // "required": true,
  6734. // "type": "string"
  6735. // }
  6736. // },
  6737. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  6738. // "response": {
  6739. // "$ref": "CustomDimension"
  6740. // },
  6741. // "scopes": [
  6742. // "https://www.googleapis.com/auth/analytics.edit",
  6743. // "https://www.googleapis.com/auth/analytics.readonly"
  6744. // ]
  6745. // }
  6746. }
  6747. // method id "analytics.management.customDimensions.insert":
  6748. type ManagementCustomDimensionsInsertCall struct {
  6749. s *Service
  6750. accountId string
  6751. webPropertyId string
  6752. customdimension *CustomDimension
  6753. urlParams_ gensupport.URLParams
  6754. ctx_ context.Context
  6755. header_ http.Header
  6756. }
  6757. // Insert: Create a new custom dimension.
  6758. func (r *ManagementCustomDimensionsService) Insert(accountId string, webPropertyId string, customdimension *CustomDimension) *ManagementCustomDimensionsInsertCall {
  6759. c := &ManagementCustomDimensionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6760. c.accountId = accountId
  6761. c.webPropertyId = webPropertyId
  6762. c.customdimension = customdimension
  6763. return c
  6764. }
  6765. // Fields allows partial responses to be retrieved. See
  6766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6767. // for more information.
  6768. func (c *ManagementCustomDimensionsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsInsertCall {
  6769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6770. return c
  6771. }
  6772. // Context sets the context to be used in this call's Do method. Any
  6773. // pending HTTP request will be aborted if the provided context is
  6774. // canceled.
  6775. func (c *ManagementCustomDimensionsInsertCall) Context(ctx context.Context) *ManagementCustomDimensionsInsertCall {
  6776. c.ctx_ = ctx
  6777. return c
  6778. }
  6779. // Header returns an http.Header that can be modified by the caller to
  6780. // add HTTP headers to the request.
  6781. func (c *ManagementCustomDimensionsInsertCall) Header() http.Header {
  6782. if c.header_ == nil {
  6783. c.header_ = make(http.Header)
  6784. }
  6785. return c.header_
  6786. }
  6787. func (c *ManagementCustomDimensionsInsertCall) doRequest(alt string) (*http.Response, error) {
  6788. reqHeaders := make(http.Header)
  6789. for k, v := range c.header_ {
  6790. reqHeaders[k] = v
  6791. }
  6792. reqHeaders.Set("User-Agent", c.s.userAgent())
  6793. var body io.Reader = nil
  6794. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  6795. if err != nil {
  6796. return nil, err
  6797. }
  6798. reqHeaders.Set("Content-Type", "application/json")
  6799. c.urlParams_.Set("alt", alt)
  6800. c.urlParams_.Set("prettyPrint", "false")
  6801. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  6802. urls += "?" + c.urlParams_.Encode()
  6803. req, err := http.NewRequest("POST", urls, body)
  6804. if err != nil {
  6805. return nil, err
  6806. }
  6807. req.Header = reqHeaders
  6808. googleapi.Expand(req.URL, map[string]string{
  6809. "accountId": c.accountId,
  6810. "webPropertyId": c.webPropertyId,
  6811. })
  6812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6813. }
  6814. // Do executes the "analytics.management.customDimensions.insert" call.
  6815. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  6816. // status code is an error. Response headers are in either
  6817. // *CustomDimension.ServerResponse.Header or (if a response was returned
  6818. // at all) in error.(*googleapi.Error).Header. Use
  6819. // googleapi.IsNotModified to check whether the returned error was
  6820. // because http.StatusNotModified was returned.
  6821. func (c *ManagementCustomDimensionsInsertCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  6822. gensupport.SetOptions(c.urlParams_, opts...)
  6823. res, err := c.doRequest("json")
  6824. if res != nil && res.StatusCode == http.StatusNotModified {
  6825. if res.Body != nil {
  6826. res.Body.Close()
  6827. }
  6828. return nil, &googleapi.Error{
  6829. Code: res.StatusCode,
  6830. Header: res.Header,
  6831. }
  6832. }
  6833. if err != nil {
  6834. return nil, err
  6835. }
  6836. defer googleapi.CloseBody(res)
  6837. if err := googleapi.CheckResponse(res); err != nil {
  6838. return nil, err
  6839. }
  6840. ret := &CustomDimension{
  6841. ServerResponse: googleapi.ServerResponse{
  6842. Header: res.Header,
  6843. HTTPStatusCode: res.StatusCode,
  6844. },
  6845. }
  6846. target := &ret
  6847. if err := gensupport.DecodeResponse(target, res); err != nil {
  6848. return nil, err
  6849. }
  6850. return ret, nil
  6851. // {
  6852. // "description": "Create a new custom dimension.",
  6853. // "httpMethod": "POST",
  6854. // "id": "analytics.management.customDimensions.insert",
  6855. // "parameterOrder": [
  6856. // "accountId",
  6857. // "webPropertyId"
  6858. // ],
  6859. // "parameters": {
  6860. // "accountId": {
  6861. // "description": "Account ID for the custom dimension to create.",
  6862. // "location": "path",
  6863. // "required": true,
  6864. // "type": "string"
  6865. // },
  6866. // "webPropertyId": {
  6867. // "description": "Web property ID for the custom dimension to create.",
  6868. // "location": "path",
  6869. // "required": true,
  6870. // "type": "string"
  6871. // }
  6872. // },
  6873. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  6874. // "request": {
  6875. // "$ref": "CustomDimension"
  6876. // },
  6877. // "response": {
  6878. // "$ref": "CustomDimension"
  6879. // },
  6880. // "scopes": [
  6881. // "https://www.googleapis.com/auth/analytics.edit"
  6882. // ]
  6883. // }
  6884. }
  6885. // method id "analytics.management.customDimensions.list":
  6886. type ManagementCustomDimensionsListCall struct {
  6887. s *Service
  6888. accountId string
  6889. webPropertyId string
  6890. urlParams_ gensupport.URLParams
  6891. ifNoneMatch_ string
  6892. ctx_ context.Context
  6893. header_ http.Header
  6894. }
  6895. // List: Lists custom dimensions to which the user has access.
  6896. func (r *ManagementCustomDimensionsService) List(accountId string, webPropertyId string) *ManagementCustomDimensionsListCall {
  6897. c := &ManagementCustomDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6898. c.accountId = accountId
  6899. c.webPropertyId = webPropertyId
  6900. return c
  6901. }
  6902. // MaxResults sets the optional parameter "max-results": The maximum
  6903. // number of custom dimensions to include in this response.
  6904. func (c *ManagementCustomDimensionsListCall) MaxResults(maxResults int64) *ManagementCustomDimensionsListCall {
  6905. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6906. return c
  6907. }
  6908. // StartIndex sets the optional parameter "start-index": An index of the
  6909. // first entity to retrieve. Use this parameter as a pagination
  6910. // mechanism along with the max-results parameter.
  6911. func (c *ManagementCustomDimensionsListCall) StartIndex(startIndex int64) *ManagementCustomDimensionsListCall {
  6912. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6913. return c
  6914. }
  6915. // Fields allows partial responses to be retrieved. See
  6916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6917. // for more information.
  6918. func (c *ManagementCustomDimensionsListCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsListCall {
  6919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6920. return c
  6921. }
  6922. // IfNoneMatch sets the optional parameter which makes the operation
  6923. // fail if the object's ETag matches the given value. This is useful for
  6924. // getting updates only after the object has changed since the last
  6925. // request. Use googleapi.IsNotModified to check whether the response
  6926. // error from Do is the result of In-None-Match.
  6927. func (c *ManagementCustomDimensionsListCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsListCall {
  6928. c.ifNoneMatch_ = entityTag
  6929. return c
  6930. }
  6931. // Context sets the context to be used in this call's Do method. Any
  6932. // pending HTTP request will be aborted if the provided context is
  6933. // canceled.
  6934. func (c *ManagementCustomDimensionsListCall) Context(ctx context.Context) *ManagementCustomDimensionsListCall {
  6935. c.ctx_ = ctx
  6936. return c
  6937. }
  6938. // Header returns an http.Header that can be modified by the caller to
  6939. // add HTTP headers to the request.
  6940. func (c *ManagementCustomDimensionsListCall) Header() http.Header {
  6941. if c.header_ == nil {
  6942. c.header_ = make(http.Header)
  6943. }
  6944. return c.header_
  6945. }
  6946. func (c *ManagementCustomDimensionsListCall) doRequest(alt string) (*http.Response, error) {
  6947. reqHeaders := make(http.Header)
  6948. for k, v := range c.header_ {
  6949. reqHeaders[k] = v
  6950. }
  6951. reqHeaders.Set("User-Agent", c.s.userAgent())
  6952. if c.ifNoneMatch_ != "" {
  6953. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6954. }
  6955. var body io.Reader = nil
  6956. c.urlParams_.Set("alt", alt)
  6957. c.urlParams_.Set("prettyPrint", "false")
  6958. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  6959. urls += "?" + c.urlParams_.Encode()
  6960. req, err := http.NewRequest("GET", urls, body)
  6961. if err != nil {
  6962. return nil, err
  6963. }
  6964. req.Header = reqHeaders
  6965. googleapi.Expand(req.URL, map[string]string{
  6966. "accountId": c.accountId,
  6967. "webPropertyId": c.webPropertyId,
  6968. })
  6969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6970. }
  6971. // Do executes the "analytics.management.customDimensions.list" call.
  6972. // Exactly one of *CustomDimensions or error will be non-nil. Any
  6973. // non-2xx status code is an error. Response headers are in either
  6974. // *CustomDimensions.ServerResponse.Header or (if a response was
  6975. // returned at all) in error.(*googleapi.Error).Header. Use
  6976. // googleapi.IsNotModified to check whether the returned error was
  6977. // because http.StatusNotModified was returned.
  6978. func (c *ManagementCustomDimensionsListCall) Do(opts ...googleapi.CallOption) (*CustomDimensions, error) {
  6979. gensupport.SetOptions(c.urlParams_, opts...)
  6980. res, err := c.doRequest("json")
  6981. if res != nil && res.StatusCode == http.StatusNotModified {
  6982. if res.Body != nil {
  6983. res.Body.Close()
  6984. }
  6985. return nil, &googleapi.Error{
  6986. Code: res.StatusCode,
  6987. Header: res.Header,
  6988. }
  6989. }
  6990. if err != nil {
  6991. return nil, err
  6992. }
  6993. defer googleapi.CloseBody(res)
  6994. if err := googleapi.CheckResponse(res); err != nil {
  6995. return nil, err
  6996. }
  6997. ret := &CustomDimensions{
  6998. ServerResponse: googleapi.ServerResponse{
  6999. Header: res.Header,
  7000. HTTPStatusCode: res.StatusCode,
  7001. },
  7002. }
  7003. target := &ret
  7004. if err := gensupport.DecodeResponse(target, res); err != nil {
  7005. return nil, err
  7006. }
  7007. return ret, nil
  7008. // {
  7009. // "description": "Lists custom dimensions to which the user has access.",
  7010. // "httpMethod": "GET",
  7011. // "id": "analytics.management.customDimensions.list",
  7012. // "parameterOrder": [
  7013. // "accountId",
  7014. // "webPropertyId"
  7015. // ],
  7016. // "parameters": {
  7017. // "accountId": {
  7018. // "description": "Account ID for the custom dimensions to retrieve.",
  7019. // "location": "path",
  7020. // "required": true,
  7021. // "type": "string"
  7022. // },
  7023. // "max-results": {
  7024. // "description": "The maximum number of custom dimensions to include in this response.",
  7025. // "format": "int32",
  7026. // "location": "query",
  7027. // "type": "integer"
  7028. // },
  7029. // "start-index": {
  7030. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  7031. // "format": "int32",
  7032. // "location": "query",
  7033. // "minimum": "1",
  7034. // "type": "integer"
  7035. // },
  7036. // "webPropertyId": {
  7037. // "description": "Web property ID for the custom dimensions to retrieve.",
  7038. // "location": "path",
  7039. // "required": true,
  7040. // "type": "string"
  7041. // }
  7042. // },
  7043. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  7044. // "response": {
  7045. // "$ref": "CustomDimensions"
  7046. // },
  7047. // "scopes": [
  7048. // "https://www.googleapis.com/auth/analytics",
  7049. // "https://www.googleapis.com/auth/analytics.readonly"
  7050. // ]
  7051. // }
  7052. }
  7053. // method id "analytics.management.customDimensions.patch":
  7054. type ManagementCustomDimensionsPatchCall struct {
  7055. s *Service
  7056. accountId string
  7057. webPropertyId string
  7058. customDimensionId string
  7059. customdimension *CustomDimension
  7060. urlParams_ gensupport.URLParams
  7061. ctx_ context.Context
  7062. header_ http.Header
  7063. }
  7064. // Patch: Updates an existing custom dimension. This method supports
  7065. // patch semantics.
  7066. func (r *ManagementCustomDimensionsService) Patch(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsPatchCall {
  7067. c := &ManagementCustomDimensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7068. c.accountId = accountId
  7069. c.webPropertyId = webPropertyId
  7070. c.customDimensionId = customDimensionId
  7071. c.customdimension = customdimension
  7072. return c
  7073. }
  7074. // IgnoreCustomDataSourceLinks sets the optional parameter
  7075. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7076. // warnings related to the custom dimension being linked to a custom
  7077. // data source / data set.
  7078. func (c *ManagementCustomDimensionsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsPatchCall {
  7079. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7080. return c
  7081. }
  7082. // Fields allows partial responses to be retrieved. See
  7083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7084. // for more information.
  7085. func (c *ManagementCustomDimensionsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsPatchCall {
  7086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7087. return c
  7088. }
  7089. // Context sets the context to be used in this call's Do method. Any
  7090. // pending HTTP request will be aborted if the provided context is
  7091. // canceled.
  7092. func (c *ManagementCustomDimensionsPatchCall) Context(ctx context.Context) *ManagementCustomDimensionsPatchCall {
  7093. c.ctx_ = ctx
  7094. return c
  7095. }
  7096. // Header returns an http.Header that can be modified by the caller to
  7097. // add HTTP headers to the request.
  7098. func (c *ManagementCustomDimensionsPatchCall) Header() http.Header {
  7099. if c.header_ == nil {
  7100. c.header_ = make(http.Header)
  7101. }
  7102. return c.header_
  7103. }
  7104. func (c *ManagementCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) {
  7105. reqHeaders := make(http.Header)
  7106. for k, v := range c.header_ {
  7107. reqHeaders[k] = v
  7108. }
  7109. reqHeaders.Set("User-Agent", c.s.userAgent())
  7110. var body io.Reader = nil
  7111. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  7112. if err != nil {
  7113. return nil, err
  7114. }
  7115. reqHeaders.Set("Content-Type", "application/json")
  7116. c.urlParams_.Set("alt", alt)
  7117. c.urlParams_.Set("prettyPrint", "false")
  7118. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  7119. urls += "?" + c.urlParams_.Encode()
  7120. req, err := http.NewRequest("PATCH", urls, body)
  7121. if err != nil {
  7122. return nil, err
  7123. }
  7124. req.Header = reqHeaders
  7125. googleapi.Expand(req.URL, map[string]string{
  7126. "accountId": c.accountId,
  7127. "webPropertyId": c.webPropertyId,
  7128. "customDimensionId": c.customDimensionId,
  7129. })
  7130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7131. }
  7132. // Do executes the "analytics.management.customDimensions.patch" call.
  7133. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  7134. // status code is an error. Response headers are in either
  7135. // *CustomDimension.ServerResponse.Header or (if a response was returned
  7136. // at all) in error.(*googleapi.Error).Header. Use
  7137. // googleapi.IsNotModified to check whether the returned error was
  7138. // because http.StatusNotModified was returned.
  7139. func (c *ManagementCustomDimensionsPatchCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  7140. gensupport.SetOptions(c.urlParams_, opts...)
  7141. res, err := c.doRequest("json")
  7142. if res != nil && res.StatusCode == http.StatusNotModified {
  7143. if res.Body != nil {
  7144. res.Body.Close()
  7145. }
  7146. return nil, &googleapi.Error{
  7147. Code: res.StatusCode,
  7148. Header: res.Header,
  7149. }
  7150. }
  7151. if err != nil {
  7152. return nil, err
  7153. }
  7154. defer googleapi.CloseBody(res)
  7155. if err := googleapi.CheckResponse(res); err != nil {
  7156. return nil, err
  7157. }
  7158. ret := &CustomDimension{
  7159. ServerResponse: googleapi.ServerResponse{
  7160. Header: res.Header,
  7161. HTTPStatusCode: res.StatusCode,
  7162. },
  7163. }
  7164. target := &ret
  7165. if err := gensupport.DecodeResponse(target, res); err != nil {
  7166. return nil, err
  7167. }
  7168. return ret, nil
  7169. // {
  7170. // "description": "Updates an existing custom dimension. This method supports patch semantics.",
  7171. // "httpMethod": "PATCH",
  7172. // "id": "analytics.management.customDimensions.patch",
  7173. // "parameterOrder": [
  7174. // "accountId",
  7175. // "webPropertyId",
  7176. // "customDimensionId"
  7177. // ],
  7178. // "parameters": {
  7179. // "accountId": {
  7180. // "description": "Account ID for the custom dimension to update.",
  7181. // "location": "path",
  7182. // "required": true,
  7183. // "type": "string"
  7184. // },
  7185. // "customDimensionId": {
  7186. // "description": "Custom dimension ID for the custom dimension to update.",
  7187. // "location": "path",
  7188. // "required": true,
  7189. // "type": "string"
  7190. // },
  7191. // "ignoreCustomDataSourceLinks": {
  7192. // "default": "false",
  7193. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  7194. // "location": "query",
  7195. // "type": "boolean"
  7196. // },
  7197. // "webPropertyId": {
  7198. // "description": "Web property ID for the custom dimension to update.",
  7199. // "location": "path",
  7200. // "required": true,
  7201. // "type": "string"
  7202. // }
  7203. // },
  7204. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  7205. // "request": {
  7206. // "$ref": "CustomDimension"
  7207. // },
  7208. // "response": {
  7209. // "$ref": "CustomDimension"
  7210. // },
  7211. // "scopes": [
  7212. // "https://www.googleapis.com/auth/analytics.edit"
  7213. // ]
  7214. // }
  7215. }
  7216. // method id "analytics.management.customDimensions.update":
  7217. type ManagementCustomDimensionsUpdateCall struct {
  7218. s *Service
  7219. accountId string
  7220. webPropertyId string
  7221. customDimensionId string
  7222. customdimension *CustomDimension
  7223. urlParams_ gensupport.URLParams
  7224. ctx_ context.Context
  7225. header_ http.Header
  7226. }
  7227. // Update: Updates an existing custom dimension.
  7228. func (r *ManagementCustomDimensionsService) Update(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsUpdateCall {
  7229. c := &ManagementCustomDimensionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7230. c.accountId = accountId
  7231. c.webPropertyId = webPropertyId
  7232. c.customDimensionId = customDimensionId
  7233. c.customdimension = customdimension
  7234. return c
  7235. }
  7236. // IgnoreCustomDataSourceLinks sets the optional parameter
  7237. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7238. // warnings related to the custom dimension being linked to a custom
  7239. // data source / data set.
  7240. func (c *ManagementCustomDimensionsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsUpdateCall {
  7241. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7242. return c
  7243. }
  7244. // Fields allows partial responses to be retrieved. See
  7245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7246. // for more information.
  7247. func (c *ManagementCustomDimensionsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsUpdateCall {
  7248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7249. return c
  7250. }
  7251. // Context sets the context to be used in this call's Do method. Any
  7252. // pending HTTP request will be aborted if the provided context is
  7253. // canceled.
  7254. func (c *ManagementCustomDimensionsUpdateCall) Context(ctx context.Context) *ManagementCustomDimensionsUpdateCall {
  7255. c.ctx_ = ctx
  7256. return c
  7257. }
  7258. // Header returns an http.Header that can be modified by the caller to
  7259. // add HTTP headers to the request.
  7260. func (c *ManagementCustomDimensionsUpdateCall) Header() http.Header {
  7261. if c.header_ == nil {
  7262. c.header_ = make(http.Header)
  7263. }
  7264. return c.header_
  7265. }
  7266. func (c *ManagementCustomDimensionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7267. reqHeaders := make(http.Header)
  7268. for k, v := range c.header_ {
  7269. reqHeaders[k] = v
  7270. }
  7271. reqHeaders.Set("User-Agent", c.s.userAgent())
  7272. var body io.Reader = nil
  7273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  7274. if err != nil {
  7275. return nil, err
  7276. }
  7277. reqHeaders.Set("Content-Type", "application/json")
  7278. c.urlParams_.Set("alt", alt)
  7279. c.urlParams_.Set("prettyPrint", "false")
  7280. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  7281. urls += "?" + c.urlParams_.Encode()
  7282. req, err := http.NewRequest("PUT", urls, body)
  7283. if err != nil {
  7284. return nil, err
  7285. }
  7286. req.Header = reqHeaders
  7287. googleapi.Expand(req.URL, map[string]string{
  7288. "accountId": c.accountId,
  7289. "webPropertyId": c.webPropertyId,
  7290. "customDimensionId": c.customDimensionId,
  7291. })
  7292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7293. }
  7294. // Do executes the "analytics.management.customDimensions.update" call.
  7295. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  7296. // status code is an error. Response headers are in either
  7297. // *CustomDimension.ServerResponse.Header or (if a response was returned
  7298. // at all) in error.(*googleapi.Error).Header. Use
  7299. // googleapi.IsNotModified to check whether the returned error was
  7300. // because http.StatusNotModified was returned.
  7301. func (c *ManagementCustomDimensionsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  7302. gensupport.SetOptions(c.urlParams_, opts...)
  7303. res, err := c.doRequest("json")
  7304. if res != nil && res.StatusCode == http.StatusNotModified {
  7305. if res.Body != nil {
  7306. res.Body.Close()
  7307. }
  7308. return nil, &googleapi.Error{
  7309. Code: res.StatusCode,
  7310. Header: res.Header,
  7311. }
  7312. }
  7313. if err != nil {
  7314. return nil, err
  7315. }
  7316. defer googleapi.CloseBody(res)
  7317. if err := googleapi.CheckResponse(res); err != nil {
  7318. return nil, err
  7319. }
  7320. ret := &CustomDimension{
  7321. ServerResponse: googleapi.ServerResponse{
  7322. Header: res.Header,
  7323. HTTPStatusCode: res.StatusCode,
  7324. },
  7325. }
  7326. target := &ret
  7327. if err := gensupport.DecodeResponse(target, res); err != nil {
  7328. return nil, err
  7329. }
  7330. return ret, nil
  7331. // {
  7332. // "description": "Updates an existing custom dimension.",
  7333. // "httpMethod": "PUT",
  7334. // "id": "analytics.management.customDimensions.update",
  7335. // "parameterOrder": [
  7336. // "accountId",
  7337. // "webPropertyId",
  7338. // "customDimensionId"
  7339. // ],
  7340. // "parameters": {
  7341. // "accountId": {
  7342. // "description": "Account ID for the custom dimension to update.",
  7343. // "location": "path",
  7344. // "required": true,
  7345. // "type": "string"
  7346. // },
  7347. // "customDimensionId": {
  7348. // "description": "Custom dimension ID for the custom dimension to update.",
  7349. // "location": "path",
  7350. // "required": true,
  7351. // "type": "string"
  7352. // },
  7353. // "ignoreCustomDataSourceLinks": {
  7354. // "default": "false",
  7355. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  7356. // "location": "query",
  7357. // "type": "boolean"
  7358. // },
  7359. // "webPropertyId": {
  7360. // "description": "Web property ID for the custom dimension to update.",
  7361. // "location": "path",
  7362. // "required": true,
  7363. // "type": "string"
  7364. // }
  7365. // },
  7366. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  7367. // "request": {
  7368. // "$ref": "CustomDimension"
  7369. // },
  7370. // "response": {
  7371. // "$ref": "CustomDimension"
  7372. // },
  7373. // "scopes": [
  7374. // "https://www.googleapis.com/auth/analytics.edit"
  7375. // ]
  7376. // }
  7377. }
  7378. // method id "analytics.management.customMetrics.get":
  7379. type ManagementCustomMetricsGetCall struct {
  7380. s *Service
  7381. accountId string
  7382. webPropertyId string
  7383. customMetricId string
  7384. urlParams_ gensupport.URLParams
  7385. ifNoneMatch_ string
  7386. ctx_ context.Context
  7387. header_ http.Header
  7388. }
  7389. // Get: Get a custom metric to which the user has access.
  7390. func (r *ManagementCustomMetricsService) Get(accountId string, webPropertyId string, customMetricId string) *ManagementCustomMetricsGetCall {
  7391. c := &ManagementCustomMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7392. c.accountId = accountId
  7393. c.webPropertyId = webPropertyId
  7394. c.customMetricId = customMetricId
  7395. return c
  7396. }
  7397. // Fields allows partial responses to be retrieved. See
  7398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7399. // for more information.
  7400. func (c *ManagementCustomMetricsGetCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsGetCall {
  7401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7402. return c
  7403. }
  7404. // IfNoneMatch sets the optional parameter which makes the operation
  7405. // fail if the object's ETag matches the given value. This is useful for
  7406. // getting updates only after the object has changed since the last
  7407. // request. Use googleapi.IsNotModified to check whether the response
  7408. // error from Do is the result of In-None-Match.
  7409. func (c *ManagementCustomMetricsGetCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsGetCall {
  7410. c.ifNoneMatch_ = entityTag
  7411. return c
  7412. }
  7413. // Context sets the context to be used in this call's Do method. Any
  7414. // pending HTTP request will be aborted if the provided context is
  7415. // canceled.
  7416. func (c *ManagementCustomMetricsGetCall) Context(ctx context.Context) *ManagementCustomMetricsGetCall {
  7417. c.ctx_ = ctx
  7418. return c
  7419. }
  7420. // Header returns an http.Header that can be modified by the caller to
  7421. // add HTTP headers to the request.
  7422. func (c *ManagementCustomMetricsGetCall) Header() http.Header {
  7423. if c.header_ == nil {
  7424. c.header_ = make(http.Header)
  7425. }
  7426. return c.header_
  7427. }
  7428. func (c *ManagementCustomMetricsGetCall) doRequest(alt string) (*http.Response, error) {
  7429. reqHeaders := make(http.Header)
  7430. for k, v := range c.header_ {
  7431. reqHeaders[k] = v
  7432. }
  7433. reqHeaders.Set("User-Agent", c.s.userAgent())
  7434. if c.ifNoneMatch_ != "" {
  7435. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7436. }
  7437. var body io.Reader = nil
  7438. c.urlParams_.Set("alt", alt)
  7439. c.urlParams_.Set("prettyPrint", "false")
  7440. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  7441. urls += "?" + c.urlParams_.Encode()
  7442. req, err := http.NewRequest("GET", urls, body)
  7443. if err != nil {
  7444. return nil, err
  7445. }
  7446. req.Header = reqHeaders
  7447. googleapi.Expand(req.URL, map[string]string{
  7448. "accountId": c.accountId,
  7449. "webPropertyId": c.webPropertyId,
  7450. "customMetricId": c.customMetricId,
  7451. })
  7452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7453. }
  7454. // Do executes the "analytics.management.customMetrics.get" call.
  7455. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7456. // status code is an error. Response headers are in either
  7457. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7458. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7459. // to check whether the returned error was because
  7460. // http.StatusNotModified was returned.
  7461. func (c *ManagementCustomMetricsGetCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7462. gensupport.SetOptions(c.urlParams_, opts...)
  7463. res, err := c.doRequest("json")
  7464. if res != nil && res.StatusCode == http.StatusNotModified {
  7465. if res.Body != nil {
  7466. res.Body.Close()
  7467. }
  7468. return nil, &googleapi.Error{
  7469. Code: res.StatusCode,
  7470. Header: res.Header,
  7471. }
  7472. }
  7473. if err != nil {
  7474. return nil, err
  7475. }
  7476. defer googleapi.CloseBody(res)
  7477. if err := googleapi.CheckResponse(res); err != nil {
  7478. return nil, err
  7479. }
  7480. ret := &CustomMetric{
  7481. ServerResponse: googleapi.ServerResponse{
  7482. Header: res.Header,
  7483. HTTPStatusCode: res.StatusCode,
  7484. },
  7485. }
  7486. target := &ret
  7487. if err := gensupport.DecodeResponse(target, res); err != nil {
  7488. return nil, err
  7489. }
  7490. return ret, nil
  7491. // {
  7492. // "description": "Get a custom metric to which the user has access.",
  7493. // "httpMethod": "GET",
  7494. // "id": "analytics.management.customMetrics.get",
  7495. // "parameterOrder": [
  7496. // "accountId",
  7497. // "webPropertyId",
  7498. // "customMetricId"
  7499. // ],
  7500. // "parameters": {
  7501. // "accountId": {
  7502. // "description": "Account ID for the custom metric to retrieve.",
  7503. // "location": "path",
  7504. // "required": true,
  7505. // "type": "string"
  7506. // },
  7507. // "customMetricId": {
  7508. // "description": "The ID of the custom metric to retrieve.",
  7509. // "location": "path",
  7510. // "required": true,
  7511. // "type": "string"
  7512. // },
  7513. // "webPropertyId": {
  7514. // "description": "Web property ID for the custom metric to retrieve.",
  7515. // "location": "path",
  7516. // "required": true,
  7517. // "type": "string"
  7518. // }
  7519. // },
  7520. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  7521. // "response": {
  7522. // "$ref": "CustomMetric"
  7523. // },
  7524. // "scopes": [
  7525. // "https://www.googleapis.com/auth/analytics.edit",
  7526. // "https://www.googleapis.com/auth/analytics.readonly"
  7527. // ]
  7528. // }
  7529. }
  7530. // method id "analytics.management.customMetrics.insert":
  7531. type ManagementCustomMetricsInsertCall struct {
  7532. s *Service
  7533. accountId string
  7534. webPropertyId string
  7535. custommetric *CustomMetric
  7536. urlParams_ gensupport.URLParams
  7537. ctx_ context.Context
  7538. header_ http.Header
  7539. }
  7540. // Insert: Create a new custom metric.
  7541. func (r *ManagementCustomMetricsService) Insert(accountId string, webPropertyId string, custommetric *CustomMetric) *ManagementCustomMetricsInsertCall {
  7542. c := &ManagementCustomMetricsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7543. c.accountId = accountId
  7544. c.webPropertyId = webPropertyId
  7545. c.custommetric = custommetric
  7546. return c
  7547. }
  7548. // Fields allows partial responses to be retrieved. See
  7549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7550. // for more information.
  7551. func (c *ManagementCustomMetricsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsInsertCall {
  7552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7553. return c
  7554. }
  7555. // Context sets the context to be used in this call's Do method. Any
  7556. // pending HTTP request will be aborted if the provided context is
  7557. // canceled.
  7558. func (c *ManagementCustomMetricsInsertCall) Context(ctx context.Context) *ManagementCustomMetricsInsertCall {
  7559. c.ctx_ = ctx
  7560. return c
  7561. }
  7562. // Header returns an http.Header that can be modified by the caller to
  7563. // add HTTP headers to the request.
  7564. func (c *ManagementCustomMetricsInsertCall) Header() http.Header {
  7565. if c.header_ == nil {
  7566. c.header_ = make(http.Header)
  7567. }
  7568. return c.header_
  7569. }
  7570. func (c *ManagementCustomMetricsInsertCall) doRequest(alt string) (*http.Response, error) {
  7571. reqHeaders := make(http.Header)
  7572. for k, v := range c.header_ {
  7573. reqHeaders[k] = v
  7574. }
  7575. reqHeaders.Set("User-Agent", c.s.userAgent())
  7576. var body io.Reader = nil
  7577. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  7578. if err != nil {
  7579. return nil, err
  7580. }
  7581. reqHeaders.Set("Content-Type", "application/json")
  7582. c.urlParams_.Set("alt", alt)
  7583. c.urlParams_.Set("prettyPrint", "false")
  7584. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  7585. urls += "?" + c.urlParams_.Encode()
  7586. req, err := http.NewRequest("POST", urls, body)
  7587. if err != nil {
  7588. return nil, err
  7589. }
  7590. req.Header = reqHeaders
  7591. googleapi.Expand(req.URL, map[string]string{
  7592. "accountId": c.accountId,
  7593. "webPropertyId": c.webPropertyId,
  7594. })
  7595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7596. }
  7597. // Do executes the "analytics.management.customMetrics.insert" call.
  7598. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7599. // status code is an error. Response headers are in either
  7600. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7602. // to check whether the returned error was because
  7603. // http.StatusNotModified was returned.
  7604. func (c *ManagementCustomMetricsInsertCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7605. gensupport.SetOptions(c.urlParams_, opts...)
  7606. res, err := c.doRequest("json")
  7607. if res != nil && res.StatusCode == http.StatusNotModified {
  7608. if res.Body != nil {
  7609. res.Body.Close()
  7610. }
  7611. return nil, &googleapi.Error{
  7612. Code: res.StatusCode,
  7613. Header: res.Header,
  7614. }
  7615. }
  7616. if err != nil {
  7617. return nil, err
  7618. }
  7619. defer googleapi.CloseBody(res)
  7620. if err := googleapi.CheckResponse(res); err != nil {
  7621. return nil, err
  7622. }
  7623. ret := &CustomMetric{
  7624. ServerResponse: googleapi.ServerResponse{
  7625. Header: res.Header,
  7626. HTTPStatusCode: res.StatusCode,
  7627. },
  7628. }
  7629. target := &ret
  7630. if err := gensupport.DecodeResponse(target, res); err != nil {
  7631. return nil, err
  7632. }
  7633. return ret, nil
  7634. // {
  7635. // "description": "Create a new custom metric.",
  7636. // "httpMethod": "POST",
  7637. // "id": "analytics.management.customMetrics.insert",
  7638. // "parameterOrder": [
  7639. // "accountId",
  7640. // "webPropertyId"
  7641. // ],
  7642. // "parameters": {
  7643. // "accountId": {
  7644. // "description": "Account ID for the custom metric to create.",
  7645. // "location": "path",
  7646. // "required": true,
  7647. // "type": "string"
  7648. // },
  7649. // "webPropertyId": {
  7650. // "description": "Web property ID for the custom dimension to create.",
  7651. // "location": "path",
  7652. // "required": true,
  7653. // "type": "string"
  7654. // }
  7655. // },
  7656. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  7657. // "request": {
  7658. // "$ref": "CustomMetric"
  7659. // },
  7660. // "response": {
  7661. // "$ref": "CustomMetric"
  7662. // },
  7663. // "scopes": [
  7664. // "https://www.googleapis.com/auth/analytics.edit"
  7665. // ]
  7666. // }
  7667. }
  7668. // method id "analytics.management.customMetrics.list":
  7669. type ManagementCustomMetricsListCall struct {
  7670. s *Service
  7671. accountId string
  7672. webPropertyId string
  7673. urlParams_ gensupport.URLParams
  7674. ifNoneMatch_ string
  7675. ctx_ context.Context
  7676. header_ http.Header
  7677. }
  7678. // List: Lists custom metrics to which the user has access.
  7679. func (r *ManagementCustomMetricsService) List(accountId string, webPropertyId string) *ManagementCustomMetricsListCall {
  7680. c := &ManagementCustomMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7681. c.accountId = accountId
  7682. c.webPropertyId = webPropertyId
  7683. return c
  7684. }
  7685. // MaxResults sets the optional parameter "max-results": The maximum
  7686. // number of custom metrics to include in this response.
  7687. func (c *ManagementCustomMetricsListCall) MaxResults(maxResults int64) *ManagementCustomMetricsListCall {
  7688. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  7689. return c
  7690. }
  7691. // StartIndex sets the optional parameter "start-index": An index of the
  7692. // first entity to retrieve. Use this parameter as a pagination
  7693. // mechanism along with the max-results parameter.
  7694. func (c *ManagementCustomMetricsListCall) StartIndex(startIndex int64) *ManagementCustomMetricsListCall {
  7695. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  7696. return c
  7697. }
  7698. // Fields allows partial responses to be retrieved. See
  7699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7700. // for more information.
  7701. func (c *ManagementCustomMetricsListCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsListCall {
  7702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7703. return c
  7704. }
  7705. // IfNoneMatch sets the optional parameter which makes the operation
  7706. // fail if the object's ETag matches the given value. This is useful for
  7707. // getting updates only after the object has changed since the last
  7708. // request. Use googleapi.IsNotModified to check whether the response
  7709. // error from Do is the result of In-None-Match.
  7710. func (c *ManagementCustomMetricsListCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsListCall {
  7711. c.ifNoneMatch_ = entityTag
  7712. return c
  7713. }
  7714. // Context sets the context to be used in this call's Do method. Any
  7715. // pending HTTP request will be aborted if the provided context is
  7716. // canceled.
  7717. func (c *ManagementCustomMetricsListCall) Context(ctx context.Context) *ManagementCustomMetricsListCall {
  7718. c.ctx_ = ctx
  7719. return c
  7720. }
  7721. // Header returns an http.Header that can be modified by the caller to
  7722. // add HTTP headers to the request.
  7723. func (c *ManagementCustomMetricsListCall) Header() http.Header {
  7724. if c.header_ == nil {
  7725. c.header_ = make(http.Header)
  7726. }
  7727. return c.header_
  7728. }
  7729. func (c *ManagementCustomMetricsListCall) doRequest(alt string) (*http.Response, error) {
  7730. reqHeaders := make(http.Header)
  7731. for k, v := range c.header_ {
  7732. reqHeaders[k] = v
  7733. }
  7734. reqHeaders.Set("User-Agent", c.s.userAgent())
  7735. if c.ifNoneMatch_ != "" {
  7736. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7737. }
  7738. var body io.Reader = nil
  7739. c.urlParams_.Set("alt", alt)
  7740. c.urlParams_.Set("prettyPrint", "false")
  7741. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  7742. urls += "?" + c.urlParams_.Encode()
  7743. req, err := http.NewRequest("GET", urls, body)
  7744. if err != nil {
  7745. return nil, err
  7746. }
  7747. req.Header = reqHeaders
  7748. googleapi.Expand(req.URL, map[string]string{
  7749. "accountId": c.accountId,
  7750. "webPropertyId": c.webPropertyId,
  7751. })
  7752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7753. }
  7754. // Do executes the "analytics.management.customMetrics.list" call.
  7755. // Exactly one of *CustomMetrics or error will be non-nil. Any non-2xx
  7756. // status code is an error. Response headers are in either
  7757. // *CustomMetrics.ServerResponse.Header or (if a response was returned
  7758. // at all) in error.(*googleapi.Error).Header. Use
  7759. // googleapi.IsNotModified to check whether the returned error was
  7760. // because http.StatusNotModified was returned.
  7761. func (c *ManagementCustomMetricsListCall) Do(opts ...googleapi.CallOption) (*CustomMetrics, error) {
  7762. gensupport.SetOptions(c.urlParams_, opts...)
  7763. res, err := c.doRequest("json")
  7764. if res != nil && res.StatusCode == http.StatusNotModified {
  7765. if res.Body != nil {
  7766. res.Body.Close()
  7767. }
  7768. return nil, &googleapi.Error{
  7769. Code: res.StatusCode,
  7770. Header: res.Header,
  7771. }
  7772. }
  7773. if err != nil {
  7774. return nil, err
  7775. }
  7776. defer googleapi.CloseBody(res)
  7777. if err := googleapi.CheckResponse(res); err != nil {
  7778. return nil, err
  7779. }
  7780. ret := &CustomMetrics{
  7781. ServerResponse: googleapi.ServerResponse{
  7782. Header: res.Header,
  7783. HTTPStatusCode: res.StatusCode,
  7784. },
  7785. }
  7786. target := &ret
  7787. if err := gensupport.DecodeResponse(target, res); err != nil {
  7788. return nil, err
  7789. }
  7790. return ret, nil
  7791. // {
  7792. // "description": "Lists custom metrics to which the user has access.",
  7793. // "httpMethod": "GET",
  7794. // "id": "analytics.management.customMetrics.list",
  7795. // "parameterOrder": [
  7796. // "accountId",
  7797. // "webPropertyId"
  7798. // ],
  7799. // "parameters": {
  7800. // "accountId": {
  7801. // "description": "Account ID for the custom metrics to retrieve.",
  7802. // "location": "path",
  7803. // "required": true,
  7804. // "type": "string"
  7805. // },
  7806. // "max-results": {
  7807. // "description": "The maximum number of custom metrics to include in this response.",
  7808. // "format": "int32",
  7809. // "location": "query",
  7810. // "type": "integer"
  7811. // },
  7812. // "start-index": {
  7813. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  7814. // "format": "int32",
  7815. // "location": "query",
  7816. // "minimum": "1",
  7817. // "type": "integer"
  7818. // },
  7819. // "webPropertyId": {
  7820. // "description": "Web property ID for the custom metrics to retrieve.",
  7821. // "location": "path",
  7822. // "required": true,
  7823. // "type": "string"
  7824. // }
  7825. // },
  7826. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  7827. // "response": {
  7828. // "$ref": "CustomMetrics"
  7829. // },
  7830. // "scopes": [
  7831. // "https://www.googleapis.com/auth/analytics",
  7832. // "https://www.googleapis.com/auth/analytics.readonly"
  7833. // ]
  7834. // }
  7835. }
  7836. // method id "analytics.management.customMetrics.patch":
  7837. type ManagementCustomMetricsPatchCall struct {
  7838. s *Service
  7839. accountId string
  7840. webPropertyId string
  7841. customMetricId string
  7842. custommetric *CustomMetric
  7843. urlParams_ gensupport.URLParams
  7844. ctx_ context.Context
  7845. header_ http.Header
  7846. }
  7847. // Patch: Updates an existing custom metric. This method supports patch
  7848. // semantics.
  7849. func (r *ManagementCustomMetricsService) Patch(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsPatchCall {
  7850. c := &ManagementCustomMetricsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7851. c.accountId = accountId
  7852. c.webPropertyId = webPropertyId
  7853. c.customMetricId = customMetricId
  7854. c.custommetric = custommetric
  7855. return c
  7856. }
  7857. // IgnoreCustomDataSourceLinks sets the optional parameter
  7858. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7859. // warnings related to the custom metric being linked to a custom data
  7860. // source / data set.
  7861. func (c *ManagementCustomMetricsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsPatchCall {
  7862. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7863. return c
  7864. }
  7865. // Fields allows partial responses to be retrieved. See
  7866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7867. // for more information.
  7868. func (c *ManagementCustomMetricsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsPatchCall {
  7869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7870. return c
  7871. }
  7872. // Context sets the context to be used in this call's Do method. Any
  7873. // pending HTTP request will be aborted if the provided context is
  7874. // canceled.
  7875. func (c *ManagementCustomMetricsPatchCall) Context(ctx context.Context) *ManagementCustomMetricsPatchCall {
  7876. c.ctx_ = ctx
  7877. return c
  7878. }
  7879. // Header returns an http.Header that can be modified by the caller to
  7880. // add HTTP headers to the request.
  7881. func (c *ManagementCustomMetricsPatchCall) Header() http.Header {
  7882. if c.header_ == nil {
  7883. c.header_ = make(http.Header)
  7884. }
  7885. return c.header_
  7886. }
  7887. func (c *ManagementCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) {
  7888. reqHeaders := make(http.Header)
  7889. for k, v := range c.header_ {
  7890. reqHeaders[k] = v
  7891. }
  7892. reqHeaders.Set("User-Agent", c.s.userAgent())
  7893. var body io.Reader = nil
  7894. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  7895. if err != nil {
  7896. return nil, err
  7897. }
  7898. reqHeaders.Set("Content-Type", "application/json")
  7899. c.urlParams_.Set("alt", alt)
  7900. c.urlParams_.Set("prettyPrint", "false")
  7901. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  7902. urls += "?" + c.urlParams_.Encode()
  7903. req, err := http.NewRequest("PATCH", urls, body)
  7904. if err != nil {
  7905. return nil, err
  7906. }
  7907. req.Header = reqHeaders
  7908. googleapi.Expand(req.URL, map[string]string{
  7909. "accountId": c.accountId,
  7910. "webPropertyId": c.webPropertyId,
  7911. "customMetricId": c.customMetricId,
  7912. })
  7913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7914. }
  7915. // Do executes the "analytics.management.customMetrics.patch" call.
  7916. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7917. // status code is an error. Response headers are in either
  7918. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7919. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7920. // to check whether the returned error was because
  7921. // http.StatusNotModified was returned.
  7922. func (c *ManagementCustomMetricsPatchCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7923. gensupport.SetOptions(c.urlParams_, opts...)
  7924. res, err := c.doRequest("json")
  7925. if res != nil && res.StatusCode == http.StatusNotModified {
  7926. if res.Body != nil {
  7927. res.Body.Close()
  7928. }
  7929. return nil, &googleapi.Error{
  7930. Code: res.StatusCode,
  7931. Header: res.Header,
  7932. }
  7933. }
  7934. if err != nil {
  7935. return nil, err
  7936. }
  7937. defer googleapi.CloseBody(res)
  7938. if err := googleapi.CheckResponse(res); err != nil {
  7939. return nil, err
  7940. }
  7941. ret := &CustomMetric{
  7942. ServerResponse: googleapi.ServerResponse{
  7943. Header: res.Header,
  7944. HTTPStatusCode: res.StatusCode,
  7945. },
  7946. }
  7947. target := &ret
  7948. if err := gensupport.DecodeResponse(target, res); err != nil {
  7949. return nil, err
  7950. }
  7951. return ret, nil
  7952. // {
  7953. // "description": "Updates an existing custom metric. This method supports patch semantics.",
  7954. // "httpMethod": "PATCH",
  7955. // "id": "analytics.management.customMetrics.patch",
  7956. // "parameterOrder": [
  7957. // "accountId",
  7958. // "webPropertyId",
  7959. // "customMetricId"
  7960. // ],
  7961. // "parameters": {
  7962. // "accountId": {
  7963. // "description": "Account ID for the custom metric to update.",
  7964. // "location": "path",
  7965. // "required": true,
  7966. // "type": "string"
  7967. // },
  7968. // "customMetricId": {
  7969. // "description": "Custom metric ID for the custom metric to update.",
  7970. // "location": "path",
  7971. // "required": true,
  7972. // "type": "string"
  7973. // },
  7974. // "ignoreCustomDataSourceLinks": {
  7975. // "default": "false",
  7976. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  7977. // "location": "query",
  7978. // "type": "boolean"
  7979. // },
  7980. // "webPropertyId": {
  7981. // "description": "Web property ID for the custom metric to update.",
  7982. // "location": "path",
  7983. // "required": true,
  7984. // "type": "string"
  7985. // }
  7986. // },
  7987. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  7988. // "request": {
  7989. // "$ref": "CustomMetric"
  7990. // },
  7991. // "response": {
  7992. // "$ref": "CustomMetric"
  7993. // },
  7994. // "scopes": [
  7995. // "https://www.googleapis.com/auth/analytics.edit"
  7996. // ]
  7997. // }
  7998. }
  7999. // method id "analytics.management.customMetrics.update":
  8000. type ManagementCustomMetricsUpdateCall struct {
  8001. s *Service
  8002. accountId string
  8003. webPropertyId string
  8004. customMetricId string
  8005. custommetric *CustomMetric
  8006. urlParams_ gensupport.URLParams
  8007. ctx_ context.Context
  8008. header_ http.Header
  8009. }
  8010. // Update: Updates an existing custom metric.
  8011. func (r *ManagementCustomMetricsService) Update(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsUpdateCall {
  8012. c := &ManagementCustomMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8013. c.accountId = accountId
  8014. c.webPropertyId = webPropertyId
  8015. c.customMetricId = customMetricId
  8016. c.custommetric = custommetric
  8017. return c
  8018. }
  8019. // IgnoreCustomDataSourceLinks sets the optional parameter
  8020. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  8021. // warnings related to the custom metric being linked to a custom data
  8022. // source / data set.
  8023. func (c *ManagementCustomMetricsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsUpdateCall {
  8024. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  8025. return c
  8026. }
  8027. // Fields allows partial responses to be retrieved. See
  8028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8029. // for more information.
  8030. func (c *ManagementCustomMetricsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsUpdateCall {
  8031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8032. return c
  8033. }
  8034. // Context sets the context to be used in this call's Do method. Any
  8035. // pending HTTP request will be aborted if the provided context is
  8036. // canceled.
  8037. func (c *ManagementCustomMetricsUpdateCall) Context(ctx context.Context) *ManagementCustomMetricsUpdateCall {
  8038. c.ctx_ = ctx
  8039. return c
  8040. }
  8041. // Header returns an http.Header that can be modified by the caller to
  8042. // add HTTP headers to the request.
  8043. func (c *ManagementCustomMetricsUpdateCall) Header() http.Header {
  8044. if c.header_ == nil {
  8045. c.header_ = make(http.Header)
  8046. }
  8047. return c.header_
  8048. }
  8049. func (c *ManagementCustomMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8050. reqHeaders := make(http.Header)
  8051. for k, v := range c.header_ {
  8052. reqHeaders[k] = v
  8053. }
  8054. reqHeaders.Set("User-Agent", c.s.userAgent())
  8055. var body io.Reader = nil
  8056. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  8057. if err != nil {
  8058. return nil, err
  8059. }
  8060. reqHeaders.Set("Content-Type", "application/json")
  8061. c.urlParams_.Set("alt", alt)
  8062. c.urlParams_.Set("prettyPrint", "false")
  8063. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  8064. urls += "?" + c.urlParams_.Encode()
  8065. req, err := http.NewRequest("PUT", urls, body)
  8066. if err != nil {
  8067. return nil, err
  8068. }
  8069. req.Header = reqHeaders
  8070. googleapi.Expand(req.URL, map[string]string{
  8071. "accountId": c.accountId,
  8072. "webPropertyId": c.webPropertyId,
  8073. "customMetricId": c.customMetricId,
  8074. })
  8075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8076. }
  8077. // Do executes the "analytics.management.customMetrics.update" call.
  8078. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  8079. // status code is an error. Response headers are in either
  8080. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  8081. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8082. // to check whether the returned error was because
  8083. // http.StatusNotModified was returned.
  8084. func (c *ManagementCustomMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  8085. gensupport.SetOptions(c.urlParams_, opts...)
  8086. res, err := c.doRequest("json")
  8087. if res != nil && res.StatusCode == http.StatusNotModified {
  8088. if res.Body != nil {
  8089. res.Body.Close()
  8090. }
  8091. return nil, &googleapi.Error{
  8092. Code: res.StatusCode,
  8093. Header: res.Header,
  8094. }
  8095. }
  8096. if err != nil {
  8097. return nil, err
  8098. }
  8099. defer googleapi.CloseBody(res)
  8100. if err := googleapi.CheckResponse(res); err != nil {
  8101. return nil, err
  8102. }
  8103. ret := &CustomMetric{
  8104. ServerResponse: googleapi.ServerResponse{
  8105. Header: res.Header,
  8106. HTTPStatusCode: res.StatusCode,
  8107. },
  8108. }
  8109. target := &ret
  8110. if err := gensupport.DecodeResponse(target, res); err != nil {
  8111. return nil, err
  8112. }
  8113. return ret, nil
  8114. // {
  8115. // "description": "Updates an existing custom metric.",
  8116. // "httpMethod": "PUT",
  8117. // "id": "analytics.management.customMetrics.update",
  8118. // "parameterOrder": [
  8119. // "accountId",
  8120. // "webPropertyId",
  8121. // "customMetricId"
  8122. // ],
  8123. // "parameters": {
  8124. // "accountId": {
  8125. // "description": "Account ID for the custom metric to update.",
  8126. // "location": "path",
  8127. // "required": true,
  8128. // "type": "string"
  8129. // },
  8130. // "customMetricId": {
  8131. // "description": "Custom metric ID for the custom metric to update.",
  8132. // "location": "path",
  8133. // "required": true,
  8134. // "type": "string"
  8135. // },
  8136. // "ignoreCustomDataSourceLinks": {
  8137. // "default": "false",
  8138. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  8139. // "location": "query",
  8140. // "type": "boolean"
  8141. // },
  8142. // "webPropertyId": {
  8143. // "description": "Web property ID for the custom metric to update.",
  8144. // "location": "path",
  8145. // "required": true,
  8146. // "type": "string"
  8147. // }
  8148. // },
  8149. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  8150. // "request": {
  8151. // "$ref": "CustomMetric"
  8152. // },
  8153. // "response": {
  8154. // "$ref": "CustomMetric"
  8155. // },
  8156. // "scopes": [
  8157. // "https://www.googleapis.com/auth/analytics.edit"
  8158. // ]
  8159. // }
  8160. }
  8161. // method id "analytics.management.experiments.delete":
  8162. type ManagementExperimentsDeleteCall struct {
  8163. s *Service
  8164. accountId string
  8165. webPropertyId string
  8166. profileId string
  8167. experimentId string
  8168. urlParams_ gensupport.URLParams
  8169. ctx_ context.Context
  8170. header_ http.Header
  8171. }
  8172. // Delete: Delete an experiment.
  8173. func (r *ManagementExperimentsService) Delete(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsDeleteCall {
  8174. c := &ManagementExperimentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8175. c.accountId = accountId
  8176. c.webPropertyId = webPropertyId
  8177. c.profileId = profileId
  8178. c.experimentId = experimentId
  8179. return c
  8180. }
  8181. // Fields allows partial responses to be retrieved. See
  8182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8183. // for more information.
  8184. func (c *ManagementExperimentsDeleteCall) Fields(s ...googleapi.Field) *ManagementExperimentsDeleteCall {
  8185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8186. return c
  8187. }
  8188. // Context sets the context to be used in this call's Do method. Any
  8189. // pending HTTP request will be aborted if the provided context is
  8190. // canceled.
  8191. func (c *ManagementExperimentsDeleteCall) Context(ctx context.Context) *ManagementExperimentsDeleteCall {
  8192. c.ctx_ = ctx
  8193. return c
  8194. }
  8195. // Header returns an http.Header that can be modified by the caller to
  8196. // add HTTP headers to the request.
  8197. func (c *ManagementExperimentsDeleteCall) Header() http.Header {
  8198. if c.header_ == nil {
  8199. c.header_ = make(http.Header)
  8200. }
  8201. return c.header_
  8202. }
  8203. func (c *ManagementExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8204. reqHeaders := make(http.Header)
  8205. for k, v := range c.header_ {
  8206. reqHeaders[k] = v
  8207. }
  8208. reqHeaders.Set("User-Agent", c.s.userAgent())
  8209. var body io.Reader = nil
  8210. c.urlParams_.Set("alt", alt)
  8211. c.urlParams_.Set("prettyPrint", "false")
  8212. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8213. urls += "?" + c.urlParams_.Encode()
  8214. req, err := http.NewRequest("DELETE", urls, body)
  8215. if err != nil {
  8216. return nil, err
  8217. }
  8218. req.Header = reqHeaders
  8219. googleapi.Expand(req.URL, map[string]string{
  8220. "accountId": c.accountId,
  8221. "webPropertyId": c.webPropertyId,
  8222. "profileId": c.profileId,
  8223. "experimentId": c.experimentId,
  8224. })
  8225. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8226. }
  8227. // Do executes the "analytics.management.experiments.delete" call.
  8228. func (c *ManagementExperimentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8229. gensupport.SetOptions(c.urlParams_, opts...)
  8230. res, err := c.doRequest("json")
  8231. if err != nil {
  8232. return err
  8233. }
  8234. defer googleapi.CloseBody(res)
  8235. if err := googleapi.CheckResponse(res); err != nil {
  8236. return err
  8237. }
  8238. return nil
  8239. // {
  8240. // "description": "Delete an experiment.",
  8241. // "httpMethod": "DELETE",
  8242. // "id": "analytics.management.experiments.delete",
  8243. // "parameterOrder": [
  8244. // "accountId",
  8245. // "webPropertyId",
  8246. // "profileId",
  8247. // "experimentId"
  8248. // ],
  8249. // "parameters": {
  8250. // "accountId": {
  8251. // "description": "Account ID to which the experiment belongs",
  8252. // "location": "path",
  8253. // "required": true,
  8254. // "type": "string"
  8255. // },
  8256. // "experimentId": {
  8257. // "description": "ID of the experiment to delete",
  8258. // "location": "path",
  8259. // "required": true,
  8260. // "type": "string"
  8261. // },
  8262. // "profileId": {
  8263. // "description": "View (Profile) ID to which the experiment belongs",
  8264. // "location": "path",
  8265. // "required": true,
  8266. // "type": "string"
  8267. // },
  8268. // "webPropertyId": {
  8269. // "description": "Web property ID to which the experiment belongs",
  8270. // "location": "path",
  8271. // "required": true,
  8272. // "type": "string"
  8273. // }
  8274. // },
  8275. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8276. // "scopes": [
  8277. // "https://www.googleapis.com/auth/analytics",
  8278. // "https://www.googleapis.com/auth/analytics.edit"
  8279. // ]
  8280. // }
  8281. }
  8282. // method id "analytics.management.experiments.get":
  8283. type ManagementExperimentsGetCall struct {
  8284. s *Service
  8285. accountId string
  8286. webPropertyId string
  8287. profileId string
  8288. experimentId string
  8289. urlParams_ gensupport.URLParams
  8290. ifNoneMatch_ string
  8291. ctx_ context.Context
  8292. header_ http.Header
  8293. }
  8294. // Get: Returns an experiment to which the user has access.
  8295. func (r *ManagementExperimentsService) Get(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsGetCall {
  8296. c := &ManagementExperimentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8297. c.accountId = accountId
  8298. c.webPropertyId = webPropertyId
  8299. c.profileId = profileId
  8300. c.experimentId = experimentId
  8301. return c
  8302. }
  8303. // Fields allows partial responses to be retrieved. See
  8304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8305. // for more information.
  8306. func (c *ManagementExperimentsGetCall) Fields(s ...googleapi.Field) *ManagementExperimentsGetCall {
  8307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8308. return c
  8309. }
  8310. // IfNoneMatch sets the optional parameter which makes the operation
  8311. // fail if the object's ETag matches the given value. This is useful for
  8312. // getting updates only after the object has changed since the last
  8313. // request. Use googleapi.IsNotModified to check whether the response
  8314. // error from Do is the result of In-None-Match.
  8315. func (c *ManagementExperimentsGetCall) IfNoneMatch(entityTag string) *ManagementExperimentsGetCall {
  8316. c.ifNoneMatch_ = entityTag
  8317. return c
  8318. }
  8319. // Context sets the context to be used in this call's Do method. Any
  8320. // pending HTTP request will be aborted if the provided context is
  8321. // canceled.
  8322. func (c *ManagementExperimentsGetCall) Context(ctx context.Context) *ManagementExperimentsGetCall {
  8323. c.ctx_ = ctx
  8324. return c
  8325. }
  8326. // Header returns an http.Header that can be modified by the caller to
  8327. // add HTTP headers to the request.
  8328. func (c *ManagementExperimentsGetCall) Header() http.Header {
  8329. if c.header_ == nil {
  8330. c.header_ = make(http.Header)
  8331. }
  8332. return c.header_
  8333. }
  8334. func (c *ManagementExperimentsGetCall) doRequest(alt string) (*http.Response, error) {
  8335. reqHeaders := make(http.Header)
  8336. for k, v := range c.header_ {
  8337. reqHeaders[k] = v
  8338. }
  8339. reqHeaders.Set("User-Agent", c.s.userAgent())
  8340. if c.ifNoneMatch_ != "" {
  8341. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8342. }
  8343. var body io.Reader = nil
  8344. c.urlParams_.Set("alt", alt)
  8345. c.urlParams_.Set("prettyPrint", "false")
  8346. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8347. urls += "?" + c.urlParams_.Encode()
  8348. req, err := http.NewRequest("GET", urls, body)
  8349. if err != nil {
  8350. return nil, err
  8351. }
  8352. req.Header = reqHeaders
  8353. googleapi.Expand(req.URL, map[string]string{
  8354. "accountId": c.accountId,
  8355. "webPropertyId": c.webPropertyId,
  8356. "profileId": c.profileId,
  8357. "experimentId": c.experimentId,
  8358. })
  8359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8360. }
  8361. // Do executes the "analytics.management.experiments.get" call.
  8362. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8363. // status code is an error. Response headers are in either
  8364. // *Experiment.ServerResponse.Header or (if a response was returned at
  8365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8366. // to check whether the returned error was because
  8367. // http.StatusNotModified was returned.
  8368. func (c *ManagementExperimentsGetCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8369. gensupport.SetOptions(c.urlParams_, opts...)
  8370. res, err := c.doRequest("json")
  8371. if res != nil && res.StatusCode == http.StatusNotModified {
  8372. if res.Body != nil {
  8373. res.Body.Close()
  8374. }
  8375. return nil, &googleapi.Error{
  8376. Code: res.StatusCode,
  8377. Header: res.Header,
  8378. }
  8379. }
  8380. if err != nil {
  8381. return nil, err
  8382. }
  8383. defer googleapi.CloseBody(res)
  8384. if err := googleapi.CheckResponse(res); err != nil {
  8385. return nil, err
  8386. }
  8387. ret := &Experiment{
  8388. ServerResponse: googleapi.ServerResponse{
  8389. Header: res.Header,
  8390. HTTPStatusCode: res.StatusCode,
  8391. },
  8392. }
  8393. target := &ret
  8394. if err := gensupport.DecodeResponse(target, res); err != nil {
  8395. return nil, err
  8396. }
  8397. return ret, nil
  8398. // {
  8399. // "description": "Returns an experiment to which the user has access.",
  8400. // "httpMethod": "GET",
  8401. // "id": "analytics.management.experiments.get",
  8402. // "parameterOrder": [
  8403. // "accountId",
  8404. // "webPropertyId",
  8405. // "profileId",
  8406. // "experimentId"
  8407. // ],
  8408. // "parameters": {
  8409. // "accountId": {
  8410. // "description": "Account ID to retrieve the experiment for.",
  8411. // "location": "path",
  8412. // "required": true,
  8413. // "type": "string"
  8414. // },
  8415. // "experimentId": {
  8416. // "description": "Experiment ID to retrieve the experiment for.",
  8417. // "location": "path",
  8418. // "required": true,
  8419. // "type": "string"
  8420. // },
  8421. // "profileId": {
  8422. // "description": "View (Profile) ID to retrieve the experiment for.",
  8423. // "location": "path",
  8424. // "required": true,
  8425. // "type": "string"
  8426. // },
  8427. // "webPropertyId": {
  8428. // "description": "Web property ID to retrieve the experiment for.",
  8429. // "location": "path",
  8430. // "required": true,
  8431. // "type": "string"
  8432. // }
  8433. // },
  8434. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8435. // "response": {
  8436. // "$ref": "Experiment"
  8437. // },
  8438. // "scopes": [
  8439. // "https://www.googleapis.com/auth/analytics",
  8440. // "https://www.googleapis.com/auth/analytics.edit",
  8441. // "https://www.googleapis.com/auth/analytics.readonly"
  8442. // ]
  8443. // }
  8444. }
  8445. // method id "analytics.management.experiments.insert":
  8446. type ManagementExperimentsInsertCall struct {
  8447. s *Service
  8448. accountId string
  8449. webPropertyId string
  8450. profileId string
  8451. experiment *Experiment
  8452. urlParams_ gensupport.URLParams
  8453. ctx_ context.Context
  8454. header_ http.Header
  8455. }
  8456. // Insert: Create a new experiment.
  8457. func (r *ManagementExperimentsService) Insert(accountId string, webPropertyId string, profileId string, experiment *Experiment) *ManagementExperimentsInsertCall {
  8458. c := &ManagementExperimentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8459. c.accountId = accountId
  8460. c.webPropertyId = webPropertyId
  8461. c.profileId = profileId
  8462. c.experiment = experiment
  8463. return c
  8464. }
  8465. // Fields allows partial responses to be retrieved. See
  8466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8467. // for more information.
  8468. func (c *ManagementExperimentsInsertCall) Fields(s ...googleapi.Field) *ManagementExperimentsInsertCall {
  8469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8470. return c
  8471. }
  8472. // Context sets the context to be used in this call's Do method. Any
  8473. // pending HTTP request will be aborted if the provided context is
  8474. // canceled.
  8475. func (c *ManagementExperimentsInsertCall) Context(ctx context.Context) *ManagementExperimentsInsertCall {
  8476. c.ctx_ = ctx
  8477. return c
  8478. }
  8479. // Header returns an http.Header that can be modified by the caller to
  8480. // add HTTP headers to the request.
  8481. func (c *ManagementExperimentsInsertCall) Header() http.Header {
  8482. if c.header_ == nil {
  8483. c.header_ = make(http.Header)
  8484. }
  8485. return c.header_
  8486. }
  8487. func (c *ManagementExperimentsInsertCall) doRequest(alt string) (*http.Response, error) {
  8488. reqHeaders := make(http.Header)
  8489. for k, v := range c.header_ {
  8490. reqHeaders[k] = v
  8491. }
  8492. reqHeaders.Set("User-Agent", c.s.userAgent())
  8493. var body io.Reader = nil
  8494. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8495. if err != nil {
  8496. return nil, err
  8497. }
  8498. reqHeaders.Set("Content-Type", "application/json")
  8499. c.urlParams_.Set("alt", alt)
  8500. c.urlParams_.Set("prettyPrint", "false")
  8501. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  8502. urls += "?" + c.urlParams_.Encode()
  8503. req, err := http.NewRequest("POST", urls, body)
  8504. if err != nil {
  8505. return nil, err
  8506. }
  8507. req.Header = reqHeaders
  8508. googleapi.Expand(req.URL, map[string]string{
  8509. "accountId": c.accountId,
  8510. "webPropertyId": c.webPropertyId,
  8511. "profileId": c.profileId,
  8512. })
  8513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8514. }
  8515. // Do executes the "analytics.management.experiments.insert" call.
  8516. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8517. // status code is an error. Response headers are in either
  8518. // *Experiment.ServerResponse.Header or (if a response was returned at
  8519. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8520. // to check whether the returned error was because
  8521. // http.StatusNotModified was returned.
  8522. func (c *ManagementExperimentsInsertCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8523. gensupport.SetOptions(c.urlParams_, opts...)
  8524. res, err := c.doRequest("json")
  8525. if res != nil && res.StatusCode == http.StatusNotModified {
  8526. if res.Body != nil {
  8527. res.Body.Close()
  8528. }
  8529. return nil, &googleapi.Error{
  8530. Code: res.StatusCode,
  8531. Header: res.Header,
  8532. }
  8533. }
  8534. if err != nil {
  8535. return nil, err
  8536. }
  8537. defer googleapi.CloseBody(res)
  8538. if err := googleapi.CheckResponse(res); err != nil {
  8539. return nil, err
  8540. }
  8541. ret := &Experiment{
  8542. ServerResponse: googleapi.ServerResponse{
  8543. Header: res.Header,
  8544. HTTPStatusCode: res.StatusCode,
  8545. },
  8546. }
  8547. target := &ret
  8548. if err := gensupport.DecodeResponse(target, res); err != nil {
  8549. return nil, err
  8550. }
  8551. return ret, nil
  8552. // {
  8553. // "description": "Create a new experiment.",
  8554. // "httpMethod": "POST",
  8555. // "id": "analytics.management.experiments.insert",
  8556. // "parameterOrder": [
  8557. // "accountId",
  8558. // "webPropertyId",
  8559. // "profileId"
  8560. // ],
  8561. // "parameters": {
  8562. // "accountId": {
  8563. // "description": "Account ID to create the experiment for.",
  8564. // "location": "path",
  8565. // "required": true,
  8566. // "type": "string"
  8567. // },
  8568. // "profileId": {
  8569. // "description": "View (Profile) ID to create the experiment for.",
  8570. // "location": "path",
  8571. // "required": true,
  8572. // "type": "string"
  8573. // },
  8574. // "webPropertyId": {
  8575. // "description": "Web property ID to create the experiment for.",
  8576. // "location": "path",
  8577. // "required": true,
  8578. // "type": "string"
  8579. // }
  8580. // },
  8581. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  8582. // "request": {
  8583. // "$ref": "Experiment"
  8584. // },
  8585. // "response": {
  8586. // "$ref": "Experiment"
  8587. // },
  8588. // "scopes": [
  8589. // "https://www.googleapis.com/auth/analytics",
  8590. // "https://www.googleapis.com/auth/analytics.edit"
  8591. // ]
  8592. // }
  8593. }
  8594. // method id "analytics.management.experiments.list":
  8595. type ManagementExperimentsListCall struct {
  8596. s *Service
  8597. accountId string
  8598. webPropertyId string
  8599. profileId string
  8600. urlParams_ gensupport.URLParams
  8601. ifNoneMatch_ string
  8602. ctx_ context.Context
  8603. header_ http.Header
  8604. }
  8605. // List: Lists experiments to which the user has access.
  8606. func (r *ManagementExperimentsService) List(accountId string, webPropertyId string, profileId string) *ManagementExperimentsListCall {
  8607. c := &ManagementExperimentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8608. c.accountId = accountId
  8609. c.webPropertyId = webPropertyId
  8610. c.profileId = profileId
  8611. return c
  8612. }
  8613. // MaxResults sets the optional parameter "max-results": The maximum
  8614. // number of experiments to include in this response.
  8615. func (c *ManagementExperimentsListCall) MaxResults(maxResults int64) *ManagementExperimentsListCall {
  8616. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  8617. return c
  8618. }
  8619. // StartIndex sets the optional parameter "start-index": An index of the
  8620. // first experiment to retrieve. Use this parameter as a pagination
  8621. // mechanism along with the max-results parameter.
  8622. func (c *ManagementExperimentsListCall) StartIndex(startIndex int64) *ManagementExperimentsListCall {
  8623. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  8624. return c
  8625. }
  8626. // Fields allows partial responses to be retrieved. See
  8627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8628. // for more information.
  8629. func (c *ManagementExperimentsListCall) Fields(s ...googleapi.Field) *ManagementExperimentsListCall {
  8630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8631. return c
  8632. }
  8633. // IfNoneMatch sets the optional parameter which makes the operation
  8634. // fail if the object's ETag matches the given value. This is useful for
  8635. // getting updates only after the object has changed since the last
  8636. // request. Use googleapi.IsNotModified to check whether the response
  8637. // error from Do is the result of In-None-Match.
  8638. func (c *ManagementExperimentsListCall) IfNoneMatch(entityTag string) *ManagementExperimentsListCall {
  8639. c.ifNoneMatch_ = entityTag
  8640. return c
  8641. }
  8642. // Context sets the context to be used in this call's Do method. Any
  8643. // pending HTTP request will be aborted if the provided context is
  8644. // canceled.
  8645. func (c *ManagementExperimentsListCall) Context(ctx context.Context) *ManagementExperimentsListCall {
  8646. c.ctx_ = ctx
  8647. return c
  8648. }
  8649. // Header returns an http.Header that can be modified by the caller to
  8650. // add HTTP headers to the request.
  8651. func (c *ManagementExperimentsListCall) Header() http.Header {
  8652. if c.header_ == nil {
  8653. c.header_ = make(http.Header)
  8654. }
  8655. return c.header_
  8656. }
  8657. func (c *ManagementExperimentsListCall) doRequest(alt string) (*http.Response, error) {
  8658. reqHeaders := make(http.Header)
  8659. for k, v := range c.header_ {
  8660. reqHeaders[k] = v
  8661. }
  8662. reqHeaders.Set("User-Agent", c.s.userAgent())
  8663. if c.ifNoneMatch_ != "" {
  8664. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8665. }
  8666. var body io.Reader = nil
  8667. c.urlParams_.Set("alt", alt)
  8668. c.urlParams_.Set("prettyPrint", "false")
  8669. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  8670. urls += "?" + c.urlParams_.Encode()
  8671. req, err := http.NewRequest("GET", urls, body)
  8672. if err != nil {
  8673. return nil, err
  8674. }
  8675. req.Header = reqHeaders
  8676. googleapi.Expand(req.URL, map[string]string{
  8677. "accountId": c.accountId,
  8678. "webPropertyId": c.webPropertyId,
  8679. "profileId": c.profileId,
  8680. })
  8681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8682. }
  8683. // Do executes the "analytics.management.experiments.list" call.
  8684. // Exactly one of *Experiments or error will be non-nil. Any non-2xx
  8685. // status code is an error. Response headers are in either
  8686. // *Experiments.ServerResponse.Header or (if a response was returned at
  8687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8688. // to check whether the returned error was because
  8689. // http.StatusNotModified was returned.
  8690. func (c *ManagementExperimentsListCall) Do(opts ...googleapi.CallOption) (*Experiments, error) {
  8691. gensupport.SetOptions(c.urlParams_, opts...)
  8692. res, err := c.doRequest("json")
  8693. if res != nil && res.StatusCode == http.StatusNotModified {
  8694. if res.Body != nil {
  8695. res.Body.Close()
  8696. }
  8697. return nil, &googleapi.Error{
  8698. Code: res.StatusCode,
  8699. Header: res.Header,
  8700. }
  8701. }
  8702. if err != nil {
  8703. return nil, err
  8704. }
  8705. defer googleapi.CloseBody(res)
  8706. if err := googleapi.CheckResponse(res); err != nil {
  8707. return nil, err
  8708. }
  8709. ret := &Experiments{
  8710. ServerResponse: googleapi.ServerResponse{
  8711. Header: res.Header,
  8712. HTTPStatusCode: res.StatusCode,
  8713. },
  8714. }
  8715. target := &ret
  8716. if err := gensupport.DecodeResponse(target, res); err != nil {
  8717. return nil, err
  8718. }
  8719. return ret, nil
  8720. // {
  8721. // "description": "Lists experiments to which the user has access.",
  8722. // "httpMethod": "GET",
  8723. // "id": "analytics.management.experiments.list",
  8724. // "parameterOrder": [
  8725. // "accountId",
  8726. // "webPropertyId",
  8727. // "profileId"
  8728. // ],
  8729. // "parameters": {
  8730. // "accountId": {
  8731. // "description": "Account ID to retrieve experiments for.",
  8732. // "location": "path",
  8733. // "pattern": "\\d+",
  8734. // "required": true,
  8735. // "type": "string"
  8736. // },
  8737. // "max-results": {
  8738. // "description": "The maximum number of experiments to include in this response.",
  8739. // "format": "int32",
  8740. // "location": "query",
  8741. // "type": "integer"
  8742. // },
  8743. // "profileId": {
  8744. // "description": "View (Profile) ID to retrieve experiments for.",
  8745. // "location": "path",
  8746. // "pattern": "\\d+",
  8747. // "required": true,
  8748. // "type": "string"
  8749. // },
  8750. // "start-index": {
  8751. // "description": "An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  8752. // "format": "int32",
  8753. // "location": "query",
  8754. // "minimum": "1",
  8755. // "type": "integer"
  8756. // },
  8757. // "webPropertyId": {
  8758. // "description": "Web property ID to retrieve experiments for.",
  8759. // "location": "path",
  8760. // "pattern": "UA-(\\d+)-(\\d+)",
  8761. // "required": true,
  8762. // "type": "string"
  8763. // }
  8764. // },
  8765. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  8766. // "response": {
  8767. // "$ref": "Experiments"
  8768. // },
  8769. // "scopes": [
  8770. // "https://www.googleapis.com/auth/analytics",
  8771. // "https://www.googleapis.com/auth/analytics.edit",
  8772. // "https://www.googleapis.com/auth/analytics.readonly"
  8773. // ]
  8774. // }
  8775. }
  8776. // method id "analytics.management.experiments.patch":
  8777. type ManagementExperimentsPatchCall struct {
  8778. s *Service
  8779. accountId string
  8780. webPropertyId string
  8781. profileId string
  8782. experimentId string
  8783. experiment *Experiment
  8784. urlParams_ gensupport.URLParams
  8785. ctx_ context.Context
  8786. header_ http.Header
  8787. }
  8788. // Patch: Update an existing experiment. This method supports patch
  8789. // semantics.
  8790. func (r *ManagementExperimentsService) Patch(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsPatchCall {
  8791. c := &ManagementExperimentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8792. c.accountId = accountId
  8793. c.webPropertyId = webPropertyId
  8794. c.profileId = profileId
  8795. c.experimentId = experimentId
  8796. c.experiment = experiment
  8797. return c
  8798. }
  8799. // Fields allows partial responses to be retrieved. See
  8800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8801. // for more information.
  8802. func (c *ManagementExperimentsPatchCall) Fields(s ...googleapi.Field) *ManagementExperimentsPatchCall {
  8803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8804. return c
  8805. }
  8806. // Context sets the context to be used in this call's Do method. Any
  8807. // pending HTTP request will be aborted if the provided context is
  8808. // canceled.
  8809. func (c *ManagementExperimentsPatchCall) Context(ctx context.Context) *ManagementExperimentsPatchCall {
  8810. c.ctx_ = ctx
  8811. return c
  8812. }
  8813. // Header returns an http.Header that can be modified by the caller to
  8814. // add HTTP headers to the request.
  8815. func (c *ManagementExperimentsPatchCall) Header() http.Header {
  8816. if c.header_ == nil {
  8817. c.header_ = make(http.Header)
  8818. }
  8819. return c.header_
  8820. }
  8821. func (c *ManagementExperimentsPatchCall) doRequest(alt string) (*http.Response, error) {
  8822. reqHeaders := make(http.Header)
  8823. for k, v := range c.header_ {
  8824. reqHeaders[k] = v
  8825. }
  8826. reqHeaders.Set("User-Agent", c.s.userAgent())
  8827. var body io.Reader = nil
  8828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8829. if err != nil {
  8830. return nil, err
  8831. }
  8832. reqHeaders.Set("Content-Type", "application/json")
  8833. c.urlParams_.Set("alt", alt)
  8834. c.urlParams_.Set("prettyPrint", "false")
  8835. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8836. urls += "?" + c.urlParams_.Encode()
  8837. req, err := http.NewRequest("PATCH", urls, body)
  8838. if err != nil {
  8839. return nil, err
  8840. }
  8841. req.Header = reqHeaders
  8842. googleapi.Expand(req.URL, map[string]string{
  8843. "accountId": c.accountId,
  8844. "webPropertyId": c.webPropertyId,
  8845. "profileId": c.profileId,
  8846. "experimentId": c.experimentId,
  8847. })
  8848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8849. }
  8850. // Do executes the "analytics.management.experiments.patch" call.
  8851. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8852. // status code is an error. Response headers are in either
  8853. // *Experiment.ServerResponse.Header or (if a response was returned at
  8854. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8855. // to check whether the returned error was because
  8856. // http.StatusNotModified was returned.
  8857. func (c *ManagementExperimentsPatchCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8858. gensupport.SetOptions(c.urlParams_, opts...)
  8859. res, err := c.doRequest("json")
  8860. if res != nil && res.StatusCode == http.StatusNotModified {
  8861. if res.Body != nil {
  8862. res.Body.Close()
  8863. }
  8864. return nil, &googleapi.Error{
  8865. Code: res.StatusCode,
  8866. Header: res.Header,
  8867. }
  8868. }
  8869. if err != nil {
  8870. return nil, err
  8871. }
  8872. defer googleapi.CloseBody(res)
  8873. if err := googleapi.CheckResponse(res); err != nil {
  8874. return nil, err
  8875. }
  8876. ret := &Experiment{
  8877. ServerResponse: googleapi.ServerResponse{
  8878. Header: res.Header,
  8879. HTTPStatusCode: res.StatusCode,
  8880. },
  8881. }
  8882. target := &ret
  8883. if err := gensupport.DecodeResponse(target, res); err != nil {
  8884. return nil, err
  8885. }
  8886. return ret, nil
  8887. // {
  8888. // "description": "Update an existing experiment. This method supports patch semantics.",
  8889. // "httpMethod": "PATCH",
  8890. // "id": "analytics.management.experiments.patch",
  8891. // "parameterOrder": [
  8892. // "accountId",
  8893. // "webPropertyId",
  8894. // "profileId",
  8895. // "experimentId"
  8896. // ],
  8897. // "parameters": {
  8898. // "accountId": {
  8899. // "description": "Account ID of the experiment to update.",
  8900. // "location": "path",
  8901. // "required": true,
  8902. // "type": "string"
  8903. // },
  8904. // "experimentId": {
  8905. // "description": "Experiment ID of the experiment to update.",
  8906. // "location": "path",
  8907. // "required": true,
  8908. // "type": "string"
  8909. // },
  8910. // "profileId": {
  8911. // "description": "View (Profile) ID of the experiment to update.",
  8912. // "location": "path",
  8913. // "required": true,
  8914. // "type": "string"
  8915. // },
  8916. // "webPropertyId": {
  8917. // "description": "Web property ID of the experiment to update.",
  8918. // "location": "path",
  8919. // "required": true,
  8920. // "type": "string"
  8921. // }
  8922. // },
  8923. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8924. // "request": {
  8925. // "$ref": "Experiment"
  8926. // },
  8927. // "response": {
  8928. // "$ref": "Experiment"
  8929. // },
  8930. // "scopes": [
  8931. // "https://www.googleapis.com/auth/analytics",
  8932. // "https://www.googleapis.com/auth/analytics.edit"
  8933. // ]
  8934. // }
  8935. }
  8936. // method id "analytics.management.experiments.update":
  8937. type ManagementExperimentsUpdateCall struct {
  8938. s *Service
  8939. accountId string
  8940. webPropertyId string
  8941. profileId string
  8942. experimentId string
  8943. experiment *Experiment
  8944. urlParams_ gensupport.URLParams
  8945. ctx_ context.Context
  8946. header_ http.Header
  8947. }
  8948. // Update: Update an existing experiment.
  8949. func (r *ManagementExperimentsService) Update(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsUpdateCall {
  8950. c := &ManagementExperimentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8951. c.accountId = accountId
  8952. c.webPropertyId = webPropertyId
  8953. c.profileId = profileId
  8954. c.experimentId = experimentId
  8955. c.experiment = experiment
  8956. return c
  8957. }
  8958. // Fields allows partial responses to be retrieved. See
  8959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8960. // for more information.
  8961. func (c *ManagementExperimentsUpdateCall) Fields(s ...googleapi.Field) *ManagementExperimentsUpdateCall {
  8962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8963. return c
  8964. }
  8965. // Context sets the context to be used in this call's Do method. Any
  8966. // pending HTTP request will be aborted if the provided context is
  8967. // canceled.
  8968. func (c *ManagementExperimentsUpdateCall) Context(ctx context.Context) *ManagementExperimentsUpdateCall {
  8969. c.ctx_ = ctx
  8970. return c
  8971. }
  8972. // Header returns an http.Header that can be modified by the caller to
  8973. // add HTTP headers to the request.
  8974. func (c *ManagementExperimentsUpdateCall) Header() http.Header {
  8975. if c.header_ == nil {
  8976. c.header_ = make(http.Header)
  8977. }
  8978. return c.header_
  8979. }
  8980. func (c *ManagementExperimentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8981. reqHeaders := make(http.Header)
  8982. for k, v := range c.header_ {
  8983. reqHeaders[k] = v
  8984. }
  8985. reqHeaders.Set("User-Agent", c.s.userAgent())
  8986. var body io.Reader = nil
  8987. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8988. if err != nil {
  8989. return nil, err
  8990. }
  8991. reqHeaders.Set("Content-Type", "application/json")
  8992. c.urlParams_.Set("alt", alt)
  8993. c.urlParams_.Set("prettyPrint", "false")
  8994. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8995. urls += "?" + c.urlParams_.Encode()
  8996. req, err := http.NewRequest("PUT", urls, body)
  8997. if err != nil {
  8998. return nil, err
  8999. }
  9000. req.Header = reqHeaders
  9001. googleapi.Expand(req.URL, map[string]string{
  9002. "accountId": c.accountId,
  9003. "webPropertyId": c.webPropertyId,
  9004. "profileId": c.profileId,
  9005. "experimentId": c.experimentId,
  9006. })
  9007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9008. }
  9009. // Do executes the "analytics.management.experiments.update" call.
  9010. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  9011. // status code is an error. Response headers are in either
  9012. // *Experiment.ServerResponse.Header or (if a response was returned at
  9013. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9014. // to check whether the returned error was because
  9015. // http.StatusNotModified was returned.
  9016. func (c *ManagementExperimentsUpdateCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  9017. gensupport.SetOptions(c.urlParams_, opts...)
  9018. res, err := c.doRequest("json")
  9019. if res != nil && res.StatusCode == http.StatusNotModified {
  9020. if res.Body != nil {
  9021. res.Body.Close()
  9022. }
  9023. return nil, &googleapi.Error{
  9024. Code: res.StatusCode,
  9025. Header: res.Header,
  9026. }
  9027. }
  9028. if err != nil {
  9029. return nil, err
  9030. }
  9031. defer googleapi.CloseBody(res)
  9032. if err := googleapi.CheckResponse(res); err != nil {
  9033. return nil, err
  9034. }
  9035. ret := &Experiment{
  9036. ServerResponse: googleapi.ServerResponse{
  9037. Header: res.Header,
  9038. HTTPStatusCode: res.StatusCode,
  9039. },
  9040. }
  9041. target := &ret
  9042. if err := gensupport.DecodeResponse(target, res); err != nil {
  9043. return nil, err
  9044. }
  9045. return ret, nil
  9046. // {
  9047. // "description": "Update an existing experiment.",
  9048. // "httpMethod": "PUT",
  9049. // "id": "analytics.management.experiments.update",
  9050. // "parameterOrder": [
  9051. // "accountId",
  9052. // "webPropertyId",
  9053. // "profileId",
  9054. // "experimentId"
  9055. // ],
  9056. // "parameters": {
  9057. // "accountId": {
  9058. // "description": "Account ID of the experiment to update.",
  9059. // "location": "path",
  9060. // "required": true,
  9061. // "type": "string"
  9062. // },
  9063. // "experimentId": {
  9064. // "description": "Experiment ID of the experiment to update.",
  9065. // "location": "path",
  9066. // "required": true,
  9067. // "type": "string"
  9068. // },
  9069. // "profileId": {
  9070. // "description": "View (Profile) ID of the experiment to update.",
  9071. // "location": "path",
  9072. // "required": true,
  9073. // "type": "string"
  9074. // },
  9075. // "webPropertyId": {
  9076. // "description": "Web property ID of the experiment to update.",
  9077. // "location": "path",
  9078. // "required": true,
  9079. // "type": "string"
  9080. // }
  9081. // },
  9082. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  9083. // "request": {
  9084. // "$ref": "Experiment"
  9085. // },
  9086. // "response": {
  9087. // "$ref": "Experiment"
  9088. // },
  9089. // "scopes": [
  9090. // "https://www.googleapis.com/auth/analytics",
  9091. // "https://www.googleapis.com/auth/analytics.edit"
  9092. // ]
  9093. // }
  9094. }
  9095. // method id "analytics.management.filters.delete":
  9096. type ManagementFiltersDeleteCall struct {
  9097. s *Service
  9098. accountId string
  9099. filterId string
  9100. urlParams_ gensupport.URLParams
  9101. ctx_ context.Context
  9102. header_ http.Header
  9103. }
  9104. // Delete: Delete a filter.
  9105. func (r *ManagementFiltersService) Delete(accountId string, filterId string) *ManagementFiltersDeleteCall {
  9106. c := &ManagementFiltersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9107. c.accountId = accountId
  9108. c.filterId = filterId
  9109. return c
  9110. }
  9111. // Fields allows partial responses to be retrieved. See
  9112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9113. // for more information.
  9114. func (c *ManagementFiltersDeleteCall) Fields(s ...googleapi.Field) *ManagementFiltersDeleteCall {
  9115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9116. return c
  9117. }
  9118. // Context sets the context to be used in this call's Do method. Any
  9119. // pending HTTP request will be aborted if the provided context is
  9120. // canceled.
  9121. func (c *ManagementFiltersDeleteCall) Context(ctx context.Context) *ManagementFiltersDeleteCall {
  9122. c.ctx_ = ctx
  9123. return c
  9124. }
  9125. // Header returns an http.Header that can be modified by the caller to
  9126. // add HTTP headers to the request.
  9127. func (c *ManagementFiltersDeleteCall) Header() http.Header {
  9128. if c.header_ == nil {
  9129. c.header_ = make(http.Header)
  9130. }
  9131. return c.header_
  9132. }
  9133. func (c *ManagementFiltersDeleteCall) doRequest(alt string) (*http.Response, error) {
  9134. reqHeaders := make(http.Header)
  9135. for k, v := range c.header_ {
  9136. reqHeaders[k] = v
  9137. }
  9138. reqHeaders.Set("User-Agent", c.s.userAgent())
  9139. var body io.Reader = nil
  9140. c.urlParams_.Set("alt", alt)
  9141. c.urlParams_.Set("prettyPrint", "false")
  9142. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9143. urls += "?" + c.urlParams_.Encode()
  9144. req, err := http.NewRequest("DELETE", urls, body)
  9145. if err != nil {
  9146. return nil, err
  9147. }
  9148. req.Header = reqHeaders
  9149. googleapi.Expand(req.URL, map[string]string{
  9150. "accountId": c.accountId,
  9151. "filterId": c.filterId,
  9152. })
  9153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9154. }
  9155. // Do executes the "analytics.management.filters.delete" call.
  9156. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9157. // code is an error. Response headers are in either
  9158. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9159. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9160. // check whether the returned error was because http.StatusNotModified
  9161. // was returned.
  9162. func (c *ManagementFiltersDeleteCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9163. gensupport.SetOptions(c.urlParams_, opts...)
  9164. res, err := c.doRequest("json")
  9165. if res != nil && res.StatusCode == http.StatusNotModified {
  9166. if res.Body != nil {
  9167. res.Body.Close()
  9168. }
  9169. return nil, &googleapi.Error{
  9170. Code: res.StatusCode,
  9171. Header: res.Header,
  9172. }
  9173. }
  9174. if err != nil {
  9175. return nil, err
  9176. }
  9177. defer googleapi.CloseBody(res)
  9178. if err := googleapi.CheckResponse(res); err != nil {
  9179. return nil, err
  9180. }
  9181. ret := &Filter{
  9182. ServerResponse: googleapi.ServerResponse{
  9183. Header: res.Header,
  9184. HTTPStatusCode: res.StatusCode,
  9185. },
  9186. }
  9187. target := &ret
  9188. if err := gensupport.DecodeResponse(target, res); err != nil {
  9189. return nil, err
  9190. }
  9191. return ret, nil
  9192. // {
  9193. // "description": "Delete a filter.",
  9194. // "httpMethod": "DELETE",
  9195. // "id": "analytics.management.filters.delete",
  9196. // "parameterOrder": [
  9197. // "accountId",
  9198. // "filterId"
  9199. // ],
  9200. // "parameters": {
  9201. // "accountId": {
  9202. // "description": "Account ID to delete the filter for.",
  9203. // "location": "path",
  9204. // "required": true,
  9205. // "type": "string"
  9206. // },
  9207. // "filterId": {
  9208. // "description": "ID of the filter to be deleted.",
  9209. // "location": "path",
  9210. // "required": true,
  9211. // "type": "string"
  9212. // }
  9213. // },
  9214. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9215. // "response": {
  9216. // "$ref": "Filter"
  9217. // },
  9218. // "scopes": [
  9219. // "https://www.googleapis.com/auth/analytics.edit"
  9220. // ]
  9221. // }
  9222. }
  9223. // method id "analytics.management.filters.get":
  9224. type ManagementFiltersGetCall struct {
  9225. s *Service
  9226. accountId string
  9227. filterId string
  9228. urlParams_ gensupport.URLParams
  9229. ifNoneMatch_ string
  9230. ctx_ context.Context
  9231. header_ http.Header
  9232. }
  9233. // Get: Returns a filters to which the user has access.
  9234. func (r *ManagementFiltersService) Get(accountId string, filterId string) *ManagementFiltersGetCall {
  9235. c := &ManagementFiltersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9236. c.accountId = accountId
  9237. c.filterId = filterId
  9238. return c
  9239. }
  9240. // Fields allows partial responses to be retrieved. See
  9241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9242. // for more information.
  9243. func (c *ManagementFiltersGetCall) Fields(s ...googleapi.Field) *ManagementFiltersGetCall {
  9244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9245. return c
  9246. }
  9247. // IfNoneMatch sets the optional parameter which makes the operation
  9248. // fail if the object's ETag matches the given value. This is useful for
  9249. // getting updates only after the object has changed since the last
  9250. // request. Use googleapi.IsNotModified to check whether the response
  9251. // error from Do is the result of In-None-Match.
  9252. func (c *ManagementFiltersGetCall) IfNoneMatch(entityTag string) *ManagementFiltersGetCall {
  9253. c.ifNoneMatch_ = entityTag
  9254. return c
  9255. }
  9256. // Context sets the context to be used in this call's Do method. Any
  9257. // pending HTTP request will be aborted if the provided context is
  9258. // canceled.
  9259. func (c *ManagementFiltersGetCall) Context(ctx context.Context) *ManagementFiltersGetCall {
  9260. c.ctx_ = ctx
  9261. return c
  9262. }
  9263. // Header returns an http.Header that can be modified by the caller to
  9264. // add HTTP headers to the request.
  9265. func (c *ManagementFiltersGetCall) Header() http.Header {
  9266. if c.header_ == nil {
  9267. c.header_ = make(http.Header)
  9268. }
  9269. return c.header_
  9270. }
  9271. func (c *ManagementFiltersGetCall) doRequest(alt string) (*http.Response, error) {
  9272. reqHeaders := make(http.Header)
  9273. for k, v := range c.header_ {
  9274. reqHeaders[k] = v
  9275. }
  9276. reqHeaders.Set("User-Agent", c.s.userAgent())
  9277. if c.ifNoneMatch_ != "" {
  9278. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9279. }
  9280. var body io.Reader = nil
  9281. c.urlParams_.Set("alt", alt)
  9282. c.urlParams_.Set("prettyPrint", "false")
  9283. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9284. urls += "?" + c.urlParams_.Encode()
  9285. req, err := http.NewRequest("GET", urls, body)
  9286. if err != nil {
  9287. return nil, err
  9288. }
  9289. req.Header = reqHeaders
  9290. googleapi.Expand(req.URL, map[string]string{
  9291. "accountId": c.accountId,
  9292. "filterId": c.filterId,
  9293. })
  9294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9295. }
  9296. // Do executes the "analytics.management.filters.get" call.
  9297. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9298. // code is an error. Response headers are in either
  9299. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9300. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9301. // check whether the returned error was because http.StatusNotModified
  9302. // was returned.
  9303. func (c *ManagementFiltersGetCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9304. gensupport.SetOptions(c.urlParams_, opts...)
  9305. res, err := c.doRequest("json")
  9306. if res != nil && res.StatusCode == http.StatusNotModified {
  9307. if res.Body != nil {
  9308. res.Body.Close()
  9309. }
  9310. return nil, &googleapi.Error{
  9311. Code: res.StatusCode,
  9312. Header: res.Header,
  9313. }
  9314. }
  9315. if err != nil {
  9316. return nil, err
  9317. }
  9318. defer googleapi.CloseBody(res)
  9319. if err := googleapi.CheckResponse(res); err != nil {
  9320. return nil, err
  9321. }
  9322. ret := &Filter{
  9323. ServerResponse: googleapi.ServerResponse{
  9324. Header: res.Header,
  9325. HTTPStatusCode: res.StatusCode,
  9326. },
  9327. }
  9328. target := &ret
  9329. if err := gensupport.DecodeResponse(target, res); err != nil {
  9330. return nil, err
  9331. }
  9332. return ret, nil
  9333. // {
  9334. // "description": "Returns a filters to which the user has access.",
  9335. // "httpMethod": "GET",
  9336. // "id": "analytics.management.filters.get",
  9337. // "parameterOrder": [
  9338. // "accountId",
  9339. // "filterId"
  9340. // ],
  9341. // "parameters": {
  9342. // "accountId": {
  9343. // "description": "Account ID to retrieve filters for.",
  9344. // "location": "path",
  9345. // "required": true,
  9346. // "type": "string"
  9347. // },
  9348. // "filterId": {
  9349. // "description": "Filter ID to retrieve filters for.",
  9350. // "location": "path",
  9351. // "required": true,
  9352. // "type": "string"
  9353. // }
  9354. // },
  9355. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9356. // "response": {
  9357. // "$ref": "Filter"
  9358. // },
  9359. // "scopes": [
  9360. // "https://www.googleapis.com/auth/analytics.edit",
  9361. // "https://www.googleapis.com/auth/analytics.readonly"
  9362. // ]
  9363. // }
  9364. }
  9365. // method id "analytics.management.filters.insert":
  9366. type ManagementFiltersInsertCall struct {
  9367. s *Service
  9368. accountId string
  9369. filter *Filter
  9370. urlParams_ gensupport.URLParams
  9371. ctx_ context.Context
  9372. header_ http.Header
  9373. }
  9374. // Insert: Create a new filter.
  9375. func (r *ManagementFiltersService) Insert(accountId string, filter *Filter) *ManagementFiltersInsertCall {
  9376. c := &ManagementFiltersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9377. c.accountId = accountId
  9378. c.filter = filter
  9379. return c
  9380. }
  9381. // Fields allows partial responses to be retrieved. See
  9382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9383. // for more information.
  9384. func (c *ManagementFiltersInsertCall) Fields(s ...googleapi.Field) *ManagementFiltersInsertCall {
  9385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9386. return c
  9387. }
  9388. // Context sets the context to be used in this call's Do method. Any
  9389. // pending HTTP request will be aborted if the provided context is
  9390. // canceled.
  9391. func (c *ManagementFiltersInsertCall) Context(ctx context.Context) *ManagementFiltersInsertCall {
  9392. c.ctx_ = ctx
  9393. return c
  9394. }
  9395. // Header returns an http.Header that can be modified by the caller to
  9396. // add HTTP headers to the request.
  9397. func (c *ManagementFiltersInsertCall) Header() http.Header {
  9398. if c.header_ == nil {
  9399. c.header_ = make(http.Header)
  9400. }
  9401. return c.header_
  9402. }
  9403. func (c *ManagementFiltersInsertCall) doRequest(alt string) (*http.Response, error) {
  9404. reqHeaders := make(http.Header)
  9405. for k, v := range c.header_ {
  9406. reqHeaders[k] = v
  9407. }
  9408. reqHeaders.Set("User-Agent", c.s.userAgent())
  9409. var body io.Reader = nil
  9410. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9411. if err != nil {
  9412. return nil, err
  9413. }
  9414. reqHeaders.Set("Content-Type", "application/json")
  9415. c.urlParams_.Set("alt", alt)
  9416. c.urlParams_.Set("prettyPrint", "false")
  9417. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  9418. urls += "?" + c.urlParams_.Encode()
  9419. req, err := http.NewRequest("POST", urls, body)
  9420. if err != nil {
  9421. return nil, err
  9422. }
  9423. req.Header = reqHeaders
  9424. googleapi.Expand(req.URL, map[string]string{
  9425. "accountId": c.accountId,
  9426. })
  9427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9428. }
  9429. // Do executes the "analytics.management.filters.insert" call.
  9430. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9431. // code is an error. Response headers are in either
  9432. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9433. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9434. // check whether the returned error was because http.StatusNotModified
  9435. // was returned.
  9436. func (c *ManagementFiltersInsertCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9437. gensupport.SetOptions(c.urlParams_, opts...)
  9438. res, err := c.doRequest("json")
  9439. if res != nil && res.StatusCode == http.StatusNotModified {
  9440. if res.Body != nil {
  9441. res.Body.Close()
  9442. }
  9443. return nil, &googleapi.Error{
  9444. Code: res.StatusCode,
  9445. Header: res.Header,
  9446. }
  9447. }
  9448. if err != nil {
  9449. return nil, err
  9450. }
  9451. defer googleapi.CloseBody(res)
  9452. if err := googleapi.CheckResponse(res); err != nil {
  9453. return nil, err
  9454. }
  9455. ret := &Filter{
  9456. ServerResponse: googleapi.ServerResponse{
  9457. Header: res.Header,
  9458. HTTPStatusCode: res.StatusCode,
  9459. },
  9460. }
  9461. target := &ret
  9462. if err := gensupport.DecodeResponse(target, res); err != nil {
  9463. return nil, err
  9464. }
  9465. return ret, nil
  9466. // {
  9467. // "description": "Create a new filter.",
  9468. // "httpMethod": "POST",
  9469. // "id": "analytics.management.filters.insert",
  9470. // "parameterOrder": [
  9471. // "accountId"
  9472. // ],
  9473. // "parameters": {
  9474. // "accountId": {
  9475. // "description": "Account ID to create filter for.",
  9476. // "location": "path",
  9477. // "required": true,
  9478. // "type": "string"
  9479. // }
  9480. // },
  9481. // "path": "management/accounts/{accountId}/filters",
  9482. // "request": {
  9483. // "$ref": "Filter"
  9484. // },
  9485. // "response": {
  9486. // "$ref": "Filter"
  9487. // },
  9488. // "scopes": [
  9489. // "https://www.googleapis.com/auth/analytics.edit"
  9490. // ]
  9491. // }
  9492. }
  9493. // method id "analytics.management.filters.list":
  9494. type ManagementFiltersListCall struct {
  9495. s *Service
  9496. accountId string
  9497. urlParams_ gensupport.URLParams
  9498. ifNoneMatch_ string
  9499. ctx_ context.Context
  9500. header_ http.Header
  9501. }
  9502. // List: Lists all filters for an account
  9503. func (r *ManagementFiltersService) List(accountId string) *ManagementFiltersListCall {
  9504. c := &ManagementFiltersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9505. c.accountId = accountId
  9506. return c
  9507. }
  9508. // MaxResults sets the optional parameter "max-results": The maximum
  9509. // number of filters to include in this response.
  9510. func (c *ManagementFiltersListCall) MaxResults(maxResults int64) *ManagementFiltersListCall {
  9511. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  9512. return c
  9513. }
  9514. // StartIndex sets the optional parameter "start-index": An index of the
  9515. // first entity to retrieve. Use this parameter as a pagination
  9516. // mechanism along with the max-results parameter.
  9517. func (c *ManagementFiltersListCall) StartIndex(startIndex int64) *ManagementFiltersListCall {
  9518. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  9519. return c
  9520. }
  9521. // Fields allows partial responses to be retrieved. See
  9522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9523. // for more information.
  9524. func (c *ManagementFiltersListCall) Fields(s ...googleapi.Field) *ManagementFiltersListCall {
  9525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9526. return c
  9527. }
  9528. // IfNoneMatch sets the optional parameter which makes the operation
  9529. // fail if the object's ETag matches the given value. This is useful for
  9530. // getting updates only after the object has changed since the last
  9531. // request. Use googleapi.IsNotModified to check whether the response
  9532. // error from Do is the result of In-None-Match.
  9533. func (c *ManagementFiltersListCall) IfNoneMatch(entityTag string) *ManagementFiltersListCall {
  9534. c.ifNoneMatch_ = entityTag
  9535. return c
  9536. }
  9537. // Context sets the context to be used in this call's Do method. Any
  9538. // pending HTTP request will be aborted if the provided context is
  9539. // canceled.
  9540. func (c *ManagementFiltersListCall) Context(ctx context.Context) *ManagementFiltersListCall {
  9541. c.ctx_ = ctx
  9542. return c
  9543. }
  9544. // Header returns an http.Header that can be modified by the caller to
  9545. // add HTTP headers to the request.
  9546. func (c *ManagementFiltersListCall) Header() http.Header {
  9547. if c.header_ == nil {
  9548. c.header_ = make(http.Header)
  9549. }
  9550. return c.header_
  9551. }
  9552. func (c *ManagementFiltersListCall) doRequest(alt string) (*http.Response, error) {
  9553. reqHeaders := make(http.Header)
  9554. for k, v := range c.header_ {
  9555. reqHeaders[k] = v
  9556. }
  9557. reqHeaders.Set("User-Agent", c.s.userAgent())
  9558. if c.ifNoneMatch_ != "" {
  9559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9560. }
  9561. var body io.Reader = nil
  9562. c.urlParams_.Set("alt", alt)
  9563. c.urlParams_.Set("prettyPrint", "false")
  9564. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  9565. urls += "?" + c.urlParams_.Encode()
  9566. req, err := http.NewRequest("GET", urls, body)
  9567. if err != nil {
  9568. return nil, err
  9569. }
  9570. req.Header = reqHeaders
  9571. googleapi.Expand(req.URL, map[string]string{
  9572. "accountId": c.accountId,
  9573. })
  9574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9575. }
  9576. // Do executes the "analytics.management.filters.list" call.
  9577. // Exactly one of *Filters or error will be non-nil. Any non-2xx status
  9578. // code is an error. Response headers are in either
  9579. // *Filters.ServerResponse.Header or (if a response was returned at all)
  9580. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9581. // check whether the returned error was because http.StatusNotModified
  9582. // was returned.
  9583. func (c *ManagementFiltersListCall) Do(opts ...googleapi.CallOption) (*Filters, error) {
  9584. gensupport.SetOptions(c.urlParams_, opts...)
  9585. res, err := c.doRequest("json")
  9586. if res != nil && res.StatusCode == http.StatusNotModified {
  9587. if res.Body != nil {
  9588. res.Body.Close()
  9589. }
  9590. return nil, &googleapi.Error{
  9591. Code: res.StatusCode,
  9592. Header: res.Header,
  9593. }
  9594. }
  9595. if err != nil {
  9596. return nil, err
  9597. }
  9598. defer googleapi.CloseBody(res)
  9599. if err := googleapi.CheckResponse(res); err != nil {
  9600. return nil, err
  9601. }
  9602. ret := &Filters{
  9603. ServerResponse: googleapi.ServerResponse{
  9604. Header: res.Header,
  9605. HTTPStatusCode: res.StatusCode,
  9606. },
  9607. }
  9608. target := &ret
  9609. if err := gensupport.DecodeResponse(target, res); err != nil {
  9610. return nil, err
  9611. }
  9612. return ret, nil
  9613. // {
  9614. // "description": "Lists all filters for an account",
  9615. // "httpMethod": "GET",
  9616. // "id": "analytics.management.filters.list",
  9617. // "parameterOrder": [
  9618. // "accountId"
  9619. // ],
  9620. // "parameters": {
  9621. // "accountId": {
  9622. // "description": "Account ID to retrieve filters for.",
  9623. // "location": "path",
  9624. // "pattern": "\\d+",
  9625. // "required": true,
  9626. // "type": "string"
  9627. // },
  9628. // "max-results": {
  9629. // "description": "The maximum number of filters to include in this response.",
  9630. // "format": "int32",
  9631. // "location": "query",
  9632. // "type": "integer"
  9633. // },
  9634. // "start-index": {
  9635. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  9636. // "format": "int32",
  9637. // "location": "query",
  9638. // "minimum": "1",
  9639. // "type": "integer"
  9640. // }
  9641. // },
  9642. // "path": "management/accounts/{accountId}/filters",
  9643. // "response": {
  9644. // "$ref": "Filters"
  9645. // },
  9646. // "scopes": [
  9647. // "https://www.googleapis.com/auth/analytics.edit",
  9648. // "https://www.googleapis.com/auth/analytics.readonly"
  9649. // ]
  9650. // }
  9651. }
  9652. // method id "analytics.management.filters.patch":
  9653. type ManagementFiltersPatchCall struct {
  9654. s *Service
  9655. accountId string
  9656. filterId string
  9657. filter *Filter
  9658. urlParams_ gensupport.URLParams
  9659. ctx_ context.Context
  9660. header_ http.Header
  9661. }
  9662. // Patch: Updates an existing filter. This method supports patch
  9663. // semantics.
  9664. func (r *ManagementFiltersService) Patch(accountId string, filterId string, filter *Filter) *ManagementFiltersPatchCall {
  9665. c := &ManagementFiltersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9666. c.accountId = accountId
  9667. c.filterId = filterId
  9668. c.filter = filter
  9669. return c
  9670. }
  9671. // Fields allows partial responses to be retrieved. See
  9672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9673. // for more information.
  9674. func (c *ManagementFiltersPatchCall) Fields(s ...googleapi.Field) *ManagementFiltersPatchCall {
  9675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9676. return c
  9677. }
  9678. // Context sets the context to be used in this call's Do method. Any
  9679. // pending HTTP request will be aborted if the provided context is
  9680. // canceled.
  9681. func (c *ManagementFiltersPatchCall) Context(ctx context.Context) *ManagementFiltersPatchCall {
  9682. c.ctx_ = ctx
  9683. return c
  9684. }
  9685. // Header returns an http.Header that can be modified by the caller to
  9686. // add HTTP headers to the request.
  9687. func (c *ManagementFiltersPatchCall) Header() http.Header {
  9688. if c.header_ == nil {
  9689. c.header_ = make(http.Header)
  9690. }
  9691. return c.header_
  9692. }
  9693. func (c *ManagementFiltersPatchCall) doRequest(alt string) (*http.Response, error) {
  9694. reqHeaders := make(http.Header)
  9695. for k, v := range c.header_ {
  9696. reqHeaders[k] = v
  9697. }
  9698. reqHeaders.Set("User-Agent", c.s.userAgent())
  9699. var body io.Reader = nil
  9700. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9701. if err != nil {
  9702. return nil, err
  9703. }
  9704. reqHeaders.Set("Content-Type", "application/json")
  9705. c.urlParams_.Set("alt", alt)
  9706. c.urlParams_.Set("prettyPrint", "false")
  9707. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9708. urls += "?" + c.urlParams_.Encode()
  9709. req, err := http.NewRequest("PATCH", urls, body)
  9710. if err != nil {
  9711. return nil, err
  9712. }
  9713. req.Header = reqHeaders
  9714. googleapi.Expand(req.URL, map[string]string{
  9715. "accountId": c.accountId,
  9716. "filterId": c.filterId,
  9717. })
  9718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9719. }
  9720. // Do executes the "analytics.management.filters.patch" call.
  9721. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9722. // code is an error. Response headers are in either
  9723. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9724. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9725. // check whether the returned error was because http.StatusNotModified
  9726. // was returned.
  9727. func (c *ManagementFiltersPatchCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9728. gensupport.SetOptions(c.urlParams_, opts...)
  9729. res, err := c.doRequest("json")
  9730. if res != nil && res.StatusCode == http.StatusNotModified {
  9731. if res.Body != nil {
  9732. res.Body.Close()
  9733. }
  9734. return nil, &googleapi.Error{
  9735. Code: res.StatusCode,
  9736. Header: res.Header,
  9737. }
  9738. }
  9739. if err != nil {
  9740. return nil, err
  9741. }
  9742. defer googleapi.CloseBody(res)
  9743. if err := googleapi.CheckResponse(res); err != nil {
  9744. return nil, err
  9745. }
  9746. ret := &Filter{
  9747. ServerResponse: googleapi.ServerResponse{
  9748. Header: res.Header,
  9749. HTTPStatusCode: res.StatusCode,
  9750. },
  9751. }
  9752. target := &ret
  9753. if err := gensupport.DecodeResponse(target, res); err != nil {
  9754. return nil, err
  9755. }
  9756. return ret, nil
  9757. // {
  9758. // "description": "Updates an existing filter. This method supports patch semantics.",
  9759. // "httpMethod": "PATCH",
  9760. // "id": "analytics.management.filters.patch",
  9761. // "parameterOrder": [
  9762. // "accountId",
  9763. // "filterId"
  9764. // ],
  9765. // "parameters": {
  9766. // "accountId": {
  9767. // "description": "Account ID to which the filter belongs.",
  9768. // "location": "path",
  9769. // "required": true,
  9770. // "type": "string"
  9771. // },
  9772. // "filterId": {
  9773. // "description": "ID of the filter to be updated.",
  9774. // "location": "path",
  9775. // "required": true,
  9776. // "type": "string"
  9777. // }
  9778. // },
  9779. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9780. // "request": {
  9781. // "$ref": "Filter"
  9782. // },
  9783. // "response": {
  9784. // "$ref": "Filter"
  9785. // },
  9786. // "scopes": [
  9787. // "https://www.googleapis.com/auth/analytics.edit"
  9788. // ]
  9789. // }
  9790. }
  9791. // method id "analytics.management.filters.update":
  9792. type ManagementFiltersUpdateCall struct {
  9793. s *Service
  9794. accountId string
  9795. filterId string
  9796. filter *Filter
  9797. urlParams_ gensupport.URLParams
  9798. ctx_ context.Context
  9799. header_ http.Header
  9800. }
  9801. // Update: Updates an existing filter.
  9802. func (r *ManagementFiltersService) Update(accountId string, filterId string, filter *Filter) *ManagementFiltersUpdateCall {
  9803. c := &ManagementFiltersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9804. c.accountId = accountId
  9805. c.filterId = filterId
  9806. c.filter = filter
  9807. return c
  9808. }
  9809. // Fields allows partial responses to be retrieved. See
  9810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9811. // for more information.
  9812. func (c *ManagementFiltersUpdateCall) Fields(s ...googleapi.Field) *ManagementFiltersUpdateCall {
  9813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9814. return c
  9815. }
  9816. // Context sets the context to be used in this call's Do method. Any
  9817. // pending HTTP request will be aborted if the provided context is
  9818. // canceled.
  9819. func (c *ManagementFiltersUpdateCall) Context(ctx context.Context) *ManagementFiltersUpdateCall {
  9820. c.ctx_ = ctx
  9821. return c
  9822. }
  9823. // Header returns an http.Header that can be modified by the caller to
  9824. // add HTTP headers to the request.
  9825. func (c *ManagementFiltersUpdateCall) Header() http.Header {
  9826. if c.header_ == nil {
  9827. c.header_ = make(http.Header)
  9828. }
  9829. return c.header_
  9830. }
  9831. func (c *ManagementFiltersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9832. reqHeaders := make(http.Header)
  9833. for k, v := range c.header_ {
  9834. reqHeaders[k] = v
  9835. }
  9836. reqHeaders.Set("User-Agent", c.s.userAgent())
  9837. var body io.Reader = nil
  9838. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9839. if err != nil {
  9840. return nil, err
  9841. }
  9842. reqHeaders.Set("Content-Type", "application/json")
  9843. c.urlParams_.Set("alt", alt)
  9844. c.urlParams_.Set("prettyPrint", "false")
  9845. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9846. urls += "?" + c.urlParams_.Encode()
  9847. req, err := http.NewRequest("PUT", urls, body)
  9848. if err != nil {
  9849. return nil, err
  9850. }
  9851. req.Header = reqHeaders
  9852. googleapi.Expand(req.URL, map[string]string{
  9853. "accountId": c.accountId,
  9854. "filterId": c.filterId,
  9855. })
  9856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9857. }
  9858. // Do executes the "analytics.management.filters.update" call.
  9859. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9860. // code is an error. Response headers are in either
  9861. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9862. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9863. // check whether the returned error was because http.StatusNotModified
  9864. // was returned.
  9865. func (c *ManagementFiltersUpdateCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9866. gensupport.SetOptions(c.urlParams_, opts...)
  9867. res, err := c.doRequest("json")
  9868. if res != nil && res.StatusCode == http.StatusNotModified {
  9869. if res.Body != nil {
  9870. res.Body.Close()
  9871. }
  9872. return nil, &googleapi.Error{
  9873. Code: res.StatusCode,
  9874. Header: res.Header,
  9875. }
  9876. }
  9877. if err != nil {
  9878. return nil, err
  9879. }
  9880. defer googleapi.CloseBody(res)
  9881. if err := googleapi.CheckResponse(res); err != nil {
  9882. return nil, err
  9883. }
  9884. ret := &Filter{
  9885. ServerResponse: googleapi.ServerResponse{
  9886. Header: res.Header,
  9887. HTTPStatusCode: res.StatusCode,
  9888. },
  9889. }
  9890. target := &ret
  9891. if err := gensupport.DecodeResponse(target, res); err != nil {
  9892. return nil, err
  9893. }
  9894. return ret, nil
  9895. // {
  9896. // "description": "Updates an existing filter.",
  9897. // "httpMethod": "PUT",
  9898. // "id": "analytics.management.filters.update",
  9899. // "parameterOrder": [
  9900. // "accountId",
  9901. // "filterId"
  9902. // ],
  9903. // "parameters": {
  9904. // "accountId": {
  9905. // "description": "Account ID to which the filter belongs.",
  9906. // "location": "path",
  9907. // "required": true,
  9908. // "type": "string"
  9909. // },
  9910. // "filterId": {
  9911. // "description": "ID of the filter to be updated.",
  9912. // "location": "path",
  9913. // "required": true,
  9914. // "type": "string"
  9915. // }
  9916. // },
  9917. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9918. // "request": {
  9919. // "$ref": "Filter"
  9920. // },
  9921. // "response": {
  9922. // "$ref": "Filter"
  9923. // },
  9924. // "scopes": [
  9925. // "https://www.googleapis.com/auth/analytics.edit"
  9926. // ]
  9927. // }
  9928. }
  9929. // method id "analytics.management.goals.get":
  9930. type ManagementGoalsGetCall struct {
  9931. s *Service
  9932. accountId string
  9933. webPropertyId string
  9934. profileId string
  9935. goalId string
  9936. urlParams_ gensupport.URLParams
  9937. ifNoneMatch_ string
  9938. ctx_ context.Context
  9939. header_ http.Header
  9940. }
  9941. // Get: Gets a goal to which the user has access.
  9942. func (r *ManagementGoalsService) Get(accountId string, webPropertyId string, profileId string, goalId string) *ManagementGoalsGetCall {
  9943. c := &ManagementGoalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9944. c.accountId = accountId
  9945. c.webPropertyId = webPropertyId
  9946. c.profileId = profileId
  9947. c.goalId = goalId
  9948. return c
  9949. }
  9950. // Fields allows partial responses to be retrieved. See
  9951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9952. // for more information.
  9953. func (c *ManagementGoalsGetCall) Fields(s ...googleapi.Field) *ManagementGoalsGetCall {
  9954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9955. return c
  9956. }
  9957. // IfNoneMatch sets the optional parameter which makes the operation
  9958. // fail if the object's ETag matches the given value. This is useful for
  9959. // getting updates only after the object has changed since the last
  9960. // request. Use googleapi.IsNotModified to check whether the response
  9961. // error from Do is the result of In-None-Match.
  9962. func (c *ManagementGoalsGetCall) IfNoneMatch(entityTag string) *ManagementGoalsGetCall {
  9963. c.ifNoneMatch_ = entityTag
  9964. return c
  9965. }
  9966. // Context sets the context to be used in this call's Do method. Any
  9967. // pending HTTP request will be aborted if the provided context is
  9968. // canceled.
  9969. func (c *ManagementGoalsGetCall) Context(ctx context.Context) *ManagementGoalsGetCall {
  9970. c.ctx_ = ctx
  9971. return c
  9972. }
  9973. // Header returns an http.Header that can be modified by the caller to
  9974. // add HTTP headers to the request.
  9975. func (c *ManagementGoalsGetCall) Header() http.Header {
  9976. if c.header_ == nil {
  9977. c.header_ = make(http.Header)
  9978. }
  9979. return c.header_
  9980. }
  9981. func (c *ManagementGoalsGetCall) doRequest(alt string) (*http.Response, error) {
  9982. reqHeaders := make(http.Header)
  9983. for k, v := range c.header_ {
  9984. reqHeaders[k] = v
  9985. }
  9986. reqHeaders.Set("User-Agent", c.s.userAgent())
  9987. if c.ifNoneMatch_ != "" {
  9988. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9989. }
  9990. var body io.Reader = nil
  9991. c.urlParams_.Set("alt", alt)
  9992. c.urlParams_.Set("prettyPrint", "false")
  9993. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  9994. urls += "?" + c.urlParams_.Encode()
  9995. req, err := http.NewRequest("GET", urls, body)
  9996. if err != nil {
  9997. return nil, err
  9998. }
  9999. req.Header = reqHeaders
  10000. googleapi.Expand(req.URL, map[string]string{
  10001. "accountId": c.accountId,
  10002. "webPropertyId": c.webPropertyId,
  10003. "profileId": c.profileId,
  10004. "goalId": c.goalId,
  10005. })
  10006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10007. }
  10008. // Do executes the "analytics.management.goals.get" call.
  10009. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10010. // code is an error. Response headers are in either
  10011. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10012. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10013. // whether the returned error was because http.StatusNotModified was
  10014. // returned.
  10015. func (c *ManagementGoalsGetCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10016. gensupport.SetOptions(c.urlParams_, opts...)
  10017. res, err := c.doRequest("json")
  10018. if res != nil && res.StatusCode == http.StatusNotModified {
  10019. if res.Body != nil {
  10020. res.Body.Close()
  10021. }
  10022. return nil, &googleapi.Error{
  10023. Code: res.StatusCode,
  10024. Header: res.Header,
  10025. }
  10026. }
  10027. if err != nil {
  10028. return nil, err
  10029. }
  10030. defer googleapi.CloseBody(res)
  10031. if err := googleapi.CheckResponse(res); err != nil {
  10032. return nil, err
  10033. }
  10034. ret := &Goal{
  10035. ServerResponse: googleapi.ServerResponse{
  10036. Header: res.Header,
  10037. HTTPStatusCode: res.StatusCode,
  10038. },
  10039. }
  10040. target := &ret
  10041. if err := gensupport.DecodeResponse(target, res); err != nil {
  10042. return nil, err
  10043. }
  10044. return ret, nil
  10045. // {
  10046. // "description": "Gets a goal to which the user has access.",
  10047. // "httpMethod": "GET",
  10048. // "id": "analytics.management.goals.get",
  10049. // "parameterOrder": [
  10050. // "accountId",
  10051. // "webPropertyId",
  10052. // "profileId",
  10053. // "goalId"
  10054. // ],
  10055. // "parameters": {
  10056. // "accountId": {
  10057. // "description": "Account ID to retrieve the goal for.",
  10058. // "location": "path",
  10059. // "required": true,
  10060. // "type": "string"
  10061. // },
  10062. // "goalId": {
  10063. // "description": "Goal ID to retrieve the goal for.",
  10064. // "location": "path",
  10065. // "required": true,
  10066. // "type": "string"
  10067. // },
  10068. // "profileId": {
  10069. // "description": "View (Profile) ID to retrieve the goal for.",
  10070. // "location": "path",
  10071. // "required": true,
  10072. // "type": "string"
  10073. // },
  10074. // "webPropertyId": {
  10075. // "description": "Web property ID to retrieve the goal for.",
  10076. // "location": "path",
  10077. // "required": true,
  10078. // "type": "string"
  10079. // }
  10080. // },
  10081. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10082. // "response": {
  10083. // "$ref": "Goal"
  10084. // },
  10085. // "scopes": [
  10086. // "https://www.googleapis.com/auth/analytics.edit",
  10087. // "https://www.googleapis.com/auth/analytics.readonly"
  10088. // ]
  10089. // }
  10090. }
  10091. // method id "analytics.management.goals.insert":
  10092. type ManagementGoalsInsertCall struct {
  10093. s *Service
  10094. accountId string
  10095. webPropertyId string
  10096. profileId string
  10097. goal *Goal
  10098. urlParams_ gensupport.URLParams
  10099. ctx_ context.Context
  10100. header_ http.Header
  10101. }
  10102. // Insert: Create a new goal.
  10103. func (r *ManagementGoalsService) Insert(accountId string, webPropertyId string, profileId string, goal *Goal) *ManagementGoalsInsertCall {
  10104. c := &ManagementGoalsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10105. c.accountId = accountId
  10106. c.webPropertyId = webPropertyId
  10107. c.profileId = profileId
  10108. c.goal = goal
  10109. return c
  10110. }
  10111. // Fields allows partial responses to be retrieved. See
  10112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10113. // for more information.
  10114. func (c *ManagementGoalsInsertCall) Fields(s ...googleapi.Field) *ManagementGoalsInsertCall {
  10115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10116. return c
  10117. }
  10118. // Context sets the context to be used in this call's Do method. Any
  10119. // pending HTTP request will be aborted if the provided context is
  10120. // canceled.
  10121. func (c *ManagementGoalsInsertCall) Context(ctx context.Context) *ManagementGoalsInsertCall {
  10122. c.ctx_ = ctx
  10123. return c
  10124. }
  10125. // Header returns an http.Header that can be modified by the caller to
  10126. // add HTTP headers to the request.
  10127. func (c *ManagementGoalsInsertCall) Header() http.Header {
  10128. if c.header_ == nil {
  10129. c.header_ = make(http.Header)
  10130. }
  10131. return c.header_
  10132. }
  10133. func (c *ManagementGoalsInsertCall) doRequest(alt string) (*http.Response, error) {
  10134. reqHeaders := make(http.Header)
  10135. for k, v := range c.header_ {
  10136. reqHeaders[k] = v
  10137. }
  10138. reqHeaders.Set("User-Agent", c.s.userAgent())
  10139. var body io.Reader = nil
  10140. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10141. if err != nil {
  10142. return nil, err
  10143. }
  10144. reqHeaders.Set("Content-Type", "application/json")
  10145. c.urlParams_.Set("alt", alt)
  10146. c.urlParams_.Set("prettyPrint", "false")
  10147. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  10148. urls += "?" + c.urlParams_.Encode()
  10149. req, err := http.NewRequest("POST", urls, body)
  10150. if err != nil {
  10151. return nil, err
  10152. }
  10153. req.Header = reqHeaders
  10154. googleapi.Expand(req.URL, map[string]string{
  10155. "accountId": c.accountId,
  10156. "webPropertyId": c.webPropertyId,
  10157. "profileId": c.profileId,
  10158. })
  10159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10160. }
  10161. // Do executes the "analytics.management.goals.insert" call.
  10162. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10163. // code is an error. Response headers are in either
  10164. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10165. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10166. // whether the returned error was because http.StatusNotModified was
  10167. // returned.
  10168. func (c *ManagementGoalsInsertCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10169. gensupport.SetOptions(c.urlParams_, opts...)
  10170. res, err := c.doRequest("json")
  10171. if res != nil && res.StatusCode == http.StatusNotModified {
  10172. if res.Body != nil {
  10173. res.Body.Close()
  10174. }
  10175. return nil, &googleapi.Error{
  10176. Code: res.StatusCode,
  10177. Header: res.Header,
  10178. }
  10179. }
  10180. if err != nil {
  10181. return nil, err
  10182. }
  10183. defer googleapi.CloseBody(res)
  10184. if err := googleapi.CheckResponse(res); err != nil {
  10185. return nil, err
  10186. }
  10187. ret := &Goal{
  10188. ServerResponse: googleapi.ServerResponse{
  10189. Header: res.Header,
  10190. HTTPStatusCode: res.StatusCode,
  10191. },
  10192. }
  10193. target := &ret
  10194. if err := gensupport.DecodeResponse(target, res); err != nil {
  10195. return nil, err
  10196. }
  10197. return ret, nil
  10198. // {
  10199. // "description": "Create a new goal.",
  10200. // "httpMethod": "POST",
  10201. // "id": "analytics.management.goals.insert",
  10202. // "parameterOrder": [
  10203. // "accountId",
  10204. // "webPropertyId",
  10205. // "profileId"
  10206. // ],
  10207. // "parameters": {
  10208. // "accountId": {
  10209. // "description": "Account ID to create the goal for.",
  10210. // "location": "path",
  10211. // "required": true,
  10212. // "type": "string"
  10213. // },
  10214. // "profileId": {
  10215. // "description": "View (Profile) ID to create the goal for.",
  10216. // "location": "path",
  10217. // "required": true,
  10218. // "type": "string"
  10219. // },
  10220. // "webPropertyId": {
  10221. // "description": "Web property ID to create the goal for.",
  10222. // "location": "path",
  10223. // "required": true,
  10224. // "type": "string"
  10225. // }
  10226. // },
  10227. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  10228. // "request": {
  10229. // "$ref": "Goal"
  10230. // },
  10231. // "response": {
  10232. // "$ref": "Goal"
  10233. // },
  10234. // "scopes": [
  10235. // "https://www.googleapis.com/auth/analytics.edit"
  10236. // ]
  10237. // }
  10238. }
  10239. // method id "analytics.management.goals.list":
  10240. type ManagementGoalsListCall struct {
  10241. s *Service
  10242. accountId string
  10243. webPropertyId string
  10244. profileId string
  10245. urlParams_ gensupport.URLParams
  10246. ifNoneMatch_ string
  10247. ctx_ context.Context
  10248. header_ http.Header
  10249. }
  10250. // List: Lists goals to which the user has access.
  10251. func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall {
  10252. c := &ManagementGoalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10253. c.accountId = accountId
  10254. c.webPropertyId = webPropertyId
  10255. c.profileId = profileId
  10256. return c
  10257. }
  10258. // MaxResults sets the optional parameter "max-results": The maximum
  10259. // number of goals to include in this response.
  10260. func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall {
  10261. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  10262. return c
  10263. }
  10264. // StartIndex sets the optional parameter "start-index": An index of the
  10265. // first goal to retrieve. Use this parameter as a pagination mechanism
  10266. // along with the max-results parameter.
  10267. func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall {
  10268. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  10269. return c
  10270. }
  10271. // Fields allows partial responses to be retrieved. See
  10272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10273. // for more information.
  10274. func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall {
  10275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10276. return c
  10277. }
  10278. // IfNoneMatch sets the optional parameter which makes the operation
  10279. // fail if the object's ETag matches the given value. This is useful for
  10280. // getting updates only after the object has changed since the last
  10281. // request. Use googleapi.IsNotModified to check whether the response
  10282. // error from Do is the result of In-None-Match.
  10283. func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall {
  10284. c.ifNoneMatch_ = entityTag
  10285. return c
  10286. }
  10287. // Context sets the context to be used in this call's Do method. Any
  10288. // pending HTTP request will be aborted if the provided context is
  10289. // canceled.
  10290. func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall {
  10291. c.ctx_ = ctx
  10292. return c
  10293. }
  10294. // Header returns an http.Header that can be modified by the caller to
  10295. // add HTTP headers to the request.
  10296. func (c *ManagementGoalsListCall) Header() http.Header {
  10297. if c.header_ == nil {
  10298. c.header_ = make(http.Header)
  10299. }
  10300. return c.header_
  10301. }
  10302. func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) {
  10303. reqHeaders := make(http.Header)
  10304. for k, v := range c.header_ {
  10305. reqHeaders[k] = v
  10306. }
  10307. reqHeaders.Set("User-Agent", c.s.userAgent())
  10308. if c.ifNoneMatch_ != "" {
  10309. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10310. }
  10311. var body io.Reader = nil
  10312. c.urlParams_.Set("alt", alt)
  10313. c.urlParams_.Set("prettyPrint", "false")
  10314. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  10315. urls += "?" + c.urlParams_.Encode()
  10316. req, err := http.NewRequest("GET", urls, body)
  10317. if err != nil {
  10318. return nil, err
  10319. }
  10320. req.Header = reqHeaders
  10321. googleapi.Expand(req.URL, map[string]string{
  10322. "accountId": c.accountId,
  10323. "webPropertyId": c.webPropertyId,
  10324. "profileId": c.profileId,
  10325. })
  10326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10327. }
  10328. // Do executes the "analytics.management.goals.list" call.
  10329. // Exactly one of *Goals or error will be non-nil. Any non-2xx status
  10330. // code is an error. Response headers are in either
  10331. // *Goals.ServerResponse.Header or (if a response was returned at all)
  10332. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10333. // check whether the returned error was because http.StatusNotModified
  10334. // was returned.
  10335. func (c *ManagementGoalsListCall) Do(opts ...googleapi.CallOption) (*Goals, error) {
  10336. gensupport.SetOptions(c.urlParams_, opts...)
  10337. res, err := c.doRequest("json")
  10338. if res != nil && res.StatusCode == http.StatusNotModified {
  10339. if res.Body != nil {
  10340. res.Body.Close()
  10341. }
  10342. return nil, &googleapi.Error{
  10343. Code: res.StatusCode,
  10344. Header: res.Header,
  10345. }
  10346. }
  10347. if err != nil {
  10348. return nil, err
  10349. }
  10350. defer googleapi.CloseBody(res)
  10351. if err := googleapi.CheckResponse(res); err != nil {
  10352. return nil, err
  10353. }
  10354. ret := &Goals{
  10355. ServerResponse: googleapi.ServerResponse{
  10356. Header: res.Header,
  10357. HTTPStatusCode: res.StatusCode,
  10358. },
  10359. }
  10360. target := &ret
  10361. if err := gensupport.DecodeResponse(target, res); err != nil {
  10362. return nil, err
  10363. }
  10364. return ret, nil
  10365. // {
  10366. // "description": "Lists goals to which the user has access.",
  10367. // "httpMethod": "GET",
  10368. // "id": "analytics.management.goals.list",
  10369. // "parameterOrder": [
  10370. // "accountId",
  10371. // "webPropertyId",
  10372. // "profileId"
  10373. // ],
  10374. // "parameters": {
  10375. // "accountId": {
  10376. // "description": "Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.",
  10377. // "location": "path",
  10378. // "required": true,
  10379. // "type": "string"
  10380. // },
  10381. // "max-results": {
  10382. // "description": "The maximum number of goals to include in this response.",
  10383. // "format": "int32",
  10384. // "location": "query",
  10385. // "type": "integer"
  10386. // },
  10387. // "profileId": {
  10388. // "description": "View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.",
  10389. // "location": "path",
  10390. // "required": true,
  10391. // "type": "string"
  10392. // },
  10393. // "start-index": {
  10394. // "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  10395. // "format": "int32",
  10396. // "location": "query",
  10397. // "minimum": "1",
  10398. // "type": "integer"
  10399. // },
  10400. // "webPropertyId": {
  10401. // "description": "Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  10402. // "location": "path",
  10403. // "required": true,
  10404. // "type": "string"
  10405. // }
  10406. // },
  10407. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  10408. // "response": {
  10409. // "$ref": "Goals"
  10410. // },
  10411. // "scopes": [
  10412. // "https://www.googleapis.com/auth/analytics",
  10413. // "https://www.googleapis.com/auth/analytics.edit",
  10414. // "https://www.googleapis.com/auth/analytics.readonly"
  10415. // ]
  10416. // }
  10417. }
  10418. // method id "analytics.management.goals.patch":
  10419. type ManagementGoalsPatchCall struct {
  10420. s *Service
  10421. accountId string
  10422. webPropertyId string
  10423. profileId string
  10424. goalId string
  10425. goal *Goal
  10426. urlParams_ gensupport.URLParams
  10427. ctx_ context.Context
  10428. header_ http.Header
  10429. }
  10430. // Patch: Updates an existing goal. This method supports patch
  10431. // semantics.
  10432. func (r *ManagementGoalsService) Patch(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsPatchCall {
  10433. c := &ManagementGoalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10434. c.accountId = accountId
  10435. c.webPropertyId = webPropertyId
  10436. c.profileId = profileId
  10437. c.goalId = goalId
  10438. c.goal = goal
  10439. return c
  10440. }
  10441. // Fields allows partial responses to be retrieved. See
  10442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10443. // for more information.
  10444. func (c *ManagementGoalsPatchCall) Fields(s ...googleapi.Field) *ManagementGoalsPatchCall {
  10445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10446. return c
  10447. }
  10448. // Context sets the context to be used in this call's Do method. Any
  10449. // pending HTTP request will be aborted if the provided context is
  10450. // canceled.
  10451. func (c *ManagementGoalsPatchCall) Context(ctx context.Context) *ManagementGoalsPatchCall {
  10452. c.ctx_ = ctx
  10453. return c
  10454. }
  10455. // Header returns an http.Header that can be modified by the caller to
  10456. // add HTTP headers to the request.
  10457. func (c *ManagementGoalsPatchCall) Header() http.Header {
  10458. if c.header_ == nil {
  10459. c.header_ = make(http.Header)
  10460. }
  10461. return c.header_
  10462. }
  10463. func (c *ManagementGoalsPatchCall) doRequest(alt string) (*http.Response, error) {
  10464. reqHeaders := make(http.Header)
  10465. for k, v := range c.header_ {
  10466. reqHeaders[k] = v
  10467. }
  10468. reqHeaders.Set("User-Agent", c.s.userAgent())
  10469. var body io.Reader = nil
  10470. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10471. if err != nil {
  10472. return nil, err
  10473. }
  10474. reqHeaders.Set("Content-Type", "application/json")
  10475. c.urlParams_.Set("alt", alt)
  10476. c.urlParams_.Set("prettyPrint", "false")
  10477. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  10478. urls += "?" + c.urlParams_.Encode()
  10479. req, err := http.NewRequest("PATCH", urls, body)
  10480. if err != nil {
  10481. return nil, err
  10482. }
  10483. req.Header = reqHeaders
  10484. googleapi.Expand(req.URL, map[string]string{
  10485. "accountId": c.accountId,
  10486. "webPropertyId": c.webPropertyId,
  10487. "profileId": c.profileId,
  10488. "goalId": c.goalId,
  10489. })
  10490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10491. }
  10492. // Do executes the "analytics.management.goals.patch" call.
  10493. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10494. // code is an error. Response headers are in either
  10495. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10496. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10497. // whether the returned error was because http.StatusNotModified was
  10498. // returned.
  10499. func (c *ManagementGoalsPatchCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10500. gensupport.SetOptions(c.urlParams_, opts...)
  10501. res, err := c.doRequest("json")
  10502. if res != nil && res.StatusCode == http.StatusNotModified {
  10503. if res.Body != nil {
  10504. res.Body.Close()
  10505. }
  10506. return nil, &googleapi.Error{
  10507. Code: res.StatusCode,
  10508. Header: res.Header,
  10509. }
  10510. }
  10511. if err != nil {
  10512. return nil, err
  10513. }
  10514. defer googleapi.CloseBody(res)
  10515. if err := googleapi.CheckResponse(res); err != nil {
  10516. return nil, err
  10517. }
  10518. ret := &Goal{
  10519. ServerResponse: googleapi.ServerResponse{
  10520. Header: res.Header,
  10521. HTTPStatusCode: res.StatusCode,
  10522. },
  10523. }
  10524. target := &ret
  10525. if err := gensupport.DecodeResponse(target, res); err != nil {
  10526. return nil, err
  10527. }
  10528. return ret, nil
  10529. // {
  10530. // "description": "Updates an existing goal. This method supports patch semantics.",
  10531. // "httpMethod": "PATCH",
  10532. // "id": "analytics.management.goals.patch",
  10533. // "parameterOrder": [
  10534. // "accountId",
  10535. // "webPropertyId",
  10536. // "profileId",
  10537. // "goalId"
  10538. // ],
  10539. // "parameters": {
  10540. // "accountId": {
  10541. // "description": "Account ID to update the goal.",
  10542. // "location": "path",
  10543. // "required": true,
  10544. // "type": "string"
  10545. // },
  10546. // "goalId": {
  10547. // "description": "Index of the goal to be updated.",
  10548. // "location": "path",
  10549. // "required": true,
  10550. // "type": "string"
  10551. // },
  10552. // "profileId": {
  10553. // "description": "View (Profile) ID to update the goal.",
  10554. // "location": "path",
  10555. // "required": true,
  10556. // "type": "string"
  10557. // },
  10558. // "webPropertyId": {
  10559. // "description": "Web property ID to update the goal.",
  10560. // "location": "path",
  10561. // "required": true,
  10562. // "type": "string"
  10563. // }
  10564. // },
  10565. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10566. // "request": {
  10567. // "$ref": "Goal"
  10568. // },
  10569. // "response": {
  10570. // "$ref": "Goal"
  10571. // },
  10572. // "scopes": [
  10573. // "https://www.googleapis.com/auth/analytics.edit"
  10574. // ]
  10575. // }
  10576. }
  10577. // method id "analytics.management.goals.update":
  10578. type ManagementGoalsUpdateCall struct {
  10579. s *Service
  10580. accountId string
  10581. webPropertyId string
  10582. profileId string
  10583. goalId string
  10584. goal *Goal
  10585. urlParams_ gensupport.URLParams
  10586. ctx_ context.Context
  10587. header_ http.Header
  10588. }
  10589. // Update: Updates an existing goal.
  10590. func (r *ManagementGoalsService) Update(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsUpdateCall {
  10591. c := &ManagementGoalsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10592. c.accountId = accountId
  10593. c.webPropertyId = webPropertyId
  10594. c.profileId = profileId
  10595. c.goalId = goalId
  10596. c.goal = goal
  10597. return c
  10598. }
  10599. // Fields allows partial responses to be retrieved. See
  10600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10601. // for more information.
  10602. func (c *ManagementGoalsUpdateCall) Fields(s ...googleapi.Field) *ManagementGoalsUpdateCall {
  10603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10604. return c
  10605. }
  10606. // Context sets the context to be used in this call's Do method. Any
  10607. // pending HTTP request will be aborted if the provided context is
  10608. // canceled.
  10609. func (c *ManagementGoalsUpdateCall) Context(ctx context.Context) *ManagementGoalsUpdateCall {
  10610. c.ctx_ = ctx
  10611. return c
  10612. }
  10613. // Header returns an http.Header that can be modified by the caller to
  10614. // add HTTP headers to the request.
  10615. func (c *ManagementGoalsUpdateCall) Header() http.Header {
  10616. if c.header_ == nil {
  10617. c.header_ = make(http.Header)
  10618. }
  10619. return c.header_
  10620. }
  10621. func (c *ManagementGoalsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10622. reqHeaders := make(http.Header)
  10623. for k, v := range c.header_ {
  10624. reqHeaders[k] = v
  10625. }
  10626. reqHeaders.Set("User-Agent", c.s.userAgent())
  10627. var body io.Reader = nil
  10628. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10629. if err != nil {
  10630. return nil, err
  10631. }
  10632. reqHeaders.Set("Content-Type", "application/json")
  10633. c.urlParams_.Set("alt", alt)
  10634. c.urlParams_.Set("prettyPrint", "false")
  10635. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  10636. urls += "?" + c.urlParams_.Encode()
  10637. req, err := http.NewRequest("PUT", urls, body)
  10638. if err != nil {
  10639. return nil, err
  10640. }
  10641. req.Header = reqHeaders
  10642. googleapi.Expand(req.URL, map[string]string{
  10643. "accountId": c.accountId,
  10644. "webPropertyId": c.webPropertyId,
  10645. "profileId": c.profileId,
  10646. "goalId": c.goalId,
  10647. })
  10648. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10649. }
  10650. // Do executes the "analytics.management.goals.update" call.
  10651. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10652. // code is an error. Response headers are in either
  10653. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10654. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10655. // whether the returned error was because http.StatusNotModified was
  10656. // returned.
  10657. func (c *ManagementGoalsUpdateCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10658. gensupport.SetOptions(c.urlParams_, opts...)
  10659. res, err := c.doRequest("json")
  10660. if res != nil && res.StatusCode == http.StatusNotModified {
  10661. if res.Body != nil {
  10662. res.Body.Close()
  10663. }
  10664. return nil, &googleapi.Error{
  10665. Code: res.StatusCode,
  10666. Header: res.Header,
  10667. }
  10668. }
  10669. if err != nil {
  10670. return nil, err
  10671. }
  10672. defer googleapi.CloseBody(res)
  10673. if err := googleapi.CheckResponse(res); err != nil {
  10674. return nil, err
  10675. }
  10676. ret := &Goal{
  10677. ServerResponse: googleapi.ServerResponse{
  10678. Header: res.Header,
  10679. HTTPStatusCode: res.StatusCode,
  10680. },
  10681. }
  10682. target := &ret
  10683. if err := gensupport.DecodeResponse(target, res); err != nil {
  10684. return nil, err
  10685. }
  10686. return ret, nil
  10687. // {
  10688. // "description": "Updates an existing goal.",
  10689. // "httpMethod": "PUT",
  10690. // "id": "analytics.management.goals.update",
  10691. // "parameterOrder": [
  10692. // "accountId",
  10693. // "webPropertyId",
  10694. // "profileId",
  10695. // "goalId"
  10696. // ],
  10697. // "parameters": {
  10698. // "accountId": {
  10699. // "description": "Account ID to update the goal.",
  10700. // "location": "path",
  10701. // "required": true,
  10702. // "type": "string"
  10703. // },
  10704. // "goalId": {
  10705. // "description": "Index of the goal to be updated.",
  10706. // "location": "path",
  10707. // "required": true,
  10708. // "type": "string"
  10709. // },
  10710. // "profileId": {
  10711. // "description": "View (Profile) ID to update the goal.",
  10712. // "location": "path",
  10713. // "required": true,
  10714. // "type": "string"
  10715. // },
  10716. // "webPropertyId": {
  10717. // "description": "Web property ID to update the goal.",
  10718. // "location": "path",
  10719. // "required": true,
  10720. // "type": "string"
  10721. // }
  10722. // },
  10723. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10724. // "request": {
  10725. // "$ref": "Goal"
  10726. // },
  10727. // "response": {
  10728. // "$ref": "Goal"
  10729. // },
  10730. // "scopes": [
  10731. // "https://www.googleapis.com/auth/analytics.edit"
  10732. // ]
  10733. // }
  10734. }
  10735. // method id "analytics.management.profileFilterLinks.delete":
  10736. type ManagementProfileFilterLinksDeleteCall struct {
  10737. s *Service
  10738. accountId string
  10739. webPropertyId string
  10740. profileId string
  10741. linkId string
  10742. urlParams_ gensupport.URLParams
  10743. ctx_ context.Context
  10744. header_ http.Header
  10745. }
  10746. // Delete: Delete a profile filter link.
  10747. func (r *ManagementProfileFilterLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksDeleteCall {
  10748. c := &ManagementProfileFilterLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10749. c.accountId = accountId
  10750. c.webPropertyId = webPropertyId
  10751. c.profileId = profileId
  10752. c.linkId = linkId
  10753. return c
  10754. }
  10755. // Fields allows partial responses to be retrieved. See
  10756. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10757. // for more information.
  10758. func (c *ManagementProfileFilterLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksDeleteCall {
  10759. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10760. return c
  10761. }
  10762. // Context sets the context to be used in this call's Do method. Any
  10763. // pending HTTP request will be aborted if the provided context is
  10764. // canceled.
  10765. func (c *ManagementProfileFilterLinksDeleteCall) Context(ctx context.Context) *ManagementProfileFilterLinksDeleteCall {
  10766. c.ctx_ = ctx
  10767. return c
  10768. }
  10769. // Header returns an http.Header that can be modified by the caller to
  10770. // add HTTP headers to the request.
  10771. func (c *ManagementProfileFilterLinksDeleteCall) Header() http.Header {
  10772. if c.header_ == nil {
  10773. c.header_ = make(http.Header)
  10774. }
  10775. return c.header_
  10776. }
  10777. func (c *ManagementProfileFilterLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  10778. reqHeaders := make(http.Header)
  10779. for k, v := range c.header_ {
  10780. reqHeaders[k] = v
  10781. }
  10782. reqHeaders.Set("User-Agent", c.s.userAgent())
  10783. var body io.Reader = nil
  10784. c.urlParams_.Set("alt", alt)
  10785. c.urlParams_.Set("prettyPrint", "false")
  10786. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  10787. urls += "?" + c.urlParams_.Encode()
  10788. req, err := http.NewRequest("DELETE", urls, body)
  10789. if err != nil {
  10790. return nil, err
  10791. }
  10792. req.Header = reqHeaders
  10793. googleapi.Expand(req.URL, map[string]string{
  10794. "accountId": c.accountId,
  10795. "webPropertyId": c.webPropertyId,
  10796. "profileId": c.profileId,
  10797. "linkId": c.linkId,
  10798. })
  10799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10800. }
  10801. // Do executes the "analytics.management.profileFilterLinks.delete" call.
  10802. func (c *ManagementProfileFilterLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  10803. gensupport.SetOptions(c.urlParams_, opts...)
  10804. res, err := c.doRequest("json")
  10805. if err != nil {
  10806. return err
  10807. }
  10808. defer googleapi.CloseBody(res)
  10809. if err := googleapi.CheckResponse(res); err != nil {
  10810. return err
  10811. }
  10812. return nil
  10813. // {
  10814. // "description": "Delete a profile filter link.",
  10815. // "httpMethod": "DELETE",
  10816. // "id": "analytics.management.profileFilterLinks.delete",
  10817. // "parameterOrder": [
  10818. // "accountId",
  10819. // "webPropertyId",
  10820. // "profileId",
  10821. // "linkId"
  10822. // ],
  10823. // "parameters": {
  10824. // "accountId": {
  10825. // "description": "Account ID to which the profile filter link belongs.",
  10826. // "location": "path",
  10827. // "pattern": "\\d+",
  10828. // "required": true,
  10829. // "type": "string"
  10830. // },
  10831. // "linkId": {
  10832. // "description": "ID of the profile filter link to delete.",
  10833. // "location": "path",
  10834. // "pattern": "\\d+:\\d+",
  10835. // "required": true,
  10836. // "type": "string"
  10837. // },
  10838. // "profileId": {
  10839. // "description": "Profile ID to which the filter link belongs.",
  10840. // "location": "path",
  10841. // "pattern": "\\d+",
  10842. // "required": true,
  10843. // "type": "string"
  10844. // },
  10845. // "webPropertyId": {
  10846. // "description": "Web property Id to which the profile filter link belongs.",
  10847. // "location": "path",
  10848. // "pattern": "UA-(\\d+)-(\\d+)",
  10849. // "required": true,
  10850. // "type": "string"
  10851. // }
  10852. // },
  10853. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  10854. // "scopes": [
  10855. // "https://www.googleapis.com/auth/analytics.edit"
  10856. // ]
  10857. // }
  10858. }
  10859. // method id "analytics.management.profileFilterLinks.get":
  10860. type ManagementProfileFilterLinksGetCall struct {
  10861. s *Service
  10862. accountId string
  10863. webPropertyId string
  10864. profileId string
  10865. linkId string
  10866. urlParams_ gensupport.URLParams
  10867. ifNoneMatch_ string
  10868. ctx_ context.Context
  10869. header_ http.Header
  10870. }
  10871. // Get: Returns a single profile filter link.
  10872. func (r *ManagementProfileFilterLinksService) Get(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksGetCall {
  10873. c := &ManagementProfileFilterLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10874. c.accountId = accountId
  10875. c.webPropertyId = webPropertyId
  10876. c.profileId = profileId
  10877. c.linkId = linkId
  10878. return c
  10879. }
  10880. // Fields allows partial responses to be retrieved. See
  10881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10882. // for more information.
  10883. func (c *ManagementProfileFilterLinksGetCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksGetCall {
  10884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10885. return c
  10886. }
  10887. // IfNoneMatch sets the optional parameter which makes the operation
  10888. // fail if the object's ETag matches the given value. This is useful for
  10889. // getting updates only after the object has changed since the last
  10890. // request. Use googleapi.IsNotModified to check whether the response
  10891. // error from Do is the result of In-None-Match.
  10892. func (c *ManagementProfileFilterLinksGetCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksGetCall {
  10893. c.ifNoneMatch_ = entityTag
  10894. return c
  10895. }
  10896. // Context sets the context to be used in this call's Do method. Any
  10897. // pending HTTP request will be aborted if the provided context is
  10898. // canceled.
  10899. func (c *ManagementProfileFilterLinksGetCall) Context(ctx context.Context) *ManagementProfileFilterLinksGetCall {
  10900. c.ctx_ = ctx
  10901. return c
  10902. }
  10903. // Header returns an http.Header that can be modified by the caller to
  10904. // add HTTP headers to the request.
  10905. func (c *ManagementProfileFilterLinksGetCall) Header() http.Header {
  10906. if c.header_ == nil {
  10907. c.header_ = make(http.Header)
  10908. }
  10909. return c.header_
  10910. }
  10911. func (c *ManagementProfileFilterLinksGetCall) doRequest(alt string) (*http.Response, error) {
  10912. reqHeaders := make(http.Header)
  10913. for k, v := range c.header_ {
  10914. reqHeaders[k] = v
  10915. }
  10916. reqHeaders.Set("User-Agent", c.s.userAgent())
  10917. if c.ifNoneMatch_ != "" {
  10918. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10919. }
  10920. var body io.Reader = nil
  10921. c.urlParams_.Set("alt", alt)
  10922. c.urlParams_.Set("prettyPrint", "false")
  10923. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  10924. urls += "?" + c.urlParams_.Encode()
  10925. req, err := http.NewRequest("GET", urls, body)
  10926. if err != nil {
  10927. return nil, err
  10928. }
  10929. req.Header = reqHeaders
  10930. googleapi.Expand(req.URL, map[string]string{
  10931. "accountId": c.accountId,
  10932. "webPropertyId": c.webPropertyId,
  10933. "profileId": c.profileId,
  10934. "linkId": c.linkId,
  10935. })
  10936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10937. }
  10938. // Do executes the "analytics.management.profileFilterLinks.get" call.
  10939. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  10940. // non-2xx status code is an error. Response headers are in either
  10941. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  10942. // returned at all) in error.(*googleapi.Error).Header. Use
  10943. // googleapi.IsNotModified to check whether the returned error was
  10944. // because http.StatusNotModified was returned.
  10945. func (c *ManagementProfileFilterLinksGetCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  10946. gensupport.SetOptions(c.urlParams_, opts...)
  10947. res, err := c.doRequest("json")
  10948. if res != nil && res.StatusCode == http.StatusNotModified {
  10949. if res.Body != nil {
  10950. res.Body.Close()
  10951. }
  10952. return nil, &googleapi.Error{
  10953. Code: res.StatusCode,
  10954. Header: res.Header,
  10955. }
  10956. }
  10957. if err != nil {
  10958. return nil, err
  10959. }
  10960. defer googleapi.CloseBody(res)
  10961. if err := googleapi.CheckResponse(res); err != nil {
  10962. return nil, err
  10963. }
  10964. ret := &ProfileFilterLink{
  10965. ServerResponse: googleapi.ServerResponse{
  10966. Header: res.Header,
  10967. HTTPStatusCode: res.StatusCode,
  10968. },
  10969. }
  10970. target := &ret
  10971. if err := gensupport.DecodeResponse(target, res); err != nil {
  10972. return nil, err
  10973. }
  10974. return ret, nil
  10975. // {
  10976. // "description": "Returns a single profile filter link.",
  10977. // "httpMethod": "GET",
  10978. // "id": "analytics.management.profileFilterLinks.get",
  10979. // "parameterOrder": [
  10980. // "accountId",
  10981. // "webPropertyId",
  10982. // "profileId",
  10983. // "linkId"
  10984. // ],
  10985. // "parameters": {
  10986. // "accountId": {
  10987. // "description": "Account ID to retrieve profile filter link for.",
  10988. // "location": "path",
  10989. // "pattern": "\\d+",
  10990. // "required": true,
  10991. // "type": "string"
  10992. // },
  10993. // "linkId": {
  10994. // "description": "ID of the profile filter link.",
  10995. // "location": "path",
  10996. // "pattern": "\\d+:\\d+",
  10997. // "required": true,
  10998. // "type": "string"
  10999. // },
  11000. // "profileId": {
  11001. // "description": "Profile ID to retrieve filter link for.",
  11002. // "location": "path",
  11003. // "pattern": "\\d+",
  11004. // "required": true,
  11005. // "type": "string"
  11006. // },
  11007. // "webPropertyId": {
  11008. // "description": "Web property Id to retrieve profile filter link for.",
  11009. // "location": "path",
  11010. // "pattern": "UA-(\\d+)-(\\d+)",
  11011. // "required": true,
  11012. // "type": "string"
  11013. // }
  11014. // },
  11015. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11016. // "response": {
  11017. // "$ref": "ProfileFilterLink"
  11018. // },
  11019. // "scopes": [
  11020. // "https://www.googleapis.com/auth/analytics.edit",
  11021. // "https://www.googleapis.com/auth/analytics.readonly"
  11022. // ]
  11023. // }
  11024. }
  11025. // method id "analytics.management.profileFilterLinks.insert":
  11026. type ManagementProfileFilterLinksInsertCall struct {
  11027. s *Service
  11028. accountId string
  11029. webPropertyId string
  11030. profileId string
  11031. profilefilterlink *ProfileFilterLink
  11032. urlParams_ gensupport.URLParams
  11033. ctx_ context.Context
  11034. header_ http.Header
  11035. }
  11036. // Insert: Create a new profile filter link.
  11037. func (r *ManagementProfileFilterLinksService) Insert(accountId string, webPropertyId string, profileId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksInsertCall {
  11038. c := &ManagementProfileFilterLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11039. c.accountId = accountId
  11040. c.webPropertyId = webPropertyId
  11041. c.profileId = profileId
  11042. c.profilefilterlink = profilefilterlink
  11043. return c
  11044. }
  11045. // Fields allows partial responses to be retrieved. See
  11046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11047. // for more information.
  11048. func (c *ManagementProfileFilterLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksInsertCall {
  11049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11050. return c
  11051. }
  11052. // Context sets the context to be used in this call's Do method. Any
  11053. // pending HTTP request will be aborted if the provided context is
  11054. // canceled.
  11055. func (c *ManagementProfileFilterLinksInsertCall) Context(ctx context.Context) *ManagementProfileFilterLinksInsertCall {
  11056. c.ctx_ = ctx
  11057. return c
  11058. }
  11059. // Header returns an http.Header that can be modified by the caller to
  11060. // add HTTP headers to the request.
  11061. func (c *ManagementProfileFilterLinksInsertCall) Header() http.Header {
  11062. if c.header_ == nil {
  11063. c.header_ = make(http.Header)
  11064. }
  11065. return c.header_
  11066. }
  11067. func (c *ManagementProfileFilterLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  11068. reqHeaders := make(http.Header)
  11069. for k, v := range c.header_ {
  11070. reqHeaders[k] = v
  11071. }
  11072. reqHeaders.Set("User-Agent", c.s.userAgent())
  11073. var body io.Reader = nil
  11074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11075. if err != nil {
  11076. return nil, err
  11077. }
  11078. reqHeaders.Set("Content-Type", "application/json")
  11079. c.urlParams_.Set("alt", alt)
  11080. c.urlParams_.Set("prettyPrint", "false")
  11081. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  11082. urls += "?" + c.urlParams_.Encode()
  11083. req, err := http.NewRequest("POST", urls, body)
  11084. if err != nil {
  11085. return nil, err
  11086. }
  11087. req.Header = reqHeaders
  11088. googleapi.Expand(req.URL, map[string]string{
  11089. "accountId": c.accountId,
  11090. "webPropertyId": c.webPropertyId,
  11091. "profileId": c.profileId,
  11092. })
  11093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11094. }
  11095. // Do executes the "analytics.management.profileFilterLinks.insert" call.
  11096. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11097. // non-2xx status code is an error. Response headers are in either
  11098. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11099. // returned at all) in error.(*googleapi.Error).Header. Use
  11100. // googleapi.IsNotModified to check whether the returned error was
  11101. // because http.StatusNotModified was returned.
  11102. func (c *ManagementProfileFilterLinksInsertCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11103. gensupport.SetOptions(c.urlParams_, opts...)
  11104. res, err := c.doRequest("json")
  11105. if res != nil && res.StatusCode == http.StatusNotModified {
  11106. if res.Body != nil {
  11107. res.Body.Close()
  11108. }
  11109. return nil, &googleapi.Error{
  11110. Code: res.StatusCode,
  11111. Header: res.Header,
  11112. }
  11113. }
  11114. if err != nil {
  11115. return nil, err
  11116. }
  11117. defer googleapi.CloseBody(res)
  11118. if err := googleapi.CheckResponse(res); err != nil {
  11119. return nil, err
  11120. }
  11121. ret := &ProfileFilterLink{
  11122. ServerResponse: googleapi.ServerResponse{
  11123. Header: res.Header,
  11124. HTTPStatusCode: res.StatusCode,
  11125. },
  11126. }
  11127. target := &ret
  11128. if err := gensupport.DecodeResponse(target, res); err != nil {
  11129. return nil, err
  11130. }
  11131. return ret, nil
  11132. // {
  11133. // "description": "Create a new profile filter link.",
  11134. // "httpMethod": "POST",
  11135. // "id": "analytics.management.profileFilterLinks.insert",
  11136. // "parameterOrder": [
  11137. // "accountId",
  11138. // "webPropertyId",
  11139. // "profileId"
  11140. // ],
  11141. // "parameters": {
  11142. // "accountId": {
  11143. // "description": "Account ID to create profile filter link for.",
  11144. // "location": "path",
  11145. // "pattern": "\\d+",
  11146. // "required": true,
  11147. // "type": "string"
  11148. // },
  11149. // "profileId": {
  11150. // "description": "Profile ID to create filter link for.",
  11151. // "location": "path",
  11152. // "pattern": "\\d+",
  11153. // "required": true,
  11154. // "type": "string"
  11155. // },
  11156. // "webPropertyId": {
  11157. // "description": "Web property Id to create profile filter link for.",
  11158. // "location": "path",
  11159. // "pattern": "UA-(\\d+)-(\\d+)",
  11160. // "required": true,
  11161. // "type": "string"
  11162. // }
  11163. // },
  11164. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  11165. // "request": {
  11166. // "$ref": "ProfileFilterLink"
  11167. // },
  11168. // "response": {
  11169. // "$ref": "ProfileFilterLink"
  11170. // },
  11171. // "scopes": [
  11172. // "https://www.googleapis.com/auth/analytics.edit"
  11173. // ]
  11174. // }
  11175. }
  11176. // method id "analytics.management.profileFilterLinks.list":
  11177. type ManagementProfileFilterLinksListCall struct {
  11178. s *Service
  11179. accountId string
  11180. webPropertyId string
  11181. profileId string
  11182. urlParams_ gensupport.URLParams
  11183. ifNoneMatch_ string
  11184. ctx_ context.Context
  11185. header_ http.Header
  11186. }
  11187. // List: Lists all profile filter links for a profile.
  11188. func (r *ManagementProfileFilterLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileFilterLinksListCall {
  11189. c := &ManagementProfileFilterLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11190. c.accountId = accountId
  11191. c.webPropertyId = webPropertyId
  11192. c.profileId = profileId
  11193. return c
  11194. }
  11195. // MaxResults sets the optional parameter "max-results": The maximum
  11196. // number of profile filter links to include in this response.
  11197. func (c *ManagementProfileFilterLinksListCall) MaxResults(maxResults int64) *ManagementProfileFilterLinksListCall {
  11198. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  11199. return c
  11200. }
  11201. // StartIndex sets the optional parameter "start-index": An index of the
  11202. // first entity to retrieve. Use this parameter as a pagination
  11203. // mechanism along with the max-results parameter.
  11204. func (c *ManagementProfileFilterLinksListCall) StartIndex(startIndex int64) *ManagementProfileFilterLinksListCall {
  11205. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  11206. return c
  11207. }
  11208. // Fields allows partial responses to be retrieved. See
  11209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11210. // for more information.
  11211. func (c *ManagementProfileFilterLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksListCall {
  11212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11213. return c
  11214. }
  11215. // IfNoneMatch sets the optional parameter which makes the operation
  11216. // fail if the object's ETag matches the given value. This is useful for
  11217. // getting updates only after the object has changed since the last
  11218. // request. Use googleapi.IsNotModified to check whether the response
  11219. // error from Do is the result of In-None-Match.
  11220. func (c *ManagementProfileFilterLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksListCall {
  11221. c.ifNoneMatch_ = entityTag
  11222. return c
  11223. }
  11224. // Context sets the context to be used in this call's Do method. Any
  11225. // pending HTTP request will be aborted if the provided context is
  11226. // canceled.
  11227. func (c *ManagementProfileFilterLinksListCall) Context(ctx context.Context) *ManagementProfileFilterLinksListCall {
  11228. c.ctx_ = ctx
  11229. return c
  11230. }
  11231. // Header returns an http.Header that can be modified by the caller to
  11232. // add HTTP headers to the request.
  11233. func (c *ManagementProfileFilterLinksListCall) Header() http.Header {
  11234. if c.header_ == nil {
  11235. c.header_ = make(http.Header)
  11236. }
  11237. return c.header_
  11238. }
  11239. func (c *ManagementProfileFilterLinksListCall) doRequest(alt string) (*http.Response, error) {
  11240. reqHeaders := make(http.Header)
  11241. for k, v := range c.header_ {
  11242. reqHeaders[k] = v
  11243. }
  11244. reqHeaders.Set("User-Agent", c.s.userAgent())
  11245. if c.ifNoneMatch_ != "" {
  11246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11247. }
  11248. var body io.Reader = nil
  11249. c.urlParams_.Set("alt", alt)
  11250. c.urlParams_.Set("prettyPrint", "false")
  11251. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  11252. urls += "?" + c.urlParams_.Encode()
  11253. req, err := http.NewRequest("GET", urls, body)
  11254. if err != nil {
  11255. return nil, err
  11256. }
  11257. req.Header = reqHeaders
  11258. googleapi.Expand(req.URL, map[string]string{
  11259. "accountId": c.accountId,
  11260. "webPropertyId": c.webPropertyId,
  11261. "profileId": c.profileId,
  11262. })
  11263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11264. }
  11265. // Do executes the "analytics.management.profileFilterLinks.list" call.
  11266. // Exactly one of *ProfileFilterLinks or error will be non-nil. Any
  11267. // non-2xx status code is an error. Response headers are in either
  11268. // *ProfileFilterLinks.ServerResponse.Header or (if a response was
  11269. // returned at all) in error.(*googleapi.Error).Header. Use
  11270. // googleapi.IsNotModified to check whether the returned error was
  11271. // because http.StatusNotModified was returned.
  11272. func (c *ManagementProfileFilterLinksListCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLinks, error) {
  11273. gensupport.SetOptions(c.urlParams_, opts...)
  11274. res, err := c.doRequest("json")
  11275. if res != nil && res.StatusCode == http.StatusNotModified {
  11276. if res.Body != nil {
  11277. res.Body.Close()
  11278. }
  11279. return nil, &googleapi.Error{
  11280. Code: res.StatusCode,
  11281. Header: res.Header,
  11282. }
  11283. }
  11284. if err != nil {
  11285. return nil, err
  11286. }
  11287. defer googleapi.CloseBody(res)
  11288. if err := googleapi.CheckResponse(res); err != nil {
  11289. return nil, err
  11290. }
  11291. ret := &ProfileFilterLinks{
  11292. ServerResponse: googleapi.ServerResponse{
  11293. Header: res.Header,
  11294. HTTPStatusCode: res.StatusCode,
  11295. },
  11296. }
  11297. target := &ret
  11298. if err := gensupport.DecodeResponse(target, res); err != nil {
  11299. return nil, err
  11300. }
  11301. return ret, nil
  11302. // {
  11303. // "description": "Lists all profile filter links for a profile.",
  11304. // "httpMethod": "GET",
  11305. // "id": "analytics.management.profileFilterLinks.list",
  11306. // "parameterOrder": [
  11307. // "accountId",
  11308. // "webPropertyId",
  11309. // "profileId"
  11310. // ],
  11311. // "parameters": {
  11312. // "accountId": {
  11313. // "description": "Account ID to retrieve profile filter links for.",
  11314. // "location": "path",
  11315. // "pattern": "\\d+",
  11316. // "required": true,
  11317. // "type": "string"
  11318. // },
  11319. // "max-results": {
  11320. // "description": "The maximum number of profile filter links to include in this response.",
  11321. // "format": "int32",
  11322. // "location": "query",
  11323. // "type": "integer"
  11324. // },
  11325. // "profileId": {
  11326. // "description": "Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.",
  11327. // "location": "path",
  11328. // "required": true,
  11329. // "type": "string"
  11330. // },
  11331. // "start-index": {
  11332. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  11333. // "format": "int32",
  11334. // "location": "query",
  11335. // "minimum": "1",
  11336. // "type": "integer"
  11337. // },
  11338. // "webPropertyId": {
  11339. // "description": "Web property Id for profile filter links for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  11340. // "location": "path",
  11341. // "required": true,
  11342. // "type": "string"
  11343. // }
  11344. // },
  11345. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  11346. // "response": {
  11347. // "$ref": "ProfileFilterLinks"
  11348. // },
  11349. // "scopes": [
  11350. // "https://www.googleapis.com/auth/analytics.edit",
  11351. // "https://www.googleapis.com/auth/analytics.readonly"
  11352. // ]
  11353. // }
  11354. }
  11355. // method id "analytics.management.profileFilterLinks.patch":
  11356. type ManagementProfileFilterLinksPatchCall struct {
  11357. s *Service
  11358. accountId string
  11359. webPropertyId string
  11360. profileId string
  11361. linkId string
  11362. profilefilterlink *ProfileFilterLink
  11363. urlParams_ gensupport.URLParams
  11364. ctx_ context.Context
  11365. header_ http.Header
  11366. }
  11367. // Patch: Update an existing profile filter link. This method supports
  11368. // patch semantics.
  11369. func (r *ManagementProfileFilterLinksService) Patch(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksPatchCall {
  11370. c := &ManagementProfileFilterLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11371. c.accountId = accountId
  11372. c.webPropertyId = webPropertyId
  11373. c.profileId = profileId
  11374. c.linkId = linkId
  11375. c.profilefilterlink = profilefilterlink
  11376. return c
  11377. }
  11378. // Fields allows partial responses to be retrieved. See
  11379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11380. // for more information.
  11381. func (c *ManagementProfileFilterLinksPatchCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksPatchCall {
  11382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11383. return c
  11384. }
  11385. // Context sets the context to be used in this call's Do method. Any
  11386. // pending HTTP request will be aborted if the provided context is
  11387. // canceled.
  11388. func (c *ManagementProfileFilterLinksPatchCall) Context(ctx context.Context) *ManagementProfileFilterLinksPatchCall {
  11389. c.ctx_ = ctx
  11390. return c
  11391. }
  11392. // Header returns an http.Header that can be modified by the caller to
  11393. // add HTTP headers to the request.
  11394. func (c *ManagementProfileFilterLinksPatchCall) Header() http.Header {
  11395. if c.header_ == nil {
  11396. c.header_ = make(http.Header)
  11397. }
  11398. return c.header_
  11399. }
  11400. func (c *ManagementProfileFilterLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  11401. reqHeaders := make(http.Header)
  11402. for k, v := range c.header_ {
  11403. reqHeaders[k] = v
  11404. }
  11405. reqHeaders.Set("User-Agent", c.s.userAgent())
  11406. var body io.Reader = nil
  11407. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11408. if err != nil {
  11409. return nil, err
  11410. }
  11411. reqHeaders.Set("Content-Type", "application/json")
  11412. c.urlParams_.Set("alt", alt)
  11413. c.urlParams_.Set("prettyPrint", "false")
  11414. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  11415. urls += "?" + c.urlParams_.Encode()
  11416. req, err := http.NewRequest("PATCH", urls, body)
  11417. if err != nil {
  11418. return nil, err
  11419. }
  11420. req.Header = reqHeaders
  11421. googleapi.Expand(req.URL, map[string]string{
  11422. "accountId": c.accountId,
  11423. "webPropertyId": c.webPropertyId,
  11424. "profileId": c.profileId,
  11425. "linkId": c.linkId,
  11426. })
  11427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11428. }
  11429. // Do executes the "analytics.management.profileFilterLinks.patch" call.
  11430. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11431. // non-2xx status code is an error. Response headers are in either
  11432. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11433. // returned at all) in error.(*googleapi.Error).Header. Use
  11434. // googleapi.IsNotModified to check whether the returned error was
  11435. // because http.StatusNotModified was returned.
  11436. func (c *ManagementProfileFilterLinksPatchCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11437. gensupport.SetOptions(c.urlParams_, opts...)
  11438. res, err := c.doRequest("json")
  11439. if res != nil && res.StatusCode == http.StatusNotModified {
  11440. if res.Body != nil {
  11441. res.Body.Close()
  11442. }
  11443. return nil, &googleapi.Error{
  11444. Code: res.StatusCode,
  11445. Header: res.Header,
  11446. }
  11447. }
  11448. if err != nil {
  11449. return nil, err
  11450. }
  11451. defer googleapi.CloseBody(res)
  11452. if err := googleapi.CheckResponse(res); err != nil {
  11453. return nil, err
  11454. }
  11455. ret := &ProfileFilterLink{
  11456. ServerResponse: googleapi.ServerResponse{
  11457. Header: res.Header,
  11458. HTTPStatusCode: res.StatusCode,
  11459. },
  11460. }
  11461. target := &ret
  11462. if err := gensupport.DecodeResponse(target, res); err != nil {
  11463. return nil, err
  11464. }
  11465. return ret, nil
  11466. // {
  11467. // "description": "Update an existing profile filter link. This method supports patch semantics.",
  11468. // "httpMethod": "PATCH",
  11469. // "id": "analytics.management.profileFilterLinks.patch",
  11470. // "parameterOrder": [
  11471. // "accountId",
  11472. // "webPropertyId",
  11473. // "profileId",
  11474. // "linkId"
  11475. // ],
  11476. // "parameters": {
  11477. // "accountId": {
  11478. // "description": "Account ID to which profile filter link belongs.",
  11479. // "location": "path",
  11480. // "pattern": "\\d+",
  11481. // "required": true,
  11482. // "type": "string"
  11483. // },
  11484. // "linkId": {
  11485. // "description": "ID of the profile filter link to be updated.",
  11486. // "location": "path",
  11487. // "pattern": "\\d+:\\d+",
  11488. // "required": true,
  11489. // "type": "string"
  11490. // },
  11491. // "profileId": {
  11492. // "description": "Profile ID to which filter link belongs",
  11493. // "location": "path",
  11494. // "pattern": "\\d+",
  11495. // "required": true,
  11496. // "type": "string"
  11497. // },
  11498. // "webPropertyId": {
  11499. // "description": "Web property Id to which profile filter link belongs",
  11500. // "location": "path",
  11501. // "pattern": "UA-(\\d+)-(\\d+)",
  11502. // "required": true,
  11503. // "type": "string"
  11504. // }
  11505. // },
  11506. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11507. // "request": {
  11508. // "$ref": "ProfileFilterLink"
  11509. // },
  11510. // "response": {
  11511. // "$ref": "ProfileFilterLink"
  11512. // },
  11513. // "scopes": [
  11514. // "https://www.googleapis.com/auth/analytics.edit"
  11515. // ]
  11516. // }
  11517. }
  11518. // method id "analytics.management.profileFilterLinks.update":
  11519. type ManagementProfileFilterLinksUpdateCall struct {
  11520. s *Service
  11521. accountId string
  11522. webPropertyId string
  11523. profileId string
  11524. linkId string
  11525. profilefilterlink *ProfileFilterLink
  11526. urlParams_ gensupport.URLParams
  11527. ctx_ context.Context
  11528. header_ http.Header
  11529. }
  11530. // Update: Update an existing profile filter link.
  11531. func (r *ManagementProfileFilterLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksUpdateCall {
  11532. c := &ManagementProfileFilterLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11533. c.accountId = accountId
  11534. c.webPropertyId = webPropertyId
  11535. c.profileId = profileId
  11536. c.linkId = linkId
  11537. c.profilefilterlink = profilefilterlink
  11538. return c
  11539. }
  11540. // Fields allows partial responses to be retrieved. See
  11541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11542. // for more information.
  11543. func (c *ManagementProfileFilterLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksUpdateCall {
  11544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11545. return c
  11546. }
  11547. // Context sets the context to be used in this call's Do method. Any
  11548. // pending HTTP request will be aborted if the provided context is
  11549. // canceled.
  11550. func (c *ManagementProfileFilterLinksUpdateCall) Context(ctx context.Context) *ManagementProfileFilterLinksUpdateCall {
  11551. c.ctx_ = ctx
  11552. return c
  11553. }
  11554. // Header returns an http.Header that can be modified by the caller to
  11555. // add HTTP headers to the request.
  11556. func (c *ManagementProfileFilterLinksUpdateCall) Header() http.Header {
  11557. if c.header_ == nil {
  11558. c.header_ = make(http.Header)
  11559. }
  11560. return c.header_
  11561. }
  11562. func (c *ManagementProfileFilterLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  11563. reqHeaders := make(http.Header)
  11564. for k, v := range c.header_ {
  11565. reqHeaders[k] = v
  11566. }
  11567. reqHeaders.Set("User-Agent", c.s.userAgent())
  11568. var body io.Reader = nil
  11569. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11570. if err != nil {
  11571. return nil, err
  11572. }
  11573. reqHeaders.Set("Content-Type", "application/json")
  11574. c.urlParams_.Set("alt", alt)
  11575. c.urlParams_.Set("prettyPrint", "false")
  11576. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  11577. urls += "?" + c.urlParams_.Encode()
  11578. req, err := http.NewRequest("PUT", urls, body)
  11579. if err != nil {
  11580. return nil, err
  11581. }
  11582. req.Header = reqHeaders
  11583. googleapi.Expand(req.URL, map[string]string{
  11584. "accountId": c.accountId,
  11585. "webPropertyId": c.webPropertyId,
  11586. "profileId": c.profileId,
  11587. "linkId": c.linkId,
  11588. })
  11589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11590. }
  11591. // Do executes the "analytics.management.profileFilterLinks.update" call.
  11592. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11593. // non-2xx status code is an error. Response headers are in either
  11594. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11595. // returned at all) in error.(*googleapi.Error).Header. Use
  11596. // googleapi.IsNotModified to check whether the returned error was
  11597. // because http.StatusNotModified was returned.
  11598. func (c *ManagementProfileFilterLinksUpdateCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11599. gensupport.SetOptions(c.urlParams_, opts...)
  11600. res, err := c.doRequest("json")
  11601. if res != nil && res.StatusCode == http.StatusNotModified {
  11602. if res.Body != nil {
  11603. res.Body.Close()
  11604. }
  11605. return nil, &googleapi.Error{
  11606. Code: res.StatusCode,
  11607. Header: res.Header,
  11608. }
  11609. }
  11610. if err != nil {
  11611. return nil, err
  11612. }
  11613. defer googleapi.CloseBody(res)
  11614. if err := googleapi.CheckResponse(res); err != nil {
  11615. return nil, err
  11616. }
  11617. ret := &ProfileFilterLink{
  11618. ServerResponse: googleapi.ServerResponse{
  11619. Header: res.Header,
  11620. HTTPStatusCode: res.StatusCode,
  11621. },
  11622. }
  11623. target := &ret
  11624. if err := gensupport.DecodeResponse(target, res); err != nil {
  11625. return nil, err
  11626. }
  11627. return ret, nil
  11628. // {
  11629. // "description": "Update an existing profile filter link.",
  11630. // "httpMethod": "PUT",
  11631. // "id": "analytics.management.profileFilterLinks.update",
  11632. // "parameterOrder": [
  11633. // "accountId",
  11634. // "webPropertyId",
  11635. // "profileId",
  11636. // "linkId"
  11637. // ],
  11638. // "parameters": {
  11639. // "accountId": {
  11640. // "description": "Account ID to which profile filter link belongs.",
  11641. // "location": "path",
  11642. // "pattern": "\\d+",
  11643. // "required": true,
  11644. // "type": "string"
  11645. // },
  11646. // "linkId": {
  11647. // "description": "ID of the profile filter link to be updated.",
  11648. // "location": "path",
  11649. // "pattern": "\\d+:\\d+",
  11650. // "required": true,
  11651. // "type": "string"
  11652. // },
  11653. // "profileId": {
  11654. // "description": "Profile ID to which filter link belongs",
  11655. // "location": "path",
  11656. // "pattern": "\\d+",
  11657. // "required": true,
  11658. // "type": "string"
  11659. // },
  11660. // "webPropertyId": {
  11661. // "description": "Web property Id to which profile filter link belongs",
  11662. // "location": "path",
  11663. // "pattern": "UA-(\\d+)-(\\d+)",
  11664. // "required": true,
  11665. // "type": "string"
  11666. // }
  11667. // },
  11668. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11669. // "request": {
  11670. // "$ref": "ProfileFilterLink"
  11671. // },
  11672. // "response": {
  11673. // "$ref": "ProfileFilterLink"
  11674. // },
  11675. // "scopes": [
  11676. // "https://www.googleapis.com/auth/analytics.edit"
  11677. // ]
  11678. // }
  11679. }
  11680. // method id "analytics.management.profileUserLinks.delete":
  11681. type ManagementProfileUserLinksDeleteCall struct {
  11682. s *Service
  11683. accountId string
  11684. webPropertyId string
  11685. profileId string
  11686. linkId string
  11687. urlParams_ gensupport.URLParams
  11688. ctx_ context.Context
  11689. header_ http.Header
  11690. }
  11691. // Delete: Removes a user from the given view (profile).
  11692. func (r *ManagementProfileUserLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileUserLinksDeleteCall {
  11693. c := &ManagementProfileUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11694. c.accountId = accountId
  11695. c.webPropertyId = webPropertyId
  11696. c.profileId = profileId
  11697. c.linkId = linkId
  11698. return c
  11699. }
  11700. // Fields allows partial responses to be retrieved. See
  11701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11702. // for more information.
  11703. func (c *ManagementProfileUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksDeleteCall {
  11704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11705. return c
  11706. }
  11707. // Context sets the context to be used in this call's Do method. Any
  11708. // pending HTTP request will be aborted if the provided context is
  11709. // canceled.
  11710. func (c *ManagementProfileUserLinksDeleteCall) Context(ctx context.Context) *ManagementProfileUserLinksDeleteCall {
  11711. c.ctx_ = ctx
  11712. return c
  11713. }
  11714. // Header returns an http.Header that can be modified by the caller to
  11715. // add HTTP headers to the request.
  11716. func (c *ManagementProfileUserLinksDeleteCall) Header() http.Header {
  11717. if c.header_ == nil {
  11718. c.header_ = make(http.Header)
  11719. }
  11720. return c.header_
  11721. }
  11722. func (c *ManagementProfileUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  11723. reqHeaders := make(http.Header)
  11724. for k, v := range c.header_ {
  11725. reqHeaders[k] = v
  11726. }
  11727. reqHeaders.Set("User-Agent", c.s.userAgent())
  11728. var body io.Reader = nil
  11729. c.urlParams_.Set("alt", alt)
  11730. c.urlParams_.Set("prettyPrint", "false")
  11731. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  11732. urls += "?" + c.urlParams_.Encode()
  11733. req, err := http.NewRequest("DELETE", urls, body)
  11734. if err != nil {
  11735. return nil, err
  11736. }
  11737. req.Header = reqHeaders
  11738. googleapi.Expand(req.URL, map[string]string{
  11739. "accountId": c.accountId,
  11740. "webPropertyId": c.webPropertyId,
  11741. "profileId": c.profileId,
  11742. "linkId": c.linkId,
  11743. })
  11744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11745. }
  11746. // Do executes the "analytics.management.profileUserLinks.delete" call.
  11747. func (c *ManagementProfileUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  11748. gensupport.SetOptions(c.urlParams_, opts...)
  11749. res, err := c.doRequest("json")
  11750. if err != nil {
  11751. return err
  11752. }
  11753. defer googleapi.CloseBody(res)
  11754. if err := googleapi.CheckResponse(res); err != nil {
  11755. return err
  11756. }
  11757. return nil
  11758. // {
  11759. // "description": "Removes a user from the given view (profile).",
  11760. // "httpMethod": "DELETE",
  11761. // "id": "analytics.management.profileUserLinks.delete",
  11762. // "parameterOrder": [
  11763. // "accountId",
  11764. // "webPropertyId",
  11765. // "profileId",
  11766. // "linkId"
  11767. // ],
  11768. // "parameters": {
  11769. // "accountId": {
  11770. // "description": "Account ID to delete the user link for.",
  11771. // "location": "path",
  11772. // "required": true,
  11773. // "type": "string"
  11774. // },
  11775. // "linkId": {
  11776. // "description": "Link ID to delete the user link for.",
  11777. // "location": "path",
  11778. // "required": true,
  11779. // "type": "string"
  11780. // },
  11781. // "profileId": {
  11782. // "description": "View (Profile) ID to delete the user link for.",
  11783. // "location": "path",
  11784. // "required": true,
  11785. // "type": "string"
  11786. // },
  11787. // "webPropertyId": {
  11788. // "description": "Web Property ID to delete the user link for.",
  11789. // "location": "path",
  11790. // "required": true,
  11791. // "type": "string"
  11792. // }
  11793. // },
  11794. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  11795. // "scopes": [
  11796. // "https://www.googleapis.com/auth/analytics.manage.users"
  11797. // ]
  11798. // }
  11799. }
  11800. // method id "analytics.management.profileUserLinks.insert":
  11801. type ManagementProfileUserLinksInsertCall struct {
  11802. s *Service
  11803. accountId string
  11804. webPropertyId string
  11805. profileId string
  11806. entityuserlink *EntityUserLink
  11807. urlParams_ gensupport.URLParams
  11808. ctx_ context.Context
  11809. header_ http.Header
  11810. }
  11811. // Insert: Adds a new user to the given view (profile).
  11812. func (r *ManagementProfileUserLinksService) Insert(accountId string, webPropertyId string, profileId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksInsertCall {
  11813. c := &ManagementProfileUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11814. c.accountId = accountId
  11815. c.webPropertyId = webPropertyId
  11816. c.profileId = profileId
  11817. c.entityuserlink = entityuserlink
  11818. return c
  11819. }
  11820. // Fields allows partial responses to be retrieved. See
  11821. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11822. // for more information.
  11823. func (c *ManagementProfileUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksInsertCall {
  11824. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11825. return c
  11826. }
  11827. // Context sets the context to be used in this call's Do method. Any
  11828. // pending HTTP request will be aborted if the provided context is
  11829. // canceled.
  11830. func (c *ManagementProfileUserLinksInsertCall) Context(ctx context.Context) *ManagementProfileUserLinksInsertCall {
  11831. c.ctx_ = ctx
  11832. return c
  11833. }
  11834. // Header returns an http.Header that can be modified by the caller to
  11835. // add HTTP headers to the request.
  11836. func (c *ManagementProfileUserLinksInsertCall) Header() http.Header {
  11837. if c.header_ == nil {
  11838. c.header_ = make(http.Header)
  11839. }
  11840. return c.header_
  11841. }
  11842. func (c *ManagementProfileUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  11843. reqHeaders := make(http.Header)
  11844. for k, v := range c.header_ {
  11845. reqHeaders[k] = v
  11846. }
  11847. reqHeaders.Set("User-Agent", c.s.userAgent())
  11848. var body io.Reader = nil
  11849. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  11850. if err != nil {
  11851. return nil, err
  11852. }
  11853. reqHeaders.Set("Content-Type", "application/json")
  11854. c.urlParams_.Set("alt", alt)
  11855. c.urlParams_.Set("prettyPrint", "false")
  11856. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  11857. urls += "?" + c.urlParams_.Encode()
  11858. req, err := http.NewRequest("POST", urls, body)
  11859. if err != nil {
  11860. return nil, err
  11861. }
  11862. req.Header = reqHeaders
  11863. googleapi.Expand(req.URL, map[string]string{
  11864. "accountId": c.accountId,
  11865. "webPropertyId": c.webPropertyId,
  11866. "profileId": c.profileId,
  11867. })
  11868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11869. }
  11870. // Do executes the "analytics.management.profileUserLinks.insert" call.
  11871. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  11872. // status code is an error. Response headers are in either
  11873. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  11874. // at all) in error.(*googleapi.Error).Header. Use
  11875. // googleapi.IsNotModified to check whether the returned error was
  11876. // because http.StatusNotModified was returned.
  11877. func (c *ManagementProfileUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  11878. gensupport.SetOptions(c.urlParams_, opts...)
  11879. res, err := c.doRequest("json")
  11880. if res != nil && res.StatusCode == http.StatusNotModified {
  11881. if res.Body != nil {
  11882. res.Body.Close()
  11883. }
  11884. return nil, &googleapi.Error{
  11885. Code: res.StatusCode,
  11886. Header: res.Header,
  11887. }
  11888. }
  11889. if err != nil {
  11890. return nil, err
  11891. }
  11892. defer googleapi.CloseBody(res)
  11893. if err := googleapi.CheckResponse(res); err != nil {
  11894. return nil, err
  11895. }
  11896. ret := &EntityUserLink{
  11897. ServerResponse: googleapi.ServerResponse{
  11898. Header: res.Header,
  11899. HTTPStatusCode: res.StatusCode,
  11900. },
  11901. }
  11902. target := &ret
  11903. if err := gensupport.DecodeResponse(target, res); err != nil {
  11904. return nil, err
  11905. }
  11906. return ret, nil
  11907. // {
  11908. // "description": "Adds a new user to the given view (profile).",
  11909. // "httpMethod": "POST",
  11910. // "id": "analytics.management.profileUserLinks.insert",
  11911. // "parameterOrder": [
  11912. // "accountId",
  11913. // "webPropertyId",
  11914. // "profileId"
  11915. // ],
  11916. // "parameters": {
  11917. // "accountId": {
  11918. // "description": "Account ID to create the user link for.",
  11919. // "location": "path",
  11920. // "required": true,
  11921. // "type": "string"
  11922. // },
  11923. // "profileId": {
  11924. // "description": "View (Profile) ID to create the user link for.",
  11925. // "location": "path",
  11926. // "required": true,
  11927. // "type": "string"
  11928. // },
  11929. // "webPropertyId": {
  11930. // "description": "Web Property ID to create the user link for.",
  11931. // "location": "path",
  11932. // "required": true,
  11933. // "type": "string"
  11934. // }
  11935. // },
  11936. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  11937. // "request": {
  11938. // "$ref": "EntityUserLink"
  11939. // },
  11940. // "response": {
  11941. // "$ref": "EntityUserLink"
  11942. // },
  11943. // "scopes": [
  11944. // "https://www.googleapis.com/auth/analytics.manage.users"
  11945. // ]
  11946. // }
  11947. }
  11948. // method id "analytics.management.profileUserLinks.list":
  11949. type ManagementProfileUserLinksListCall struct {
  11950. s *Service
  11951. accountId string
  11952. webPropertyId string
  11953. profileId string
  11954. urlParams_ gensupport.URLParams
  11955. ifNoneMatch_ string
  11956. ctx_ context.Context
  11957. header_ http.Header
  11958. }
  11959. // List: Lists profile-user links for a given view (profile).
  11960. func (r *ManagementProfileUserLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileUserLinksListCall {
  11961. c := &ManagementProfileUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11962. c.accountId = accountId
  11963. c.webPropertyId = webPropertyId
  11964. c.profileId = profileId
  11965. return c
  11966. }
  11967. // MaxResults sets the optional parameter "max-results": The maximum
  11968. // number of profile-user links to include in this response.
  11969. func (c *ManagementProfileUserLinksListCall) MaxResults(maxResults int64) *ManagementProfileUserLinksListCall {
  11970. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  11971. return c
  11972. }
  11973. // StartIndex sets the optional parameter "start-index": An index of the
  11974. // first profile-user link to retrieve. Use this parameter as a
  11975. // pagination mechanism along with the max-results parameter.
  11976. func (c *ManagementProfileUserLinksListCall) StartIndex(startIndex int64) *ManagementProfileUserLinksListCall {
  11977. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  11978. return c
  11979. }
  11980. // Fields allows partial responses to be retrieved. See
  11981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11982. // for more information.
  11983. func (c *ManagementProfileUserLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksListCall {
  11984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11985. return c
  11986. }
  11987. // IfNoneMatch sets the optional parameter which makes the operation
  11988. // fail if the object's ETag matches the given value. This is useful for
  11989. // getting updates only after the object has changed since the last
  11990. // request. Use googleapi.IsNotModified to check whether the response
  11991. // error from Do is the result of In-None-Match.
  11992. func (c *ManagementProfileUserLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileUserLinksListCall {
  11993. c.ifNoneMatch_ = entityTag
  11994. return c
  11995. }
  11996. // Context sets the context to be used in this call's Do method. Any
  11997. // pending HTTP request will be aborted if the provided context is
  11998. // canceled.
  11999. func (c *ManagementProfileUserLinksListCall) Context(ctx context.Context) *ManagementProfileUserLinksListCall {
  12000. c.ctx_ = ctx
  12001. return c
  12002. }
  12003. // Header returns an http.Header that can be modified by the caller to
  12004. // add HTTP headers to the request.
  12005. func (c *ManagementProfileUserLinksListCall) Header() http.Header {
  12006. if c.header_ == nil {
  12007. c.header_ = make(http.Header)
  12008. }
  12009. return c.header_
  12010. }
  12011. func (c *ManagementProfileUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  12012. reqHeaders := make(http.Header)
  12013. for k, v := range c.header_ {
  12014. reqHeaders[k] = v
  12015. }
  12016. reqHeaders.Set("User-Agent", c.s.userAgent())
  12017. if c.ifNoneMatch_ != "" {
  12018. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12019. }
  12020. var body io.Reader = nil
  12021. c.urlParams_.Set("alt", alt)
  12022. c.urlParams_.Set("prettyPrint", "false")
  12023. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  12024. urls += "?" + c.urlParams_.Encode()
  12025. req, err := http.NewRequest("GET", urls, body)
  12026. if err != nil {
  12027. return nil, err
  12028. }
  12029. req.Header = reqHeaders
  12030. googleapi.Expand(req.URL, map[string]string{
  12031. "accountId": c.accountId,
  12032. "webPropertyId": c.webPropertyId,
  12033. "profileId": c.profileId,
  12034. })
  12035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12036. }
  12037. // Do executes the "analytics.management.profileUserLinks.list" call.
  12038. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  12039. // status code is an error. Response headers are in either
  12040. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  12041. // at all) in error.(*googleapi.Error).Header. Use
  12042. // googleapi.IsNotModified to check whether the returned error was
  12043. // because http.StatusNotModified was returned.
  12044. func (c *ManagementProfileUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  12045. gensupport.SetOptions(c.urlParams_, opts...)
  12046. res, err := c.doRequest("json")
  12047. if res != nil && res.StatusCode == http.StatusNotModified {
  12048. if res.Body != nil {
  12049. res.Body.Close()
  12050. }
  12051. return nil, &googleapi.Error{
  12052. Code: res.StatusCode,
  12053. Header: res.Header,
  12054. }
  12055. }
  12056. if err != nil {
  12057. return nil, err
  12058. }
  12059. defer googleapi.CloseBody(res)
  12060. if err := googleapi.CheckResponse(res); err != nil {
  12061. return nil, err
  12062. }
  12063. ret := &EntityUserLinks{
  12064. ServerResponse: googleapi.ServerResponse{
  12065. Header: res.Header,
  12066. HTTPStatusCode: res.StatusCode,
  12067. },
  12068. }
  12069. target := &ret
  12070. if err := gensupport.DecodeResponse(target, res); err != nil {
  12071. return nil, err
  12072. }
  12073. return ret, nil
  12074. // {
  12075. // "description": "Lists profile-user links for a given view (profile).",
  12076. // "httpMethod": "GET",
  12077. // "id": "analytics.management.profileUserLinks.list",
  12078. // "parameterOrder": [
  12079. // "accountId",
  12080. // "webPropertyId",
  12081. // "profileId"
  12082. // ],
  12083. // "parameters": {
  12084. // "accountId": {
  12085. // "description": "Account ID which the given view (profile) belongs to.",
  12086. // "location": "path",
  12087. // "required": true,
  12088. // "type": "string"
  12089. // },
  12090. // "max-results": {
  12091. // "description": "The maximum number of profile-user links to include in this response.",
  12092. // "format": "int32",
  12093. // "location": "query",
  12094. // "type": "integer"
  12095. // },
  12096. // "profileId": {
  12097. // "description": "View (Profile) ID to retrieve the profile-user links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to.",
  12098. // "location": "path",
  12099. // "required": true,
  12100. // "type": "string"
  12101. // },
  12102. // "start-index": {
  12103. // "description": "An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  12104. // "format": "int32",
  12105. // "location": "query",
  12106. // "minimum": "1",
  12107. // "type": "integer"
  12108. // },
  12109. // "webPropertyId": {
  12110. // "description": "Web Property ID which the given view (profile) belongs to. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  12111. // "location": "path",
  12112. // "required": true,
  12113. // "type": "string"
  12114. // }
  12115. // },
  12116. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  12117. // "response": {
  12118. // "$ref": "EntityUserLinks"
  12119. // },
  12120. // "scopes": [
  12121. // "https://www.googleapis.com/auth/analytics.manage.users",
  12122. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  12123. // ]
  12124. // }
  12125. }
  12126. // method id "analytics.management.profileUserLinks.update":
  12127. type ManagementProfileUserLinksUpdateCall struct {
  12128. s *Service
  12129. accountId string
  12130. webPropertyId string
  12131. profileId string
  12132. linkId string
  12133. entityuserlink *EntityUserLink
  12134. urlParams_ gensupport.URLParams
  12135. ctx_ context.Context
  12136. header_ http.Header
  12137. }
  12138. // Update: Updates permissions for an existing user on the given view
  12139. // (profile).
  12140. func (r *ManagementProfileUserLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksUpdateCall {
  12141. c := &ManagementProfileUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12142. c.accountId = accountId
  12143. c.webPropertyId = webPropertyId
  12144. c.profileId = profileId
  12145. c.linkId = linkId
  12146. c.entityuserlink = entityuserlink
  12147. return c
  12148. }
  12149. // Fields allows partial responses to be retrieved. See
  12150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12151. // for more information.
  12152. func (c *ManagementProfileUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksUpdateCall {
  12153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12154. return c
  12155. }
  12156. // Context sets the context to be used in this call's Do method. Any
  12157. // pending HTTP request will be aborted if the provided context is
  12158. // canceled.
  12159. func (c *ManagementProfileUserLinksUpdateCall) Context(ctx context.Context) *ManagementProfileUserLinksUpdateCall {
  12160. c.ctx_ = ctx
  12161. return c
  12162. }
  12163. // Header returns an http.Header that can be modified by the caller to
  12164. // add HTTP headers to the request.
  12165. func (c *ManagementProfileUserLinksUpdateCall) Header() http.Header {
  12166. if c.header_ == nil {
  12167. c.header_ = make(http.Header)
  12168. }
  12169. return c.header_
  12170. }
  12171. func (c *ManagementProfileUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  12172. reqHeaders := make(http.Header)
  12173. for k, v := range c.header_ {
  12174. reqHeaders[k] = v
  12175. }
  12176. reqHeaders.Set("User-Agent", c.s.userAgent())
  12177. var body io.Reader = nil
  12178. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  12179. if err != nil {
  12180. return nil, err
  12181. }
  12182. reqHeaders.Set("Content-Type", "application/json")
  12183. c.urlParams_.Set("alt", alt)
  12184. c.urlParams_.Set("prettyPrint", "false")
  12185. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  12186. urls += "?" + c.urlParams_.Encode()
  12187. req, err := http.NewRequest("PUT", urls, body)
  12188. if err != nil {
  12189. return nil, err
  12190. }
  12191. req.Header = reqHeaders
  12192. googleapi.Expand(req.URL, map[string]string{
  12193. "accountId": c.accountId,
  12194. "webPropertyId": c.webPropertyId,
  12195. "profileId": c.profileId,
  12196. "linkId": c.linkId,
  12197. })
  12198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12199. }
  12200. // Do executes the "analytics.management.profileUserLinks.update" call.
  12201. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  12202. // status code is an error. Response headers are in either
  12203. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  12204. // at all) in error.(*googleapi.Error).Header. Use
  12205. // googleapi.IsNotModified to check whether the returned error was
  12206. // because http.StatusNotModified was returned.
  12207. func (c *ManagementProfileUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  12208. gensupport.SetOptions(c.urlParams_, opts...)
  12209. res, err := c.doRequest("json")
  12210. if res != nil && res.StatusCode == http.StatusNotModified {
  12211. if res.Body != nil {
  12212. res.Body.Close()
  12213. }
  12214. return nil, &googleapi.Error{
  12215. Code: res.StatusCode,
  12216. Header: res.Header,
  12217. }
  12218. }
  12219. if err != nil {
  12220. return nil, err
  12221. }
  12222. defer googleapi.CloseBody(res)
  12223. if err := googleapi.CheckResponse(res); err != nil {
  12224. return nil, err
  12225. }
  12226. ret := &EntityUserLink{
  12227. ServerResponse: googleapi.ServerResponse{
  12228. Header: res.Header,
  12229. HTTPStatusCode: res.StatusCode,
  12230. },
  12231. }
  12232. target := &ret
  12233. if err := gensupport.DecodeResponse(target, res); err != nil {
  12234. return nil, err
  12235. }
  12236. return ret, nil
  12237. // {
  12238. // "description": "Updates permissions for an existing user on the given view (profile).",
  12239. // "httpMethod": "PUT",
  12240. // "id": "analytics.management.profileUserLinks.update",
  12241. // "parameterOrder": [
  12242. // "accountId",
  12243. // "webPropertyId",
  12244. // "profileId",
  12245. // "linkId"
  12246. // ],
  12247. // "parameters": {
  12248. // "accountId": {
  12249. // "description": "Account ID to update the user link for.",
  12250. // "location": "path",
  12251. // "required": true,
  12252. // "type": "string"
  12253. // },
  12254. // "linkId": {
  12255. // "description": "Link ID to update the user link for.",
  12256. // "location": "path",
  12257. // "required": true,
  12258. // "type": "string"
  12259. // },
  12260. // "profileId": {
  12261. // "description": "View (Profile ID) to update the user link for.",
  12262. // "location": "path",
  12263. // "required": true,
  12264. // "type": "string"
  12265. // },
  12266. // "webPropertyId": {
  12267. // "description": "Web Property ID to update the user link for.",
  12268. // "location": "path",
  12269. // "required": true,
  12270. // "type": "string"
  12271. // }
  12272. // },
  12273. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  12274. // "request": {
  12275. // "$ref": "EntityUserLink"
  12276. // },
  12277. // "response": {
  12278. // "$ref": "EntityUserLink"
  12279. // },
  12280. // "scopes": [
  12281. // "https://www.googleapis.com/auth/analytics.manage.users"
  12282. // ]
  12283. // }
  12284. }
  12285. // method id "analytics.management.profiles.delete":
  12286. type ManagementProfilesDeleteCall struct {
  12287. s *Service
  12288. accountId string
  12289. webPropertyId string
  12290. profileId string
  12291. urlParams_ gensupport.URLParams
  12292. ctx_ context.Context
  12293. header_ http.Header
  12294. }
  12295. // Delete: Deletes a view (profile).
  12296. func (r *ManagementProfilesService) Delete(accountId string, webPropertyId string, profileId string) *ManagementProfilesDeleteCall {
  12297. c := &ManagementProfilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12298. c.accountId = accountId
  12299. c.webPropertyId = webPropertyId
  12300. c.profileId = profileId
  12301. return c
  12302. }
  12303. // Fields allows partial responses to be retrieved. See
  12304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12305. // for more information.
  12306. func (c *ManagementProfilesDeleteCall) Fields(s ...googleapi.Field) *ManagementProfilesDeleteCall {
  12307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12308. return c
  12309. }
  12310. // Context sets the context to be used in this call's Do method. Any
  12311. // pending HTTP request will be aborted if the provided context is
  12312. // canceled.
  12313. func (c *ManagementProfilesDeleteCall) Context(ctx context.Context) *ManagementProfilesDeleteCall {
  12314. c.ctx_ = ctx
  12315. return c
  12316. }
  12317. // Header returns an http.Header that can be modified by the caller to
  12318. // add HTTP headers to the request.
  12319. func (c *ManagementProfilesDeleteCall) Header() http.Header {
  12320. if c.header_ == nil {
  12321. c.header_ = make(http.Header)
  12322. }
  12323. return c.header_
  12324. }
  12325. func (c *ManagementProfilesDeleteCall) doRequest(alt string) (*http.Response, error) {
  12326. reqHeaders := make(http.Header)
  12327. for k, v := range c.header_ {
  12328. reqHeaders[k] = v
  12329. }
  12330. reqHeaders.Set("User-Agent", c.s.userAgent())
  12331. var body io.Reader = nil
  12332. c.urlParams_.Set("alt", alt)
  12333. c.urlParams_.Set("prettyPrint", "false")
  12334. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12335. urls += "?" + c.urlParams_.Encode()
  12336. req, err := http.NewRequest("DELETE", urls, body)
  12337. if err != nil {
  12338. return nil, err
  12339. }
  12340. req.Header = reqHeaders
  12341. googleapi.Expand(req.URL, map[string]string{
  12342. "accountId": c.accountId,
  12343. "webPropertyId": c.webPropertyId,
  12344. "profileId": c.profileId,
  12345. })
  12346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12347. }
  12348. // Do executes the "analytics.management.profiles.delete" call.
  12349. func (c *ManagementProfilesDeleteCall) Do(opts ...googleapi.CallOption) error {
  12350. gensupport.SetOptions(c.urlParams_, opts...)
  12351. res, err := c.doRequest("json")
  12352. if err != nil {
  12353. return err
  12354. }
  12355. defer googleapi.CloseBody(res)
  12356. if err := googleapi.CheckResponse(res); err != nil {
  12357. return err
  12358. }
  12359. return nil
  12360. // {
  12361. // "description": "Deletes a view (profile).",
  12362. // "httpMethod": "DELETE",
  12363. // "id": "analytics.management.profiles.delete",
  12364. // "parameterOrder": [
  12365. // "accountId",
  12366. // "webPropertyId",
  12367. // "profileId"
  12368. // ],
  12369. // "parameters": {
  12370. // "accountId": {
  12371. // "description": "Account ID to delete the view (profile) for.",
  12372. // "location": "path",
  12373. // "required": true,
  12374. // "type": "string"
  12375. // },
  12376. // "profileId": {
  12377. // "description": "ID of the view (profile) to be deleted.",
  12378. // "location": "path",
  12379. // "required": true,
  12380. // "type": "string"
  12381. // },
  12382. // "webPropertyId": {
  12383. // "description": "Web property ID to delete the view (profile) for.",
  12384. // "location": "path",
  12385. // "required": true,
  12386. // "type": "string"
  12387. // }
  12388. // },
  12389. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12390. // "scopes": [
  12391. // "https://www.googleapis.com/auth/analytics.edit"
  12392. // ]
  12393. // }
  12394. }
  12395. // method id "analytics.management.profiles.get":
  12396. type ManagementProfilesGetCall struct {
  12397. s *Service
  12398. accountId string
  12399. webPropertyId string
  12400. profileId string
  12401. urlParams_ gensupport.URLParams
  12402. ifNoneMatch_ string
  12403. ctx_ context.Context
  12404. header_ http.Header
  12405. }
  12406. // Get: Gets a view (profile) to which the user has access.
  12407. func (r *ManagementProfilesService) Get(accountId string, webPropertyId string, profileId string) *ManagementProfilesGetCall {
  12408. c := &ManagementProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12409. c.accountId = accountId
  12410. c.webPropertyId = webPropertyId
  12411. c.profileId = profileId
  12412. return c
  12413. }
  12414. // Fields allows partial responses to be retrieved. See
  12415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12416. // for more information.
  12417. func (c *ManagementProfilesGetCall) Fields(s ...googleapi.Field) *ManagementProfilesGetCall {
  12418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12419. return c
  12420. }
  12421. // IfNoneMatch sets the optional parameter which makes the operation
  12422. // fail if the object's ETag matches the given value. This is useful for
  12423. // getting updates only after the object has changed since the last
  12424. // request. Use googleapi.IsNotModified to check whether the response
  12425. // error from Do is the result of In-None-Match.
  12426. func (c *ManagementProfilesGetCall) IfNoneMatch(entityTag string) *ManagementProfilesGetCall {
  12427. c.ifNoneMatch_ = entityTag
  12428. return c
  12429. }
  12430. // Context sets the context to be used in this call's Do method. Any
  12431. // pending HTTP request will be aborted if the provided context is
  12432. // canceled.
  12433. func (c *ManagementProfilesGetCall) Context(ctx context.Context) *ManagementProfilesGetCall {
  12434. c.ctx_ = ctx
  12435. return c
  12436. }
  12437. // Header returns an http.Header that can be modified by the caller to
  12438. // add HTTP headers to the request.
  12439. func (c *ManagementProfilesGetCall) Header() http.Header {
  12440. if c.header_ == nil {
  12441. c.header_ = make(http.Header)
  12442. }
  12443. return c.header_
  12444. }
  12445. func (c *ManagementProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12446. reqHeaders := make(http.Header)
  12447. for k, v := range c.header_ {
  12448. reqHeaders[k] = v
  12449. }
  12450. reqHeaders.Set("User-Agent", c.s.userAgent())
  12451. if c.ifNoneMatch_ != "" {
  12452. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12453. }
  12454. var body io.Reader = nil
  12455. c.urlParams_.Set("alt", alt)
  12456. c.urlParams_.Set("prettyPrint", "false")
  12457. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12458. urls += "?" + c.urlParams_.Encode()
  12459. req, err := http.NewRequest("GET", urls, body)
  12460. if err != nil {
  12461. return nil, err
  12462. }
  12463. req.Header = reqHeaders
  12464. googleapi.Expand(req.URL, map[string]string{
  12465. "accountId": c.accountId,
  12466. "webPropertyId": c.webPropertyId,
  12467. "profileId": c.profileId,
  12468. })
  12469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12470. }
  12471. // Do executes the "analytics.management.profiles.get" call.
  12472. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12473. // code is an error. Response headers are in either
  12474. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12475. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12476. // check whether the returned error was because http.StatusNotModified
  12477. // was returned.
  12478. func (c *ManagementProfilesGetCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12479. gensupport.SetOptions(c.urlParams_, opts...)
  12480. res, err := c.doRequest("json")
  12481. if res != nil && res.StatusCode == http.StatusNotModified {
  12482. if res.Body != nil {
  12483. res.Body.Close()
  12484. }
  12485. return nil, &googleapi.Error{
  12486. Code: res.StatusCode,
  12487. Header: res.Header,
  12488. }
  12489. }
  12490. if err != nil {
  12491. return nil, err
  12492. }
  12493. defer googleapi.CloseBody(res)
  12494. if err := googleapi.CheckResponse(res); err != nil {
  12495. return nil, err
  12496. }
  12497. ret := &Profile{
  12498. ServerResponse: googleapi.ServerResponse{
  12499. Header: res.Header,
  12500. HTTPStatusCode: res.StatusCode,
  12501. },
  12502. }
  12503. target := &ret
  12504. if err := gensupport.DecodeResponse(target, res); err != nil {
  12505. return nil, err
  12506. }
  12507. return ret, nil
  12508. // {
  12509. // "description": "Gets a view (profile) to which the user has access.",
  12510. // "httpMethod": "GET",
  12511. // "id": "analytics.management.profiles.get",
  12512. // "parameterOrder": [
  12513. // "accountId",
  12514. // "webPropertyId",
  12515. // "profileId"
  12516. // ],
  12517. // "parameters": {
  12518. // "accountId": {
  12519. // "description": "Account ID to retrieve the view (profile) for.",
  12520. // "location": "path",
  12521. // "pattern": "[0-9]+",
  12522. // "required": true,
  12523. // "type": "string"
  12524. // },
  12525. // "profileId": {
  12526. // "description": "View (Profile) ID to retrieve the view (profile) for.",
  12527. // "location": "path",
  12528. // "pattern": "[0-9]+",
  12529. // "required": true,
  12530. // "type": "string"
  12531. // },
  12532. // "webPropertyId": {
  12533. // "description": "Web property ID to retrieve the view (profile) for.",
  12534. // "location": "path",
  12535. // "pattern": "UA-[0-9]+-[0-9]+",
  12536. // "required": true,
  12537. // "type": "string"
  12538. // }
  12539. // },
  12540. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12541. // "response": {
  12542. // "$ref": "Profile"
  12543. // },
  12544. // "scopes": [
  12545. // "https://www.googleapis.com/auth/analytics.edit",
  12546. // "https://www.googleapis.com/auth/analytics.readonly"
  12547. // ]
  12548. // }
  12549. }
  12550. // method id "analytics.management.profiles.insert":
  12551. type ManagementProfilesInsertCall struct {
  12552. s *Service
  12553. accountId string
  12554. webPropertyId string
  12555. profile *Profile
  12556. urlParams_ gensupport.URLParams
  12557. ctx_ context.Context
  12558. header_ http.Header
  12559. }
  12560. // Insert: Create a new view (profile).
  12561. func (r *ManagementProfilesService) Insert(accountId string, webPropertyId string, profile *Profile) *ManagementProfilesInsertCall {
  12562. c := &ManagementProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12563. c.accountId = accountId
  12564. c.webPropertyId = webPropertyId
  12565. c.profile = profile
  12566. return c
  12567. }
  12568. // Fields allows partial responses to be retrieved. See
  12569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12570. // for more information.
  12571. func (c *ManagementProfilesInsertCall) Fields(s ...googleapi.Field) *ManagementProfilesInsertCall {
  12572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12573. return c
  12574. }
  12575. // Context sets the context to be used in this call's Do method. Any
  12576. // pending HTTP request will be aborted if the provided context is
  12577. // canceled.
  12578. func (c *ManagementProfilesInsertCall) Context(ctx context.Context) *ManagementProfilesInsertCall {
  12579. c.ctx_ = ctx
  12580. return c
  12581. }
  12582. // Header returns an http.Header that can be modified by the caller to
  12583. // add HTTP headers to the request.
  12584. func (c *ManagementProfilesInsertCall) Header() http.Header {
  12585. if c.header_ == nil {
  12586. c.header_ = make(http.Header)
  12587. }
  12588. return c.header_
  12589. }
  12590. func (c *ManagementProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12591. reqHeaders := make(http.Header)
  12592. for k, v := range c.header_ {
  12593. reqHeaders[k] = v
  12594. }
  12595. reqHeaders.Set("User-Agent", c.s.userAgent())
  12596. var body io.Reader = nil
  12597. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  12598. if err != nil {
  12599. return nil, err
  12600. }
  12601. reqHeaders.Set("Content-Type", "application/json")
  12602. c.urlParams_.Set("alt", alt)
  12603. c.urlParams_.Set("prettyPrint", "false")
  12604. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  12605. urls += "?" + c.urlParams_.Encode()
  12606. req, err := http.NewRequest("POST", urls, body)
  12607. if err != nil {
  12608. return nil, err
  12609. }
  12610. req.Header = reqHeaders
  12611. googleapi.Expand(req.URL, map[string]string{
  12612. "accountId": c.accountId,
  12613. "webPropertyId": c.webPropertyId,
  12614. })
  12615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12616. }
  12617. // Do executes the "analytics.management.profiles.insert" call.
  12618. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12619. // code is an error. Response headers are in either
  12620. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12621. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12622. // check whether the returned error was because http.StatusNotModified
  12623. // was returned.
  12624. func (c *ManagementProfilesInsertCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12625. gensupport.SetOptions(c.urlParams_, opts...)
  12626. res, err := c.doRequest("json")
  12627. if res != nil && res.StatusCode == http.StatusNotModified {
  12628. if res.Body != nil {
  12629. res.Body.Close()
  12630. }
  12631. return nil, &googleapi.Error{
  12632. Code: res.StatusCode,
  12633. Header: res.Header,
  12634. }
  12635. }
  12636. if err != nil {
  12637. return nil, err
  12638. }
  12639. defer googleapi.CloseBody(res)
  12640. if err := googleapi.CheckResponse(res); err != nil {
  12641. return nil, err
  12642. }
  12643. ret := &Profile{
  12644. ServerResponse: googleapi.ServerResponse{
  12645. Header: res.Header,
  12646. HTTPStatusCode: res.StatusCode,
  12647. },
  12648. }
  12649. target := &ret
  12650. if err := gensupport.DecodeResponse(target, res); err != nil {
  12651. return nil, err
  12652. }
  12653. return ret, nil
  12654. // {
  12655. // "description": "Create a new view (profile).",
  12656. // "httpMethod": "POST",
  12657. // "id": "analytics.management.profiles.insert",
  12658. // "parameterOrder": [
  12659. // "accountId",
  12660. // "webPropertyId"
  12661. // ],
  12662. // "parameters": {
  12663. // "accountId": {
  12664. // "description": "Account ID to create the view (profile) for.",
  12665. // "location": "path",
  12666. // "required": true,
  12667. // "type": "string"
  12668. // },
  12669. // "webPropertyId": {
  12670. // "description": "Web property ID to create the view (profile) for.",
  12671. // "location": "path",
  12672. // "required": true,
  12673. // "type": "string"
  12674. // }
  12675. // },
  12676. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  12677. // "request": {
  12678. // "$ref": "Profile"
  12679. // },
  12680. // "response": {
  12681. // "$ref": "Profile"
  12682. // },
  12683. // "scopes": [
  12684. // "https://www.googleapis.com/auth/analytics.edit"
  12685. // ]
  12686. // }
  12687. }
  12688. // method id "analytics.management.profiles.list":
  12689. type ManagementProfilesListCall struct {
  12690. s *Service
  12691. accountId string
  12692. webPropertyId string
  12693. urlParams_ gensupport.URLParams
  12694. ifNoneMatch_ string
  12695. ctx_ context.Context
  12696. header_ http.Header
  12697. }
  12698. // List: Lists views (profiles) to which the user has access.
  12699. func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall {
  12700. c := &ManagementProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12701. c.accountId = accountId
  12702. c.webPropertyId = webPropertyId
  12703. return c
  12704. }
  12705. // MaxResults sets the optional parameter "max-results": The maximum
  12706. // number of views (profiles) to include in this response.
  12707. func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall {
  12708. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  12709. return c
  12710. }
  12711. // StartIndex sets the optional parameter "start-index": An index of the
  12712. // first entity to retrieve. Use this parameter as a pagination
  12713. // mechanism along with the max-results parameter.
  12714. func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall {
  12715. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  12716. return c
  12717. }
  12718. // Fields allows partial responses to be retrieved. See
  12719. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12720. // for more information.
  12721. func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall {
  12722. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12723. return c
  12724. }
  12725. // IfNoneMatch sets the optional parameter which makes the operation
  12726. // fail if the object's ETag matches the given value. This is useful for
  12727. // getting updates only after the object has changed since the last
  12728. // request. Use googleapi.IsNotModified to check whether the response
  12729. // error from Do is the result of In-None-Match.
  12730. func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall {
  12731. c.ifNoneMatch_ = entityTag
  12732. return c
  12733. }
  12734. // Context sets the context to be used in this call's Do method. Any
  12735. // pending HTTP request will be aborted if the provided context is
  12736. // canceled.
  12737. func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall {
  12738. c.ctx_ = ctx
  12739. return c
  12740. }
  12741. // Header returns an http.Header that can be modified by the caller to
  12742. // add HTTP headers to the request.
  12743. func (c *ManagementProfilesListCall) Header() http.Header {
  12744. if c.header_ == nil {
  12745. c.header_ = make(http.Header)
  12746. }
  12747. return c.header_
  12748. }
  12749. func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12750. reqHeaders := make(http.Header)
  12751. for k, v := range c.header_ {
  12752. reqHeaders[k] = v
  12753. }
  12754. reqHeaders.Set("User-Agent", c.s.userAgent())
  12755. if c.ifNoneMatch_ != "" {
  12756. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12757. }
  12758. var body io.Reader = nil
  12759. c.urlParams_.Set("alt", alt)
  12760. c.urlParams_.Set("prettyPrint", "false")
  12761. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  12762. urls += "?" + c.urlParams_.Encode()
  12763. req, err := http.NewRequest("GET", urls, body)
  12764. if err != nil {
  12765. return nil, err
  12766. }
  12767. req.Header = reqHeaders
  12768. googleapi.Expand(req.URL, map[string]string{
  12769. "accountId": c.accountId,
  12770. "webPropertyId": c.webPropertyId,
  12771. })
  12772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12773. }
  12774. // Do executes the "analytics.management.profiles.list" call.
  12775. // Exactly one of *Profiles or error will be non-nil. Any non-2xx status
  12776. // code is an error. Response headers are in either
  12777. // *Profiles.ServerResponse.Header or (if a response was returned at
  12778. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12779. // to check whether the returned error was because
  12780. // http.StatusNotModified was returned.
  12781. func (c *ManagementProfilesListCall) Do(opts ...googleapi.CallOption) (*Profiles, error) {
  12782. gensupport.SetOptions(c.urlParams_, opts...)
  12783. res, err := c.doRequest("json")
  12784. if res != nil && res.StatusCode == http.StatusNotModified {
  12785. if res.Body != nil {
  12786. res.Body.Close()
  12787. }
  12788. return nil, &googleapi.Error{
  12789. Code: res.StatusCode,
  12790. Header: res.Header,
  12791. }
  12792. }
  12793. if err != nil {
  12794. return nil, err
  12795. }
  12796. defer googleapi.CloseBody(res)
  12797. if err := googleapi.CheckResponse(res); err != nil {
  12798. return nil, err
  12799. }
  12800. ret := &Profiles{
  12801. ServerResponse: googleapi.ServerResponse{
  12802. Header: res.Header,
  12803. HTTPStatusCode: res.StatusCode,
  12804. },
  12805. }
  12806. target := &ret
  12807. if err := gensupport.DecodeResponse(target, res); err != nil {
  12808. return nil, err
  12809. }
  12810. return ret, nil
  12811. // {
  12812. // "description": "Lists views (profiles) to which the user has access.",
  12813. // "httpMethod": "GET",
  12814. // "id": "analytics.management.profiles.list",
  12815. // "parameterOrder": [
  12816. // "accountId",
  12817. // "webPropertyId"
  12818. // ],
  12819. // "parameters": {
  12820. // "accountId": {
  12821. // "description": "Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access.",
  12822. // "location": "path",
  12823. // "required": true,
  12824. // "type": "string"
  12825. // },
  12826. // "max-results": {
  12827. // "description": "The maximum number of views (profiles) to include in this response.",
  12828. // "format": "int32",
  12829. // "location": "query",
  12830. // "type": "integer"
  12831. // },
  12832. // "start-index": {
  12833. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  12834. // "format": "int32",
  12835. // "location": "query",
  12836. // "minimum": "1",
  12837. // "type": "integer"
  12838. // },
  12839. // "webPropertyId": {
  12840. // "description": "Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access.",
  12841. // "location": "path",
  12842. // "required": true,
  12843. // "type": "string"
  12844. // }
  12845. // },
  12846. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  12847. // "response": {
  12848. // "$ref": "Profiles"
  12849. // },
  12850. // "scopes": [
  12851. // "https://www.googleapis.com/auth/analytics",
  12852. // "https://www.googleapis.com/auth/analytics.edit",
  12853. // "https://www.googleapis.com/auth/analytics.readonly"
  12854. // ]
  12855. // }
  12856. }
  12857. // method id "analytics.management.profiles.patch":
  12858. type ManagementProfilesPatchCall struct {
  12859. s *Service
  12860. accountId string
  12861. webPropertyId string
  12862. profileId string
  12863. profile *Profile
  12864. urlParams_ gensupport.URLParams
  12865. ctx_ context.Context
  12866. header_ http.Header
  12867. }
  12868. // Patch: Updates an existing view (profile). This method supports patch
  12869. // semantics.
  12870. func (r *ManagementProfilesService) Patch(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesPatchCall {
  12871. c := &ManagementProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12872. c.accountId = accountId
  12873. c.webPropertyId = webPropertyId
  12874. c.profileId = profileId
  12875. c.profile = profile
  12876. return c
  12877. }
  12878. // Fields allows partial responses to be retrieved. See
  12879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12880. // for more information.
  12881. func (c *ManagementProfilesPatchCall) Fields(s ...googleapi.Field) *ManagementProfilesPatchCall {
  12882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12883. return c
  12884. }
  12885. // Context sets the context to be used in this call's Do method. Any
  12886. // pending HTTP request will be aborted if the provided context is
  12887. // canceled.
  12888. func (c *ManagementProfilesPatchCall) Context(ctx context.Context) *ManagementProfilesPatchCall {
  12889. c.ctx_ = ctx
  12890. return c
  12891. }
  12892. // Header returns an http.Header that can be modified by the caller to
  12893. // add HTTP headers to the request.
  12894. func (c *ManagementProfilesPatchCall) Header() http.Header {
  12895. if c.header_ == nil {
  12896. c.header_ = make(http.Header)
  12897. }
  12898. return c.header_
  12899. }
  12900. func (c *ManagementProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  12901. reqHeaders := make(http.Header)
  12902. for k, v := range c.header_ {
  12903. reqHeaders[k] = v
  12904. }
  12905. reqHeaders.Set("User-Agent", c.s.userAgent())
  12906. var body io.Reader = nil
  12907. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  12908. if err != nil {
  12909. return nil, err
  12910. }
  12911. reqHeaders.Set("Content-Type", "application/json")
  12912. c.urlParams_.Set("alt", alt)
  12913. c.urlParams_.Set("prettyPrint", "false")
  12914. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12915. urls += "?" + c.urlParams_.Encode()
  12916. req, err := http.NewRequest("PATCH", urls, body)
  12917. if err != nil {
  12918. return nil, err
  12919. }
  12920. req.Header = reqHeaders
  12921. googleapi.Expand(req.URL, map[string]string{
  12922. "accountId": c.accountId,
  12923. "webPropertyId": c.webPropertyId,
  12924. "profileId": c.profileId,
  12925. })
  12926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12927. }
  12928. // Do executes the "analytics.management.profiles.patch" call.
  12929. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12930. // code is an error. Response headers are in either
  12931. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12932. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12933. // check whether the returned error was because http.StatusNotModified
  12934. // was returned.
  12935. func (c *ManagementProfilesPatchCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12936. gensupport.SetOptions(c.urlParams_, opts...)
  12937. res, err := c.doRequest("json")
  12938. if res != nil && res.StatusCode == http.StatusNotModified {
  12939. if res.Body != nil {
  12940. res.Body.Close()
  12941. }
  12942. return nil, &googleapi.Error{
  12943. Code: res.StatusCode,
  12944. Header: res.Header,
  12945. }
  12946. }
  12947. if err != nil {
  12948. return nil, err
  12949. }
  12950. defer googleapi.CloseBody(res)
  12951. if err := googleapi.CheckResponse(res); err != nil {
  12952. return nil, err
  12953. }
  12954. ret := &Profile{
  12955. ServerResponse: googleapi.ServerResponse{
  12956. Header: res.Header,
  12957. HTTPStatusCode: res.StatusCode,
  12958. },
  12959. }
  12960. target := &ret
  12961. if err := gensupport.DecodeResponse(target, res); err != nil {
  12962. return nil, err
  12963. }
  12964. return ret, nil
  12965. // {
  12966. // "description": "Updates an existing view (profile). This method supports patch semantics.",
  12967. // "httpMethod": "PATCH",
  12968. // "id": "analytics.management.profiles.patch",
  12969. // "parameterOrder": [
  12970. // "accountId",
  12971. // "webPropertyId",
  12972. // "profileId"
  12973. // ],
  12974. // "parameters": {
  12975. // "accountId": {
  12976. // "description": "Account ID to which the view (profile) belongs",
  12977. // "location": "path",
  12978. // "required": true,
  12979. // "type": "string"
  12980. // },
  12981. // "profileId": {
  12982. // "description": "ID of the view (profile) to be updated.",
  12983. // "location": "path",
  12984. // "required": true,
  12985. // "type": "string"
  12986. // },
  12987. // "webPropertyId": {
  12988. // "description": "Web property ID to which the view (profile) belongs",
  12989. // "location": "path",
  12990. // "required": true,
  12991. // "type": "string"
  12992. // }
  12993. // },
  12994. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12995. // "request": {
  12996. // "$ref": "Profile"
  12997. // },
  12998. // "response": {
  12999. // "$ref": "Profile"
  13000. // },
  13001. // "scopes": [
  13002. // "https://www.googleapis.com/auth/analytics.edit"
  13003. // ]
  13004. // }
  13005. }
  13006. // method id "analytics.management.profiles.update":
  13007. type ManagementProfilesUpdateCall struct {
  13008. s *Service
  13009. accountId string
  13010. webPropertyId string
  13011. profileId string
  13012. profile *Profile
  13013. urlParams_ gensupport.URLParams
  13014. ctx_ context.Context
  13015. header_ http.Header
  13016. }
  13017. // Update: Updates an existing view (profile).
  13018. func (r *ManagementProfilesService) Update(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesUpdateCall {
  13019. c := &ManagementProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13020. c.accountId = accountId
  13021. c.webPropertyId = webPropertyId
  13022. c.profileId = profileId
  13023. c.profile = profile
  13024. return c
  13025. }
  13026. // Fields allows partial responses to be retrieved. See
  13027. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13028. // for more information.
  13029. func (c *ManagementProfilesUpdateCall) Fields(s ...googleapi.Field) *ManagementProfilesUpdateCall {
  13030. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13031. return c
  13032. }
  13033. // Context sets the context to be used in this call's Do method. Any
  13034. // pending HTTP request will be aborted if the provided context is
  13035. // canceled.
  13036. func (c *ManagementProfilesUpdateCall) Context(ctx context.Context) *ManagementProfilesUpdateCall {
  13037. c.ctx_ = ctx
  13038. return c
  13039. }
  13040. // Header returns an http.Header that can be modified by the caller to
  13041. // add HTTP headers to the request.
  13042. func (c *ManagementProfilesUpdateCall) Header() http.Header {
  13043. if c.header_ == nil {
  13044. c.header_ = make(http.Header)
  13045. }
  13046. return c.header_
  13047. }
  13048. func (c *ManagementProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13049. reqHeaders := make(http.Header)
  13050. for k, v := range c.header_ {
  13051. reqHeaders[k] = v
  13052. }
  13053. reqHeaders.Set("User-Agent", c.s.userAgent())
  13054. var body io.Reader = nil
  13055. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  13056. if err != nil {
  13057. return nil, err
  13058. }
  13059. reqHeaders.Set("Content-Type", "application/json")
  13060. c.urlParams_.Set("alt", alt)
  13061. c.urlParams_.Set("prettyPrint", "false")
  13062. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  13063. urls += "?" + c.urlParams_.Encode()
  13064. req, err := http.NewRequest("PUT", urls, body)
  13065. if err != nil {
  13066. return nil, err
  13067. }
  13068. req.Header = reqHeaders
  13069. googleapi.Expand(req.URL, map[string]string{
  13070. "accountId": c.accountId,
  13071. "webPropertyId": c.webPropertyId,
  13072. "profileId": c.profileId,
  13073. })
  13074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13075. }
  13076. // Do executes the "analytics.management.profiles.update" call.
  13077. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  13078. // code is an error. Response headers are in either
  13079. // *Profile.ServerResponse.Header or (if a response was returned at all)
  13080. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13081. // check whether the returned error was because http.StatusNotModified
  13082. // was returned.
  13083. func (c *ManagementProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  13084. gensupport.SetOptions(c.urlParams_, opts...)
  13085. res, err := c.doRequest("json")
  13086. if res != nil && res.StatusCode == http.StatusNotModified {
  13087. if res.Body != nil {
  13088. res.Body.Close()
  13089. }
  13090. return nil, &googleapi.Error{
  13091. Code: res.StatusCode,
  13092. Header: res.Header,
  13093. }
  13094. }
  13095. if err != nil {
  13096. return nil, err
  13097. }
  13098. defer googleapi.CloseBody(res)
  13099. if err := googleapi.CheckResponse(res); err != nil {
  13100. return nil, err
  13101. }
  13102. ret := &Profile{
  13103. ServerResponse: googleapi.ServerResponse{
  13104. Header: res.Header,
  13105. HTTPStatusCode: res.StatusCode,
  13106. },
  13107. }
  13108. target := &ret
  13109. if err := gensupport.DecodeResponse(target, res); err != nil {
  13110. return nil, err
  13111. }
  13112. return ret, nil
  13113. // {
  13114. // "description": "Updates an existing view (profile).",
  13115. // "httpMethod": "PUT",
  13116. // "id": "analytics.management.profiles.update",
  13117. // "parameterOrder": [
  13118. // "accountId",
  13119. // "webPropertyId",
  13120. // "profileId"
  13121. // ],
  13122. // "parameters": {
  13123. // "accountId": {
  13124. // "description": "Account ID to which the view (profile) belongs",
  13125. // "location": "path",
  13126. // "required": true,
  13127. // "type": "string"
  13128. // },
  13129. // "profileId": {
  13130. // "description": "ID of the view (profile) to be updated.",
  13131. // "location": "path",
  13132. // "required": true,
  13133. // "type": "string"
  13134. // },
  13135. // "webPropertyId": {
  13136. // "description": "Web property ID to which the view (profile) belongs",
  13137. // "location": "path",
  13138. // "required": true,
  13139. // "type": "string"
  13140. // }
  13141. // },
  13142. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  13143. // "request": {
  13144. // "$ref": "Profile"
  13145. // },
  13146. // "response": {
  13147. // "$ref": "Profile"
  13148. // },
  13149. // "scopes": [
  13150. // "https://www.googleapis.com/auth/analytics.edit"
  13151. // ]
  13152. // }
  13153. }
  13154. // method id "analytics.management.remarketingAudience.delete":
  13155. type ManagementRemarketingAudienceDeleteCall struct {
  13156. s *Service
  13157. accountId string
  13158. webPropertyId string
  13159. remarketingAudienceId string
  13160. urlParams_ gensupport.URLParams
  13161. ctx_ context.Context
  13162. header_ http.Header
  13163. }
  13164. // Delete: Delete a remarketing audience.
  13165. func (r *ManagementRemarketingAudienceService) Delete(accountId string, webPropertyId string, remarketingAudienceId string) *ManagementRemarketingAudienceDeleteCall {
  13166. c := &ManagementRemarketingAudienceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13167. c.accountId = accountId
  13168. c.webPropertyId = webPropertyId
  13169. c.remarketingAudienceId = remarketingAudienceId
  13170. return c
  13171. }
  13172. // Fields allows partial responses to be retrieved. See
  13173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13174. // for more information.
  13175. func (c *ManagementRemarketingAudienceDeleteCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceDeleteCall {
  13176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13177. return c
  13178. }
  13179. // Context sets the context to be used in this call's Do method. Any
  13180. // pending HTTP request will be aborted if the provided context is
  13181. // canceled.
  13182. func (c *ManagementRemarketingAudienceDeleteCall) Context(ctx context.Context) *ManagementRemarketingAudienceDeleteCall {
  13183. c.ctx_ = ctx
  13184. return c
  13185. }
  13186. // Header returns an http.Header that can be modified by the caller to
  13187. // add HTTP headers to the request.
  13188. func (c *ManagementRemarketingAudienceDeleteCall) Header() http.Header {
  13189. if c.header_ == nil {
  13190. c.header_ = make(http.Header)
  13191. }
  13192. return c.header_
  13193. }
  13194. func (c *ManagementRemarketingAudienceDeleteCall) doRequest(alt string) (*http.Response, error) {
  13195. reqHeaders := make(http.Header)
  13196. for k, v := range c.header_ {
  13197. reqHeaders[k] = v
  13198. }
  13199. reqHeaders.Set("User-Agent", c.s.userAgent())
  13200. var body io.Reader = nil
  13201. c.urlParams_.Set("alt", alt)
  13202. c.urlParams_.Set("prettyPrint", "false")
  13203. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13204. urls += "?" + c.urlParams_.Encode()
  13205. req, err := http.NewRequest("DELETE", urls, body)
  13206. if err != nil {
  13207. return nil, err
  13208. }
  13209. req.Header = reqHeaders
  13210. googleapi.Expand(req.URL, map[string]string{
  13211. "accountId": c.accountId,
  13212. "webPropertyId": c.webPropertyId,
  13213. "remarketingAudienceId": c.remarketingAudienceId,
  13214. })
  13215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13216. }
  13217. // Do executes the "analytics.management.remarketingAudience.delete" call.
  13218. func (c *ManagementRemarketingAudienceDeleteCall) Do(opts ...googleapi.CallOption) error {
  13219. gensupport.SetOptions(c.urlParams_, opts...)
  13220. res, err := c.doRequest("json")
  13221. if err != nil {
  13222. return err
  13223. }
  13224. defer googleapi.CloseBody(res)
  13225. if err := googleapi.CheckResponse(res); err != nil {
  13226. return err
  13227. }
  13228. return nil
  13229. // {
  13230. // "description": "Delete a remarketing audience.",
  13231. // "httpMethod": "DELETE",
  13232. // "id": "analytics.management.remarketingAudience.delete",
  13233. // "parameterOrder": [
  13234. // "accountId",
  13235. // "webPropertyId",
  13236. // "remarketingAudienceId"
  13237. // ],
  13238. // "parameters": {
  13239. // "accountId": {
  13240. // "description": "Account ID to which the remarketing audience belongs.",
  13241. // "location": "path",
  13242. // "required": true,
  13243. // "type": "string"
  13244. // },
  13245. // "remarketingAudienceId": {
  13246. // "description": "The ID of the remarketing audience to delete.",
  13247. // "location": "path",
  13248. // "required": true,
  13249. // "type": "string"
  13250. // },
  13251. // "webPropertyId": {
  13252. // "description": "Web property ID to which the remarketing audience belongs.",
  13253. // "location": "path",
  13254. // "required": true,
  13255. // "type": "string"
  13256. // }
  13257. // },
  13258. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13259. // "scopes": [
  13260. // "https://www.googleapis.com/auth/analytics.edit"
  13261. // ]
  13262. // }
  13263. }
  13264. // method id "analytics.management.remarketingAudience.get":
  13265. type ManagementRemarketingAudienceGetCall struct {
  13266. s *Service
  13267. accountId string
  13268. webPropertyId string
  13269. remarketingAudienceId string
  13270. urlParams_ gensupport.URLParams
  13271. ifNoneMatch_ string
  13272. ctx_ context.Context
  13273. header_ http.Header
  13274. }
  13275. // Get: Gets a remarketing audience to which the user has access.
  13276. func (r *ManagementRemarketingAudienceService) Get(accountId string, webPropertyId string, remarketingAudienceId string) *ManagementRemarketingAudienceGetCall {
  13277. c := &ManagementRemarketingAudienceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13278. c.accountId = accountId
  13279. c.webPropertyId = webPropertyId
  13280. c.remarketingAudienceId = remarketingAudienceId
  13281. return c
  13282. }
  13283. // Fields allows partial responses to be retrieved. See
  13284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13285. // for more information.
  13286. func (c *ManagementRemarketingAudienceGetCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceGetCall {
  13287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13288. return c
  13289. }
  13290. // IfNoneMatch sets the optional parameter which makes the operation
  13291. // fail if the object's ETag matches the given value. This is useful for
  13292. // getting updates only after the object has changed since the last
  13293. // request. Use googleapi.IsNotModified to check whether the response
  13294. // error from Do is the result of In-None-Match.
  13295. func (c *ManagementRemarketingAudienceGetCall) IfNoneMatch(entityTag string) *ManagementRemarketingAudienceGetCall {
  13296. c.ifNoneMatch_ = entityTag
  13297. return c
  13298. }
  13299. // Context sets the context to be used in this call's Do method. Any
  13300. // pending HTTP request will be aborted if the provided context is
  13301. // canceled.
  13302. func (c *ManagementRemarketingAudienceGetCall) Context(ctx context.Context) *ManagementRemarketingAudienceGetCall {
  13303. c.ctx_ = ctx
  13304. return c
  13305. }
  13306. // Header returns an http.Header that can be modified by the caller to
  13307. // add HTTP headers to the request.
  13308. func (c *ManagementRemarketingAudienceGetCall) Header() http.Header {
  13309. if c.header_ == nil {
  13310. c.header_ = make(http.Header)
  13311. }
  13312. return c.header_
  13313. }
  13314. func (c *ManagementRemarketingAudienceGetCall) doRequest(alt string) (*http.Response, error) {
  13315. reqHeaders := make(http.Header)
  13316. for k, v := range c.header_ {
  13317. reqHeaders[k] = v
  13318. }
  13319. reqHeaders.Set("User-Agent", c.s.userAgent())
  13320. if c.ifNoneMatch_ != "" {
  13321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13322. }
  13323. var body io.Reader = nil
  13324. c.urlParams_.Set("alt", alt)
  13325. c.urlParams_.Set("prettyPrint", "false")
  13326. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13327. urls += "?" + c.urlParams_.Encode()
  13328. req, err := http.NewRequest("GET", urls, body)
  13329. if err != nil {
  13330. return nil, err
  13331. }
  13332. req.Header = reqHeaders
  13333. googleapi.Expand(req.URL, map[string]string{
  13334. "accountId": c.accountId,
  13335. "webPropertyId": c.webPropertyId,
  13336. "remarketingAudienceId": c.remarketingAudienceId,
  13337. })
  13338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13339. }
  13340. // Do executes the "analytics.management.remarketingAudience.get" call.
  13341. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13342. // non-2xx status code is an error. Response headers are in either
  13343. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13344. // returned at all) in error.(*googleapi.Error).Header. Use
  13345. // googleapi.IsNotModified to check whether the returned error was
  13346. // because http.StatusNotModified was returned.
  13347. func (c *ManagementRemarketingAudienceGetCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13348. gensupport.SetOptions(c.urlParams_, opts...)
  13349. res, err := c.doRequest("json")
  13350. if res != nil && res.StatusCode == http.StatusNotModified {
  13351. if res.Body != nil {
  13352. res.Body.Close()
  13353. }
  13354. return nil, &googleapi.Error{
  13355. Code: res.StatusCode,
  13356. Header: res.Header,
  13357. }
  13358. }
  13359. if err != nil {
  13360. return nil, err
  13361. }
  13362. defer googleapi.CloseBody(res)
  13363. if err := googleapi.CheckResponse(res); err != nil {
  13364. return nil, err
  13365. }
  13366. ret := &RemarketingAudience{
  13367. ServerResponse: googleapi.ServerResponse{
  13368. Header: res.Header,
  13369. HTTPStatusCode: res.StatusCode,
  13370. },
  13371. }
  13372. target := &ret
  13373. if err := gensupport.DecodeResponse(target, res); err != nil {
  13374. return nil, err
  13375. }
  13376. return ret, nil
  13377. // {
  13378. // "description": "Gets a remarketing audience to which the user has access.",
  13379. // "httpMethod": "GET",
  13380. // "id": "analytics.management.remarketingAudience.get",
  13381. // "parameterOrder": [
  13382. // "accountId",
  13383. // "webPropertyId",
  13384. // "remarketingAudienceId"
  13385. // ],
  13386. // "parameters": {
  13387. // "accountId": {
  13388. // "description": "The account ID of the remarketing audience to retrieve.",
  13389. // "location": "path",
  13390. // "required": true,
  13391. // "type": "string"
  13392. // },
  13393. // "remarketingAudienceId": {
  13394. // "description": "The ID of the remarketing audience to retrieve.",
  13395. // "location": "path",
  13396. // "required": true,
  13397. // "type": "string"
  13398. // },
  13399. // "webPropertyId": {
  13400. // "description": "The web property ID of the remarketing audience to retrieve.",
  13401. // "location": "path",
  13402. // "required": true,
  13403. // "type": "string"
  13404. // }
  13405. // },
  13406. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13407. // "response": {
  13408. // "$ref": "RemarketingAudience"
  13409. // },
  13410. // "scopes": [
  13411. // "https://www.googleapis.com/auth/analytics.edit",
  13412. // "https://www.googleapis.com/auth/analytics.readonly"
  13413. // ]
  13414. // }
  13415. }
  13416. // method id "analytics.management.remarketingAudience.insert":
  13417. type ManagementRemarketingAudienceInsertCall struct {
  13418. s *Service
  13419. accountId string
  13420. webPropertyId string
  13421. remarketingaudience *RemarketingAudience
  13422. urlParams_ gensupport.URLParams
  13423. ctx_ context.Context
  13424. header_ http.Header
  13425. }
  13426. // Insert: Creates a new remarketing audience.
  13427. func (r *ManagementRemarketingAudienceService) Insert(accountId string, webPropertyId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudienceInsertCall {
  13428. c := &ManagementRemarketingAudienceInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13429. c.accountId = accountId
  13430. c.webPropertyId = webPropertyId
  13431. c.remarketingaudience = remarketingaudience
  13432. return c
  13433. }
  13434. // Fields allows partial responses to be retrieved. See
  13435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13436. // for more information.
  13437. func (c *ManagementRemarketingAudienceInsertCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceInsertCall {
  13438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13439. return c
  13440. }
  13441. // Context sets the context to be used in this call's Do method. Any
  13442. // pending HTTP request will be aborted if the provided context is
  13443. // canceled.
  13444. func (c *ManagementRemarketingAudienceInsertCall) Context(ctx context.Context) *ManagementRemarketingAudienceInsertCall {
  13445. c.ctx_ = ctx
  13446. return c
  13447. }
  13448. // Header returns an http.Header that can be modified by the caller to
  13449. // add HTTP headers to the request.
  13450. func (c *ManagementRemarketingAudienceInsertCall) Header() http.Header {
  13451. if c.header_ == nil {
  13452. c.header_ = make(http.Header)
  13453. }
  13454. return c.header_
  13455. }
  13456. func (c *ManagementRemarketingAudienceInsertCall) doRequest(alt string) (*http.Response, error) {
  13457. reqHeaders := make(http.Header)
  13458. for k, v := range c.header_ {
  13459. reqHeaders[k] = v
  13460. }
  13461. reqHeaders.Set("User-Agent", c.s.userAgent())
  13462. var body io.Reader = nil
  13463. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13464. if err != nil {
  13465. return nil, err
  13466. }
  13467. reqHeaders.Set("Content-Type", "application/json")
  13468. c.urlParams_.Set("alt", alt)
  13469. c.urlParams_.Set("prettyPrint", "false")
  13470. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences")
  13471. urls += "?" + c.urlParams_.Encode()
  13472. req, err := http.NewRequest("POST", urls, body)
  13473. if err != nil {
  13474. return nil, err
  13475. }
  13476. req.Header = reqHeaders
  13477. googleapi.Expand(req.URL, map[string]string{
  13478. "accountId": c.accountId,
  13479. "webPropertyId": c.webPropertyId,
  13480. })
  13481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13482. }
  13483. // Do executes the "analytics.management.remarketingAudience.insert" call.
  13484. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13485. // non-2xx status code is an error. Response headers are in either
  13486. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13487. // returned at all) in error.(*googleapi.Error).Header. Use
  13488. // googleapi.IsNotModified to check whether the returned error was
  13489. // because http.StatusNotModified was returned.
  13490. func (c *ManagementRemarketingAudienceInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13491. gensupport.SetOptions(c.urlParams_, opts...)
  13492. res, err := c.doRequest("json")
  13493. if res != nil && res.StatusCode == http.StatusNotModified {
  13494. if res.Body != nil {
  13495. res.Body.Close()
  13496. }
  13497. return nil, &googleapi.Error{
  13498. Code: res.StatusCode,
  13499. Header: res.Header,
  13500. }
  13501. }
  13502. if err != nil {
  13503. return nil, err
  13504. }
  13505. defer googleapi.CloseBody(res)
  13506. if err := googleapi.CheckResponse(res); err != nil {
  13507. return nil, err
  13508. }
  13509. ret := &RemarketingAudience{
  13510. ServerResponse: googleapi.ServerResponse{
  13511. Header: res.Header,
  13512. HTTPStatusCode: res.StatusCode,
  13513. },
  13514. }
  13515. target := &ret
  13516. if err := gensupport.DecodeResponse(target, res); err != nil {
  13517. return nil, err
  13518. }
  13519. return ret, nil
  13520. // {
  13521. // "description": "Creates a new remarketing audience.",
  13522. // "httpMethod": "POST",
  13523. // "id": "analytics.management.remarketingAudience.insert",
  13524. // "parameterOrder": [
  13525. // "accountId",
  13526. // "webPropertyId"
  13527. // ],
  13528. // "parameters": {
  13529. // "accountId": {
  13530. // "description": "The account ID for which to create the remarketing audience.",
  13531. // "location": "path",
  13532. // "required": true,
  13533. // "type": "string"
  13534. // },
  13535. // "webPropertyId": {
  13536. // "description": "Web property ID for which to create the remarketing audience.",
  13537. // "location": "path",
  13538. // "required": true,
  13539. // "type": "string"
  13540. // }
  13541. // },
  13542. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences",
  13543. // "request": {
  13544. // "$ref": "RemarketingAudience"
  13545. // },
  13546. // "response": {
  13547. // "$ref": "RemarketingAudience"
  13548. // },
  13549. // "scopes": [
  13550. // "https://www.googleapis.com/auth/analytics.edit"
  13551. // ]
  13552. // }
  13553. }
  13554. // method id "analytics.management.remarketingAudience.list":
  13555. type ManagementRemarketingAudienceListCall struct {
  13556. s *Service
  13557. accountId string
  13558. webPropertyId string
  13559. urlParams_ gensupport.URLParams
  13560. ifNoneMatch_ string
  13561. ctx_ context.Context
  13562. header_ http.Header
  13563. }
  13564. // List: Lists remarketing audiences to which the user has access.
  13565. func (r *ManagementRemarketingAudienceService) List(accountId string, webPropertyId string) *ManagementRemarketingAudienceListCall {
  13566. c := &ManagementRemarketingAudienceListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13567. c.accountId = accountId
  13568. c.webPropertyId = webPropertyId
  13569. return c
  13570. }
  13571. // MaxResults sets the optional parameter "max-results": The maximum
  13572. // number of remarketing audiences to include in this response.
  13573. func (c *ManagementRemarketingAudienceListCall) MaxResults(maxResults int64) *ManagementRemarketingAudienceListCall {
  13574. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  13575. return c
  13576. }
  13577. // StartIndex sets the optional parameter "start-index": An index of the
  13578. // first entity to retrieve. Use this parameter as a pagination
  13579. // mechanism along with the max-results parameter.
  13580. func (c *ManagementRemarketingAudienceListCall) StartIndex(startIndex int64) *ManagementRemarketingAudienceListCall {
  13581. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  13582. return c
  13583. }
  13584. // Type sets the optional parameter "type":
  13585. func (c *ManagementRemarketingAudienceListCall) Type(type_ string) *ManagementRemarketingAudienceListCall {
  13586. c.urlParams_.Set("type", type_)
  13587. return c
  13588. }
  13589. // Fields allows partial responses to be retrieved. See
  13590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13591. // for more information.
  13592. func (c *ManagementRemarketingAudienceListCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceListCall {
  13593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13594. return c
  13595. }
  13596. // IfNoneMatch sets the optional parameter which makes the operation
  13597. // fail if the object's ETag matches the given value. This is useful for
  13598. // getting updates only after the object has changed since the last
  13599. // request. Use googleapi.IsNotModified to check whether the response
  13600. // error from Do is the result of In-None-Match.
  13601. func (c *ManagementRemarketingAudienceListCall) IfNoneMatch(entityTag string) *ManagementRemarketingAudienceListCall {
  13602. c.ifNoneMatch_ = entityTag
  13603. return c
  13604. }
  13605. // Context sets the context to be used in this call's Do method. Any
  13606. // pending HTTP request will be aborted if the provided context is
  13607. // canceled.
  13608. func (c *ManagementRemarketingAudienceListCall) Context(ctx context.Context) *ManagementRemarketingAudienceListCall {
  13609. c.ctx_ = ctx
  13610. return c
  13611. }
  13612. // Header returns an http.Header that can be modified by the caller to
  13613. // add HTTP headers to the request.
  13614. func (c *ManagementRemarketingAudienceListCall) Header() http.Header {
  13615. if c.header_ == nil {
  13616. c.header_ = make(http.Header)
  13617. }
  13618. return c.header_
  13619. }
  13620. func (c *ManagementRemarketingAudienceListCall) doRequest(alt string) (*http.Response, error) {
  13621. reqHeaders := make(http.Header)
  13622. for k, v := range c.header_ {
  13623. reqHeaders[k] = v
  13624. }
  13625. reqHeaders.Set("User-Agent", c.s.userAgent())
  13626. if c.ifNoneMatch_ != "" {
  13627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13628. }
  13629. var body io.Reader = nil
  13630. c.urlParams_.Set("alt", alt)
  13631. c.urlParams_.Set("prettyPrint", "false")
  13632. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences")
  13633. urls += "?" + c.urlParams_.Encode()
  13634. req, err := http.NewRequest("GET", urls, body)
  13635. if err != nil {
  13636. return nil, err
  13637. }
  13638. req.Header = reqHeaders
  13639. googleapi.Expand(req.URL, map[string]string{
  13640. "accountId": c.accountId,
  13641. "webPropertyId": c.webPropertyId,
  13642. })
  13643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13644. }
  13645. // Do executes the "analytics.management.remarketingAudience.list" call.
  13646. // Exactly one of *RemarketingAudiences or error will be non-nil. Any
  13647. // non-2xx status code is an error. Response headers are in either
  13648. // *RemarketingAudiences.ServerResponse.Header or (if a response was
  13649. // returned at all) in error.(*googleapi.Error).Header. Use
  13650. // googleapi.IsNotModified to check whether the returned error was
  13651. // because http.StatusNotModified was returned.
  13652. func (c *ManagementRemarketingAudienceListCall) Do(opts ...googleapi.CallOption) (*RemarketingAudiences, error) {
  13653. gensupport.SetOptions(c.urlParams_, opts...)
  13654. res, err := c.doRequest("json")
  13655. if res != nil && res.StatusCode == http.StatusNotModified {
  13656. if res.Body != nil {
  13657. res.Body.Close()
  13658. }
  13659. return nil, &googleapi.Error{
  13660. Code: res.StatusCode,
  13661. Header: res.Header,
  13662. }
  13663. }
  13664. if err != nil {
  13665. return nil, err
  13666. }
  13667. defer googleapi.CloseBody(res)
  13668. if err := googleapi.CheckResponse(res); err != nil {
  13669. return nil, err
  13670. }
  13671. ret := &RemarketingAudiences{
  13672. ServerResponse: googleapi.ServerResponse{
  13673. Header: res.Header,
  13674. HTTPStatusCode: res.StatusCode,
  13675. },
  13676. }
  13677. target := &ret
  13678. if err := gensupport.DecodeResponse(target, res); err != nil {
  13679. return nil, err
  13680. }
  13681. return ret, nil
  13682. // {
  13683. // "description": "Lists remarketing audiences to which the user has access.",
  13684. // "httpMethod": "GET",
  13685. // "id": "analytics.management.remarketingAudience.list",
  13686. // "parameterOrder": [
  13687. // "accountId",
  13688. // "webPropertyId"
  13689. // ],
  13690. // "parameters": {
  13691. // "accountId": {
  13692. // "description": "The account ID of the remarketing audiences to retrieve.",
  13693. // "location": "path",
  13694. // "required": true,
  13695. // "type": "string"
  13696. // },
  13697. // "max-results": {
  13698. // "description": "The maximum number of remarketing audiences to include in this response.",
  13699. // "format": "int32",
  13700. // "location": "query",
  13701. // "type": "integer"
  13702. // },
  13703. // "start-index": {
  13704. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  13705. // "format": "int32",
  13706. // "location": "query",
  13707. // "minimum": "1",
  13708. // "type": "integer"
  13709. // },
  13710. // "type": {
  13711. // "default": "all",
  13712. // "location": "query",
  13713. // "type": "string"
  13714. // },
  13715. // "webPropertyId": {
  13716. // "description": "The web property ID of the remarketing audiences to retrieve.",
  13717. // "location": "path",
  13718. // "required": true,
  13719. // "type": "string"
  13720. // }
  13721. // },
  13722. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences",
  13723. // "response": {
  13724. // "$ref": "RemarketingAudiences"
  13725. // },
  13726. // "scopes": [
  13727. // "https://www.googleapis.com/auth/analytics.edit",
  13728. // "https://www.googleapis.com/auth/analytics.readonly"
  13729. // ]
  13730. // }
  13731. }
  13732. // method id "analytics.management.remarketingAudience.patch":
  13733. type ManagementRemarketingAudiencePatchCall struct {
  13734. s *Service
  13735. accountId string
  13736. webPropertyId string
  13737. remarketingAudienceId string
  13738. remarketingaudience *RemarketingAudience
  13739. urlParams_ gensupport.URLParams
  13740. ctx_ context.Context
  13741. header_ http.Header
  13742. }
  13743. // Patch: Updates an existing remarketing audience. This method supports
  13744. // patch semantics.
  13745. func (r *ManagementRemarketingAudienceService) Patch(accountId string, webPropertyId string, remarketingAudienceId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudiencePatchCall {
  13746. c := &ManagementRemarketingAudiencePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13747. c.accountId = accountId
  13748. c.webPropertyId = webPropertyId
  13749. c.remarketingAudienceId = remarketingAudienceId
  13750. c.remarketingaudience = remarketingaudience
  13751. return c
  13752. }
  13753. // Fields allows partial responses to be retrieved. See
  13754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13755. // for more information.
  13756. func (c *ManagementRemarketingAudiencePatchCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudiencePatchCall {
  13757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13758. return c
  13759. }
  13760. // Context sets the context to be used in this call's Do method. Any
  13761. // pending HTTP request will be aborted if the provided context is
  13762. // canceled.
  13763. func (c *ManagementRemarketingAudiencePatchCall) Context(ctx context.Context) *ManagementRemarketingAudiencePatchCall {
  13764. c.ctx_ = ctx
  13765. return c
  13766. }
  13767. // Header returns an http.Header that can be modified by the caller to
  13768. // add HTTP headers to the request.
  13769. func (c *ManagementRemarketingAudiencePatchCall) Header() http.Header {
  13770. if c.header_ == nil {
  13771. c.header_ = make(http.Header)
  13772. }
  13773. return c.header_
  13774. }
  13775. func (c *ManagementRemarketingAudiencePatchCall) doRequest(alt string) (*http.Response, error) {
  13776. reqHeaders := make(http.Header)
  13777. for k, v := range c.header_ {
  13778. reqHeaders[k] = v
  13779. }
  13780. reqHeaders.Set("User-Agent", c.s.userAgent())
  13781. var body io.Reader = nil
  13782. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13783. if err != nil {
  13784. return nil, err
  13785. }
  13786. reqHeaders.Set("Content-Type", "application/json")
  13787. c.urlParams_.Set("alt", alt)
  13788. c.urlParams_.Set("prettyPrint", "false")
  13789. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13790. urls += "?" + c.urlParams_.Encode()
  13791. req, err := http.NewRequest("PATCH", urls, body)
  13792. if err != nil {
  13793. return nil, err
  13794. }
  13795. req.Header = reqHeaders
  13796. googleapi.Expand(req.URL, map[string]string{
  13797. "accountId": c.accountId,
  13798. "webPropertyId": c.webPropertyId,
  13799. "remarketingAudienceId": c.remarketingAudienceId,
  13800. })
  13801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13802. }
  13803. // Do executes the "analytics.management.remarketingAudience.patch" call.
  13804. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13805. // non-2xx status code is an error. Response headers are in either
  13806. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13807. // returned at all) in error.(*googleapi.Error).Header. Use
  13808. // googleapi.IsNotModified to check whether the returned error was
  13809. // because http.StatusNotModified was returned.
  13810. func (c *ManagementRemarketingAudiencePatchCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13811. gensupport.SetOptions(c.urlParams_, opts...)
  13812. res, err := c.doRequest("json")
  13813. if res != nil && res.StatusCode == http.StatusNotModified {
  13814. if res.Body != nil {
  13815. res.Body.Close()
  13816. }
  13817. return nil, &googleapi.Error{
  13818. Code: res.StatusCode,
  13819. Header: res.Header,
  13820. }
  13821. }
  13822. if err != nil {
  13823. return nil, err
  13824. }
  13825. defer googleapi.CloseBody(res)
  13826. if err := googleapi.CheckResponse(res); err != nil {
  13827. return nil, err
  13828. }
  13829. ret := &RemarketingAudience{
  13830. ServerResponse: googleapi.ServerResponse{
  13831. Header: res.Header,
  13832. HTTPStatusCode: res.StatusCode,
  13833. },
  13834. }
  13835. target := &ret
  13836. if err := gensupport.DecodeResponse(target, res); err != nil {
  13837. return nil, err
  13838. }
  13839. return ret, nil
  13840. // {
  13841. // "description": "Updates an existing remarketing audience. This method supports patch semantics.",
  13842. // "httpMethod": "PATCH",
  13843. // "id": "analytics.management.remarketingAudience.patch",
  13844. // "parameterOrder": [
  13845. // "accountId",
  13846. // "webPropertyId",
  13847. // "remarketingAudienceId"
  13848. // ],
  13849. // "parameters": {
  13850. // "accountId": {
  13851. // "description": "The account ID of the remarketing audience to update.",
  13852. // "location": "path",
  13853. // "required": true,
  13854. // "type": "string"
  13855. // },
  13856. // "remarketingAudienceId": {
  13857. // "description": "The ID of the remarketing audience to update.",
  13858. // "location": "path",
  13859. // "required": true,
  13860. // "type": "string"
  13861. // },
  13862. // "webPropertyId": {
  13863. // "description": "The web property ID of the remarketing audience to update.",
  13864. // "location": "path",
  13865. // "required": true,
  13866. // "type": "string"
  13867. // }
  13868. // },
  13869. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13870. // "request": {
  13871. // "$ref": "RemarketingAudience"
  13872. // },
  13873. // "response": {
  13874. // "$ref": "RemarketingAudience"
  13875. // },
  13876. // "scopes": [
  13877. // "https://www.googleapis.com/auth/analytics.edit"
  13878. // ]
  13879. // }
  13880. }
  13881. // method id "analytics.management.remarketingAudience.update":
  13882. type ManagementRemarketingAudienceUpdateCall struct {
  13883. s *Service
  13884. accountId string
  13885. webPropertyId string
  13886. remarketingAudienceId string
  13887. remarketingaudience *RemarketingAudience
  13888. urlParams_ gensupport.URLParams
  13889. ctx_ context.Context
  13890. header_ http.Header
  13891. }
  13892. // Update: Updates an existing remarketing audience.
  13893. func (r *ManagementRemarketingAudienceService) Update(accountId string, webPropertyId string, remarketingAudienceId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudienceUpdateCall {
  13894. c := &ManagementRemarketingAudienceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13895. c.accountId = accountId
  13896. c.webPropertyId = webPropertyId
  13897. c.remarketingAudienceId = remarketingAudienceId
  13898. c.remarketingaudience = remarketingaudience
  13899. return c
  13900. }
  13901. // Fields allows partial responses to be retrieved. See
  13902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13903. // for more information.
  13904. func (c *ManagementRemarketingAudienceUpdateCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceUpdateCall {
  13905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13906. return c
  13907. }
  13908. // Context sets the context to be used in this call's Do method. Any
  13909. // pending HTTP request will be aborted if the provided context is
  13910. // canceled.
  13911. func (c *ManagementRemarketingAudienceUpdateCall) Context(ctx context.Context) *ManagementRemarketingAudienceUpdateCall {
  13912. c.ctx_ = ctx
  13913. return c
  13914. }
  13915. // Header returns an http.Header that can be modified by the caller to
  13916. // add HTTP headers to the request.
  13917. func (c *ManagementRemarketingAudienceUpdateCall) Header() http.Header {
  13918. if c.header_ == nil {
  13919. c.header_ = make(http.Header)
  13920. }
  13921. return c.header_
  13922. }
  13923. func (c *ManagementRemarketingAudienceUpdateCall) doRequest(alt string) (*http.Response, error) {
  13924. reqHeaders := make(http.Header)
  13925. for k, v := range c.header_ {
  13926. reqHeaders[k] = v
  13927. }
  13928. reqHeaders.Set("User-Agent", c.s.userAgent())
  13929. var body io.Reader = nil
  13930. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13931. if err != nil {
  13932. return nil, err
  13933. }
  13934. reqHeaders.Set("Content-Type", "application/json")
  13935. c.urlParams_.Set("alt", alt)
  13936. c.urlParams_.Set("prettyPrint", "false")
  13937. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13938. urls += "?" + c.urlParams_.Encode()
  13939. req, err := http.NewRequest("PUT", urls, body)
  13940. if err != nil {
  13941. return nil, err
  13942. }
  13943. req.Header = reqHeaders
  13944. googleapi.Expand(req.URL, map[string]string{
  13945. "accountId": c.accountId,
  13946. "webPropertyId": c.webPropertyId,
  13947. "remarketingAudienceId": c.remarketingAudienceId,
  13948. })
  13949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13950. }
  13951. // Do executes the "analytics.management.remarketingAudience.update" call.
  13952. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13953. // non-2xx status code is an error. Response headers are in either
  13954. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13955. // returned at all) in error.(*googleapi.Error).Header. Use
  13956. // googleapi.IsNotModified to check whether the returned error was
  13957. // because http.StatusNotModified was returned.
  13958. func (c *ManagementRemarketingAudienceUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13959. gensupport.SetOptions(c.urlParams_, opts...)
  13960. res, err := c.doRequest("json")
  13961. if res != nil && res.StatusCode == http.StatusNotModified {
  13962. if res.Body != nil {
  13963. res.Body.Close()
  13964. }
  13965. return nil, &googleapi.Error{
  13966. Code: res.StatusCode,
  13967. Header: res.Header,
  13968. }
  13969. }
  13970. if err != nil {
  13971. return nil, err
  13972. }
  13973. defer googleapi.CloseBody(res)
  13974. if err := googleapi.CheckResponse(res); err != nil {
  13975. return nil, err
  13976. }
  13977. ret := &RemarketingAudience{
  13978. ServerResponse: googleapi.ServerResponse{
  13979. Header: res.Header,
  13980. HTTPStatusCode: res.StatusCode,
  13981. },
  13982. }
  13983. target := &ret
  13984. if err := gensupport.DecodeResponse(target, res); err != nil {
  13985. return nil, err
  13986. }
  13987. return ret, nil
  13988. // {
  13989. // "description": "Updates an existing remarketing audience.",
  13990. // "httpMethod": "PUT",
  13991. // "id": "analytics.management.remarketingAudience.update",
  13992. // "parameterOrder": [
  13993. // "accountId",
  13994. // "webPropertyId",
  13995. // "remarketingAudienceId"
  13996. // ],
  13997. // "parameters": {
  13998. // "accountId": {
  13999. // "description": "The account ID of the remarketing audience to update.",
  14000. // "location": "path",
  14001. // "required": true,
  14002. // "type": "string"
  14003. // },
  14004. // "remarketingAudienceId": {
  14005. // "description": "The ID of the remarketing audience to update.",
  14006. // "location": "path",
  14007. // "required": true,
  14008. // "type": "string"
  14009. // },
  14010. // "webPropertyId": {
  14011. // "description": "The web property ID of the remarketing audience to update.",
  14012. // "location": "path",
  14013. // "required": true,
  14014. // "type": "string"
  14015. // }
  14016. // },
  14017. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  14018. // "request": {
  14019. // "$ref": "RemarketingAudience"
  14020. // },
  14021. // "response": {
  14022. // "$ref": "RemarketingAudience"
  14023. // },
  14024. // "scopes": [
  14025. // "https://www.googleapis.com/auth/analytics.edit"
  14026. // ]
  14027. // }
  14028. }
  14029. // method id "analytics.management.segments.list":
  14030. type ManagementSegmentsListCall struct {
  14031. s *Service
  14032. urlParams_ gensupport.URLParams
  14033. ifNoneMatch_ string
  14034. ctx_ context.Context
  14035. header_ http.Header
  14036. }
  14037. // List: Lists segments to which the user has access.
  14038. func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall {
  14039. c := &ManagementSegmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14040. return c
  14041. }
  14042. // MaxResults sets the optional parameter "max-results": The maximum
  14043. // number of segments to include in this response.
  14044. func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall {
  14045. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  14046. return c
  14047. }
  14048. // StartIndex sets the optional parameter "start-index": An index of the
  14049. // first segment to retrieve. Use this parameter as a pagination
  14050. // mechanism along with the max-results parameter.
  14051. func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall {
  14052. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  14053. return c
  14054. }
  14055. // Fields allows partial responses to be retrieved. See
  14056. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14057. // for more information.
  14058. func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall {
  14059. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14060. return c
  14061. }
  14062. // IfNoneMatch sets the optional parameter which makes the operation
  14063. // fail if the object's ETag matches the given value. This is useful for
  14064. // getting updates only after the object has changed since the last
  14065. // request. Use googleapi.IsNotModified to check whether the response
  14066. // error from Do is the result of In-None-Match.
  14067. func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall {
  14068. c.ifNoneMatch_ = entityTag
  14069. return c
  14070. }
  14071. // Context sets the context to be used in this call's Do method. Any
  14072. // pending HTTP request will be aborted if the provided context is
  14073. // canceled.
  14074. func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall {
  14075. c.ctx_ = ctx
  14076. return c
  14077. }
  14078. // Header returns an http.Header that can be modified by the caller to
  14079. // add HTTP headers to the request.
  14080. func (c *ManagementSegmentsListCall) Header() http.Header {
  14081. if c.header_ == nil {
  14082. c.header_ = make(http.Header)
  14083. }
  14084. return c.header_
  14085. }
  14086. func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, error) {
  14087. reqHeaders := make(http.Header)
  14088. for k, v := range c.header_ {
  14089. reqHeaders[k] = v
  14090. }
  14091. reqHeaders.Set("User-Agent", c.s.userAgent())
  14092. if c.ifNoneMatch_ != "" {
  14093. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14094. }
  14095. var body io.Reader = nil
  14096. c.urlParams_.Set("alt", alt)
  14097. c.urlParams_.Set("prettyPrint", "false")
  14098. urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments")
  14099. urls += "?" + c.urlParams_.Encode()
  14100. req, err := http.NewRequest("GET", urls, body)
  14101. if err != nil {
  14102. return nil, err
  14103. }
  14104. req.Header = reqHeaders
  14105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14106. }
  14107. // Do executes the "analytics.management.segments.list" call.
  14108. // Exactly one of *Segments or error will be non-nil. Any non-2xx status
  14109. // code is an error. Response headers are in either
  14110. // *Segments.ServerResponse.Header or (if a response was returned at
  14111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14112. // to check whether the returned error was because
  14113. // http.StatusNotModified was returned.
  14114. func (c *ManagementSegmentsListCall) Do(opts ...googleapi.CallOption) (*Segments, error) {
  14115. gensupport.SetOptions(c.urlParams_, opts...)
  14116. res, err := c.doRequest("json")
  14117. if res != nil && res.StatusCode == http.StatusNotModified {
  14118. if res.Body != nil {
  14119. res.Body.Close()
  14120. }
  14121. return nil, &googleapi.Error{
  14122. Code: res.StatusCode,
  14123. Header: res.Header,
  14124. }
  14125. }
  14126. if err != nil {
  14127. return nil, err
  14128. }
  14129. defer googleapi.CloseBody(res)
  14130. if err := googleapi.CheckResponse(res); err != nil {
  14131. return nil, err
  14132. }
  14133. ret := &Segments{
  14134. ServerResponse: googleapi.ServerResponse{
  14135. Header: res.Header,
  14136. HTTPStatusCode: res.StatusCode,
  14137. },
  14138. }
  14139. target := &ret
  14140. if err := gensupport.DecodeResponse(target, res); err != nil {
  14141. return nil, err
  14142. }
  14143. return ret, nil
  14144. // {
  14145. // "description": "Lists segments to which the user has access.",
  14146. // "httpMethod": "GET",
  14147. // "id": "analytics.management.segments.list",
  14148. // "parameters": {
  14149. // "max-results": {
  14150. // "description": "The maximum number of segments to include in this response.",
  14151. // "format": "int32",
  14152. // "location": "query",
  14153. // "type": "integer"
  14154. // },
  14155. // "start-index": {
  14156. // "description": "An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  14157. // "format": "int32",
  14158. // "location": "query",
  14159. // "minimum": "1",
  14160. // "type": "integer"
  14161. // }
  14162. // },
  14163. // "path": "management/segments",
  14164. // "response": {
  14165. // "$ref": "Segments"
  14166. // },
  14167. // "scopes": [
  14168. // "https://www.googleapis.com/auth/analytics",
  14169. // "https://www.googleapis.com/auth/analytics.edit",
  14170. // "https://www.googleapis.com/auth/analytics.readonly"
  14171. // ]
  14172. // }
  14173. }
  14174. // method id "analytics.management.unsampledReports.delete":
  14175. type ManagementUnsampledReportsDeleteCall struct {
  14176. s *Service
  14177. accountId string
  14178. webPropertyId string
  14179. profileId string
  14180. unsampledReportId string
  14181. urlParams_ gensupport.URLParams
  14182. ctx_ context.Context
  14183. header_ http.Header
  14184. }
  14185. // Delete: Deletes an unsampled report.
  14186. func (r *ManagementUnsampledReportsService) Delete(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsDeleteCall {
  14187. c := &ManagementUnsampledReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14188. c.accountId = accountId
  14189. c.webPropertyId = webPropertyId
  14190. c.profileId = profileId
  14191. c.unsampledReportId = unsampledReportId
  14192. return c
  14193. }
  14194. // Fields allows partial responses to be retrieved. See
  14195. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14196. // for more information.
  14197. func (c *ManagementUnsampledReportsDeleteCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsDeleteCall {
  14198. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14199. return c
  14200. }
  14201. // Context sets the context to be used in this call's Do method. Any
  14202. // pending HTTP request will be aborted if the provided context is
  14203. // canceled.
  14204. func (c *ManagementUnsampledReportsDeleteCall) Context(ctx context.Context) *ManagementUnsampledReportsDeleteCall {
  14205. c.ctx_ = ctx
  14206. return c
  14207. }
  14208. // Header returns an http.Header that can be modified by the caller to
  14209. // add HTTP headers to the request.
  14210. func (c *ManagementUnsampledReportsDeleteCall) Header() http.Header {
  14211. if c.header_ == nil {
  14212. c.header_ = make(http.Header)
  14213. }
  14214. return c.header_
  14215. }
  14216. func (c *ManagementUnsampledReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14217. reqHeaders := make(http.Header)
  14218. for k, v := range c.header_ {
  14219. reqHeaders[k] = v
  14220. }
  14221. reqHeaders.Set("User-Agent", c.s.userAgent())
  14222. var body io.Reader = nil
  14223. c.urlParams_.Set("alt", alt)
  14224. c.urlParams_.Set("prettyPrint", "false")
  14225. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  14226. urls += "?" + c.urlParams_.Encode()
  14227. req, err := http.NewRequest("DELETE", urls, body)
  14228. if err != nil {
  14229. return nil, err
  14230. }
  14231. req.Header = reqHeaders
  14232. googleapi.Expand(req.URL, map[string]string{
  14233. "accountId": c.accountId,
  14234. "webPropertyId": c.webPropertyId,
  14235. "profileId": c.profileId,
  14236. "unsampledReportId": c.unsampledReportId,
  14237. })
  14238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14239. }
  14240. // Do executes the "analytics.management.unsampledReports.delete" call.
  14241. func (c *ManagementUnsampledReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14242. gensupport.SetOptions(c.urlParams_, opts...)
  14243. res, err := c.doRequest("json")
  14244. if err != nil {
  14245. return err
  14246. }
  14247. defer googleapi.CloseBody(res)
  14248. if err := googleapi.CheckResponse(res); err != nil {
  14249. return err
  14250. }
  14251. return nil
  14252. // {
  14253. // "description": "Deletes an unsampled report.",
  14254. // "httpMethod": "DELETE",
  14255. // "id": "analytics.management.unsampledReports.delete",
  14256. // "parameterOrder": [
  14257. // "accountId",
  14258. // "webPropertyId",
  14259. // "profileId",
  14260. // "unsampledReportId"
  14261. // ],
  14262. // "parameters": {
  14263. // "accountId": {
  14264. // "description": "Account ID to delete the unsampled report for.",
  14265. // "location": "path",
  14266. // "required": true,
  14267. // "type": "string"
  14268. // },
  14269. // "profileId": {
  14270. // "description": "View (Profile) ID to delete the unsampled report for.",
  14271. // "location": "path",
  14272. // "required": true,
  14273. // "type": "string"
  14274. // },
  14275. // "unsampledReportId": {
  14276. // "description": "ID of the unsampled report to be deleted.",
  14277. // "location": "path",
  14278. // "required": true,
  14279. // "type": "string"
  14280. // },
  14281. // "webPropertyId": {
  14282. // "description": "Web property ID to delete the unsampled reports for.",
  14283. // "location": "path",
  14284. // "required": true,
  14285. // "type": "string"
  14286. // }
  14287. // },
  14288. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  14289. // "scopes": [
  14290. // "https://www.googleapis.com/auth/analytics.edit"
  14291. // ]
  14292. // }
  14293. }
  14294. // method id "analytics.management.unsampledReports.get":
  14295. type ManagementUnsampledReportsGetCall struct {
  14296. s *Service
  14297. accountId string
  14298. webPropertyId string
  14299. profileId string
  14300. unsampledReportId string
  14301. urlParams_ gensupport.URLParams
  14302. ifNoneMatch_ string
  14303. ctx_ context.Context
  14304. header_ http.Header
  14305. }
  14306. // Get: Returns a single unsampled report.
  14307. func (r *ManagementUnsampledReportsService) Get(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsGetCall {
  14308. c := &ManagementUnsampledReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14309. c.accountId = accountId
  14310. c.webPropertyId = webPropertyId
  14311. c.profileId = profileId
  14312. c.unsampledReportId = unsampledReportId
  14313. return c
  14314. }
  14315. // Fields allows partial responses to be retrieved. See
  14316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14317. // for more information.
  14318. func (c *ManagementUnsampledReportsGetCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsGetCall {
  14319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14320. return c
  14321. }
  14322. // IfNoneMatch sets the optional parameter which makes the operation
  14323. // fail if the object's ETag matches the given value. This is useful for
  14324. // getting updates only after the object has changed since the last
  14325. // request. Use googleapi.IsNotModified to check whether the response
  14326. // error from Do is the result of In-None-Match.
  14327. func (c *ManagementUnsampledReportsGetCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsGetCall {
  14328. c.ifNoneMatch_ = entityTag
  14329. return c
  14330. }
  14331. // Context sets the context to be used in this call's Do method. Any
  14332. // pending HTTP request will be aborted if the provided context is
  14333. // canceled.
  14334. func (c *ManagementUnsampledReportsGetCall) Context(ctx context.Context) *ManagementUnsampledReportsGetCall {
  14335. c.ctx_ = ctx
  14336. return c
  14337. }
  14338. // Header returns an http.Header that can be modified by the caller to
  14339. // add HTTP headers to the request.
  14340. func (c *ManagementUnsampledReportsGetCall) Header() http.Header {
  14341. if c.header_ == nil {
  14342. c.header_ = make(http.Header)
  14343. }
  14344. return c.header_
  14345. }
  14346. func (c *ManagementUnsampledReportsGetCall) doRequest(alt string) (*http.Response, error) {
  14347. reqHeaders := make(http.Header)
  14348. for k, v := range c.header_ {
  14349. reqHeaders[k] = v
  14350. }
  14351. reqHeaders.Set("User-Agent", c.s.userAgent())
  14352. if c.ifNoneMatch_ != "" {
  14353. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14354. }
  14355. var body io.Reader = nil
  14356. c.urlParams_.Set("alt", alt)
  14357. c.urlParams_.Set("prettyPrint", "false")
  14358. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  14359. urls += "?" + c.urlParams_.Encode()
  14360. req, err := http.NewRequest("GET", urls, body)
  14361. if err != nil {
  14362. return nil, err
  14363. }
  14364. req.Header = reqHeaders
  14365. googleapi.Expand(req.URL, map[string]string{
  14366. "accountId": c.accountId,
  14367. "webPropertyId": c.webPropertyId,
  14368. "profileId": c.profileId,
  14369. "unsampledReportId": c.unsampledReportId,
  14370. })
  14371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14372. }
  14373. // Do executes the "analytics.management.unsampledReports.get" call.
  14374. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  14375. // status code is an error. Response headers are in either
  14376. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  14377. // at all) in error.(*googleapi.Error).Header. Use
  14378. // googleapi.IsNotModified to check whether the returned error was
  14379. // because http.StatusNotModified was returned.
  14380. func (c *ManagementUnsampledReportsGetCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  14381. gensupport.SetOptions(c.urlParams_, opts...)
  14382. res, err := c.doRequest("json")
  14383. if res != nil && res.StatusCode == http.StatusNotModified {
  14384. if res.Body != nil {
  14385. res.Body.Close()
  14386. }
  14387. return nil, &googleapi.Error{
  14388. Code: res.StatusCode,
  14389. Header: res.Header,
  14390. }
  14391. }
  14392. if err != nil {
  14393. return nil, err
  14394. }
  14395. defer googleapi.CloseBody(res)
  14396. if err := googleapi.CheckResponse(res); err != nil {
  14397. return nil, err
  14398. }
  14399. ret := &UnsampledReport{
  14400. ServerResponse: googleapi.ServerResponse{
  14401. Header: res.Header,
  14402. HTTPStatusCode: res.StatusCode,
  14403. },
  14404. }
  14405. target := &ret
  14406. if err := gensupport.DecodeResponse(target, res); err != nil {
  14407. return nil, err
  14408. }
  14409. return ret, nil
  14410. // {
  14411. // "description": "Returns a single unsampled report.",
  14412. // "httpMethod": "GET",
  14413. // "id": "analytics.management.unsampledReports.get",
  14414. // "parameterOrder": [
  14415. // "accountId",
  14416. // "webPropertyId",
  14417. // "profileId",
  14418. // "unsampledReportId"
  14419. // ],
  14420. // "parameters": {
  14421. // "accountId": {
  14422. // "description": "Account ID to retrieve unsampled report for.",
  14423. // "location": "path",
  14424. // "required": true,
  14425. // "type": "string"
  14426. // },
  14427. // "profileId": {
  14428. // "description": "View (Profile) ID to retrieve unsampled report for.",
  14429. // "location": "path",
  14430. // "required": true,
  14431. // "type": "string"
  14432. // },
  14433. // "unsampledReportId": {
  14434. // "description": "ID of the unsampled report to retrieve.",
  14435. // "location": "path",
  14436. // "required": true,
  14437. // "type": "string"
  14438. // },
  14439. // "webPropertyId": {
  14440. // "description": "Web property ID to retrieve unsampled reports for.",
  14441. // "location": "path",
  14442. // "required": true,
  14443. // "type": "string"
  14444. // }
  14445. // },
  14446. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  14447. // "response": {
  14448. // "$ref": "UnsampledReport"
  14449. // },
  14450. // "scopes": [
  14451. // "https://www.googleapis.com/auth/analytics",
  14452. // "https://www.googleapis.com/auth/analytics.edit",
  14453. // "https://www.googleapis.com/auth/analytics.readonly"
  14454. // ]
  14455. // }
  14456. }
  14457. // method id "analytics.management.unsampledReports.insert":
  14458. type ManagementUnsampledReportsInsertCall struct {
  14459. s *Service
  14460. accountId string
  14461. webPropertyId string
  14462. profileId string
  14463. unsampledreport *UnsampledReport
  14464. urlParams_ gensupport.URLParams
  14465. ctx_ context.Context
  14466. header_ http.Header
  14467. }
  14468. // Insert: Create a new unsampled report.
  14469. func (r *ManagementUnsampledReportsService) Insert(accountId string, webPropertyId string, profileId string, unsampledreport *UnsampledReport) *ManagementUnsampledReportsInsertCall {
  14470. c := &ManagementUnsampledReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14471. c.accountId = accountId
  14472. c.webPropertyId = webPropertyId
  14473. c.profileId = profileId
  14474. c.unsampledreport = unsampledreport
  14475. return c
  14476. }
  14477. // Fields allows partial responses to be retrieved. See
  14478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14479. // for more information.
  14480. func (c *ManagementUnsampledReportsInsertCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsInsertCall {
  14481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14482. return c
  14483. }
  14484. // Context sets the context to be used in this call's Do method. Any
  14485. // pending HTTP request will be aborted if the provided context is
  14486. // canceled.
  14487. func (c *ManagementUnsampledReportsInsertCall) Context(ctx context.Context) *ManagementUnsampledReportsInsertCall {
  14488. c.ctx_ = ctx
  14489. return c
  14490. }
  14491. // Header returns an http.Header that can be modified by the caller to
  14492. // add HTTP headers to the request.
  14493. func (c *ManagementUnsampledReportsInsertCall) Header() http.Header {
  14494. if c.header_ == nil {
  14495. c.header_ = make(http.Header)
  14496. }
  14497. return c.header_
  14498. }
  14499. func (c *ManagementUnsampledReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  14500. reqHeaders := make(http.Header)
  14501. for k, v := range c.header_ {
  14502. reqHeaders[k] = v
  14503. }
  14504. reqHeaders.Set("User-Agent", c.s.userAgent())
  14505. var body io.Reader = nil
  14506. body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsampledreport)
  14507. if err != nil {
  14508. return nil, err
  14509. }
  14510. reqHeaders.Set("Content-Type", "application/json")
  14511. c.urlParams_.Set("alt", alt)
  14512. c.urlParams_.Set("prettyPrint", "false")
  14513. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  14514. urls += "?" + c.urlParams_.Encode()
  14515. req, err := http.NewRequest("POST", urls, body)
  14516. if err != nil {
  14517. return nil, err
  14518. }
  14519. req.Header = reqHeaders
  14520. googleapi.Expand(req.URL, map[string]string{
  14521. "accountId": c.accountId,
  14522. "webPropertyId": c.webPropertyId,
  14523. "profileId": c.profileId,
  14524. })
  14525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14526. }
  14527. // Do executes the "analytics.management.unsampledReports.insert" call.
  14528. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  14529. // status code is an error. Response headers are in either
  14530. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  14531. // at all) in error.(*googleapi.Error).Header. Use
  14532. // googleapi.IsNotModified to check whether the returned error was
  14533. // because http.StatusNotModified was returned.
  14534. func (c *ManagementUnsampledReportsInsertCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  14535. gensupport.SetOptions(c.urlParams_, opts...)
  14536. res, err := c.doRequest("json")
  14537. if res != nil && res.StatusCode == http.StatusNotModified {
  14538. if res.Body != nil {
  14539. res.Body.Close()
  14540. }
  14541. return nil, &googleapi.Error{
  14542. Code: res.StatusCode,
  14543. Header: res.Header,
  14544. }
  14545. }
  14546. if err != nil {
  14547. return nil, err
  14548. }
  14549. defer googleapi.CloseBody(res)
  14550. if err := googleapi.CheckResponse(res); err != nil {
  14551. return nil, err
  14552. }
  14553. ret := &UnsampledReport{
  14554. ServerResponse: googleapi.ServerResponse{
  14555. Header: res.Header,
  14556. HTTPStatusCode: res.StatusCode,
  14557. },
  14558. }
  14559. target := &ret
  14560. if err := gensupport.DecodeResponse(target, res); err != nil {
  14561. return nil, err
  14562. }
  14563. return ret, nil
  14564. // {
  14565. // "description": "Create a new unsampled report.",
  14566. // "httpMethod": "POST",
  14567. // "id": "analytics.management.unsampledReports.insert",
  14568. // "parameterOrder": [
  14569. // "accountId",
  14570. // "webPropertyId",
  14571. // "profileId"
  14572. // ],
  14573. // "parameters": {
  14574. // "accountId": {
  14575. // "description": "Account ID to create the unsampled report for.",
  14576. // "location": "path",
  14577. // "required": true,
  14578. // "type": "string"
  14579. // },
  14580. // "profileId": {
  14581. // "description": "View (Profile) ID to create the unsampled report for.",
  14582. // "location": "path",
  14583. // "required": true,
  14584. // "type": "string"
  14585. // },
  14586. // "webPropertyId": {
  14587. // "description": "Web property ID to create the unsampled report for.",
  14588. // "location": "path",
  14589. // "required": true,
  14590. // "type": "string"
  14591. // }
  14592. // },
  14593. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  14594. // "request": {
  14595. // "$ref": "UnsampledReport"
  14596. // },
  14597. // "response": {
  14598. // "$ref": "UnsampledReport"
  14599. // },
  14600. // "scopes": [
  14601. // "https://www.googleapis.com/auth/analytics",
  14602. // "https://www.googleapis.com/auth/analytics.edit"
  14603. // ]
  14604. // }
  14605. }
  14606. // method id "analytics.management.unsampledReports.list":
  14607. type ManagementUnsampledReportsListCall struct {
  14608. s *Service
  14609. accountId string
  14610. webPropertyId string
  14611. profileId string
  14612. urlParams_ gensupport.URLParams
  14613. ifNoneMatch_ string
  14614. ctx_ context.Context
  14615. header_ http.Header
  14616. }
  14617. // List: Lists unsampled reports to which the user has access.
  14618. func (r *ManagementUnsampledReportsService) List(accountId string, webPropertyId string, profileId string) *ManagementUnsampledReportsListCall {
  14619. c := &ManagementUnsampledReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14620. c.accountId = accountId
  14621. c.webPropertyId = webPropertyId
  14622. c.profileId = profileId
  14623. return c
  14624. }
  14625. // MaxResults sets the optional parameter "max-results": The maximum
  14626. // number of unsampled reports to include in this response.
  14627. func (c *ManagementUnsampledReportsListCall) MaxResults(maxResults int64) *ManagementUnsampledReportsListCall {
  14628. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  14629. return c
  14630. }
  14631. // StartIndex sets the optional parameter "start-index": An index of the
  14632. // first unsampled report to retrieve. Use this parameter as a
  14633. // pagination mechanism along with the max-results parameter.
  14634. func (c *ManagementUnsampledReportsListCall) StartIndex(startIndex int64) *ManagementUnsampledReportsListCall {
  14635. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  14636. return c
  14637. }
  14638. // Fields allows partial responses to be retrieved. See
  14639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14640. // for more information.
  14641. func (c *ManagementUnsampledReportsListCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsListCall {
  14642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14643. return c
  14644. }
  14645. // IfNoneMatch sets the optional parameter which makes the operation
  14646. // fail if the object's ETag matches the given value. This is useful for
  14647. // getting updates only after the object has changed since the last
  14648. // request. Use googleapi.IsNotModified to check whether the response
  14649. // error from Do is the result of In-None-Match.
  14650. func (c *ManagementUnsampledReportsListCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsListCall {
  14651. c.ifNoneMatch_ = entityTag
  14652. return c
  14653. }
  14654. // Context sets the context to be used in this call's Do method. Any
  14655. // pending HTTP request will be aborted if the provided context is
  14656. // canceled.
  14657. func (c *ManagementUnsampledReportsListCall) Context(ctx context.Context) *ManagementUnsampledReportsListCall {
  14658. c.ctx_ = ctx
  14659. return c
  14660. }
  14661. // Header returns an http.Header that can be modified by the caller to
  14662. // add HTTP headers to the request.
  14663. func (c *ManagementUnsampledReportsListCall) Header() http.Header {
  14664. if c.header_ == nil {
  14665. c.header_ = make(http.Header)
  14666. }
  14667. return c.header_
  14668. }
  14669. func (c *ManagementUnsampledReportsListCall) doRequest(alt string) (*http.Response, error) {
  14670. reqHeaders := make(http.Header)
  14671. for k, v := range c.header_ {
  14672. reqHeaders[k] = v
  14673. }
  14674. reqHeaders.Set("User-Agent", c.s.userAgent())
  14675. if c.ifNoneMatch_ != "" {
  14676. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14677. }
  14678. var body io.Reader = nil
  14679. c.urlParams_.Set("alt", alt)
  14680. c.urlParams_.Set("prettyPrint", "false")
  14681. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  14682. urls += "?" + c.urlParams_.Encode()
  14683. req, err := http.NewRequest("GET", urls, body)
  14684. if err != nil {
  14685. return nil, err
  14686. }
  14687. req.Header = reqHeaders
  14688. googleapi.Expand(req.URL, map[string]string{
  14689. "accountId": c.accountId,
  14690. "webPropertyId": c.webPropertyId,
  14691. "profileId": c.profileId,
  14692. })
  14693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14694. }
  14695. // Do executes the "analytics.management.unsampledReports.list" call.
  14696. // Exactly one of *UnsampledReports or error will be non-nil. Any
  14697. // non-2xx status code is an error. Response headers are in either
  14698. // *UnsampledReports.ServerResponse.Header or (if a response was
  14699. // returned at all) in error.(*googleapi.Error).Header. Use
  14700. // googleapi.IsNotModified to check whether the returned error was
  14701. // because http.StatusNotModified was returned.
  14702. func (c *ManagementUnsampledReportsListCall) Do(opts ...googleapi.CallOption) (*UnsampledReports, error) {
  14703. gensupport.SetOptions(c.urlParams_, opts...)
  14704. res, err := c.doRequest("json")
  14705. if res != nil && res.StatusCode == http.StatusNotModified {
  14706. if res.Body != nil {
  14707. res.Body.Close()
  14708. }
  14709. return nil, &googleapi.Error{
  14710. Code: res.StatusCode,
  14711. Header: res.Header,
  14712. }
  14713. }
  14714. if err != nil {
  14715. return nil, err
  14716. }
  14717. defer googleapi.CloseBody(res)
  14718. if err := googleapi.CheckResponse(res); err != nil {
  14719. return nil, err
  14720. }
  14721. ret := &UnsampledReports{
  14722. ServerResponse: googleapi.ServerResponse{
  14723. Header: res.Header,
  14724. HTTPStatusCode: res.StatusCode,
  14725. },
  14726. }
  14727. target := &ret
  14728. if err := gensupport.DecodeResponse(target, res); err != nil {
  14729. return nil, err
  14730. }
  14731. return ret, nil
  14732. // {
  14733. // "description": "Lists unsampled reports to which the user has access.",
  14734. // "httpMethod": "GET",
  14735. // "id": "analytics.management.unsampledReports.list",
  14736. // "parameterOrder": [
  14737. // "accountId",
  14738. // "webPropertyId",
  14739. // "profileId"
  14740. // ],
  14741. // "parameters": {
  14742. // "accountId": {
  14743. // "description": "Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported.",
  14744. // "location": "path",
  14745. // "required": true,
  14746. // "type": "string"
  14747. // },
  14748. // "max-results": {
  14749. // "description": "The maximum number of unsampled reports to include in this response.",
  14750. // "format": "int32",
  14751. // "location": "query",
  14752. // "type": "integer"
  14753. // },
  14754. // "profileId": {
  14755. // "description": "View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported.",
  14756. // "location": "path",
  14757. // "required": true,
  14758. // "type": "string"
  14759. // },
  14760. // "start-index": {
  14761. // "description": "An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  14762. // "format": "int32",
  14763. // "location": "query",
  14764. // "minimum": "1",
  14765. // "type": "integer"
  14766. // },
  14767. // "webPropertyId": {
  14768. // "description": "Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported.",
  14769. // "location": "path",
  14770. // "required": true,
  14771. // "type": "string"
  14772. // }
  14773. // },
  14774. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  14775. // "response": {
  14776. // "$ref": "UnsampledReports"
  14777. // },
  14778. // "scopes": [
  14779. // "https://www.googleapis.com/auth/analytics",
  14780. // "https://www.googleapis.com/auth/analytics.edit",
  14781. // "https://www.googleapis.com/auth/analytics.readonly"
  14782. // ]
  14783. // }
  14784. }
  14785. // method id "analytics.management.uploads.deleteUploadData":
  14786. type ManagementUploadsDeleteUploadDataCall struct {
  14787. s *Service
  14788. accountId string
  14789. webPropertyId string
  14790. customDataSourceId string
  14791. analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest
  14792. urlParams_ gensupport.URLParams
  14793. ctx_ context.Context
  14794. header_ http.Header
  14795. }
  14796. // DeleteUploadData: Delete data associated with a previous upload.
  14797. func (r *ManagementUploadsService) DeleteUploadData(accountId string, webPropertyId string, customDataSourceId string, analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest) *ManagementUploadsDeleteUploadDataCall {
  14798. c := &ManagementUploadsDeleteUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14799. c.accountId = accountId
  14800. c.webPropertyId = webPropertyId
  14801. c.customDataSourceId = customDataSourceId
  14802. c.analyticsdataimportdeleteuploaddatarequest = analyticsdataimportdeleteuploaddatarequest
  14803. return c
  14804. }
  14805. // Fields allows partial responses to be retrieved. See
  14806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14807. // for more information.
  14808. func (c *ManagementUploadsDeleteUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsDeleteUploadDataCall {
  14809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14810. return c
  14811. }
  14812. // Context sets the context to be used in this call's Do method. Any
  14813. // pending HTTP request will be aborted if the provided context is
  14814. // canceled.
  14815. func (c *ManagementUploadsDeleteUploadDataCall) Context(ctx context.Context) *ManagementUploadsDeleteUploadDataCall {
  14816. c.ctx_ = ctx
  14817. return c
  14818. }
  14819. // Header returns an http.Header that can be modified by the caller to
  14820. // add HTTP headers to the request.
  14821. func (c *ManagementUploadsDeleteUploadDataCall) Header() http.Header {
  14822. if c.header_ == nil {
  14823. c.header_ = make(http.Header)
  14824. }
  14825. return c.header_
  14826. }
  14827. func (c *ManagementUploadsDeleteUploadDataCall) doRequest(alt string) (*http.Response, error) {
  14828. reqHeaders := make(http.Header)
  14829. for k, v := range c.header_ {
  14830. reqHeaders[k] = v
  14831. }
  14832. reqHeaders.Set("User-Agent", c.s.userAgent())
  14833. var body io.Reader = nil
  14834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsdataimportdeleteuploaddatarequest)
  14835. if err != nil {
  14836. return nil, err
  14837. }
  14838. reqHeaders.Set("Content-Type", "application/json")
  14839. c.urlParams_.Set("alt", alt)
  14840. c.urlParams_.Set("prettyPrint", "false")
  14841. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData")
  14842. urls += "?" + c.urlParams_.Encode()
  14843. req, err := http.NewRequest("POST", urls, body)
  14844. if err != nil {
  14845. return nil, err
  14846. }
  14847. req.Header = reqHeaders
  14848. googleapi.Expand(req.URL, map[string]string{
  14849. "accountId": c.accountId,
  14850. "webPropertyId": c.webPropertyId,
  14851. "customDataSourceId": c.customDataSourceId,
  14852. })
  14853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14854. }
  14855. // Do executes the "analytics.management.uploads.deleteUploadData" call.
  14856. func (c *ManagementUploadsDeleteUploadDataCall) Do(opts ...googleapi.CallOption) error {
  14857. gensupport.SetOptions(c.urlParams_, opts...)
  14858. res, err := c.doRequest("json")
  14859. if err != nil {
  14860. return err
  14861. }
  14862. defer googleapi.CloseBody(res)
  14863. if err := googleapi.CheckResponse(res); err != nil {
  14864. return err
  14865. }
  14866. return nil
  14867. // {
  14868. // "description": "Delete data associated with a previous upload.",
  14869. // "httpMethod": "POST",
  14870. // "id": "analytics.management.uploads.deleteUploadData",
  14871. // "parameterOrder": [
  14872. // "accountId",
  14873. // "webPropertyId",
  14874. // "customDataSourceId"
  14875. // ],
  14876. // "parameters": {
  14877. // "accountId": {
  14878. // "description": "Account Id for the uploads to be deleted.",
  14879. // "location": "path",
  14880. // "pattern": "\\d+",
  14881. // "required": true,
  14882. // "type": "string"
  14883. // },
  14884. // "customDataSourceId": {
  14885. // "description": "Custom data source Id for the uploads to be deleted.",
  14886. // "location": "path",
  14887. // "pattern": ".{22}",
  14888. // "required": true,
  14889. // "type": "string"
  14890. // },
  14891. // "webPropertyId": {
  14892. // "description": "Web property Id for the uploads to be deleted.",
  14893. // "location": "path",
  14894. // "pattern": "UA-(\\d+)-(\\d+)",
  14895. // "required": true,
  14896. // "type": "string"
  14897. // }
  14898. // },
  14899. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData",
  14900. // "request": {
  14901. // "$ref": "AnalyticsDataimportDeleteUploadDataRequest"
  14902. // },
  14903. // "scopes": [
  14904. // "https://www.googleapis.com/auth/analytics",
  14905. // "https://www.googleapis.com/auth/analytics.edit"
  14906. // ]
  14907. // }
  14908. }
  14909. // method id "analytics.management.uploads.get":
  14910. type ManagementUploadsGetCall struct {
  14911. s *Service
  14912. accountId string
  14913. webPropertyId string
  14914. customDataSourceId string
  14915. uploadId string
  14916. urlParams_ gensupport.URLParams
  14917. ifNoneMatch_ string
  14918. ctx_ context.Context
  14919. header_ http.Header
  14920. }
  14921. // Get: List uploads to which the user has access.
  14922. func (r *ManagementUploadsService) Get(accountId string, webPropertyId string, customDataSourceId string, uploadId string) *ManagementUploadsGetCall {
  14923. c := &ManagementUploadsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14924. c.accountId = accountId
  14925. c.webPropertyId = webPropertyId
  14926. c.customDataSourceId = customDataSourceId
  14927. c.uploadId = uploadId
  14928. return c
  14929. }
  14930. // Fields allows partial responses to be retrieved. See
  14931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14932. // for more information.
  14933. func (c *ManagementUploadsGetCall) Fields(s ...googleapi.Field) *ManagementUploadsGetCall {
  14934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14935. return c
  14936. }
  14937. // IfNoneMatch sets the optional parameter which makes the operation
  14938. // fail if the object's ETag matches the given value. This is useful for
  14939. // getting updates only after the object has changed since the last
  14940. // request. Use googleapi.IsNotModified to check whether the response
  14941. // error from Do is the result of In-None-Match.
  14942. func (c *ManagementUploadsGetCall) IfNoneMatch(entityTag string) *ManagementUploadsGetCall {
  14943. c.ifNoneMatch_ = entityTag
  14944. return c
  14945. }
  14946. // Context sets the context to be used in this call's Do method. Any
  14947. // pending HTTP request will be aborted if the provided context is
  14948. // canceled.
  14949. func (c *ManagementUploadsGetCall) Context(ctx context.Context) *ManagementUploadsGetCall {
  14950. c.ctx_ = ctx
  14951. return c
  14952. }
  14953. // Header returns an http.Header that can be modified by the caller to
  14954. // add HTTP headers to the request.
  14955. func (c *ManagementUploadsGetCall) Header() http.Header {
  14956. if c.header_ == nil {
  14957. c.header_ = make(http.Header)
  14958. }
  14959. return c.header_
  14960. }
  14961. func (c *ManagementUploadsGetCall) doRequest(alt string) (*http.Response, error) {
  14962. reqHeaders := make(http.Header)
  14963. for k, v := range c.header_ {
  14964. reqHeaders[k] = v
  14965. }
  14966. reqHeaders.Set("User-Agent", c.s.userAgent())
  14967. if c.ifNoneMatch_ != "" {
  14968. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14969. }
  14970. var body io.Reader = nil
  14971. c.urlParams_.Set("alt", alt)
  14972. c.urlParams_.Set("prettyPrint", "false")
  14973. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}")
  14974. urls += "?" + c.urlParams_.Encode()
  14975. req, err := http.NewRequest("GET", urls, body)
  14976. if err != nil {
  14977. return nil, err
  14978. }
  14979. req.Header = reqHeaders
  14980. googleapi.Expand(req.URL, map[string]string{
  14981. "accountId": c.accountId,
  14982. "webPropertyId": c.webPropertyId,
  14983. "customDataSourceId": c.customDataSourceId,
  14984. "uploadId": c.uploadId,
  14985. })
  14986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14987. }
  14988. // Do executes the "analytics.management.uploads.get" call.
  14989. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  14990. // code is an error. Response headers are in either
  14991. // *Upload.ServerResponse.Header or (if a response was returned at all)
  14992. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14993. // check whether the returned error was because http.StatusNotModified
  14994. // was returned.
  14995. func (c *ManagementUploadsGetCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  14996. gensupport.SetOptions(c.urlParams_, opts...)
  14997. res, err := c.doRequest("json")
  14998. if res != nil && res.StatusCode == http.StatusNotModified {
  14999. if res.Body != nil {
  15000. res.Body.Close()
  15001. }
  15002. return nil, &googleapi.Error{
  15003. Code: res.StatusCode,
  15004. Header: res.Header,
  15005. }
  15006. }
  15007. if err != nil {
  15008. return nil, err
  15009. }
  15010. defer googleapi.CloseBody(res)
  15011. if err := googleapi.CheckResponse(res); err != nil {
  15012. return nil, err
  15013. }
  15014. ret := &Upload{
  15015. ServerResponse: googleapi.ServerResponse{
  15016. Header: res.Header,
  15017. HTTPStatusCode: res.StatusCode,
  15018. },
  15019. }
  15020. target := &ret
  15021. if err := gensupport.DecodeResponse(target, res); err != nil {
  15022. return nil, err
  15023. }
  15024. return ret, nil
  15025. // {
  15026. // "description": "List uploads to which the user has access.",
  15027. // "httpMethod": "GET",
  15028. // "id": "analytics.management.uploads.get",
  15029. // "parameterOrder": [
  15030. // "accountId",
  15031. // "webPropertyId",
  15032. // "customDataSourceId",
  15033. // "uploadId"
  15034. // ],
  15035. // "parameters": {
  15036. // "accountId": {
  15037. // "description": "Account Id for the upload to retrieve.",
  15038. // "location": "path",
  15039. // "pattern": "\\d+",
  15040. // "required": true,
  15041. // "type": "string"
  15042. // },
  15043. // "customDataSourceId": {
  15044. // "description": "Custom data source Id for upload to retrieve.",
  15045. // "location": "path",
  15046. // "pattern": ".{22}",
  15047. // "required": true,
  15048. // "type": "string"
  15049. // },
  15050. // "uploadId": {
  15051. // "description": "Upload Id to retrieve.",
  15052. // "location": "path",
  15053. // "pattern": ".{22}",
  15054. // "required": true,
  15055. // "type": "string"
  15056. // },
  15057. // "webPropertyId": {
  15058. // "description": "Web property Id for the upload to retrieve.",
  15059. // "location": "path",
  15060. // "pattern": "UA-(\\d+)-(\\d+)",
  15061. // "required": true,
  15062. // "type": "string"
  15063. // }
  15064. // },
  15065. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}",
  15066. // "response": {
  15067. // "$ref": "Upload"
  15068. // },
  15069. // "scopes": [
  15070. // "https://www.googleapis.com/auth/analytics",
  15071. // "https://www.googleapis.com/auth/analytics.edit",
  15072. // "https://www.googleapis.com/auth/analytics.readonly"
  15073. // ]
  15074. // }
  15075. }
  15076. // method id "analytics.management.uploads.list":
  15077. type ManagementUploadsListCall struct {
  15078. s *Service
  15079. accountId string
  15080. webPropertyId string
  15081. customDataSourceId string
  15082. urlParams_ gensupport.URLParams
  15083. ifNoneMatch_ string
  15084. ctx_ context.Context
  15085. header_ http.Header
  15086. }
  15087. // List: List uploads to which the user has access.
  15088. func (r *ManagementUploadsService) List(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsListCall {
  15089. c := &ManagementUploadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15090. c.accountId = accountId
  15091. c.webPropertyId = webPropertyId
  15092. c.customDataSourceId = customDataSourceId
  15093. return c
  15094. }
  15095. // MaxResults sets the optional parameter "max-results": The maximum
  15096. // number of uploads to include in this response.
  15097. func (c *ManagementUploadsListCall) MaxResults(maxResults int64) *ManagementUploadsListCall {
  15098. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  15099. return c
  15100. }
  15101. // StartIndex sets the optional parameter "start-index": A 1-based index
  15102. // of the first upload to retrieve. Use this parameter as a pagination
  15103. // mechanism along with the max-results parameter.
  15104. func (c *ManagementUploadsListCall) StartIndex(startIndex int64) *ManagementUploadsListCall {
  15105. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  15106. return c
  15107. }
  15108. // Fields allows partial responses to be retrieved. See
  15109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15110. // for more information.
  15111. func (c *ManagementUploadsListCall) Fields(s ...googleapi.Field) *ManagementUploadsListCall {
  15112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15113. return c
  15114. }
  15115. // IfNoneMatch sets the optional parameter which makes the operation
  15116. // fail if the object's ETag matches the given value. This is useful for
  15117. // getting updates only after the object has changed since the last
  15118. // request. Use googleapi.IsNotModified to check whether the response
  15119. // error from Do is the result of In-None-Match.
  15120. func (c *ManagementUploadsListCall) IfNoneMatch(entityTag string) *ManagementUploadsListCall {
  15121. c.ifNoneMatch_ = entityTag
  15122. return c
  15123. }
  15124. // Context sets the context to be used in this call's Do method. Any
  15125. // pending HTTP request will be aborted if the provided context is
  15126. // canceled.
  15127. func (c *ManagementUploadsListCall) Context(ctx context.Context) *ManagementUploadsListCall {
  15128. c.ctx_ = ctx
  15129. return c
  15130. }
  15131. // Header returns an http.Header that can be modified by the caller to
  15132. // add HTTP headers to the request.
  15133. func (c *ManagementUploadsListCall) Header() http.Header {
  15134. if c.header_ == nil {
  15135. c.header_ = make(http.Header)
  15136. }
  15137. return c.header_
  15138. }
  15139. func (c *ManagementUploadsListCall) doRequest(alt string) (*http.Response, error) {
  15140. reqHeaders := make(http.Header)
  15141. for k, v := range c.header_ {
  15142. reqHeaders[k] = v
  15143. }
  15144. reqHeaders.Set("User-Agent", c.s.userAgent())
  15145. if c.ifNoneMatch_ != "" {
  15146. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15147. }
  15148. var body io.Reader = nil
  15149. c.urlParams_.Set("alt", alt)
  15150. c.urlParams_.Set("prettyPrint", "false")
  15151. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  15152. urls += "?" + c.urlParams_.Encode()
  15153. req, err := http.NewRequest("GET", urls, body)
  15154. if err != nil {
  15155. return nil, err
  15156. }
  15157. req.Header = reqHeaders
  15158. googleapi.Expand(req.URL, map[string]string{
  15159. "accountId": c.accountId,
  15160. "webPropertyId": c.webPropertyId,
  15161. "customDataSourceId": c.customDataSourceId,
  15162. })
  15163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15164. }
  15165. // Do executes the "analytics.management.uploads.list" call.
  15166. // Exactly one of *Uploads or error will be non-nil. Any non-2xx status
  15167. // code is an error. Response headers are in either
  15168. // *Uploads.ServerResponse.Header or (if a response was returned at all)
  15169. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15170. // check whether the returned error was because http.StatusNotModified
  15171. // was returned.
  15172. func (c *ManagementUploadsListCall) Do(opts ...googleapi.CallOption) (*Uploads, error) {
  15173. gensupport.SetOptions(c.urlParams_, opts...)
  15174. res, err := c.doRequest("json")
  15175. if res != nil && res.StatusCode == http.StatusNotModified {
  15176. if res.Body != nil {
  15177. res.Body.Close()
  15178. }
  15179. return nil, &googleapi.Error{
  15180. Code: res.StatusCode,
  15181. Header: res.Header,
  15182. }
  15183. }
  15184. if err != nil {
  15185. return nil, err
  15186. }
  15187. defer googleapi.CloseBody(res)
  15188. if err := googleapi.CheckResponse(res); err != nil {
  15189. return nil, err
  15190. }
  15191. ret := &Uploads{
  15192. ServerResponse: googleapi.ServerResponse{
  15193. Header: res.Header,
  15194. HTTPStatusCode: res.StatusCode,
  15195. },
  15196. }
  15197. target := &ret
  15198. if err := gensupport.DecodeResponse(target, res); err != nil {
  15199. return nil, err
  15200. }
  15201. return ret, nil
  15202. // {
  15203. // "description": "List uploads to which the user has access.",
  15204. // "httpMethod": "GET",
  15205. // "id": "analytics.management.uploads.list",
  15206. // "parameterOrder": [
  15207. // "accountId",
  15208. // "webPropertyId",
  15209. // "customDataSourceId"
  15210. // ],
  15211. // "parameters": {
  15212. // "accountId": {
  15213. // "description": "Account Id for the uploads to retrieve.",
  15214. // "location": "path",
  15215. // "pattern": "\\d+",
  15216. // "required": true,
  15217. // "type": "string"
  15218. // },
  15219. // "customDataSourceId": {
  15220. // "description": "Custom data source Id for uploads to retrieve.",
  15221. // "location": "path",
  15222. // "pattern": ".{22}",
  15223. // "required": true,
  15224. // "type": "string"
  15225. // },
  15226. // "max-results": {
  15227. // "description": "The maximum number of uploads to include in this response.",
  15228. // "format": "int32",
  15229. // "location": "query",
  15230. // "minimum": "1",
  15231. // "type": "integer"
  15232. // },
  15233. // "start-index": {
  15234. // "description": "A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  15235. // "format": "int32",
  15236. // "location": "query",
  15237. // "minimum": "1",
  15238. // "type": "integer"
  15239. // },
  15240. // "webPropertyId": {
  15241. // "description": "Web property Id for the uploads to retrieve.",
  15242. // "location": "path",
  15243. // "pattern": "UA-(\\d+)-(\\d+)",
  15244. // "required": true,
  15245. // "type": "string"
  15246. // }
  15247. // },
  15248. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  15249. // "response": {
  15250. // "$ref": "Uploads"
  15251. // },
  15252. // "scopes": [
  15253. // "https://www.googleapis.com/auth/analytics",
  15254. // "https://www.googleapis.com/auth/analytics.edit",
  15255. // "https://www.googleapis.com/auth/analytics.readonly"
  15256. // ]
  15257. // }
  15258. }
  15259. // method id "analytics.management.uploads.uploadData":
  15260. type ManagementUploadsUploadDataCall struct {
  15261. s *Service
  15262. accountId string
  15263. webPropertyId string
  15264. customDataSourceId string
  15265. urlParams_ gensupport.URLParams
  15266. mediaInfo_ *gensupport.MediaInfo
  15267. ctx_ context.Context
  15268. header_ http.Header
  15269. }
  15270. // UploadData: Upload data for a custom data source.
  15271. func (r *ManagementUploadsService) UploadData(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsUploadDataCall {
  15272. c := &ManagementUploadsUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15273. c.accountId = accountId
  15274. c.webPropertyId = webPropertyId
  15275. c.customDataSourceId = customDataSourceId
  15276. return c
  15277. }
  15278. // Media specifies the media to upload in one or more chunks. The chunk
  15279. // size may be controlled by supplying a MediaOption generated by
  15280. // googleapi.ChunkSize. The chunk size defaults to
  15281. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  15282. // upload request will be determined by sniffing the contents of r,
  15283. // unless a MediaOption generated by googleapi.ContentType is
  15284. // supplied.
  15285. // At most one of Media and ResumableMedia may be set.
  15286. func (c *ManagementUploadsUploadDataCall) Media(r io.Reader, options ...googleapi.MediaOption) *ManagementUploadsUploadDataCall {
  15287. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  15288. return c
  15289. }
  15290. // ResumableMedia specifies the media to upload in chunks and can be
  15291. // canceled with ctx.
  15292. //
  15293. // Deprecated: use Media instead.
  15294. //
  15295. // At most one of Media and ResumableMedia may be set. mediaType
  15296. // identifies the MIME media type of the upload, such as "image/png". If
  15297. // mediaType is "", it will be auto-detected. The provided ctx will
  15298. // supersede any context previously provided to the Context method.
  15299. func (c *ManagementUploadsUploadDataCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ManagementUploadsUploadDataCall {
  15300. c.ctx_ = ctx
  15301. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  15302. return c
  15303. }
  15304. // ProgressUpdater provides a callback function that will be called
  15305. // after every chunk. It should be a low-latency function in order to
  15306. // not slow down the upload operation. This should only be called when
  15307. // using ResumableMedia (as opposed to Media).
  15308. func (c *ManagementUploadsUploadDataCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ManagementUploadsUploadDataCall {
  15309. c.mediaInfo_.SetProgressUpdater(pu)
  15310. return c
  15311. }
  15312. // Fields allows partial responses to be retrieved. See
  15313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15314. // for more information.
  15315. func (c *ManagementUploadsUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsUploadDataCall {
  15316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15317. return c
  15318. }
  15319. // Context sets the context to be used in this call's Do method. Any
  15320. // pending HTTP request will be aborted if the provided context is
  15321. // canceled.
  15322. // This context will supersede any context previously provided to the
  15323. // ResumableMedia method.
  15324. func (c *ManagementUploadsUploadDataCall) Context(ctx context.Context) *ManagementUploadsUploadDataCall {
  15325. c.ctx_ = ctx
  15326. return c
  15327. }
  15328. // Header returns an http.Header that can be modified by the caller to
  15329. // add HTTP headers to the request.
  15330. func (c *ManagementUploadsUploadDataCall) Header() http.Header {
  15331. if c.header_ == nil {
  15332. c.header_ = make(http.Header)
  15333. }
  15334. return c.header_
  15335. }
  15336. func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response, error) {
  15337. reqHeaders := make(http.Header)
  15338. for k, v := range c.header_ {
  15339. reqHeaders[k] = v
  15340. }
  15341. reqHeaders.Set("User-Agent", c.s.userAgent())
  15342. var body io.Reader = nil
  15343. c.urlParams_.Set("alt", alt)
  15344. c.urlParams_.Set("prettyPrint", "false")
  15345. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  15346. if c.mediaInfo_ != nil {
  15347. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  15348. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  15349. }
  15350. if body == nil {
  15351. body = new(bytes.Buffer)
  15352. reqHeaders.Set("Content-Type", "application/json")
  15353. }
  15354. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  15355. defer cleanup()
  15356. urls += "?" + c.urlParams_.Encode()
  15357. req, err := http.NewRequest("POST", urls, body)
  15358. if err != nil {
  15359. return nil, err
  15360. }
  15361. req.Header = reqHeaders
  15362. req.GetBody = getBody
  15363. googleapi.Expand(req.URL, map[string]string{
  15364. "accountId": c.accountId,
  15365. "webPropertyId": c.webPropertyId,
  15366. "customDataSourceId": c.customDataSourceId,
  15367. })
  15368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15369. }
  15370. // Do executes the "analytics.management.uploads.uploadData" call.
  15371. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  15372. // code is an error. Response headers are in either
  15373. // *Upload.ServerResponse.Header or (if a response was returned at all)
  15374. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  15375. // check whether the returned error was because http.StatusNotModified
  15376. // was returned.
  15377. func (c *ManagementUploadsUploadDataCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  15378. gensupport.SetOptions(c.urlParams_, opts...)
  15379. res, err := c.doRequest("json")
  15380. if res != nil && res.StatusCode == http.StatusNotModified {
  15381. if res.Body != nil {
  15382. res.Body.Close()
  15383. }
  15384. return nil, &googleapi.Error{
  15385. Code: res.StatusCode,
  15386. Header: res.Header,
  15387. }
  15388. }
  15389. if err != nil {
  15390. return nil, err
  15391. }
  15392. defer googleapi.CloseBody(res)
  15393. if err := googleapi.CheckResponse(res); err != nil {
  15394. return nil, err
  15395. }
  15396. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  15397. if rx != nil {
  15398. rx.Client = c.s.client
  15399. rx.UserAgent = c.s.userAgent()
  15400. ctx := c.ctx_
  15401. if ctx == nil {
  15402. ctx = context.TODO()
  15403. }
  15404. res, err = rx.Upload(ctx)
  15405. if err != nil {
  15406. return nil, err
  15407. }
  15408. defer res.Body.Close()
  15409. if err := googleapi.CheckResponse(res); err != nil {
  15410. return nil, err
  15411. }
  15412. }
  15413. ret := &Upload{
  15414. ServerResponse: googleapi.ServerResponse{
  15415. Header: res.Header,
  15416. HTTPStatusCode: res.StatusCode,
  15417. },
  15418. }
  15419. target := &ret
  15420. if err := gensupport.DecodeResponse(target, res); err != nil {
  15421. return nil, err
  15422. }
  15423. return ret, nil
  15424. // {
  15425. // "description": "Upload data for a custom data source.",
  15426. // "httpMethod": "POST",
  15427. // "id": "analytics.management.uploads.uploadData",
  15428. // "mediaUpload": {
  15429. // "accept": [
  15430. // "application/octet-stream"
  15431. // ],
  15432. // "maxSize": "1GB",
  15433. // "protocols": {
  15434. // "resumable": {
  15435. // "multipart": true,
  15436. // "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  15437. // },
  15438. // "simple": {
  15439. // "multipart": true,
  15440. // "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  15441. // }
  15442. // }
  15443. // },
  15444. // "parameterOrder": [
  15445. // "accountId",
  15446. // "webPropertyId",
  15447. // "customDataSourceId"
  15448. // ],
  15449. // "parameters": {
  15450. // "accountId": {
  15451. // "description": "Account Id associated with the upload.",
  15452. // "location": "path",
  15453. // "pattern": "\\d+",
  15454. // "required": true,
  15455. // "type": "string"
  15456. // },
  15457. // "customDataSourceId": {
  15458. // "description": "Custom data source Id to which the data being uploaded belongs.",
  15459. // "location": "path",
  15460. // "required": true,
  15461. // "type": "string"
  15462. // },
  15463. // "webPropertyId": {
  15464. // "description": "Web property UA-string associated with the upload.",
  15465. // "location": "path",
  15466. // "pattern": "UA-\\d+-\\d+",
  15467. // "required": true,
  15468. // "type": "string"
  15469. // }
  15470. // },
  15471. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  15472. // "response": {
  15473. // "$ref": "Upload"
  15474. // },
  15475. // "scopes": [
  15476. // "https://www.googleapis.com/auth/analytics",
  15477. // "https://www.googleapis.com/auth/analytics.edit"
  15478. // ],
  15479. // "supportsMediaUpload": true
  15480. // }
  15481. }
  15482. // method id "analytics.management.webPropertyAdWordsLinks.delete":
  15483. type ManagementWebPropertyAdWordsLinksDeleteCall struct {
  15484. s *Service
  15485. accountId string
  15486. webPropertyId string
  15487. webPropertyAdWordsLinkId string
  15488. urlParams_ gensupport.URLParams
  15489. ctx_ context.Context
  15490. header_ http.Header
  15491. }
  15492. // Delete: Deletes a web property-Google Ads link.
  15493. func (r *ManagementWebPropertyAdWordsLinksService) Delete(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15494. c := &ManagementWebPropertyAdWordsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15495. c.accountId = accountId
  15496. c.webPropertyId = webPropertyId
  15497. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15498. return c
  15499. }
  15500. // Fields allows partial responses to be retrieved. See
  15501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15502. // for more information.
  15503. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15505. return c
  15506. }
  15507. // Context sets the context to be used in this call's Do method. Any
  15508. // pending HTTP request will be aborted if the provided context is
  15509. // canceled.
  15510. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15511. c.ctx_ = ctx
  15512. return c
  15513. }
  15514. // Header returns an http.Header that can be modified by the caller to
  15515. // add HTTP headers to the request.
  15516. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Header() http.Header {
  15517. if c.header_ == nil {
  15518. c.header_ = make(http.Header)
  15519. }
  15520. return c.header_
  15521. }
  15522. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  15523. reqHeaders := make(http.Header)
  15524. for k, v := range c.header_ {
  15525. reqHeaders[k] = v
  15526. }
  15527. reqHeaders.Set("User-Agent", c.s.userAgent())
  15528. var body io.Reader = nil
  15529. c.urlParams_.Set("alt", alt)
  15530. c.urlParams_.Set("prettyPrint", "false")
  15531. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15532. urls += "?" + c.urlParams_.Encode()
  15533. req, err := http.NewRequest("DELETE", urls, body)
  15534. if err != nil {
  15535. return nil, err
  15536. }
  15537. req.Header = reqHeaders
  15538. googleapi.Expand(req.URL, map[string]string{
  15539. "accountId": c.accountId,
  15540. "webPropertyId": c.webPropertyId,
  15541. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15542. })
  15543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15544. }
  15545. // Do executes the "analytics.management.webPropertyAdWordsLinks.delete" call.
  15546. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  15547. gensupport.SetOptions(c.urlParams_, opts...)
  15548. res, err := c.doRequest("json")
  15549. if err != nil {
  15550. return err
  15551. }
  15552. defer googleapi.CloseBody(res)
  15553. if err := googleapi.CheckResponse(res); err != nil {
  15554. return err
  15555. }
  15556. return nil
  15557. // {
  15558. // "description": "Deletes a web property-Google Ads link.",
  15559. // "httpMethod": "DELETE",
  15560. // "id": "analytics.management.webPropertyAdWordsLinks.delete",
  15561. // "parameterOrder": [
  15562. // "accountId",
  15563. // "webPropertyId",
  15564. // "webPropertyAdWordsLinkId"
  15565. // ],
  15566. // "parameters": {
  15567. // "accountId": {
  15568. // "description": "ID of the account which the given web property belongs to.",
  15569. // "location": "path",
  15570. // "required": true,
  15571. // "type": "string"
  15572. // },
  15573. // "webPropertyAdWordsLinkId": {
  15574. // "description": "Web property Google Ads link ID.",
  15575. // "location": "path",
  15576. // "required": true,
  15577. // "type": "string"
  15578. // },
  15579. // "webPropertyId": {
  15580. // "description": "Web property ID to delete the Google Ads link for.",
  15581. // "location": "path",
  15582. // "required": true,
  15583. // "type": "string"
  15584. // }
  15585. // },
  15586. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15587. // "scopes": [
  15588. // "https://www.googleapis.com/auth/analytics.edit"
  15589. // ]
  15590. // }
  15591. }
  15592. // method id "analytics.management.webPropertyAdWordsLinks.get":
  15593. type ManagementWebPropertyAdWordsLinksGetCall struct {
  15594. s *Service
  15595. accountId string
  15596. webPropertyId string
  15597. webPropertyAdWordsLinkId string
  15598. urlParams_ gensupport.URLParams
  15599. ifNoneMatch_ string
  15600. ctx_ context.Context
  15601. header_ http.Header
  15602. }
  15603. // Get: Returns a web property-Google Ads link to which the user has
  15604. // access.
  15605. func (r *ManagementWebPropertyAdWordsLinksService) Get(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksGetCall {
  15606. c := &ManagementWebPropertyAdWordsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15607. c.accountId = accountId
  15608. c.webPropertyId = webPropertyId
  15609. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15610. return c
  15611. }
  15612. // Fields allows partial responses to be retrieved. See
  15613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15614. // for more information.
  15615. func (c *ManagementWebPropertyAdWordsLinksGetCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksGetCall {
  15616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15617. return c
  15618. }
  15619. // IfNoneMatch sets the optional parameter which makes the operation
  15620. // fail if the object's ETag matches the given value. This is useful for
  15621. // getting updates only after the object has changed since the last
  15622. // request. Use googleapi.IsNotModified to check whether the response
  15623. // error from Do is the result of In-None-Match.
  15624. func (c *ManagementWebPropertyAdWordsLinksGetCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksGetCall {
  15625. c.ifNoneMatch_ = entityTag
  15626. return c
  15627. }
  15628. // Context sets the context to be used in this call's Do method. Any
  15629. // pending HTTP request will be aborted if the provided context is
  15630. // canceled.
  15631. func (c *ManagementWebPropertyAdWordsLinksGetCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksGetCall {
  15632. c.ctx_ = ctx
  15633. return c
  15634. }
  15635. // Header returns an http.Header that can be modified by the caller to
  15636. // add HTTP headers to the request.
  15637. func (c *ManagementWebPropertyAdWordsLinksGetCall) Header() http.Header {
  15638. if c.header_ == nil {
  15639. c.header_ = make(http.Header)
  15640. }
  15641. return c.header_
  15642. }
  15643. func (c *ManagementWebPropertyAdWordsLinksGetCall) doRequest(alt string) (*http.Response, error) {
  15644. reqHeaders := make(http.Header)
  15645. for k, v := range c.header_ {
  15646. reqHeaders[k] = v
  15647. }
  15648. reqHeaders.Set("User-Agent", c.s.userAgent())
  15649. if c.ifNoneMatch_ != "" {
  15650. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15651. }
  15652. var body io.Reader = nil
  15653. c.urlParams_.Set("alt", alt)
  15654. c.urlParams_.Set("prettyPrint", "false")
  15655. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15656. urls += "?" + c.urlParams_.Encode()
  15657. req, err := http.NewRequest("GET", urls, body)
  15658. if err != nil {
  15659. return nil, err
  15660. }
  15661. req.Header = reqHeaders
  15662. googleapi.Expand(req.URL, map[string]string{
  15663. "accountId": c.accountId,
  15664. "webPropertyId": c.webPropertyId,
  15665. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15666. })
  15667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15668. }
  15669. // Do executes the "analytics.management.webPropertyAdWordsLinks.get" call.
  15670. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15671. // non-2xx status code is an error. Response headers are in either
  15672. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15673. // returned at all) in error.(*googleapi.Error).Header. Use
  15674. // googleapi.IsNotModified to check whether the returned error was
  15675. // because http.StatusNotModified was returned.
  15676. func (c *ManagementWebPropertyAdWordsLinksGetCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15677. gensupport.SetOptions(c.urlParams_, opts...)
  15678. res, err := c.doRequest("json")
  15679. if res != nil && res.StatusCode == http.StatusNotModified {
  15680. if res.Body != nil {
  15681. res.Body.Close()
  15682. }
  15683. return nil, &googleapi.Error{
  15684. Code: res.StatusCode,
  15685. Header: res.Header,
  15686. }
  15687. }
  15688. if err != nil {
  15689. return nil, err
  15690. }
  15691. defer googleapi.CloseBody(res)
  15692. if err := googleapi.CheckResponse(res); err != nil {
  15693. return nil, err
  15694. }
  15695. ret := &EntityAdWordsLink{
  15696. ServerResponse: googleapi.ServerResponse{
  15697. Header: res.Header,
  15698. HTTPStatusCode: res.StatusCode,
  15699. },
  15700. }
  15701. target := &ret
  15702. if err := gensupport.DecodeResponse(target, res); err != nil {
  15703. return nil, err
  15704. }
  15705. return ret, nil
  15706. // {
  15707. // "description": "Returns a web property-Google Ads link to which the user has access.",
  15708. // "httpMethod": "GET",
  15709. // "id": "analytics.management.webPropertyAdWordsLinks.get",
  15710. // "parameterOrder": [
  15711. // "accountId",
  15712. // "webPropertyId",
  15713. // "webPropertyAdWordsLinkId"
  15714. // ],
  15715. // "parameters": {
  15716. // "accountId": {
  15717. // "description": "ID of the account which the given web property belongs to.",
  15718. // "location": "path",
  15719. // "required": true,
  15720. // "type": "string"
  15721. // },
  15722. // "webPropertyAdWordsLinkId": {
  15723. // "description": "Web property-Google Ads link ID.",
  15724. // "location": "path",
  15725. // "required": true,
  15726. // "type": "string"
  15727. // },
  15728. // "webPropertyId": {
  15729. // "description": "Web property ID to retrieve the Google Ads link for.",
  15730. // "location": "path",
  15731. // "required": true,
  15732. // "type": "string"
  15733. // }
  15734. // },
  15735. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15736. // "response": {
  15737. // "$ref": "EntityAdWordsLink"
  15738. // },
  15739. // "scopes": [
  15740. // "https://www.googleapis.com/auth/analytics.edit",
  15741. // "https://www.googleapis.com/auth/analytics.readonly"
  15742. // ]
  15743. // }
  15744. }
  15745. // method id "analytics.management.webPropertyAdWordsLinks.insert":
  15746. type ManagementWebPropertyAdWordsLinksInsertCall struct {
  15747. s *Service
  15748. accountId string
  15749. webPropertyId string
  15750. entityadwordslink *EntityAdWordsLink
  15751. urlParams_ gensupport.URLParams
  15752. ctx_ context.Context
  15753. header_ http.Header
  15754. }
  15755. // Insert: Creates a webProperty-Google Ads link.
  15756. func (r *ManagementWebPropertyAdWordsLinksService) Insert(accountId string, webPropertyId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksInsertCall {
  15757. c := &ManagementWebPropertyAdWordsLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15758. c.accountId = accountId
  15759. c.webPropertyId = webPropertyId
  15760. c.entityadwordslink = entityadwordslink
  15761. return c
  15762. }
  15763. // Fields allows partial responses to be retrieved. See
  15764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15765. // for more information.
  15766. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksInsertCall {
  15767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15768. return c
  15769. }
  15770. // Context sets the context to be used in this call's Do method. Any
  15771. // pending HTTP request will be aborted if the provided context is
  15772. // canceled.
  15773. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksInsertCall {
  15774. c.ctx_ = ctx
  15775. return c
  15776. }
  15777. // Header returns an http.Header that can be modified by the caller to
  15778. // add HTTP headers to the request.
  15779. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Header() http.Header {
  15780. if c.header_ == nil {
  15781. c.header_ = make(http.Header)
  15782. }
  15783. return c.header_
  15784. }
  15785. func (c *ManagementWebPropertyAdWordsLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  15786. reqHeaders := make(http.Header)
  15787. for k, v := range c.header_ {
  15788. reqHeaders[k] = v
  15789. }
  15790. reqHeaders.Set("User-Agent", c.s.userAgent())
  15791. var body io.Reader = nil
  15792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  15793. if err != nil {
  15794. return nil, err
  15795. }
  15796. reqHeaders.Set("Content-Type", "application/json")
  15797. c.urlParams_.Set("alt", alt)
  15798. c.urlParams_.Set("prettyPrint", "false")
  15799. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  15800. urls += "?" + c.urlParams_.Encode()
  15801. req, err := http.NewRequest("POST", urls, body)
  15802. if err != nil {
  15803. return nil, err
  15804. }
  15805. req.Header = reqHeaders
  15806. googleapi.Expand(req.URL, map[string]string{
  15807. "accountId": c.accountId,
  15808. "webPropertyId": c.webPropertyId,
  15809. })
  15810. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15811. }
  15812. // Do executes the "analytics.management.webPropertyAdWordsLinks.insert" call.
  15813. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15814. // non-2xx status code is an error. Response headers are in either
  15815. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15816. // returned at all) in error.(*googleapi.Error).Header. Use
  15817. // googleapi.IsNotModified to check whether the returned error was
  15818. // because http.StatusNotModified was returned.
  15819. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15820. gensupport.SetOptions(c.urlParams_, opts...)
  15821. res, err := c.doRequest("json")
  15822. if res != nil && res.StatusCode == http.StatusNotModified {
  15823. if res.Body != nil {
  15824. res.Body.Close()
  15825. }
  15826. return nil, &googleapi.Error{
  15827. Code: res.StatusCode,
  15828. Header: res.Header,
  15829. }
  15830. }
  15831. if err != nil {
  15832. return nil, err
  15833. }
  15834. defer googleapi.CloseBody(res)
  15835. if err := googleapi.CheckResponse(res); err != nil {
  15836. return nil, err
  15837. }
  15838. ret := &EntityAdWordsLink{
  15839. ServerResponse: googleapi.ServerResponse{
  15840. Header: res.Header,
  15841. HTTPStatusCode: res.StatusCode,
  15842. },
  15843. }
  15844. target := &ret
  15845. if err := gensupport.DecodeResponse(target, res); err != nil {
  15846. return nil, err
  15847. }
  15848. return ret, nil
  15849. // {
  15850. // "description": "Creates a webProperty-Google Ads link.",
  15851. // "httpMethod": "POST",
  15852. // "id": "analytics.management.webPropertyAdWordsLinks.insert",
  15853. // "parameterOrder": [
  15854. // "accountId",
  15855. // "webPropertyId"
  15856. // ],
  15857. // "parameters": {
  15858. // "accountId": {
  15859. // "description": "ID of the Google Analytics account to create the link for.",
  15860. // "location": "path",
  15861. // "required": true,
  15862. // "type": "string"
  15863. // },
  15864. // "webPropertyId": {
  15865. // "description": "Web property ID to create the link for.",
  15866. // "location": "path",
  15867. // "required": true,
  15868. // "type": "string"
  15869. // }
  15870. // },
  15871. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  15872. // "request": {
  15873. // "$ref": "EntityAdWordsLink"
  15874. // },
  15875. // "response": {
  15876. // "$ref": "EntityAdWordsLink"
  15877. // },
  15878. // "scopes": [
  15879. // "https://www.googleapis.com/auth/analytics.edit"
  15880. // ]
  15881. // }
  15882. }
  15883. // method id "analytics.management.webPropertyAdWordsLinks.list":
  15884. type ManagementWebPropertyAdWordsLinksListCall struct {
  15885. s *Service
  15886. accountId string
  15887. webPropertyId string
  15888. urlParams_ gensupport.URLParams
  15889. ifNoneMatch_ string
  15890. ctx_ context.Context
  15891. header_ http.Header
  15892. }
  15893. // List: Lists webProperty-Google Ads links for a given web property.
  15894. func (r *ManagementWebPropertyAdWordsLinksService) List(accountId string, webPropertyId string) *ManagementWebPropertyAdWordsLinksListCall {
  15895. c := &ManagementWebPropertyAdWordsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15896. c.accountId = accountId
  15897. c.webPropertyId = webPropertyId
  15898. return c
  15899. }
  15900. // MaxResults sets the optional parameter "max-results": The maximum
  15901. // number of webProperty-Google Ads links to include in this response.
  15902. func (c *ManagementWebPropertyAdWordsLinksListCall) MaxResults(maxResults int64) *ManagementWebPropertyAdWordsLinksListCall {
  15903. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  15904. return c
  15905. }
  15906. // StartIndex sets the optional parameter "start-index": An index of the
  15907. // first webProperty-Google Ads link to retrieve. Use this parameter as
  15908. // a pagination mechanism along with the max-results parameter.
  15909. func (c *ManagementWebPropertyAdWordsLinksListCall) StartIndex(startIndex int64) *ManagementWebPropertyAdWordsLinksListCall {
  15910. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  15911. return c
  15912. }
  15913. // Fields allows partial responses to be retrieved. See
  15914. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15915. // for more information.
  15916. func (c *ManagementWebPropertyAdWordsLinksListCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksListCall {
  15917. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15918. return c
  15919. }
  15920. // IfNoneMatch sets the optional parameter which makes the operation
  15921. // fail if the object's ETag matches the given value. This is useful for
  15922. // getting updates only after the object has changed since the last
  15923. // request. Use googleapi.IsNotModified to check whether the response
  15924. // error from Do is the result of In-None-Match.
  15925. func (c *ManagementWebPropertyAdWordsLinksListCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksListCall {
  15926. c.ifNoneMatch_ = entityTag
  15927. return c
  15928. }
  15929. // Context sets the context to be used in this call's Do method. Any
  15930. // pending HTTP request will be aborted if the provided context is
  15931. // canceled.
  15932. func (c *ManagementWebPropertyAdWordsLinksListCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksListCall {
  15933. c.ctx_ = ctx
  15934. return c
  15935. }
  15936. // Header returns an http.Header that can be modified by the caller to
  15937. // add HTTP headers to the request.
  15938. func (c *ManagementWebPropertyAdWordsLinksListCall) Header() http.Header {
  15939. if c.header_ == nil {
  15940. c.header_ = make(http.Header)
  15941. }
  15942. return c.header_
  15943. }
  15944. func (c *ManagementWebPropertyAdWordsLinksListCall) doRequest(alt string) (*http.Response, error) {
  15945. reqHeaders := make(http.Header)
  15946. for k, v := range c.header_ {
  15947. reqHeaders[k] = v
  15948. }
  15949. reqHeaders.Set("User-Agent", c.s.userAgent())
  15950. if c.ifNoneMatch_ != "" {
  15951. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15952. }
  15953. var body io.Reader = nil
  15954. c.urlParams_.Set("alt", alt)
  15955. c.urlParams_.Set("prettyPrint", "false")
  15956. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  15957. urls += "?" + c.urlParams_.Encode()
  15958. req, err := http.NewRequest("GET", urls, body)
  15959. if err != nil {
  15960. return nil, err
  15961. }
  15962. req.Header = reqHeaders
  15963. googleapi.Expand(req.URL, map[string]string{
  15964. "accountId": c.accountId,
  15965. "webPropertyId": c.webPropertyId,
  15966. })
  15967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15968. }
  15969. // Do executes the "analytics.management.webPropertyAdWordsLinks.list" call.
  15970. // Exactly one of *EntityAdWordsLinks or error will be non-nil. Any
  15971. // non-2xx status code is an error. Response headers are in either
  15972. // *EntityAdWordsLinks.ServerResponse.Header or (if a response was
  15973. // returned at all) in error.(*googleapi.Error).Header. Use
  15974. // googleapi.IsNotModified to check whether the returned error was
  15975. // because http.StatusNotModified was returned.
  15976. func (c *ManagementWebPropertyAdWordsLinksListCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLinks, error) {
  15977. gensupport.SetOptions(c.urlParams_, opts...)
  15978. res, err := c.doRequest("json")
  15979. if res != nil && res.StatusCode == http.StatusNotModified {
  15980. if res.Body != nil {
  15981. res.Body.Close()
  15982. }
  15983. return nil, &googleapi.Error{
  15984. Code: res.StatusCode,
  15985. Header: res.Header,
  15986. }
  15987. }
  15988. if err != nil {
  15989. return nil, err
  15990. }
  15991. defer googleapi.CloseBody(res)
  15992. if err := googleapi.CheckResponse(res); err != nil {
  15993. return nil, err
  15994. }
  15995. ret := &EntityAdWordsLinks{
  15996. ServerResponse: googleapi.ServerResponse{
  15997. Header: res.Header,
  15998. HTTPStatusCode: res.StatusCode,
  15999. },
  16000. }
  16001. target := &ret
  16002. if err := gensupport.DecodeResponse(target, res); err != nil {
  16003. return nil, err
  16004. }
  16005. return ret, nil
  16006. // {
  16007. // "description": "Lists webProperty-Google Ads links for a given web property.",
  16008. // "httpMethod": "GET",
  16009. // "id": "analytics.management.webPropertyAdWordsLinks.list",
  16010. // "parameterOrder": [
  16011. // "accountId",
  16012. // "webPropertyId"
  16013. // ],
  16014. // "parameters": {
  16015. // "accountId": {
  16016. // "description": "ID of the account which the given web property belongs to.",
  16017. // "location": "path",
  16018. // "pattern": "\\d+",
  16019. // "required": true,
  16020. // "type": "string"
  16021. // },
  16022. // "max-results": {
  16023. // "description": "The maximum number of webProperty-Google Ads links to include in this response.",
  16024. // "format": "int32",
  16025. // "location": "query",
  16026. // "type": "integer"
  16027. // },
  16028. // "start-index": {
  16029. // "description": "An index of the first webProperty-Google Ads link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  16030. // "format": "int32",
  16031. // "location": "query",
  16032. // "minimum": "1",
  16033. // "type": "integer"
  16034. // },
  16035. // "webPropertyId": {
  16036. // "description": "Web property ID to retrieve the Google Ads links for.",
  16037. // "location": "path",
  16038. // "required": true,
  16039. // "type": "string"
  16040. // }
  16041. // },
  16042. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  16043. // "response": {
  16044. // "$ref": "EntityAdWordsLinks"
  16045. // },
  16046. // "scopes": [
  16047. // "https://www.googleapis.com/auth/analytics.edit",
  16048. // "https://www.googleapis.com/auth/analytics.readonly"
  16049. // ]
  16050. // }
  16051. }
  16052. // method id "analytics.management.webPropertyAdWordsLinks.patch":
  16053. type ManagementWebPropertyAdWordsLinksPatchCall struct {
  16054. s *Service
  16055. accountId string
  16056. webPropertyId string
  16057. webPropertyAdWordsLinkId string
  16058. entityadwordslink *EntityAdWordsLink
  16059. urlParams_ gensupport.URLParams
  16060. ctx_ context.Context
  16061. header_ http.Header
  16062. }
  16063. // Patch: Updates an existing webProperty-Google Ads link. This method
  16064. // supports patch semantics.
  16065. func (r *ManagementWebPropertyAdWordsLinksService) Patch(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksPatchCall {
  16066. c := &ManagementWebPropertyAdWordsLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16067. c.accountId = accountId
  16068. c.webPropertyId = webPropertyId
  16069. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  16070. c.entityadwordslink = entityadwordslink
  16071. return c
  16072. }
  16073. // Fields allows partial responses to be retrieved. See
  16074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16075. // for more information.
  16076. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksPatchCall {
  16077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16078. return c
  16079. }
  16080. // Context sets the context to be used in this call's Do method. Any
  16081. // pending HTTP request will be aborted if the provided context is
  16082. // canceled.
  16083. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksPatchCall {
  16084. c.ctx_ = ctx
  16085. return c
  16086. }
  16087. // Header returns an http.Header that can be modified by the caller to
  16088. // add HTTP headers to the request.
  16089. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Header() http.Header {
  16090. if c.header_ == nil {
  16091. c.header_ = make(http.Header)
  16092. }
  16093. return c.header_
  16094. }
  16095. func (c *ManagementWebPropertyAdWordsLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  16096. reqHeaders := make(http.Header)
  16097. for k, v := range c.header_ {
  16098. reqHeaders[k] = v
  16099. }
  16100. reqHeaders.Set("User-Agent", c.s.userAgent())
  16101. var body io.Reader = nil
  16102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  16103. if err != nil {
  16104. return nil, err
  16105. }
  16106. reqHeaders.Set("Content-Type", "application/json")
  16107. c.urlParams_.Set("alt", alt)
  16108. c.urlParams_.Set("prettyPrint", "false")
  16109. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  16110. urls += "?" + c.urlParams_.Encode()
  16111. req, err := http.NewRequest("PATCH", urls, body)
  16112. if err != nil {
  16113. return nil, err
  16114. }
  16115. req.Header = reqHeaders
  16116. googleapi.Expand(req.URL, map[string]string{
  16117. "accountId": c.accountId,
  16118. "webPropertyId": c.webPropertyId,
  16119. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  16120. })
  16121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16122. }
  16123. // Do executes the "analytics.management.webPropertyAdWordsLinks.patch" call.
  16124. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  16125. // non-2xx status code is an error. Response headers are in either
  16126. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  16127. // returned at all) in error.(*googleapi.Error).Header. Use
  16128. // googleapi.IsNotModified to check whether the returned error was
  16129. // because http.StatusNotModified was returned.
  16130. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, 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 := &EntityAdWordsLink{
  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": "Updates an existing webProperty-Google Ads link. This method supports patch semantics.",
  16162. // "httpMethod": "PATCH",
  16163. // "id": "analytics.management.webPropertyAdWordsLinks.patch",
  16164. // "parameterOrder": [
  16165. // "accountId",
  16166. // "webPropertyId",
  16167. // "webPropertyAdWordsLinkId"
  16168. // ],
  16169. // "parameters": {
  16170. // "accountId": {
  16171. // "description": "ID of the account which the given web property belongs to.",
  16172. // "location": "path",
  16173. // "required": true,
  16174. // "type": "string"
  16175. // },
  16176. // "webPropertyAdWordsLinkId": {
  16177. // "description": "Web property-Google Ads link ID.",
  16178. // "location": "path",
  16179. // "required": true,
  16180. // "type": "string"
  16181. // },
  16182. // "webPropertyId": {
  16183. // "description": "Web property ID to retrieve the Google Ads link for.",
  16184. // "location": "path",
  16185. // "required": true,
  16186. // "type": "string"
  16187. // }
  16188. // },
  16189. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  16190. // "request": {
  16191. // "$ref": "EntityAdWordsLink"
  16192. // },
  16193. // "response": {
  16194. // "$ref": "EntityAdWordsLink"
  16195. // },
  16196. // "scopes": [
  16197. // "https://www.googleapis.com/auth/analytics.edit"
  16198. // ]
  16199. // }
  16200. }
  16201. // method id "analytics.management.webPropertyAdWordsLinks.update":
  16202. type ManagementWebPropertyAdWordsLinksUpdateCall struct {
  16203. s *Service
  16204. accountId string
  16205. webPropertyId string
  16206. webPropertyAdWordsLinkId string
  16207. entityadwordslink *EntityAdWordsLink
  16208. urlParams_ gensupport.URLParams
  16209. ctx_ context.Context
  16210. header_ http.Header
  16211. }
  16212. // Update: Updates an existing webProperty-Google Ads link.
  16213. func (r *ManagementWebPropertyAdWordsLinksService) Update(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksUpdateCall {
  16214. c := &ManagementWebPropertyAdWordsLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16215. c.accountId = accountId
  16216. c.webPropertyId = webPropertyId
  16217. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  16218. c.entityadwordslink = entityadwordslink
  16219. return c
  16220. }
  16221. // Fields allows partial responses to be retrieved. See
  16222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16223. // for more information.
  16224. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksUpdateCall {
  16225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16226. return c
  16227. }
  16228. // Context sets the context to be used in this call's Do method. Any
  16229. // pending HTTP request will be aborted if the provided context is
  16230. // canceled.
  16231. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksUpdateCall {
  16232. c.ctx_ = ctx
  16233. return c
  16234. }
  16235. // Header returns an http.Header that can be modified by the caller to
  16236. // add HTTP headers to the request.
  16237. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Header() http.Header {
  16238. if c.header_ == nil {
  16239. c.header_ = make(http.Header)
  16240. }
  16241. return c.header_
  16242. }
  16243. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  16244. reqHeaders := make(http.Header)
  16245. for k, v := range c.header_ {
  16246. reqHeaders[k] = v
  16247. }
  16248. reqHeaders.Set("User-Agent", c.s.userAgent())
  16249. var body io.Reader = nil
  16250. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  16251. if err != nil {
  16252. return nil, err
  16253. }
  16254. reqHeaders.Set("Content-Type", "application/json")
  16255. c.urlParams_.Set("alt", alt)
  16256. c.urlParams_.Set("prettyPrint", "false")
  16257. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  16258. urls += "?" + c.urlParams_.Encode()
  16259. req, err := http.NewRequest("PUT", urls, body)
  16260. if err != nil {
  16261. return nil, err
  16262. }
  16263. req.Header = reqHeaders
  16264. googleapi.Expand(req.URL, map[string]string{
  16265. "accountId": c.accountId,
  16266. "webPropertyId": c.webPropertyId,
  16267. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  16268. })
  16269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16270. }
  16271. // Do executes the "analytics.management.webPropertyAdWordsLinks.update" call.
  16272. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  16273. // non-2xx status code is an error. Response headers are in either
  16274. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  16275. // returned at all) in error.(*googleapi.Error).Header. Use
  16276. // googleapi.IsNotModified to check whether the returned error was
  16277. // because http.StatusNotModified was returned.
  16278. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  16279. gensupport.SetOptions(c.urlParams_, opts...)
  16280. res, err := c.doRequest("json")
  16281. if res != nil && res.StatusCode == http.StatusNotModified {
  16282. if res.Body != nil {
  16283. res.Body.Close()
  16284. }
  16285. return nil, &googleapi.Error{
  16286. Code: res.StatusCode,
  16287. Header: res.Header,
  16288. }
  16289. }
  16290. if err != nil {
  16291. return nil, err
  16292. }
  16293. defer googleapi.CloseBody(res)
  16294. if err := googleapi.CheckResponse(res); err != nil {
  16295. return nil, err
  16296. }
  16297. ret := &EntityAdWordsLink{
  16298. ServerResponse: googleapi.ServerResponse{
  16299. Header: res.Header,
  16300. HTTPStatusCode: res.StatusCode,
  16301. },
  16302. }
  16303. target := &ret
  16304. if err := gensupport.DecodeResponse(target, res); err != nil {
  16305. return nil, err
  16306. }
  16307. return ret, nil
  16308. // {
  16309. // "description": "Updates an existing webProperty-Google Ads link.",
  16310. // "httpMethod": "PUT",
  16311. // "id": "analytics.management.webPropertyAdWordsLinks.update",
  16312. // "parameterOrder": [
  16313. // "accountId",
  16314. // "webPropertyId",
  16315. // "webPropertyAdWordsLinkId"
  16316. // ],
  16317. // "parameters": {
  16318. // "accountId": {
  16319. // "description": "ID of the account which the given web property belongs to.",
  16320. // "location": "path",
  16321. // "required": true,
  16322. // "type": "string"
  16323. // },
  16324. // "webPropertyAdWordsLinkId": {
  16325. // "description": "Web property-Google Ads link ID.",
  16326. // "location": "path",
  16327. // "required": true,
  16328. // "type": "string"
  16329. // },
  16330. // "webPropertyId": {
  16331. // "description": "Web property ID to retrieve the Google Ads link for.",
  16332. // "location": "path",
  16333. // "required": true,
  16334. // "type": "string"
  16335. // }
  16336. // },
  16337. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  16338. // "request": {
  16339. // "$ref": "EntityAdWordsLink"
  16340. // },
  16341. // "response": {
  16342. // "$ref": "EntityAdWordsLink"
  16343. // },
  16344. // "scopes": [
  16345. // "https://www.googleapis.com/auth/analytics.edit"
  16346. // ]
  16347. // }
  16348. }
  16349. // method id "analytics.management.webproperties.get":
  16350. type ManagementWebpropertiesGetCall struct {
  16351. s *Service
  16352. accountId string
  16353. webPropertyId string
  16354. urlParams_ gensupport.URLParams
  16355. ifNoneMatch_ string
  16356. ctx_ context.Context
  16357. header_ http.Header
  16358. }
  16359. // Get: Gets a web property to which the user has access.
  16360. func (r *ManagementWebpropertiesService) Get(accountId string, webPropertyId string) *ManagementWebpropertiesGetCall {
  16361. c := &ManagementWebpropertiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16362. c.accountId = accountId
  16363. c.webPropertyId = webPropertyId
  16364. return c
  16365. }
  16366. // Fields allows partial responses to be retrieved. See
  16367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16368. // for more information.
  16369. func (c *ManagementWebpropertiesGetCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesGetCall {
  16370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16371. return c
  16372. }
  16373. // IfNoneMatch sets the optional parameter which makes the operation
  16374. // fail if the object's ETag matches the given value. This is useful for
  16375. // getting updates only after the object has changed since the last
  16376. // request. Use googleapi.IsNotModified to check whether the response
  16377. // error from Do is the result of In-None-Match.
  16378. func (c *ManagementWebpropertiesGetCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesGetCall {
  16379. c.ifNoneMatch_ = entityTag
  16380. return c
  16381. }
  16382. // Context sets the context to be used in this call's Do method. Any
  16383. // pending HTTP request will be aborted if the provided context is
  16384. // canceled.
  16385. func (c *ManagementWebpropertiesGetCall) Context(ctx context.Context) *ManagementWebpropertiesGetCall {
  16386. c.ctx_ = ctx
  16387. return c
  16388. }
  16389. // Header returns an http.Header that can be modified by the caller to
  16390. // add HTTP headers to the request.
  16391. func (c *ManagementWebpropertiesGetCall) Header() http.Header {
  16392. if c.header_ == nil {
  16393. c.header_ = make(http.Header)
  16394. }
  16395. return c.header_
  16396. }
  16397. func (c *ManagementWebpropertiesGetCall) doRequest(alt string) (*http.Response, error) {
  16398. reqHeaders := make(http.Header)
  16399. for k, v := range c.header_ {
  16400. reqHeaders[k] = v
  16401. }
  16402. reqHeaders.Set("User-Agent", c.s.userAgent())
  16403. if c.ifNoneMatch_ != "" {
  16404. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16405. }
  16406. var body io.Reader = nil
  16407. c.urlParams_.Set("alt", alt)
  16408. c.urlParams_.Set("prettyPrint", "false")
  16409. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16410. urls += "?" + c.urlParams_.Encode()
  16411. req, err := http.NewRequest("GET", urls, body)
  16412. if err != nil {
  16413. return nil, err
  16414. }
  16415. req.Header = reqHeaders
  16416. googleapi.Expand(req.URL, map[string]string{
  16417. "accountId": c.accountId,
  16418. "webPropertyId": c.webPropertyId,
  16419. })
  16420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16421. }
  16422. // Do executes the "analytics.management.webproperties.get" call.
  16423. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16424. // status code is an error. Response headers are in either
  16425. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16426. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16427. // to check whether the returned error was because
  16428. // http.StatusNotModified was returned.
  16429. func (c *ManagementWebpropertiesGetCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16430. gensupport.SetOptions(c.urlParams_, opts...)
  16431. res, err := c.doRequest("json")
  16432. if res != nil && res.StatusCode == http.StatusNotModified {
  16433. if res.Body != nil {
  16434. res.Body.Close()
  16435. }
  16436. return nil, &googleapi.Error{
  16437. Code: res.StatusCode,
  16438. Header: res.Header,
  16439. }
  16440. }
  16441. if err != nil {
  16442. return nil, err
  16443. }
  16444. defer googleapi.CloseBody(res)
  16445. if err := googleapi.CheckResponse(res); err != nil {
  16446. return nil, err
  16447. }
  16448. ret := &Webproperty{
  16449. ServerResponse: googleapi.ServerResponse{
  16450. Header: res.Header,
  16451. HTTPStatusCode: res.StatusCode,
  16452. },
  16453. }
  16454. target := &ret
  16455. if err := gensupport.DecodeResponse(target, res); err != nil {
  16456. return nil, err
  16457. }
  16458. return ret, nil
  16459. // {
  16460. // "description": "Gets a web property to which the user has access.",
  16461. // "httpMethod": "GET",
  16462. // "id": "analytics.management.webproperties.get",
  16463. // "parameterOrder": [
  16464. // "accountId",
  16465. // "webPropertyId"
  16466. // ],
  16467. // "parameters": {
  16468. // "accountId": {
  16469. // "description": "Account ID to retrieve the web property for.",
  16470. // "location": "path",
  16471. // "pattern": "[0-9]+",
  16472. // "required": true,
  16473. // "type": "string"
  16474. // },
  16475. // "webPropertyId": {
  16476. // "description": "ID to retrieve the web property for.",
  16477. // "location": "path",
  16478. // "pattern": "UA-[0-9]+-[0-9]+",
  16479. // "required": true,
  16480. // "type": "string"
  16481. // }
  16482. // },
  16483. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  16484. // "response": {
  16485. // "$ref": "Webproperty"
  16486. // },
  16487. // "scopes": [
  16488. // "https://www.googleapis.com/auth/analytics.edit",
  16489. // "https://www.googleapis.com/auth/analytics.readonly"
  16490. // ]
  16491. // }
  16492. }
  16493. // method id "analytics.management.webproperties.insert":
  16494. type ManagementWebpropertiesInsertCall struct {
  16495. s *Service
  16496. accountId string
  16497. webproperty *Webproperty
  16498. urlParams_ gensupport.URLParams
  16499. ctx_ context.Context
  16500. header_ http.Header
  16501. }
  16502. // Insert: Create a new property if the account has fewer than 20
  16503. // properties. Web properties are visible in the Google Analytics
  16504. // interface only if they have at least one profile.
  16505. func (r *ManagementWebpropertiesService) Insert(accountId string, webproperty *Webproperty) *ManagementWebpropertiesInsertCall {
  16506. c := &ManagementWebpropertiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16507. c.accountId = accountId
  16508. c.webproperty = webproperty
  16509. return c
  16510. }
  16511. // Fields allows partial responses to be retrieved. See
  16512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16513. // for more information.
  16514. func (c *ManagementWebpropertiesInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesInsertCall {
  16515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16516. return c
  16517. }
  16518. // Context sets the context to be used in this call's Do method. Any
  16519. // pending HTTP request will be aborted if the provided context is
  16520. // canceled.
  16521. func (c *ManagementWebpropertiesInsertCall) Context(ctx context.Context) *ManagementWebpropertiesInsertCall {
  16522. c.ctx_ = ctx
  16523. return c
  16524. }
  16525. // Header returns an http.Header that can be modified by the caller to
  16526. // add HTTP headers to the request.
  16527. func (c *ManagementWebpropertiesInsertCall) Header() http.Header {
  16528. if c.header_ == nil {
  16529. c.header_ = make(http.Header)
  16530. }
  16531. return c.header_
  16532. }
  16533. func (c *ManagementWebpropertiesInsertCall) doRequest(alt string) (*http.Response, error) {
  16534. reqHeaders := make(http.Header)
  16535. for k, v := range c.header_ {
  16536. reqHeaders[k] = v
  16537. }
  16538. reqHeaders.Set("User-Agent", c.s.userAgent())
  16539. var body io.Reader = nil
  16540. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16541. if err != nil {
  16542. return nil, err
  16543. }
  16544. reqHeaders.Set("Content-Type", "application/json")
  16545. c.urlParams_.Set("alt", alt)
  16546. c.urlParams_.Set("prettyPrint", "false")
  16547. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  16548. urls += "?" + c.urlParams_.Encode()
  16549. req, err := http.NewRequest("POST", urls, body)
  16550. if err != nil {
  16551. return nil, err
  16552. }
  16553. req.Header = reqHeaders
  16554. googleapi.Expand(req.URL, map[string]string{
  16555. "accountId": c.accountId,
  16556. })
  16557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16558. }
  16559. // Do executes the "analytics.management.webproperties.insert" call.
  16560. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16561. // status code is an error. Response headers are in either
  16562. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16563. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16564. // to check whether the returned error was because
  16565. // http.StatusNotModified was returned.
  16566. func (c *ManagementWebpropertiesInsertCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16567. gensupport.SetOptions(c.urlParams_, opts...)
  16568. res, err := c.doRequest("json")
  16569. if res != nil && res.StatusCode == http.StatusNotModified {
  16570. if res.Body != nil {
  16571. res.Body.Close()
  16572. }
  16573. return nil, &googleapi.Error{
  16574. Code: res.StatusCode,
  16575. Header: res.Header,
  16576. }
  16577. }
  16578. if err != nil {
  16579. return nil, err
  16580. }
  16581. defer googleapi.CloseBody(res)
  16582. if err := googleapi.CheckResponse(res); err != nil {
  16583. return nil, err
  16584. }
  16585. ret := &Webproperty{
  16586. ServerResponse: googleapi.ServerResponse{
  16587. Header: res.Header,
  16588. HTTPStatusCode: res.StatusCode,
  16589. },
  16590. }
  16591. target := &ret
  16592. if err := gensupport.DecodeResponse(target, res); err != nil {
  16593. return nil, err
  16594. }
  16595. return ret, nil
  16596. // {
  16597. // "description": "Create a new property if the account has fewer than 20 properties. Web properties are visible in the Google Analytics interface only if they have at least one profile.",
  16598. // "httpMethod": "POST",
  16599. // "id": "analytics.management.webproperties.insert",
  16600. // "parameterOrder": [
  16601. // "accountId"
  16602. // ],
  16603. // "parameters": {
  16604. // "accountId": {
  16605. // "description": "Account ID to create the web property for.",
  16606. // "location": "path",
  16607. // "required": true,
  16608. // "type": "string"
  16609. // }
  16610. // },
  16611. // "path": "management/accounts/{accountId}/webproperties",
  16612. // "request": {
  16613. // "$ref": "Webproperty"
  16614. // },
  16615. // "response": {
  16616. // "$ref": "Webproperty"
  16617. // },
  16618. // "scopes": [
  16619. // "https://www.googleapis.com/auth/analytics.edit"
  16620. // ]
  16621. // }
  16622. }
  16623. // method id "analytics.management.webproperties.list":
  16624. type ManagementWebpropertiesListCall struct {
  16625. s *Service
  16626. accountId string
  16627. urlParams_ gensupport.URLParams
  16628. ifNoneMatch_ string
  16629. ctx_ context.Context
  16630. header_ http.Header
  16631. }
  16632. // List: Lists web properties to which the user has access.
  16633. func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall {
  16634. c := &ManagementWebpropertiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16635. c.accountId = accountId
  16636. return c
  16637. }
  16638. // MaxResults sets the optional parameter "max-results": The maximum
  16639. // number of web properties to include in this response.
  16640. func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall {
  16641. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  16642. return c
  16643. }
  16644. // StartIndex sets the optional parameter "start-index": An index of the
  16645. // first entity to retrieve. Use this parameter as a pagination
  16646. // mechanism along with the max-results parameter.
  16647. func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall {
  16648. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  16649. return c
  16650. }
  16651. // Fields allows partial responses to be retrieved. See
  16652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16653. // for more information.
  16654. func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall {
  16655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16656. return c
  16657. }
  16658. // IfNoneMatch sets the optional parameter which makes the operation
  16659. // fail if the object's ETag matches the given value. This is useful for
  16660. // getting updates only after the object has changed since the last
  16661. // request. Use googleapi.IsNotModified to check whether the response
  16662. // error from Do is the result of In-None-Match.
  16663. func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall {
  16664. c.ifNoneMatch_ = entityTag
  16665. return c
  16666. }
  16667. // Context sets the context to be used in this call's Do method. Any
  16668. // pending HTTP request will be aborted if the provided context is
  16669. // canceled.
  16670. func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall {
  16671. c.ctx_ = ctx
  16672. return c
  16673. }
  16674. // Header returns an http.Header that can be modified by the caller to
  16675. // add HTTP headers to the request.
  16676. func (c *ManagementWebpropertiesListCall) Header() http.Header {
  16677. if c.header_ == nil {
  16678. c.header_ = make(http.Header)
  16679. }
  16680. return c.header_
  16681. }
  16682. func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, error) {
  16683. reqHeaders := make(http.Header)
  16684. for k, v := range c.header_ {
  16685. reqHeaders[k] = v
  16686. }
  16687. reqHeaders.Set("User-Agent", c.s.userAgent())
  16688. if c.ifNoneMatch_ != "" {
  16689. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16690. }
  16691. var body io.Reader = nil
  16692. c.urlParams_.Set("alt", alt)
  16693. c.urlParams_.Set("prettyPrint", "false")
  16694. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  16695. urls += "?" + c.urlParams_.Encode()
  16696. req, err := http.NewRequest("GET", urls, body)
  16697. if err != nil {
  16698. return nil, err
  16699. }
  16700. req.Header = reqHeaders
  16701. googleapi.Expand(req.URL, map[string]string{
  16702. "accountId": c.accountId,
  16703. })
  16704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16705. }
  16706. // Do executes the "analytics.management.webproperties.list" call.
  16707. // Exactly one of *Webproperties or error will be non-nil. Any non-2xx
  16708. // status code is an error. Response headers are in either
  16709. // *Webproperties.ServerResponse.Header or (if a response was returned
  16710. // at all) in error.(*googleapi.Error).Header. Use
  16711. // googleapi.IsNotModified to check whether the returned error was
  16712. // because http.StatusNotModified was returned.
  16713. func (c *ManagementWebpropertiesListCall) Do(opts ...googleapi.CallOption) (*Webproperties, error) {
  16714. gensupport.SetOptions(c.urlParams_, opts...)
  16715. res, err := c.doRequest("json")
  16716. if res != nil && res.StatusCode == http.StatusNotModified {
  16717. if res.Body != nil {
  16718. res.Body.Close()
  16719. }
  16720. return nil, &googleapi.Error{
  16721. Code: res.StatusCode,
  16722. Header: res.Header,
  16723. }
  16724. }
  16725. if err != nil {
  16726. return nil, err
  16727. }
  16728. defer googleapi.CloseBody(res)
  16729. if err := googleapi.CheckResponse(res); err != nil {
  16730. return nil, err
  16731. }
  16732. ret := &Webproperties{
  16733. ServerResponse: googleapi.ServerResponse{
  16734. Header: res.Header,
  16735. HTTPStatusCode: res.StatusCode,
  16736. },
  16737. }
  16738. target := &ret
  16739. if err := gensupport.DecodeResponse(target, res); err != nil {
  16740. return nil, err
  16741. }
  16742. return ret, nil
  16743. // {
  16744. // "description": "Lists web properties to which the user has access.",
  16745. // "httpMethod": "GET",
  16746. // "id": "analytics.management.webproperties.list",
  16747. // "parameterOrder": [
  16748. // "accountId"
  16749. // ],
  16750. // "parameters": {
  16751. // "accountId": {
  16752. // "description": "Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.",
  16753. // "location": "path",
  16754. // "required": true,
  16755. // "type": "string"
  16756. // },
  16757. // "max-results": {
  16758. // "description": "The maximum number of web properties to include in this response.",
  16759. // "format": "int32",
  16760. // "location": "query",
  16761. // "type": "integer"
  16762. // },
  16763. // "start-index": {
  16764. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  16765. // "format": "int32",
  16766. // "location": "query",
  16767. // "minimum": "1",
  16768. // "type": "integer"
  16769. // }
  16770. // },
  16771. // "path": "management/accounts/{accountId}/webproperties",
  16772. // "response": {
  16773. // "$ref": "Webproperties"
  16774. // },
  16775. // "scopes": [
  16776. // "https://www.googleapis.com/auth/analytics",
  16777. // "https://www.googleapis.com/auth/analytics.edit",
  16778. // "https://www.googleapis.com/auth/analytics.readonly"
  16779. // ]
  16780. // }
  16781. }
  16782. // method id "analytics.management.webproperties.patch":
  16783. type ManagementWebpropertiesPatchCall struct {
  16784. s *Service
  16785. accountId string
  16786. webPropertyId string
  16787. webproperty *Webproperty
  16788. urlParams_ gensupport.URLParams
  16789. ctx_ context.Context
  16790. header_ http.Header
  16791. }
  16792. // Patch: Updates an existing web property. This method supports patch
  16793. // semantics.
  16794. func (r *ManagementWebpropertiesService) Patch(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesPatchCall {
  16795. c := &ManagementWebpropertiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16796. c.accountId = accountId
  16797. c.webPropertyId = webPropertyId
  16798. c.webproperty = webproperty
  16799. return c
  16800. }
  16801. // Fields allows partial responses to be retrieved. See
  16802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16803. // for more information.
  16804. func (c *ManagementWebpropertiesPatchCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesPatchCall {
  16805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16806. return c
  16807. }
  16808. // Context sets the context to be used in this call's Do method. Any
  16809. // pending HTTP request will be aborted if the provided context is
  16810. // canceled.
  16811. func (c *ManagementWebpropertiesPatchCall) Context(ctx context.Context) *ManagementWebpropertiesPatchCall {
  16812. c.ctx_ = ctx
  16813. return c
  16814. }
  16815. // Header returns an http.Header that can be modified by the caller to
  16816. // add HTTP headers to the request.
  16817. func (c *ManagementWebpropertiesPatchCall) Header() http.Header {
  16818. if c.header_ == nil {
  16819. c.header_ = make(http.Header)
  16820. }
  16821. return c.header_
  16822. }
  16823. func (c *ManagementWebpropertiesPatchCall) doRequest(alt string) (*http.Response, error) {
  16824. reqHeaders := make(http.Header)
  16825. for k, v := range c.header_ {
  16826. reqHeaders[k] = v
  16827. }
  16828. reqHeaders.Set("User-Agent", c.s.userAgent())
  16829. var body io.Reader = nil
  16830. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16831. if err != nil {
  16832. return nil, err
  16833. }
  16834. reqHeaders.Set("Content-Type", "application/json")
  16835. c.urlParams_.Set("alt", alt)
  16836. c.urlParams_.Set("prettyPrint", "false")
  16837. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16838. urls += "?" + c.urlParams_.Encode()
  16839. req, err := http.NewRequest("PATCH", urls, body)
  16840. if err != nil {
  16841. return nil, err
  16842. }
  16843. req.Header = reqHeaders
  16844. googleapi.Expand(req.URL, map[string]string{
  16845. "accountId": c.accountId,
  16846. "webPropertyId": c.webPropertyId,
  16847. })
  16848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16849. }
  16850. // Do executes the "analytics.management.webproperties.patch" call.
  16851. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16852. // status code is an error. Response headers are in either
  16853. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16854. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16855. // to check whether the returned error was because
  16856. // http.StatusNotModified was returned.
  16857. func (c *ManagementWebpropertiesPatchCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16858. gensupport.SetOptions(c.urlParams_, opts...)
  16859. res, err := c.doRequest("json")
  16860. if res != nil && res.StatusCode == http.StatusNotModified {
  16861. if res.Body != nil {
  16862. res.Body.Close()
  16863. }
  16864. return nil, &googleapi.Error{
  16865. Code: res.StatusCode,
  16866. Header: res.Header,
  16867. }
  16868. }
  16869. if err != nil {
  16870. return nil, err
  16871. }
  16872. defer googleapi.CloseBody(res)
  16873. if err := googleapi.CheckResponse(res); err != nil {
  16874. return nil, err
  16875. }
  16876. ret := &Webproperty{
  16877. ServerResponse: googleapi.ServerResponse{
  16878. Header: res.Header,
  16879. HTTPStatusCode: res.StatusCode,
  16880. },
  16881. }
  16882. target := &ret
  16883. if err := gensupport.DecodeResponse(target, res); err != nil {
  16884. return nil, err
  16885. }
  16886. return ret, nil
  16887. // {
  16888. // "description": "Updates an existing web property. This method supports patch semantics.",
  16889. // "httpMethod": "PATCH",
  16890. // "id": "analytics.management.webproperties.patch",
  16891. // "parameterOrder": [
  16892. // "accountId",
  16893. // "webPropertyId"
  16894. // ],
  16895. // "parameters": {
  16896. // "accountId": {
  16897. // "description": "Account ID to which the web property belongs",
  16898. // "location": "path",
  16899. // "required": true,
  16900. // "type": "string"
  16901. // },
  16902. // "webPropertyId": {
  16903. // "description": "Web property ID",
  16904. // "location": "path",
  16905. // "required": true,
  16906. // "type": "string"
  16907. // }
  16908. // },
  16909. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  16910. // "request": {
  16911. // "$ref": "Webproperty"
  16912. // },
  16913. // "response": {
  16914. // "$ref": "Webproperty"
  16915. // },
  16916. // "scopes": [
  16917. // "https://www.googleapis.com/auth/analytics.edit"
  16918. // ]
  16919. // }
  16920. }
  16921. // method id "analytics.management.webproperties.update":
  16922. type ManagementWebpropertiesUpdateCall struct {
  16923. s *Service
  16924. accountId string
  16925. webPropertyId string
  16926. webproperty *Webproperty
  16927. urlParams_ gensupport.URLParams
  16928. ctx_ context.Context
  16929. header_ http.Header
  16930. }
  16931. // Update: Updates an existing web property.
  16932. func (r *ManagementWebpropertiesService) Update(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesUpdateCall {
  16933. c := &ManagementWebpropertiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16934. c.accountId = accountId
  16935. c.webPropertyId = webPropertyId
  16936. c.webproperty = webproperty
  16937. return c
  16938. }
  16939. // Fields allows partial responses to be retrieved. See
  16940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16941. // for more information.
  16942. func (c *ManagementWebpropertiesUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesUpdateCall {
  16943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16944. return c
  16945. }
  16946. // Context sets the context to be used in this call's Do method. Any
  16947. // pending HTTP request will be aborted if the provided context is
  16948. // canceled.
  16949. func (c *ManagementWebpropertiesUpdateCall) Context(ctx context.Context) *ManagementWebpropertiesUpdateCall {
  16950. c.ctx_ = ctx
  16951. return c
  16952. }
  16953. // Header returns an http.Header that can be modified by the caller to
  16954. // add HTTP headers to the request.
  16955. func (c *ManagementWebpropertiesUpdateCall) Header() http.Header {
  16956. if c.header_ == nil {
  16957. c.header_ = make(http.Header)
  16958. }
  16959. return c.header_
  16960. }
  16961. func (c *ManagementWebpropertiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16962. reqHeaders := make(http.Header)
  16963. for k, v := range c.header_ {
  16964. reqHeaders[k] = v
  16965. }
  16966. reqHeaders.Set("User-Agent", c.s.userAgent())
  16967. var body io.Reader = nil
  16968. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16969. if err != nil {
  16970. return nil, err
  16971. }
  16972. reqHeaders.Set("Content-Type", "application/json")
  16973. c.urlParams_.Set("alt", alt)
  16974. c.urlParams_.Set("prettyPrint", "false")
  16975. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16976. urls += "?" + c.urlParams_.Encode()
  16977. req, err := http.NewRequest("PUT", urls, body)
  16978. if err != nil {
  16979. return nil, err
  16980. }
  16981. req.Header = reqHeaders
  16982. googleapi.Expand(req.URL, map[string]string{
  16983. "accountId": c.accountId,
  16984. "webPropertyId": c.webPropertyId,
  16985. })
  16986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16987. }
  16988. // Do executes the "analytics.management.webproperties.update" call.
  16989. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16990. // status code is an error. Response headers are in either
  16991. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16992. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16993. // to check whether the returned error was because
  16994. // http.StatusNotModified was returned.
  16995. func (c *ManagementWebpropertiesUpdateCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16996. gensupport.SetOptions(c.urlParams_, opts...)
  16997. res, err := c.doRequest("json")
  16998. if res != nil && res.StatusCode == http.StatusNotModified {
  16999. if res.Body != nil {
  17000. res.Body.Close()
  17001. }
  17002. return nil, &googleapi.Error{
  17003. Code: res.StatusCode,
  17004. Header: res.Header,
  17005. }
  17006. }
  17007. if err != nil {
  17008. return nil, err
  17009. }
  17010. defer googleapi.CloseBody(res)
  17011. if err := googleapi.CheckResponse(res); err != nil {
  17012. return nil, err
  17013. }
  17014. ret := &Webproperty{
  17015. ServerResponse: googleapi.ServerResponse{
  17016. Header: res.Header,
  17017. HTTPStatusCode: res.StatusCode,
  17018. },
  17019. }
  17020. target := &ret
  17021. if err := gensupport.DecodeResponse(target, res); err != nil {
  17022. return nil, err
  17023. }
  17024. return ret, nil
  17025. // {
  17026. // "description": "Updates an existing web property.",
  17027. // "httpMethod": "PUT",
  17028. // "id": "analytics.management.webproperties.update",
  17029. // "parameterOrder": [
  17030. // "accountId",
  17031. // "webPropertyId"
  17032. // ],
  17033. // "parameters": {
  17034. // "accountId": {
  17035. // "description": "Account ID to which the web property belongs",
  17036. // "location": "path",
  17037. // "required": true,
  17038. // "type": "string"
  17039. // },
  17040. // "webPropertyId": {
  17041. // "description": "Web property ID",
  17042. // "location": "path",
  17043. // "required": true,
  17044. // "type": "string"
  17045. // }
  17046. // },
  17047. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  17048. // "request": {
  17049. // "$ref": "Webproperty"
  17050. // },
  17051. // "response": {
  17052. // "$ref": "Webproperty"
  17053. // },
  17054. // "scopes": [
  17055. // "https://www.googleapis.com/auth/analytics.edit"
  17056. // ]
  17057. // }
  17058. }
  17059. // method id "analytics.management.webpropertyUserLinks.delete":
  17060. type ManagementWebpropertyUserLinksDeleteCall struct {
  17061. s *Service
  17062. accountId string
  17063. webPropertyId string
  17064. linkId string
  17065. urlParams_ gensupport.URLParams
  17066. ctx_ context.Context
  17067. header_ http.Header
  17068. }
  17069. // Delete: Removes a user from the given web property.
  17070. func (r *ManagementWebpropertyUserLinksService) Delete(accountId string, webPropertyId string, linkId string) *ManagementWebpropertyUserLinksDeleteCall {
  17071. c := &ManagementWebpropertyUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17072. c.accountId = accountId
  17073. c.webPropertyId = webPropertyId
  17074. c.linkId = linkId
  17075. return c
  17076. }
  17077. // Fields allows partial responses to be retrieved. See
  17078. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17079. // for more information.
  17080. func (c *ManagementWebpropertyUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksDeleteCall {
  17081. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17082. return c
  17083. }
  17084. // Context sets the context to be used in this call's Do method. Any
  17085. // pending HTTP request will be aborted if the provided context is
  17086. // canceled.
  17087. func (c *ManagementWebpropertyUserLinksDeleteCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksDeleteCall {
  17088. c.ctx_ = ctx
  17089. return c
  17090. }
  17091. // Header returns an http.Header that can be modified by the caller to
  17092. // add HTTP headers to the request.
  17093. func (c *ManagementWebpropertyUserLinksDeleteCall) Header() http.Header {
  17094. if c.header_ == nil {
  17095. c.header_ = make(http.Header)
  17096. }
  17097. return c.header_
  17098. }
  17099. func (c *ManagementWebpropertyUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  17100. reqHeaders := make(http.Header)
  17101. for k, v := range c.header_ {
  17102. reqHeaders[k] = v
  17103. }
  17104. reqHeaders.Set("User-Agent", c.s.userAgent())
  17105. var body io.Reader = nil
  17106. c.urlParams_.Set("alt", alt)
  17107. c.urlParams_.Set("prettyPrint", "false")
  17108. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  17109. urls += "?" + c.urlParams_.Encode()
  17110. req, err := http.NewRequest("DELETE", urls, body)
  17111. if err != nil {
  17112. return nil, err
  17113. }
  17114. req.Header = reqHeaders
  17115. googleapi.Expand(req.URL, map[string]string{
  17116. "accountId": c.accountId,
  17117. "webPropertyId": c.webPropertyId,
  17118. "linkId": c.linkId,
  17119. })
  17120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17121. }
  17122. // Do executes the "analytics.management.webpropertyUserLinks.delete" call.
  17123. func (c *ManagementWebpropertyUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  17124. gensupport.SetOptions(c.urlParams_, opts...)
  17125. res, err := c.doRequest("json")
  17126. if err != nil {
  17127. return err
  17128. }
  17129. defer googleapi.CloseBody(res)
  17130. if err := googleapi.CheckResponse(res); err != nil {
  17131. return err
  17132. }
  17133. return nil
  17134. // {
  17135. // "description": "Removes a user from the given web property.",
  17136. // "httpMethod": "DELETE",
  17137. // "id": "analytics.management.webpropertyUserLinks.delete",
  17138. // "parameterOrder": [
  17139. // "accountId",
  17140. // "webPropertyId",
  17141. // "linkId"
  17142. // ],
  17143. // "parameters": {
  17144. // "accountId": {
  17145. // "description": "Account ID to delete the user link for.",
  17146. // "location": "path",
  17147. // "required": true,
  17148. // "type": "string"
  17149. // },
  17150. // "linkId": {
  17151. // "description": "Link ID to delete the user link for.",
  17152. // "location": "path",
  17153. // "required": true,
  17154. // "type": "string"
  17155. // },
  17156. // "webPropertyId": {
  17157. // "description": "Web Property ID to delete the user link for.",
  17158. // "location": "path",
  17159. // "required": true,
  17160. // "type": "string"
  17161. // }
  17162. // },
  17163. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  17164. // "scopes": [
  17165. // "https://www.googleapis.com/auth/analytics.manage.users"
  17166. // ]
  17167. // }
  17168. }
  17169. // method id "analytics.management.webpropertyUserLinks.insert":
  17170. type ManagementWebpropertyUserLinksInsertCall struct {
  17171. s *Service
  17172. accountId string
  17173. webPropertyId string
  17174. entityuserlink *EntityUserLink
  17175. urlParams_ gensupport.URLParams
  17176. ctx_ context.Context
  17177. header_ http.Header
  17178. }
  17179. // Insert: Adds a new user to the given web property.
  17180. func (r *ManagementWebpropertyUserLinksService) Insert(accountId string, webPropertyId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksInsertCall {
  17181. c := &ManagementWebpropertyUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17182. c.accountId = accountId
  17183. c.webPropertyId = webPropertyId
  17184. c.entityuserlink = entityuserlink
  17185. return c
  17186. }
  17187. // Fields allows partial responses to be retrieved. See
  17188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17189. // for more information.
  17190. func (c *ManagementWebpropertyUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksInsertCall {
  17191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17192. return c
  17193. }
  17194. // Context sets the context to be used in this call's Do method. Any
  17195. // pending HTTP request will be aborted if the provided context is
  17196. // canceled.
  17197. func (c *ManagementWebpropertyUserLinksInsertCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksInsertCall {
  17198. c.ctx_ = ctx
  17199. return c
  17200. }
  17201. // Header returns an http.Header that can be modified by the caller to
  17202. // add HTTP headers to the request.
  17203. func (c *ManagementWebpropertyUserLinksInsertCall) Header() http.Header {
  17204. if c.header_ == nil {
  17205. c.header_ = make(http.Header)
  17206. }
  17207. return c.header_
  17208. }
  17209. func (c *ManagementWebpropertyUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  17210. reqHeaders := make(http.Header)
  17211. for k, v := range c.header_ {
  17212. reqHeaders[k] = v
  17213. }
  17214. reqHeaders.Set("User-Agent", c.s.userAgent())
  17215. var body io.Reader = nil
  17216. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  17217. if err != nil {
  17218. return nil, err
  17219. }
  17220. reqHeaders.Set("Content-Type", "application/json")
  17221. c.urlParams_.Set("alt", alt)
  17222. c.urlParams_.Set("prettyPrint", "false")
  17223. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  17224. urls += "?" + c.urlParams_.Encode()
  17225. req, err := http.NewRequest("POST", urls, body)
  17226. if err != nil {
  17227. return nil, err
  17228. }
  17229. req.Header = reqHeaders
  17230. googleapi.Expand(req.URL, map[string]string{
  17231. "accountId": c.accountId,
  17232. "webPropertyId": c.webPropertyId,
  17233. })
  17234. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17235. }
  17236. // Do executes the "analytics.management.webpropertyUserLinks.insert" call.
  17237. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  17238. // status code is an error. Response headers are in either
  17239. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  17240. // at all) in error.(*googleapi.Error).Header. Use
  17241. // googleapi.IsNotModified to check whether the returned error was
  17242. // because http.StatusNotModified was returned.
  17243. func (c *ManagementWebpropertyUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  17244. gensupport.SetOptions(c.urlParams_, opts...)
  17245. res, err := c.doRequest("json")
  17246. if res != nil && res.StatusCode == http.StatusNotModified {
  17247. if res.Body != nil {
  17248. res.Body.Close()
  17249. }
  17250. return nil, &googleapi.Error{
  17251. Code: res.StatusCode,
  17252. Header: res.Header,
  17253. }
  17254. }
  17255. if err != nil {
  17256. return nil, err
  17257. }
  17258. defer googleapi.CloseBody(res)
  17259. if err := googleapi.CheckResponse(res); err != nil {
  17260. return nil, err
  17261. }
  17262. ret := &EntityUserLink{
  17263. ServerResponse: googleapi.ServerResponse{
  17264. Header: res.Header,
  17265. HTTPStatusCode: res.StatusCode,
  17266. },
  17267. }
  17268. target := &ret
  17269. if err := gensupport.DecodeResponse(target, res); err != nil {
  17270. return nil, err
  17271. }
  17272. return ret, nil
  17273. // {
  17274. // "description": "Adds a new user to the given web property.",
  17275. // "httpMethod": "POST",
  17276. // "id": "analytics.management.webpropertyUserLinks.insert",
  17277. // "parameterOrder": [
  17278. // "accountId",
  17279. // "webPropertyId"
  17280. // ],
  17281. // "parameters": {
  17282. // "accountId": {
  17283. // "description": "Account ID to create the user link for.",
  17284. // "location": "path",
  17285. // "required": true,
  17286. // "type": "string"
  17287. // },
  17288. // "webPropertyId": {
  17289. // "description": "Web Property ID to create the user link for.",
  17290. // "location": "path",
  17291. // "required": true,
  17292. // "type": "string"
  17293. // }
  17294. // },
  17295. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  17296. // "request": {
  17297. // "$ref": "EntityUserLink"
  17298. // },
  17299. // "response": {
  17300. // "$ref": "EntityUserLink"
  17301. // },
  17302. // "scopes": [
  17303. // "https://www.googleapis.com/auth/analytics.manage.users"
  17304. // ]
  17305. // }
  17306. }
  17307. // method id "analytics.management.webpropertyUserLinks.list":
  17308. type ManagementWebpropertyUserLinksListCall struct {
  17309. s *Service
  17310. accountId string
  17311. webPropertyId string
  17312. urlParams_ gensupport.URLParams
  17313. ifNoneMatch_ string
  17314. ctx_ context.Context
  17315. header_ http.Header
  17316. }
  17317. // List: Lists webProperty-user links for a given web property.
  17318. func (r *ManagementWebpropertyUserLinksService) List(accountId string, webPropertyId string) *ManagementWebpropertyUserLinksListCall {
  17319. c := &ManagementWebpropertyUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17320. c.accountId = accountId
  17321. c.webPropertyId = webPropertyId
  17322. return c
  17323. }
  17324. // MaxResults sets the optional parameter "max-results": The maximum
  17325. // number of webProperty-user Links to include in this response.
  17326. func (c *ManagementWebpropertyUserLinksListCall) MaxResults(maxResults int64) *ManagementWebpropertyUserLinksListCall {
  17327. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  17328. return c
  17329. }
  17330. // StartIndex sets the optional parameter "start-index": An index of the
  17331. // first webProperty-user link to retrieve. Use this parameter as a
  17332. // pagination mechanism along with the max-results parameter.
  17333. func (c *ManagementWebpropertyUserLinksListCall) StartIndex(startIndex int64) *ManagementWebpropertyUserLinksListCall {
  17334. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  17335. return c
  17336. }
  17337. // Fields allows partial responses to be retrieved. See
  17338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17339. // for more information.
  17340. func (c *ManagementWebpropertyUserLinksListCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksListCall {
  17341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17342. return c
  17343. }
  17344. // IfNoneMatch sets the optional parameter which makes the operation
  17345. // fail if the object's ETag matches the given value. This is useful for
  17346. // getting updates only after the object has changed since the last
  17347. // request. Use googleapi.IsNotModified to check whether the response
  17348. // error from Do is the result of In-None-Match.
  17349. func (c *ManagementWebpropertyUserLinksListCall) IfNoneMatch(entityTag string) *ManagementWebpropertyUserLinksListCall {
  17350. c.ifNoneMatch_ = entityTag
  17351. return c
  17352. }
  17353. // Context sets the context to be used in this call's Do method. Any
  17354. // pending HTTP request will be aborted if the provided context is
  17355. // canceled.
  17356. func (c *ManagementWebpropertyUserLinksListCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksListCall {
  17357. c.ctx_ = ctx
  17358. return c
  17359. }
  17360. // Header returns an http.Header that can be modified by the caller to
  17361. // add HTTP headers to the request.
  17362. func (c *ManagementWebpropertyUserLinksListCall) Header() http.Header {
  17363. if c.header_ == nil {
  17364. c.header_ = make(http.Header)
  17365. }
  17366. return c.header_
  17367. }
  17368. func (c *ManagementWebpropertyUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  17369. reqHeaders := make(http.Header)
  17370. for k, v := range c.header_ {
  17371. reqHeaders[k] = v
  17372. }
  17373. reqHeaders.Set("User-Agent", c.s.userAgent())
  17374. if c.ifNoneMatch_ != "" {
  17375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17376. }
  17377. var body io.Reader = nil
  17378. c.urlParams_.Set("alt", alt)
  17379. c.urlParams_.Set("prettyPrint", "false")
  17380. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  17381. urls += "?" + c.urlParams_.Encode()
  17382. req, err := http.NewRequest("GET", urls, body)
  17383. if err != nil {
  17384. return nil, err
  17385. }
  17386. req.Header = reqHeaders
  17387. googleapi.Expand(req.URL, map[string]string{
  17388. "accountId": c.accountId,
  17389. "webPropertyId": c.webPropertyId,
  17390. })
  17391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17392. }
  17393. // Do executes the "analytics.management.webpropertyUserLinks.list" call.
  17394. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  17395. // status code is an error. Response headers are in either
  17396. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  17397. // at all) in error.(*googleapi.Error).Header. Use
  17398. // googleapi.IsNotModified to check whether the returned error was
  17399. // because http.StatusNotModified was returned.
  17400. func (c *ManagementWebpropertyUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  17401. gensupport.SetOptions(c.urlParams_, opts...)
  17402. res, err := c.doRequest("json")
  17403. if res != nil && res.StatusCode == http.StatusNotModified {
  17404. if res.Body != nil {
  17405. res.Body.Close()
  17406. }
  17407. return nil, &googleapi.Error{
  17408. Code: res.StatusCode,
  17409. Header: res.Header,
  17410. }
  17411. }
  17412. if err != nil {
  17413. return nil, err
  17414. }
  17415. defer googleapi.CloseBody(res)
  17416. if err := googleapi.CheckResponse(res); err != nil {
  17417. return nil, err
  17418. }
  17419. ret := &EntityUserLinks{
  17420. ServerResponse: googleapi.ServerResponse{
  17421. Header: res.Header,
  17422. HTTPStatusCode: res.StatusCode,
  17423. },
  17424. }
  17425. target := &ret
  17426. if err := gensupport.DecodeResponse(target, res); err != nil {
  17427. return nil, err
  17428. }
  17429. return ret, nil
  17430. // {
  17431. // "description": "Lists webProperty-user links for a given web property.",
  17432. // "httpMethod": "GET",
  17433. // "id": "analytics.management.webpropertyUserLinks.list",
  17434. // "parameterOrder": [
  17435. // "accountId",
  17436. // "webPropertyId"
  17437. // ],
  17438. // "parameters": {
  17439. // "accountId": {
  17440. // "description": "Account ID which the given web property belongs to.",
  17441. // "location": "path",
  17442. // "required": true,
  17443. // "type": "string"
  17444. // },
  17445. // "max-results": {
  17446. // "description": "The maximum number of webProperty-user Links to include in this response.",
  17447. // "format": "int32",
  17448. // "location": "query",
  17449. // "type": "integer"
  17450. // },
  17451. // "start-index": {
  17452. // "description": "An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  17453. // "format": "int32",
  17454. // "location": "query",
  17455. // "minimum": "1",
  17456. // "type": "integer"
  17457. // },
  17458. // "webPropertyId": {
  17459. // "description": "Web Property ID for the webProperty-user links to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
  17460. // "location": "path",
  17461. // "required": true,
  17462. // "type": "string"
  17463. // }
  17464. // },
  17465. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  17466. // "response": {
  17467. // "$ref": "EntityUserLinks"
  17468. // },
  17469. // "scopes": [
  17470. // "https://www.googleapis.com/auth/analytics.manage.users",
  17471. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  17472. // ]
  17473. // }
  17474. }
  17475. // method id "analytics.management.webpropertyUserLinks.update":
  17476. type ManagementWebpropertyUserLinksUpdateCall struct {
  17477. s *Service
  17478. accountId string
  17479. webPropertyId string
  17480. linkId string
  17481. entityuserlink *EntityUserLink
  17482. urlParams_ gensupport.URLParams
  17483. ctx_ context.Context
  17484. header_ http.Header
  17485. }
  17486. // Update: Updates permissions for an existing user on the given web
  17487. // property.
  17488. func (r *ManagementWebpropertyUserLinksService) Update(accountId string, webPropertyId string, linkId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksUpdateCall {
  17489. c := &ManagementWebpropertyUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17490. c.accountId = accountId
  17491. c.webPropertyId = webPropertyId
  17492. c.linkId = linkId
  17493. c.entityuserlink = entityuserlink
  17494. return c
  17495. }
  17496. // Fields allows partial responses to be retrieved. See
  17497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17498. // for more information.
  17499. func (c *ManagementWebpropertyUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksUpdateCall {
  17500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17501. return c
  17502. }
  17503. // Context sets the context to be used in this call's Do method. Any
  17504. // pending HTTP request will be aborted if the provided context is
  17505. // canceled.
  17506. func (c *ManagementWebpropertyUserLinksUpdateCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksUpdateCall {
  17507. c.ctx_ = ctx
  17508. return c
  17509. }
  17510. // Header returns an http.Header that can be modified by the caller to
  17511. // add HTTP headers to the request.
  17512. func (c *ManagementWebpropertyUserLinksUpdateCall) Header() http.Header {
  17513. if c.header_ == nil {
  17514. c.header_ = make(http.Header)
  17515. }
  17516. return c.header_
  17517. }
  17518. func (c *ManagementWebpropertyUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  17519. reqHeaders := make(http.Header)
  17520. for k, v := range c.header_ {
  17521. reqHeaders[k] = v
  17522. }
  17523. reqHeaders.Set("User-Agent", c.s.userAgent())
  17524. var body io.Reader = nil
  17525. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  17526. if err != nil {
  17527. return nil, err
  17528. }
  17529. reqHeaders.Set("Content-Type", "application/json")
  17530. c.urlParams_.Set("alt", alt)
  17531. c.urlParams_.Set("prettyPrint", "false")
  17532. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  17533. urls += "?" + c.urlParams_.Encode()
  17534. req, err := http.NewRequest("PUT", urls, body)
  17535. if err != nil {
  17536. return nil, err
  17537. }
  17538. req.Header = reqHeaders
  17539. googleapi.Expand(req.URL, map[string]string{
  17540. "accountId": c.accountId,
  17541. "webPropertyId": c.webPropertyId,
  17542. "linkId": c.linkId,
  17543. })
  17544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17545. }
  17546. // Do executes the "analytics.management.webpropertyUserLinks.update" call.
  17547. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  17548. // status code is an error. Response headers are in either
  17549. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  17550. // at all) in error.(*googleapi.Error).Header. Use
  17551. // googleapi.IsNotModified to check whether the returned error was
  17552. // because http.StatusNotModified was returned.
  17553. func (c *ManagementWebpropertyUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  17554. gensupport.SetOptions(c.urlParams_, opts...)
  17555. res, err := c.doRequest("json")
  17556. if res != nil && res.StatusCode == http.StatusNotModified {
  17557. if res.Body != nil {
  17558. res.Body.Close()
  17559. }
  17560. return nil, &googleapi.Error{
  17561. Code: res.StatusCode,
  17562. Header: res.Header,
  17563. }
  17564. }
  17565. if err != nil {
  17566. return nil, err
  17567. }
  17568. defer googleapi.CloseBody(res)
  17569. if err := googleapi.CheckResponse(res); err != nil {
  17570. return nil, err
  17571. }
  17572. ret := &EntityUserLink{
  17573. ServerResponse: googleapi.ServerResponse{
  17574. Header: res.Header,
  17575. HTTPStatusCode: res.StatusCode,
  17576. },
  17577. }
  17578. target := &ret
  17579. if err := gensupport.DecodeResponse(target, res); err != nil {
  17580. return nil, err
  17581. }
  17582. return ret, nil
  17583. // {
  17584. // "description": "Updates permissions for an existing user on the given web property.",
  17585. // "httpMethod": "PUT",
  17586. // "id": "analytics.management.webpropertyUserLinks.update",
  17587. // "parameterOrder": [
  17588. // "accountId",
  17589. // "webPropertyId",
  17590. // "linkId"
  17591. // ],
  17592. // "parameters": {
  17593. // "accountId": {
  17594. // "description": "Account ID to update the account-user link for.",
  17595. // "location": "path",
  17596. // "required": true,
  17597. // "type": "string"
  17598. // },
  17599. // "linkId": {
  17600. // "description": "Link ID to update the account-user link for.",
  17601. // "location": "path",
  17602. // "required": true,
  17603. // "type": "string"
  17604. // },
  17605. // "webPropertyId": {
  17606. // "description": "Web property ID to update the account-user link for.",
  17607. // "location": "path",
  17608. // "required": true,
  17609. // "type": "string"
  17610. // }
  17611. // },
  17612. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  17613. // "request": {
  17614. // "$ref": "EntityUserLink"
  17615. // },
  17616. // "response": {
  17617. // "$ref": "EntityUserLink"
  17618. // },
  17619. // "scopes": [
  17620. // "https://www.googleapis.com/auth/analytics.manage.users"
  17621. // ]
  17622. // }
  17623. }
  17624. // method id "analytics.metadata.columns.list":
  17625. type MetadataColumnsListCall struct {
  17626. s *Service
  17627. reportType string
  17628. urlParams_ gensupport.URLParams
  17629. ifNoneMatch_ string
  17630. ctx_ context.Context
  17631. header_ http.Header
  17632. }
  17633. // List: Lists all columns for a report type
  17634. func (r *MetadataColumnsService) List(reportType string) *MetadataColumnsListCall {
  17635. c := &MetadataColumnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17636. c.reportType = reportType
  17637. return c
  17638. }
  17639. // Fields allows partial responses to be retrieved. See
  17640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17641. // for more information.
  17642. func (c *MetadataColumnsListCall) Fields(s ...googleapi.Field) *MetadataColumnsListCall {
  17643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17644. return c
  17645. }
  17646. // IfNoneMatch sets the optional parameter which makes the operation
  17647. // fail if the object's ETag matches the given value. This is useful for
  17648. // getting updates only after the object has changed since the last
  17649. // request. Use googleapi.IsNotModified to check whether the response
  17650. // error from Do is the result of In-None-Match.
  17651. func (c *MetadataColumnsListCall) IfNoneMatch(entityTag string) *MetadataColumnsListCall {
  17652. c.ifNoneMatch_ = entityTag
  17653. return c
  17654. }
  17655. // Context sets the context to be used in this call's Do method. Any
  17656. // pending HTTP request will be aborted if the provided context is
  17657. // canceled.
  17658. func (c *MetadataColumnsListCall) Context(ctx context.Context) *MetadataColumnsListCall {
  17659. c.ctx_ = ctx
  17660. return c
  17661. }
  17662. // Header returns an http.Header that can be modified by the caller to
  17663. // add HTTP headers to the request.
  17664. func (c *MetadataColumnsListCall) Header() http.Header {
  17665. if c.header_ == nil {
  17666. c.header_ = make(http.Header)
  17667. }
  17668. return c.header_
  17669. }
  17670. func (c *MetadataColumnsListCall) doRequest(alt string) (*http.Response, error) {
  17671. reqHeaders := make(http.Header)
  17672. for k, v := range c.header_ {
  17673. reqHeaders[k] = v
  17674. }
  17675. reqHeaders.Set("User-Agent", c.s.userAgent())
  17676. if c.ifNoneMatch_ != "" {
  17677. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17678. }
  17679. var body io.Reader = nil
  17680. c.urlParams_.Set("alt", alt)
  17681. c.urlParams_.Set("prettyPrint", "false")
  17682. urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/{reportType}/columns")
  17683. urls += "?" + c.urlParams_.Encode()
  17684. req, err := http.NewRequest("GET", urls, body)
  17685. if err != nil {
  17686. return nil, err
  17687. }
  17688. req.Header = reqHeaders
  17689. googleapi.Expand(req.URL, map[string]string{
  17690. "reportType": c.reportType,
  17691. })
  17692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17693. }
  17694. // Do executes the "analytics.metadata.columns.list" call.
  17695. // Exactly one of *Columns or error will be non-nil. Any non-2xx status
  17696. // code is an error. Response headers are in either
  17697. // *Columns.ServerResponse.Header or (if a response was returned at all)
  17698. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  17699. // check whether the returned error was because http.StatusNotModified
  17700. // was returned.
  17701. func (c *MetadataColumnsListCall) Do(opts ...googleapi.CallOption) (*Columns, error) {
  17702. gensupport.SetOptions(c.urlParams_, opts...)
  17703. res, err := c.doRequest("json")
  17704. if res != nil && res.StatusCode == http.StatusNotModified {
  17705. if res.Body != nil {
  17706. res.Body.Close()
  17707. }
  17708. return nil, &googleapi.Error{
  17709. Code: res.StatusCode,
  17710. Header: res.Header,
  17711. }
  17712. }
  17713. if err != nil {
  17714. return nil, err
  17715. }
  17716. defer googleapi.CloseBody(res)
  17717. if err := googleapi.CheckResponse(res); err != nil {
  17718. return nil, err
  17719. }
  17720. ret := &Columns{
  17721. ServerResponse: googleapi.ServerResponse{
  17722. Header: res.Header,
  17723. HTTPStatusCode: res.StatusCode,
  17724. },
  17725. }
  17726. target := &ret
  17727. if err := gensupport.DecodeResponse(target, res); err != nil {
  17728. return nil, err
  17729. }
  17730. return ret, nil
  17731. // {
  17732. // "description": "Lists all columns for a report type",
  17733. // "httpMethod": "GET",
  17734. // "id": "analytics.metadata.columns.list",
  17735. // "parameterOrder": [
  17736. // "reportType"
  17737. // ],
  17738. // "parameters": {
  17739. // "reportType": {
  17740. // "description": "Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API",
  17741. // "location": "path",
  17742. // "pattern": "ga",
  17743. // "required": true,
  17744. // "type": "string"
  17745. // }
  17746. // },
  17747. // "path": "metadata/{reportType}/columns",
  17748. // "response": {
  17749. // "$ref": "Columns"
  17750. // },
  17751. // "scopes": [
  17752. // "https://www.googleapis.com/auth/analytics",
  17753. // "https://www.googleapis.com/auth/analytics.edit",
  17754. // "https://www.googleapis.com/auth/analytics.readonly"
  17755. // ]
  17756. // }
  17757. }
  17758. // method id "analytics.provisioning.createAccountTicket":
  17759. type ProvisioningCreateAccountTicketCall struct {
  17760. s *Service
  17761. accountticket *AccountTicket
  17762. urlParams_ gensupport.URLParams
  17763. ctx_ context.Context
  17764. header_ http.Header
  17765. }
  17766. // CreateAccountTicket: Creates an account ticket.
  17767. func (r *ProvisioningService) CreateAccountTicket(accountticket *AccountTicket) *ProvisioningCreateAccountTicketCall {
  17768. c := &ProvisioningCreateAccountTicketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17769. c.accountticket = accountticket
  17770. return c
  17771. }
  17772. // Fields allows partial responses to be retrieved. See
  17773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17774. // for more information.
  17775. func (c *ProvisioningCreateAccountTicketCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTicketCall {
  17776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17777. return c
  17778. }
  17779. // Context sets the context to be used in this call's Do method. Any
  17780. // pending HTTP request will be aborted if the provided context is
  17781. // canceled.
  17782. func (c *ProvisioningCreateAccountTicketCall) Context(ctx context.Context) *ProvisioningCreateAccountTicketCall {
  17783. c.ctx_ = ctx
  17784. return c
  17785. }
  17786. // Header returns an http.Header that can be modified by the caller to
  17787. // add HTTP headers to the request.
  17788. func (c *ProvisioningCreateAccountTicketCall) Header() http.Header {
  17789. if c.header_ == nil {
  17790. c.header_ = make(http.Header)
  17791. }
  17792. return c.header_
  17793. }
  17794. func (c *ProvisioningCreateAccountTicketCall) doRequest(alt string) (*http.Response, error) {
  17795. reqHeaders := make(http.Header)
  17796. for k, v := range c.header_ {
  17797. reqHeaders[k] = v
  17798. }
  17799. reqHeaders.Set("User-Agent", c.s.userAgent())
  17800. var body io.Reader = nil
  17801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountticket)
  17802. if err != nil {
  17803. return nil, err
  17804. }
  17805. reqHeaders.Set("Content-Type", "application/json")
  17806. c.urlParams_.Set("alt", alt)
  17807. c.urlParams_.Set("prettyPrint", "false")
  17808. urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTicket")
  17809. urls += "?" + c.urlParams_.Encode()
  17810. req, err := http.NewRequest("POST", urls, body)
  17811. if err != nil {
  17812. return nil, err
  17813. }
  17814. req.Header = reqHeaders
  17815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17816. }
  17817. // Do executes the "analytics.provisioning.createAccountTicket" call.
  17818. // Exactly one of *AccountTicket or error will be non-nil. Any non-2xx
  17819. // status code is an error. Response headers are in either
  17820. // *AccountTicket.ServerResponse.Header or (if a response was returned
  17821. // at all) in error.(*googleapi.Error).Header. Use
  17822. // googleapi.IsNotModified to check whether the returned error was
  17823. // because http.StatusNotModified was returned.
  17824. func (c *ProvisioningCreateAccountTicketCall) Do(opts ...googleapi.CallOption) (*AccountTicket, error) {
  17825. gensupport.SetOptions(c.urlParams_, opts...)
  17826. res, err := c.doRequest("json")
  17827. if res != nil && res.StatusCode == http.StatusNotModified {
  17828. if res.Body != nil {
  17829. res.Body.Close()
  17830. }
  17831. return nil, &googleapi.Error{
  17832. Code: res.StatusCode,
  17833. Header: res.Header,
  17834. }
  17835. }
  17836. if err != nil {
  17837. return nil, err
  17838. }
  17839. defer googleapi.CloseBody(res)
  17840. if err := googleapi.CheckResponse(res); err != nil {
  17841. return nil, err
  17842. }
  17843. ret := &AccountTicket{
  17844. ServerResponse: googleapi.ServerResponse{
  17845. Header: res.Header,
  17846. HTTPStatusCode: res.StatusCode,
  17847. },
  17848. }
  17849. target := &ret
  17850. if err := gensupport.DecodeResponse(target, res); err != nil {
  17851. return nil, err
  17852. }
  17853. return ret, nil
  17854. // {
  17855. // "description": "Creates an account ticket.",
  17856. // "httpMethod": "POST",
  17857. // "id": "analytics.provisioning.createAccountTicket",
  17858. // "path": "provisioning/createAccountTicket",
  17859. // "request": {
  17860. // "$ref": "AccountTicket"
  17861. // },
  17862. // "response": {
  17863. // "$ref": "AccountTicket"
  17864. // },
  17865. // "scopes": [
  17866. // "https://www.googleapis.com/auth/analytics.provision"
  17867. // ]
  17868. // }
  17869. }
  17870. // method id "analytics.provisioning.createAccountTree":
  17871. type ProvisioningCreateAccountTreeCall struct {
  17872. s *Service
  17873. accounttreerequest *AccountTreeRequest
  17874. urlParams_ gensupport.URLParams
  17875. ctx_ context.Context
  17876. header_ http.Header
  17877. }
  17878. // CreateAccountTree: Provision account.
  17879. func (r *ProvisioningService) CreateAccountTree(accounttreerequest *AccountTreeRequest) *ProvisioningCreateAccountTreeCall {
  17880. c := &ProvisioningCreateAccountTreeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17881. c.accounttreerequest = accounttreerequest
  17882. return c
  17883. }
  17884. // Fields allows partial responses to be retrieved. See
  17885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17886. // for more information.
  17887. func (c *ProvisioningCreateAccountTreeCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTreeCall {
  17888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17889. return c
  17890. }
  17891. // Context sets the context to be used in this call's Do method. Any
  17892. // pending HTTP request will be aborted if the provided context is
  17893. // canceled.
  17894. func (c *ProvisioningCreateAccountTreeCall) Context(ctx context.Context) *ProvisioningCreateAccountTreeCall {
  17895. c.ctx_ = ctx
  17896. return c
  17897. }
  17898. // Header returns an http.Header that can be modified by the caller to
  17899. // add HTTP headers to the request.
  17900. func (c *ProvisioningCreateAccountTreeCall) Header() http.Header {
  17901. if c.header_ == nil {
  17902. c.header_ = make(http.Header)
  17903. }
  17904. return c.header_
  17905. }
  17906. func (c *ProvisioningCreateAccountTreeCall) doRequest(alt string) (*http.Response, error) {
  17907. reqHeaders := make(http.Header)
  17908. for k, v := range c.header_ {
  17909. reqHeaders[k] = v
  17910. }
  17911. reqHeaders.Set("User-Agent", c.s.userAgent())
  17912. var body io.Reader = nil
  17913. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttreerequest)
  17914. if err != nil {
  17915. return nil, err
  17916. }
  17917. reqHeaders.Set("Content-Type", "application/json")
  17918. c.urlParams_.Set("alt", alt)
  17919. c.urlParams_.Set("prettyPrint", "false")
  17920. urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTree")
  17921. urls += "?" + c.urlParams_.Encode()
  17922. req, err := http.NewRequest("POST", urls, body)
  17923. if err != nil {
  17924. return nil, err
  17925. }
  17926. req.Header = reqHeaders
  17927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17928. }
  17929. // Do executes the "analytics.provisioning.createAccountTree" call.
  17930. // Exactly one of *AccountTreeResponse or error will be non-nil. Any
  17931. // non-2xx status code is an error. Response headers are in either
  17932. // *AccountTreeResponse.ServerResponse.Header or (if a response was
  17933. // returned at all) in error.(*googleapi.Error).Header. Use
  17934. // googleapi.IsNotModified to check whether the returned error was
  17935. // because http.StatusNotModified was returned.
  17936. func (c *ProvisioningCreateAccountTreeCall) Do(opts ...googleapi.CallOption) (*AccountTreeResponse, error) {
  17937. gensupport.SetOptions(c.urlParams_, opts...)
  17938. res, err := c.doRequest("json")
  17939. if res != nil && res.StatusCode == http.StatusNotModified {
  17940. if res.Body != nil {
  17941. res.Body.Close()
  17942. }
  17943. return nil, &googleapi.Error{
  17944. Code: res.StatusCode,
  17945. Header: res.Header,
  17946. }
  17947. }
  17948. if err != nil {
  17949. return nil, err
  17950. }
  17951. defer googleapi.CloseBody(res)
  17952. if err := googleapi.CheckResponse(res); err != nil {
  17953. return nil, err
  17954. }
  17955. ret := &AccountTreeResponse{
  17956. ServerResponse: googleapi.ServerResponse{
  17957. Header: res.Header,
  17958. HTTPStatusCode: res.StatusCode,
  17959. },
  17960. }
  17961. target := &ret
  17962. if err := gensupport.DecodeResponse(target, res); err != nil {
  17963. return nil, err
  17964. }
  17965. return ret, nil
  17966. // {
  17967. // "description": "Provision account.",
  17968. // "httpMethod": "POST",
  17969. // "id": "analytics.provisioning.createAccountTree",
  17970. // "path": "provisioning/createAccountTree",
  17971. // "request": {
  17972. // "$ref": "AccountTreeRequest"
  17973. // },
  17974. // "response": {
  17975. // "$ref": "AccountTreeResponse"
  17976. // },
  17977. // "scopes": [
  17978. // "https://www.googleapis.com/auth/analytics.provision"
  17979. // ]
  17980. // }
  17981. }
  17982. // method id "analytics.userDeletion.userDeletionRequest.upsert":
  17983. type UserDeletionUserDeletionRequestUpsertCall struct {
  17984. s *Service
  17985. userdeletionrequest *UserDeletionRequest
  17986. urlParams_ gensupport.URLParams
  17987. ctx_ context.Context
  17988. header_ http.Header
  17989. }
  17990. // Upsert: Insert or update a user deletion requests.
  17991. func (r *UserDeletionUserDeletionRequestService) Upsert(userdeletionrequest *UserDeletionRequest) *UserDeletionUserDeletionRequestUpsertCall {
  17992. c := &UserDeletionUserDeletionRequestUpsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17993. c.userdeletionrequest = userdeletionrequest
  17994. return c
  17995. }
  17996. // Fields allows partial responses to be retrieved. See
  17997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17998. // for more information.
  17999. func (c *UserDeletionUserDeletionRequestUpsertCall) Fields(s ...googleapi.Field) *UserDeletionUserDeletionRequestUpsertCall {
  18000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18001. return c
  18002. }
  18003. // Context sets the context to be used in this call's Do method. Any
  18004. // pending HTTP request will be aborted if the provided context is
  18005. // canceled.
  18006. func (c *UserDeletionUserDeletionRequestUpsertCall) Context(ctx context.Context) *UserDeletionUserDeletionRequestUpsertCall {
  18007. c.ctx_ = ctx
  18008. return c
  18009. }
  18010. // Header returns an http.Header that can be modified by the caller to
  18011. // add HTTP headers to the request.
  18012. func (c *UserDeletionUserDeletionRequestUpsertCall) Header() http.Header {
  18013. if c.header_ == nil {
  18014. c.header_ = make(http.Header)
  18015. }
  18016. return c.header_
  18017. }
  18018. func (c *UserDeletionUserDeletionRequestUpsertCall) doRequest(alt string) (*http.Response, error) {
  18019. reqHeaders := make(http.Header)
  18020. for k, v := range c.header_ {
  18021. reqHeaders[k] = v
  18022. }
  18023. reqHeaders.Set("User-Agent", c.s.userAgent())
  18024. var body io.Reader = nil
  18025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdeletionrequest)
  18026. if err != nil {
  18027. return nil, err
  18028. }
  18029. reqHeaders.Set("Content-Type", "application/json")
  18030. c.urlParams_.Set("alt", alt)
  18031. c.urlParams_.Set("prettyPrint", "false")
  18032. urls := googleapi.ResolveRelative(c.s.BasePath, "userDeletion/userDeletionRequests:upsert")
  18033. urls += "?" + c.urlParams_.Encode()
  18034. req, err := http.NewRequest("POST", urls, body)
  18035. if err != nil {
  18036. return nil, err
  18037. }
  18038. req.Header = reqHeaders
  18039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18040. }
  18041. // Do executes the "analytics.userDeletion.userDeletionRequest.upsert" call.
  18042. // Exactly one of *UserDeletionRequest or error will be non-nil. Any
  18043. // non-2xx status code is an error. Response headers are in either
  18044. // *UserDeletionRequest.ServerResponse.Header or (if a response was
  18045. // returned at all) in error.(*googleapi.Error).Header. Use
  18046. // googleapi.IsNotModified to check whether the returned error was
  18047. // because http.StatusNotModified was returned.
  18048. func (c *UserDeletionUserDeletionRequestUpsertCall) Do(opts ...googleapi.CallOption) (*UserDeletionRequest, error) {
  18049. gensupport.SetOptions(c.urlParams_, opts...)
  18050. res, err := c.doRequest("json")
  18051. if res != nil && res.StatusCode == http.StatusNotModified {
  18052. if res.Body != nil {
  18053. res.Body.Close()
  18054. }
  18055. return nil, &googleapi.Error{
  18056. Code: res.StatusCode,
  18057. Header: res.Header,
  18058. }
  18059. }
  18060. if err != nil {
  18061. return nil, err
  18062. }
  18063. defer googleapi.CloseBody(res)
  18064. if err := googleapi.CheckResponse(res); err != nil {
  18065. return nil, err
  18066. }
  18067. ret := &UserDeletionRequest{
  18068. ServerResponse: googleapi.ServerResponse{
  18069. Header: res.Header,
  18070. HTTPStatusCode: res.StatusCode,
  18071. },
  18072. }
  18073. target := &ret
  18074. if err := gensupport.DecodeResponse(target, res); err != nil {
  18075. return nil, err
  18076. }
  18077. return ret, nil
  18078. // {
  18079. // "description": "Insert or update a user deletion requests.",
  18080. // "httpMethod": "POST",
  18081. // "id": "analytics.userDeletion.userDeletionRequest.upsert",
  18082. // "path": "userDeletion/userDeletionRequests:upsert",
  18083. // "request": {
  18084. // "$ref": "UserDeletionRequest"
  18085. // },
  18086. // "response": {
  18087. // "$ref": "UserDeletionRequest"
  18088. // },
  18089. // "scopes": [
  18090. // "https://www.googleapis.com/auth/analytics.user.deletion"
  18091. // ]
  18092. // }
  18093. }