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

19568 lines
683 KiB

  1. // Package analytics provides access to the Google Analytics API.
  2. //
  3. // See https://developers.google.com/analytics/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/analytics/v3"
  8. // ...
  9. // analyticsService, err := analytics.New(oauthHttpClient)
  10. package analytics // import "google.golang.org/api/analytics/v3"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "analytics:v3"
  41. const apiName = "analytics"
  42. const apiVersion = "v3"
  43. const basePath = "https://www.googleapis.com/analytics/v3/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your Google Analytics data
  47. AnalyticsScope = "https://www.googleapis.com/auth/analytics"
  48. // Edit Google Analytics management entities
  49. AnalyticsEditScope = "https://www.googleapis.com/auth/analytics.edit"
  50. // Manage Google Analytics Account users by email address
  51. AnalyticsManageUsersScope = "https://www.googleapis.com/auth/analytics.manage.users"
  52. // View Google Analytics user permissions
  53. AnalyticsManageUsersReadonlyScope = "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  54. // Create a new Google Analytics account along with its default property
  55. // and view
  56. AnalyticsProvisionScope = "https://www.googleapis.com/auth/analytics.provision"
  57. // View your Google Analytics data
  58. AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly"
  59. // Manage Google Analytics user deletion requests
  60. AnalyticsUserDeletionScope = "https://www.googleapis.com/auth/analytics.user.deletion"
  61. )
  62. func New(client *http.Client) (*Service, error) {
  63. if client == nil {
  64. return nil, errors.New("client is nil")
  65. }
  66. s := &Service{client: client, BasePath: basePath}
  67. s.Data = NewDataService(s)
  68. s.Management = NewManagementService(s)
  69. s.Metadata = NewMetadataService(s)
  70. s.Provisioning = NewProvisioningService(s)
  71. s.UserDeletion = NewUserDeletionService(s)
  72. return s, nil
  73. }
  74. type Service struct {
  75. client *http.Client
  76. BasePath string // API endpoint base URL
  77. UserAgent string // optional additional User-Agent fragment
  78. Data *DataService
  79. Management *ManagementService
  80. Metadata *MetadataService
  81. Provisioning *ProvisioningService
  82. UserDeletion *UserDeletionService
  83. }
  84. func (s *Service) userAgent() string {
  85. if s.UserAgent == "" {
  86. return googleapi.UserAgent
  87. }
  88. return googleapi.UserAgent + " " + s.UserAgent
  89. }
  90. func NewDataService(s *Service) *DataService {
  91. rs := &DataService{s: s}
  92. rs.Ga = NewDataGaService(s)
  93. rs.Mcf = NewDataMcfService(s)
  94. rs.Realtime = NewDataRealtimeService(s)
  95. return rs
  96. }
  97. type DataService struct {
  98. s *Service
  99. Ga *DataGaService
  100. Mcf *DataMcfService
  101. Realtime *DataRealtimeService
  102. }
  103. func NewDataGaService(s *Service) *DataGaService {
  104. rs := &DataGaService{s: s}
  105. return rs
  106. }
  107. type DataGaService struct {
  108. s *Service
  109. }
  110. func NewDataMcfService(s *Service) *DataMcfService {
  111. rs := &DataMcfService{s: s}
  112. return rs
  113. }
  114. type DataMcfService struct {
  115. s *Service
  116. }
  117. func NewDataRealtimeService(s *Service) *DataRealtimeService {
  118. rs := &DataRealtimeService{s: s}
  119. return rs
  120. }
  121. type DataRealtimeService struct {
  122. s *Service
  123. }
  124. func NewManagementService(s *Service) *ManagementService {
  125. rs := &ManagementService{s: s}
  126. rs.AccountSummaries = NewManagementAccountSummariesService(s)
  127. rs.AccountUserLinks = NewManagementAccountUserLinksService(s)
  128. rs.Accounts = NewManagementAccountsService(s)
  129. rs.CustomDataSources = NewManagementCustomDataSourcesService(s)
  130. rs.CustomDimensions = NewManagementCustomDimensionsService(s)
  131. rs.CustomMetrics = NewManagementCustomMetricsService(s)
  132. rs.Experiments = NewManagementExperimentsService(s)
  133. rs.Filters = NewManagementFiltersService(s)
  134. rs.Goals = NewManagementGoalsService(s)
  135. rs.ProfileFilterLinks = NewManagementProfileFilterLinksService(s)
  136. rs.ProfileUserLinks = NewManagementProfileUserLinksService(s)
  137. rs.Profiles = NewManagementProfilesService(s)
  138. rs.RemarketingAudience = NewManagementRemarketingAudienceService(s)
  139. rs.Segments = NewManagementSegmentsService(s)
  140. rs.UnsampledReports = NewManagementUnsampledReportsService(s)
  141. rs.Uploads = NewManagementUploadsService(s)
  142. rs.WebPropertyAdWordsLinks = NewManagementWebPropertyAdWordsLinksService(s)
  143. rs.Webproperties = NewManagementWebpropertiesService(s)
  144. rs.WebpropertyUserLinks = NewManagementWebpropertyUserLinksService(s)
  145. return rs
  146. }
  147. type ManagementService struct {
  148. s *Service
  149. AccountSummaries *ManagementAccountSummariesService
  150. AccountUserLinks *ManagementAccountUserLinksService
  151. Accounts *ManagementAccountsService
  152. CustomDataSources *ManagementCustomDataSourcesService
  153. CustomDimensions *ManagementCustomDimensionsService
  154. CustomMetrics *ManagementCustomMetricsService
  155. Experiments *ManagementExperimentsService
  156. Filters *ManagementFiltersService
  157. Goals *ManagementGoalsService
  158. ProfileFilterLinks *ManagementProfileFilterLinksService
  159. ProfileUserLinks *ManagementProfileUserLinksService
  160. Profiles *ManagementProfilesService
  161. RemarketingAudience *ManagementRemarketingAudienceService
  162. Segments *ManagementSegmentsService
  163. UnsampledReports *ManagementUnsampledReportsService
  164. Uploads *ManagementUploadsService
  165. WebPropertyAdWordsLinks *ManagementWebPropertyAdWordsLinksService
  166. Webproperties *ManagementWebpropertiesService
  167. WebpropertyUserLinks *ManagementWebpropertyUserLinksService
  168. }
  169. func NewManagementAccountSummariesService(s *Service) *ManagementAccountSummariesService {
  170. rs := &ManagementAccountSummariesService{s: s}
  171. return rs
  172. }
  173. type ManagementAccountSummariesService struct {
  174. s *Service
  175. }
  176. func NewManagementAccountUserLinksService(s *Service) *ManagementAccountUserLinksService {
  177. rs := &ManagementAccountUserLinksService{s: s}
  178. return rs
  179. }
  180. type ManagementAccountUserLinksService struct {
  181. s *Service
  182. }
  183. func NewManagementAccountsService(s *Service) *ManagementAccountsService {
  184. rs := &ManagementAccountsService{s: s}
  185. return rs
  186. }
  187. type ManagementAccountsService struct {
  188. s *Service
  189. }
  190. func NewManagementCustomDataSourcesService(s *Service) *ManagementCustomDataSourcesService {
  191. rs := &ManagementCustomDataSourcesService{s: s}
  192. return rs
  193. }
  194. type ManagementCustomDataSourcesService struct {
  195. s *Service
  196. }
  197. func NewManagementCustomDimensionsService(s *Service) *ManagementCustomDimensionsService {
  198. rs := &ManagementCustomDimensionsService{s: s}
  199. return rs
  200. }
  201. type ManagementCustomDimensionsService struct {
  202. s *Service
  203. }
  204. func NewManagementCustomMetricsService(s *Service) *ManagementCustomMetricsService {
  205. rs := &ManagementCustomMetricsService{s: s}
  206. return rs
  207. }
  208. type ManagementCustomMetricsService struct {
  209. s *Service
  210. }
  211. func NewManagementExperimentsService(s *Service) *ManagementExperimentsService {
  212. rs := &ManagementExperimentsService{s: s}
  213. return rs
  214. }
  215. type ManagementExperimentsService struct {
  216. s *Service
  217. }
  218. func NewManagementFiltersService(s *Service) *ManagementFiltersService {
  219. rs := &ManagementFiltersService{s: s}
  220. return rs
  221. }
  222. type ManagementFiltersService struct {
  223. s *Service
  224. }
  225. func NewManagementGoalsService(s *Service) *ManagementGoalsService {
  226. rs := &ManagementGoalsService{s: s}
  227. return rs
  228. }
  229. type ManagementGoalsService struct {
  230. s *Service
  231. }
  232. func NewManagementProfileFilterLinksService(s *Service) *ManagementProfileFilterLinksService {
  233. rs := &ManagementProfileFilterLinksService{s: s}
  234. return rs
  235. }
  236. type ManagementProfileFilterLinksService struct {
  237. s *Service
  238. }
  239. func NewManagementProfileUserLinksService(s *Service) *ManagementProfileUserLinksService {
  240. rs := &ManagementProfileUserLinksService{s: s}
  241. return rs
  242. }
  243. type ManagementProfileUserLinksService struct {
  244. s *Service
  245. }
  246. func NewManagementProfilesService(s *Service) *ManagementProfilesService {
  247. rs := &ManagementProfilesService{s: s}
  248. return rs
  249. }
  250. type ManagementProfilesService struct {
  251. s *Service
  252. }
  253. func NewManagementRemarketingAudienceService(s *Service) *ManagementRemarketingAudienceService {
  254. rs := &ManagementRemarketingAudienceService{s: s}
  255. return rs
  256. }
  257. type ManagementRemarketingAudienceService struct {
  258. s *Service
  259. }
  260. func NewManagementSegmentsService(s *Service) *ManagementSegmentsService {
  261. rs := &ManagementSegmentsService{s: s}
  262. return rs
  263. }
  264. type ManagementSegmentsService struct {
  265. s *Service
  266. }
  267. func NewManagementUnsampledReportsService(s *Service) *ManagementUnsampledReportsService {
  268. rs := &ManagementUnsampledReportsService{s: s}
  269. return rs
  270. }
  271. type ManagementUnsampledReportsService struct {
  272. s *Service
  273. }
  274. func NewManagementUploadsService(s *Service) *ManagementUploadsService {
  275. rs := &ManagementUploadsService{s: s}
  276. return rs
  277. }
  278. type ManagementUploadsService struct {
  279. s *Service
  280. }
  281. func NewManagementWebPropertyAdWordsLinksService(s *Service) *ManagementWebPropertyAdWordsLinksService {
  282. rs := &ManagementWebPropertyAdWordsLinksService{s: s}
  283. return rs
  284. }
  285. type ManagementWebPropertyAdWordsLinksService struct {
  286. s *Service
  287. }
  288. func NewManagementWebpropertiesService(s *Service) *ManagementWebpropertiesService {
  289. rs := &ManagementWebpropertiesService{s: s}
  290. return rs
  291. }
  292. type ManagementWebpropertiesService struct {
  293. s *Service
  294. }
  295. func NewManagementWebpropertyUserLinksService(s *Service) *ManagementWebpropertyUserLinksService {
  296. rs := &ManagementWebpropertyUserLinksService{s: s}
  297. return rs
  298. }
  299. type ManagementWebpropertyUserLinksService struct {
  300. s *Service
  301. }
  302. func NewMetadataService(s *Service) *MetadataService {
  303. rs := &MetadataService{s: s}
  304. rs.Columns = NewMetadataColumnsService(s)
  305. return rs
  306. }
  307. type MetadataService struct {
  308. s *Service
  309. Columns *MetadataColumnsService
  310. }
  311. func NewMetadataColumnsService(s *Service) *MetadataColumnsService {
  312. rs := &MetadataColumnsService{s: s}
  313. return rs
  314. }
  315. type MetadataColumnsService struct {
  316. s *Service
  317. }
  318. func NewProvisioningService(s *Service) *ProvisioningService {
  319. rs := &ProvisioningService{s: s}
  320. return rs
  321. }
  322. type ProvisioningService struct {
  323. s *Service
  324. }
  325. func NewUserDeletionService(s *Service) *UserDeletionService {
  326. rs := &UserDeletionService{s: s}
  327. rs.UserDeletionRequest = NewUserDeletionUserDeletionRequestService(s)
  328. return rs
  329. }
  330. type UserDeletionService struct {
  331. s *Service
  332. UserDeletionRequest *UserDeletionUserDeletionRequestService
  333. }
  334. func NewUserDeletionUserDeletionRequestService(s *Service) *UserDeletionUserDeletionRequestService {
  335. rs := &UserDeletionUserDeletionRequestService{s: s}
  336. return rs
  337. }
  338. type UserDeletionUserDeletionRequestService struct {
  339. s *Service
  340. }
  341. // Account: JSON template for Analytics account entry.
  342. type Account struct {
  343. // ChildLink: Child link for an account entry. Points to the list of web
  344. // properties for this account.
  345. ChildLink *AccountChildLink `json:"childLink,omitempty"`
  346. // Created: Time the account was created.
  347. Created string `json:"created,omitempty"`
  348. // Id: Account ID.
  349. Id string `json:"id,omitempty"`
  350. // Kind: Resource type for Analytics account.
  351. Kind string `json:"kind,omitempty"`
  352. // Name: Account name.
  353. Name string `json:"name,omitempty"`
  354. // Permissions: Permissions the user has for this account.
  355. Permissions *AccountPermissions `json:"permissions,omitempty"`
  356. // SelfLink: Link for this account.
  357. SelfLink string `json:"selfLink,omitempty"`
  358. // Starred: Indicates whether this account is starred or not.
  359. Starred bool `json:"starred,omitempty"`
  360. // Updated: Time the account was last modified.
  361. Updated string `json:"updated,omitempty"`
  362. // ForceSendFields is a list of field names (e.g. "ChildLink") to
  363. // unconditionally include in API requests. By default, fields with
  364. // empty values are omitted from API requests. However, any non-pointer,
  365. // non-interface field appearing in ForceSendFields will be sent to the
  366. // server regardless of whether the field is empty or not. This may be
  367. // used to include empty fields in Patch requests.
  368. ForceSendFields []string `json:"-"`
  369. // NullFields is a list of field names (e.g. "ChildLink") to include in
  370. // API requests with the JSON null value. By default, fields with empty
  371. // values are omitted from API requests. However, any field with an
  372. // empty value appearing in NullFields will be sent to the server as
  373. // null. It is an error if a field in this list has a non-empty value.
  374. // This may be used to include null fields in Patch requests.
  375. NullFields []string `json:"-"`
  376. }
  377. func (s *Account) MarshalJSON() ([]byte, error) {
  378. type NoMethod Account
  379. raw := NoMethod(*s)
  380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  381. }
  382. // AccountChildLink: Child link for an account entry. Points to the list
  383. // of web properties for this account.
  384. type AccountChildLink struct {
  385. // Href: Link to the list of web properties for this account.
  386. Href string `json:"href,omitempty"`
  387. // Type: Type of the child link. Its value is "analytics#webproperties".
  388. Type string `json:"type,omitempty"`
  389. // ForceSendFields is a list of field names (e.g. "Href") to
  390. // unconditionally include in API requests. By default, fields with
  391. // empty values are omitted from API requests. However, any non-pointer,
  392. // non-interface field appearing in ForceSendFields will be sent to the
  393. // server regardless of whether the field is empty or not. This may be
  394. // used to include empty fields in Patch requests.
  395. ForceSendFields []string `json:"-"`
  396. // NullFields is a list of field names (e.g. "Href") to include in API
  397. // requests with the JSON null value. By default, fields with empty
  398. // values are omitted from API requests. However, any field with an
  399. // empty value appearing in NullFields will be sent to the server as
  400. // null. It is an error if a field in this list has a non-empty value.
  401. // This may be used to include null fields in Patch requests.
  402. NullFields []string `json:"-"`
  403. }
  404. func (s *AccountChildLink) MarshalJSON() ([]byte, error) {
  405. type NoMethod AccountChildLink
  406. raw := NoMethod(*s)
  407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  408. }
  409. // AccountPermissions: Permissions the user has for this account.
  410. type AccountPermissions struct {
  411. // Effective: All the permissions that the user has for this account.
  412. // These include any implied permissions (e.g., EDIT implies VIEW).
  413. Effective []string `json:"effective,omitempty"`
  414. // ForceSendFields is a list of field names (e.g. "Effective") to
  415. // unconditionally include in API requests. By default, fields with
  416. // empty values are omitted from API requests. However, any non-pointer,
  417. // non-interface field appearing in ForceSendFields will be sent to the
  418. // server regardless of whether the field is empty or not. This may be
  419. // used to include empty fields in Patch requests.
  420. ForceSendFields []string `json:"-"`
  421. // NullFields is a list of field names (e.g. "Effective") to include in
  422. // API requests with the JSON null value. By default, fields with empty
  423. // values are omitted from API requests. However, any field with an
  424. // empty value appearing in NullFields will be sent to the server as
  425. // null. It is an error if a field in this list has a non-empty value.
  426. // This may be used to include null fields in Patch requests.
  427. NullFields []string `json:"-"`
  428. }
  429. func (s *AccountPermissions) MarshalJSON() ([]byte, error) {
  430. type NoMethod AccountPermissions
  431. raw := NoMethod(*s)
  432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  433. }
  434. // AccountRef: JSON template for a linked account.
  435. type AccountRef struct {
  436. // Href: Link for this account.
  437. Href string `json:"href,omitempty"`
  438. // Id: Account ID.
  439. Id string `json:"id,omitempty"`
  440. // Kind: Analytics account reference.
  441. Kind string `json:"kind,omitempty"`
  442. // Name: Account name.
  443. Name string `json:"name,omitempty"`
  444. // ForceSendFields is a list of field names (e.g. "Href") to
  445. // unconditionally include in API requests. By default, fields with
  446. // empty values are omitted from API requests. However, any non-pointer,
  447. // non-interface field appearing in ForceSendFields will be sent to the
  448. // server regardless of whether the field is empty or not. This may be
  449. // used to include empty fields in Patch requests.
  450. ForceSendFields []string `json:"-"`
  451. // NullFields is a list of field names (e.g. "Href") to include in API
  452. // requests with the JSON null value. By default, fields with empty
  453. // values are omitted from API requests. However, any field with an
  454. // empty value appearing in NullFields will be sent to the server as
  455. // null. It is an error if a field in this list has a non-empty value.
  456. // This may be used to include null fields in Patch requests.
  457. NullFields []string `json:"-"`
  458. }
  459. func (s *AccountRef) MarshalJSON() ([]byte, error) {
  460. type NoMethod AccountRef
  461. raw := NoMethod(*s)
  462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  463. }
  464. // AccountSummaries: An AccountSummary collection lists a summary of
  465. // accounts, properties and views (profiles) to which the user has
  466. // access. Each resource in the collection corresponds to a single
  467. // AccountSummary.
  468. type AccountSummaries struct {
  469. // Items: A list of AccountSummaries.
  470. Items []*AccountSummary `json:"items,omitempty"`
  471. // ItemsPerPage: The maximum number of resources the response can
  472. // contain, regardless of the actual number of resources returned. Its
  473. // value ranges from 1 to 1000 with a value of 1000 by default, or
  474. // otherwise specified by the max-results query parameter.
  475. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  476. // Kind: Collection type.
  477. Kind string `json:"kind,omitempty"`
  478. // NextLink: Link to next page for this AccountSummary collection.
  479. NextLink string `json:"nextLink,omitempty"`
  480. // PreviousLink: Link to previous page for this AccountSummary
  481. // collection.
  482. PreviousLink string `json:"previousLink,omitempty"`
  483. // StartIndex: The starting index of the resources, which is 1 by
  484. // default or otherwise specified by the start-index query parameter.
  485. StartIndex int64 `json:"startIndex,omitempty"`
  486. // TotalResults: The total number of results for the query, regardless
  487. // of the number of results in the response.
  488. TotalResults int64 `json:"totalResults,omitempty"`
  489. // Username: Email ID of the authenticated user
  490. Username string `json:"username,omitempty"`
  491. // ServerResponse contains the HTTP response code and headers from the
  492. // server.
  493. googleapi.ServerResponse `json:"-"`
  494. // ForceSendFields is a list of field names (e.g. "Items") to
  495. // unconditionally include in API requests. By default, fields with
  496. // empty values are omitted from API requests. However, any non-pointer,
  497. // non-interface field appearing in ForceSendFields will be sent to the
  498. // server regardless of whether the field is empty or not. This may be
  499. // used to include empty fields in Patch requests.
  500. ForceSendFields []string `json:"-"`
  501. // NullFields is a list of field names (e.g. "Items") to include in API
  502. // requests with the JSON null value. By default, fields with empty
  503. // values are omitted from API requests. However, any field with an
  504. // empty value appearing in NullFields will be sent to the server as
  505. // null. It is an error if a field in this list has a non-empty value.
  506. // This may be used to include null fields in Patch requests.
  507. NullFields []string `json:"-"`
  508. }
  509. func (s *AccountSummaries) MarshalJSON() ([]byte, error) {
  510. type NoMethod AccountSummaries
  511. raw := NoMethod(*s)
  512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  513. }
  514. // AccountSummary: JSON template for an Analytics AccountSummary. An
  515. // AccountSummary is a lightweight tree comprised of
  516. // properties/profiles.
  517. type AccountSummary struct {
  518. // Id: Account ID.
  519. Id string `json:"id,omitempty"`
  520. // Kind: Resource type for Analytics AccountSummary.
  521. Kind string `json:"kind,omitempty"`
  522. // Name: Account name.
  523. Name string `json:"name,omitempty"`
  524. // Starred: Indicates whether this account is starred or not.
  525. Starred bool `json:"starred,omitempty"`
  526. // WebProperties: List of web properties under this account.
  527. WebProperties []*WebPropertySummary `json:"webProperties,omitempty"`
  528. // ForceSendFields is a list of field names (e.g. "Id") to
  529. // unconditionally include in API requests. By default, fields with
  530. // empty values are omitted from API requests. However, any non-pointer,
  531. // non-interface field appearing in ForceSendFields will be sent to the
  532. // server regardless of whether the field is empty or not. This may be
  533. // used to include empty fields in Patch requests.
  534. ForceSendFields []string `json:"-"`
  535. // NullFields is a list of field names (e.g. "Id") to include in API
  536. // requests with the JSON null value. By default, fields with empty
  537. // values are omitted from API requests. However, any field with an
  538. // empty value appearing in NullFields will be sent to the server as
  539. // null. It is an error if a field in this list has a non-empty value.
  540. // This may be used to include null fields in Patch requests.
  541. NullFields []string `json:"-"`
  542. }
  543. func (s *AccountSummary) MarshalJSON() ([]byte, error) {
  544. type NoMethod AccountSummary
  545. raw := NoMethod(*s)
  546. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  547. }
  548. // AccountTicket: JSON template for an Analytics account ticket. The
  549. // account ticket consists of the ticket ID and the basic information
  550. // for the account, property and profile.
  551. type AccountTicket struct {
  552. // Account: Account for this ticket.
  553. Account *Account `json:"account,omitempty"`
  554. // Id: Account ticket ID used to access the account ticket.
  555. Id string `json:"id,omitempty"`
  556. // Kind: Resource type for account ticket.
  557. Kind string `json:"kind,omitempty"`
  558. // Profile: View (Profile) for the account.
  559. Profile *Profile `json:"profile,omitempty"`
  560. // RedirectUri: Redirect URI where the user will be sent after accepting
  561. // Terms of Service. Must be configured in APIs console as a callback
  562. // URL.
  563. RedirectUri string `json:"redirectUri,omitempty"`
  564. // Webproperty: Web property for the account.
  565. Webproperty *Webproperty `json:"webproperty,omitempty"`
  566. // ServerResponse contains the HTTP response code and headers from the
  567. // server.
  568. googleapi.ServerResponse `json:"-"`
  569. // ForceSendFields is a list of field names (e.g. "Account") to
  570. // unconditionally include in API requests. By default, fields with
  571. // empty values are omitted from API requests. However, any non-pointer,
  572. // non-interface field appearing in ForceSendFields will be sent to the
  573. // server regardless of whether the field is empty or not. This may be
  574. // used to include empty fields in Patch requests.
  575. ForceSendFields []string `json:"-"`
  576. // NullFields is a list of field names (e.g. "Account") to include in
  577. // API requests with the JSON null value. By default, fields with empty
  578. // values are omitted from API requests. However, any field with an
  579. // empty value appearing in NullFields will be sent to the server as
  580. // null. It is an error if a field in this list has a non-empty value.
  581. // This may be used to include null fields in Patch requests.
  582. NullFields []string `json:"-"`
  583. }
  584. func (s *AccountTicket) MarshalJSON() ([]byte, error) {
  585. type NoMethod AccountTicket
  586. raw := NoMethod(*s)
  587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  588. }
  589. // AccountTreeRequest: JSON template for an Analytics account tree
  590. // requests. The account tree request is used in the provisioning api to
  591. // create an account, property, and view (profile). It contains the
  592. // basic information required to make these fields.
  593. type AccountTreeRequest struct {
  594. AccountName string `json:"accountName,omitempty"`
  595. AccountSettings *AccountTreeRequestAccountSettings `json:"accountSettings,omitempty"`
  596. // Kind: Resource type for account ticket.
  597. Kind string `json:"kind,omitempty"`
  598. ProfileName string `json:"profileName,omitempty"`
  599. Timezone string `json:"timezone,omitempty"`
  600. WebpropertyName string `json:"webpropertyName,omitempty"`
  601. WebsiteUrl string `json:"websiteUrl,omitempty"`
  602. // ForceSendFields is a list of field names (e.g. "AccountName") to
  603. // unconditionally include in API requests. By default, fields with
  604. // empty values are omitted from API requests. However, any non-pointer,
  605. // non-interface field appearing in ForceSendFields will be sent to the
  606. // server regardless of whether the field is empty or not. This may be
  607. // used to include empty fields in Patch requests.
  608. ForceSendFields []string `json:"-"`
  609. // NullFields is a list of field names (e.g. "AccountName") to include
  610. // in API requests with the JSON null value. By default, fields with
  611. // empty values are omitted from API requests. However, any field with
  612. // an empty value appearing in NullFields will be sent to the server as
  613. // null. It is an error if a field in this list has a non-empty value.
  614. // This may be used to include null fields in Patch requests.
  615. NullFields []string `json:"-"`
  616. }
  617. func (s *AccountTreeRequest) MarshalJSON() ([]byte, error) {
  618. type NoMethod AccountTreeRequest
  619. raw := NoMethod(*s)
  620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  621. }
  622. type AccountTreeRequestAccountSettings struct {
  623. ShareAnonymouslyWithOthers bool `json:"shareAnonymouslyWithOthers,omitempty"`
  624. ShareWithGoogleProducts bool `json:"shareWithGoogleProducts,omitempty"`
  625. ShareWithSpecialists bool `json:"shareWithSpecialists,omitempty"`
  626. ShareWithSupport bool `json:"shareWithSupport,omitempty"`
  627. // ForceSendFields is a list of field names (e.g.
  628. // "ShareAnonymouslyWithOthers") to unconditionally include in API
  629. // requests. By default, fields with empty values are omitted from API
  630. // requests. However, any non-pointer, non-interface field appearing in
  631. // ForceSendFields will be sent to the server regardless of whether the
  632. // field is empty or not. This may be used to include empty fields in
  633. // Patch requests.
  634. ForceSendFields []string `json:"-"`
  635. // NullFields is a list of field names (e.g.
  636. // "ShareAnonymouslyWithOthers") to include in API requests with the
  637. // JSON null value. By default, fields with empty values are omitted
  638. // from API requests. However, any field with an empty value appearing
  639. // in NullFields will be sent to the server as null. It is an error if a
  640. // field in this list has a non-empty value. This may be used to include
  641. // null fields in Patch requests.
  642. NullFields []string `json:"-"`
  643. }
  644. func (s *AccountTreeRequestAccountSettings) MarshalJSON() ([]byte, error) {
  645. type NoMethod AccountTreeRequestAccountSettings
  646. raw := NoMethod(*s)
  647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  648. }
  649. // AccountTreeResponse: JSON template for an Analytics account tree
  650. // response. The account tree response is used in the provisioning api
  651. // to return the result of creating an account, property, and view
  652. // (profile).
  653. type AccountTreeResponse struct {
  654. // Account: The account created.
  655. Account *Account `json:"account,omitempty"`
  656. AccountSettings *AccountTreeResponseAccountSettings `json:"accountSettings,omitempty"`
  657. // Kind: Resource type for account ticket.
  658. Kind string `json:"kind,omitempty"`
  659. // Profile: View (Profile) for the account.
  660. Profile *Profile `json:"profile,omitempty"`
  661. // Webproperty: Web property for the account.
  662. Webproperty *Webproperty `json:"webproperty,omitempty"`
  663. // ServerResponse contains the HTTP response code and headers from the
  664. // server.
  665. googleapi.ServerResponse `json:"-"`
  666. // ForceSendFields is a list of field names (e.g. "Account") to
  667. // unconditionally include in API requests. By default, fields with
  668. // empty values are omitted from API requests. However, any non-pointer,
  669. // non-interface field appearing in ForceSendFields will be sent to the
  670. // server regardless of whether the field is empty or not. This may be
  671. // used to include empty fields in Patch requests.
  672. ForceSendFields []string `json:"-"`
  673. // NullFields is a list of field names (e.g. "Account") to include in
  674. // API requests with the JSON null value. By default, fields with empty
  675. // values are omitted from API requests. However, any field with an
  676. // empty value appearing in NullFields will be sent to the server as
  677. // null. It is an error if a field in this list has a non-empty value.
  678. // This may be used to include null fields in Patch requests.
  679. NullFields []string `json:"-"`
  680. }
  681. func (s *AccountTreeResponse) MarshalJSON() ([]byte, error) {
  682. type NoMethod AccountTreeResponse
  683. raw := NoMethod(*s)
  684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  685. }
  686. type AccountTreeResponseAccountSettings struct {
  687. ShareAnonymouslyWithOthers bool `json:"shareAnonymouslyWithOthers,omitempty"`
  688. ShareWithGoogleProducts bool `json:"shareWithGoogleProducts,omitempty"`
  689. ShareWithSpecialists bool `json:"shareWithSpecialists,omitempty"`
  690. ShareWithSupport bool `json:"shareWithSupport,omitempty"`
  691. // ForceSendFields is a list of field names (e.g.
  692. // "ShareAnonymouslyWithOthers") to unconditionally include in API
  693. // requests. By default, fields with empty values are omitted from API
  694. // requests. However, any non-pointer, non-interface field appearing in
  695. // ForceSendFields will be sent to the server regardless of whether the
  696. // field is empty or not. This may be used to include empty fields in
  697. // Patch requests.
  698. ForceSendFields []string `json:"-"`
  699. // NullFields is a list of field names (e.g.
  700. // "ShareAnonymouslyWithOthers") to include in API requests with the
  701. // JSON null value. By default, fields with empty values are omitted
  702. // from API requests. However, any field with an empty value appearing
  703. // in NullFields will be sent to the server as null. It is an error if a
  704. // field in this list has a non-empty value. This may be used to include
  705. // null fields in Patch requests.
  706. NullFields []string `json:"-"`
  707. }
  708. func (s *AccountTreeResponseAccountSettings) MarshalJSON() ([]byte, error) {
  709. type NoMethod AccountTreeResponseAccountSettings
  710. raw := NoMethod(*s)
  711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  712. }
  713. // Accounts: An account collection provides a list of Analytics accounts
  714. // to which a user has access. The account collection is the entry point
  715. // to all management information. Each resource in the collection
  716. // corresponds to a single Analytics account.
  717. type Accounts struct {
  718. // Items: A list of accounts.
  719. Items []*Account `json:"items,omitempty"`
  720. // ItemsPerPage: The maximum number of entries the response can contain,
  721. // regardless of the actual number of entries returned. Its value ranges
  722. // from 1 to 1000 with a value of 1000 by default, or otherwise
  723. // specified by the max-results query parameter.
  724. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  725. // Kind: Collection type.
  726. Kind string `json:"kind,omitempty"`
  727. // NextLink: Next link for this account collection.
  728. NextLink string `json:"nextLink,omitempty"`
  729. // PreviousLink: Previous link for this account collection.
  730. PreviousLink string `json:"previousLink,omitempty"`
  731. // StartIndex: The starting index of the entries, which is 1 by default
  732. // or otherwise specified by the start-index query parameter.
  733. StartIndex int64 `json:"startIndex,omitempty"`
  734. // TotalResults: The total number of results for the query, regardless
  735. // of the number of results in the response.
  736. TotalResults int64 `json:"totalResults,omitempty"`
  737. // Username: Email ID of the authenticated user
  738. Username string `json:"username,omitempty"`
  739. // ServerResponse contains the HTTP response code and headers from the
  740. // server.
  741. googleapi.ServerResponse `json:"-"`
  742. // ForceSendFields is a list of field names (e.g. "Items") to
  743. // unconditionally include in API requests. By default, fields with
  744. // empty values are omitted from API requests. However, any non-pointer,
  745. // non-interface field appearing in ForceSendFields will be sent to the
  746. // server regardless of whether the field is empty or not. This may be
  747. // used to include empty fields in Patch requests.
  748. ForceSendFields []string `json:"-"`
  749. // NullFields is a list of field names (e.g. "Items") to include in API
  750. // requests with the JSON null value. By default, fields with empty
  751. // values are omitted from API requests. However, any field with an
  752. // empty value appearing in NullFields will be sent to the server as
  753. // null. It is an error if a field in this list has a non-empty value.
  754. // This may be used to include null fields in Patch requests.
  755. NullFields []string `json:"-"`
  756. }
  757. func (s *Accounts) MarshalJSON() ([]byte, error) {
  758. type NoMethod Accounts
  759. raw := NoMethod(*s)
  760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  761. }
  762. // AdWordsAccount: JSON template for an AdWords account.
  763. type AdWordsAccount struct {
  764. // AutoTaggingEnabled: True if auto-tagging is enabled on the AdWords
  765. // account. Read-only after the insert operation.
  766. AutoTaggingEnabled bool `json:"autoTaggingEnabled,omitempty"`
  767. // CustomerId: Customer ID. This field is required when creating an
  768. // AdWords link.
  769. CustomerId string `json:"customerId,omitempty"`
  770. // Kind: Resource type for AdWords account.
  771. Kind string `json:"kind,omitempty"`
  772. // ForceSendFields is a list of field names (e.g. "AutoTaggingEnabled")
  773. // to unconditionally include in API requests. By default, fields with
  774. // empty values are omitted from API requests. However, any non-pointer,
  775. // non-interface field appearing in ForceSendFields will be sent to the
  776. // server regardless of whether the field is empty or not. This may be
  777. // used to include empty fields in Patch requests.
  778. ForceSendFields []string `json:"-"`
  779. // NullFields is a list of field names (e.g. "AutoTaggingEnabled") to
  780. // include in API requests with the JSON null value. By default, fields
  781. // with empty values are omitted from API requests. However, any field
  782. // with an empty value appearing in NullFields will be sent to the
  783. // server as null. It is an error if a field in this list has a
  784. // non-empty value. This may be used to include null fields in Patch
  785. // requests.
  786. NullFields []string `json:"-"`
  787. }
  788. func (s *AdWordsAccount) MarshalJSON() ([]byte, error) {
  789. type NoMethod AdWordsAccount
  790. raw := NoMethod(*s)
  791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  792. }
  793. // AnalyticsDataimportDeleteUploadDataRequest: Request template for the
  794. // delete upload data request.
  795. type AnalyticsDataimportDeleteUploadDataRequest struct {
  796. // CustomDataImportUids: A list of upload UIDs.
  797. CustomDataImportUids []string `json:"customDataImportUids,omitempty"`
  798. // ForceSendFields is a list of field names (e.g.
  799. // "CustomDataImportUids") to unconditionally include in API requests.
  800. // By default, fields with empty values are omitted from API requests.
  801. // However, any non-pointer, non-interface field appearing in
  802. // ForceSendFields will be sent to the server regardless of whether the
  803. // field is empty or not. This may be used to include empty fields in
  804. // Patch requests.
  805. ForceSendFields []string `json:"-"`
  806. // NullFields is a list of field names (e.g. "CustomDataImportUids") to
  807. // include in API requests with the JSON null value. By default, fields
  808. // with empty values are omitted from API requests. However, any field
  809. // with an empty value appearing in NullFields will be sent to the
  810. // server as null. It is an error if a field in this list has a
  811. // non-empty value. This may be used to include null fields in Patch
  812. // requests.
  813. NullFields []string `json:"-"`
  814. }
  815. func (s *AnalyticsDataimportDeleteUploadDataRequest) MarshalJSON() ([]byte, error) {
  816. type NoMethod AnalyticsDataimportDeleteUploadDataRequest
  817. raw := NoMethod(*s)
  818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  819. }
  820. // Column: JSON template for a metadata column.
  821. type Column struct {
  822. // Attributes: Map of attribute name and value for this column.
  823. Attributes map[string]string `json:"attributes,omitempty"`
  824. // Id: Column id.
  825. Id string `json:"id,omitempty"`
  826. // Kind: Resource type for Analytics column.
  827. Kind string `json:"kind,omitempty"`
  828. // ForceSendFields is a list of field names (e.g. "Attributes") to
  829. // unconditionally include in API requests. By default, fields with
  830. // empty values are omitted from API requests. However, any non-pointer,
  831. // non-interface field appearing in ForceSendFields will be sent to the
  832. // server regardless of whether the field is empty or not. This may be
  833. // used to include empty fields in Patch requests.
  834. ForceSendFields []string `json:"-"`
  835. // NullFields is a list of field names (e.g. "Attributes") to include in
  836. // API requests with the JSON null value. By default, fields with empty
  837. // values are omitted from API requests. However, any field with an
  838. // empty value appearing in NullFields will be sent to the server as
  839. // null. It is an error if a field in this list has a non-empty value.
  840. // This may be used to include null fields in Patch requests.
  841. NullFields []string `json:"-"`
  842. }
  843. func (s *Column) MarshalJSON() ([]byte, error) {
  844. type NoMethod Column
  845. raw := NoMethod(*s)
  846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  847. }
  848. // Columns: Lists columns (dimensions and metrics) for a particular
  849. // report type.
  850. type Columns struct {
  851. // AttributeNames: List of attributes names returned by columns.
  852. AttributeNames []string `json:"attributeNames,omitempty"`
  853. // Etag: Etag of collection. This etag can be compared with the last
  854. // response etag to check if response has changed.
  855. Etag string `json:"etag,omitempty"`
  856. // Items: List of columns for a report type.
  857. Items []*Column `json:"items,omitempty"`
  858. // Kind: Collection type.
  859. Kind string `json:"kind,omitempty"`
  860. // TotalResults: Total number of columns returned in the response.
  861. TotalResults int64 `json:"totalResults,omitempty"`
  862. // ServerResponse contains the HTTP response code and headers from the
  863. // server.
  864. googleapi.ServerResponse `json:"-"`
  865. // ForceSendFields is a list of field names (e.g. "AttributeNames") to
  866. // unconditionally include in API requests. By default, fields with
  867. // empty values are omitted from API requests. However, any non-pointer,
  868. // non-interface field appearing in ForceSendFields will be sent to the
  869. // server regardless of whether the field is empty or not. This may be
  870. // used to include empty fields in Patch requests.
  871. ForceSendFields []string `json:"-"`
  872. // NullFields is a list of field names (e.g. "AttributeNames") to
  873. // include in API requests with the JSON null value. By default, fields
  874. // with empty values are omitted from API requests. However, any field
  875. // with an empty value appearing in NullFields will be sent to the
  876. // server as null. It is an error if a field in this list has a
  877. // non-empty value. This may be used to include null fields in Patch
  878. // requests.
  879. NullFields []string `json:"-"`
  880. }
  881. func (s *Columns) MarshalJSON() ([]byte, error) {
  882. type NoMethod Columns
  883. raw := NoMethod(*s)
  884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  885. }
  886. // CustomDataSource: JSON template for an Analytics custom data source.
  887. type CustomDataSource struct {
  888. // AccountId: Account ID to which this custom data source belongs.
  889. AccountId string `json:"accountId,omitempty"`
  890. ChildLink *CustomDataSourceChildLink `json:"childLink,omitempty"`
  891. // Created: Time this custom data source was created.
  892. Created string `json:"created,omitempty"`
  893. // Description: Description of custom data source.
  894. Description string `json:"description,omitempty"`
  895. // Id: Custom data source ID.
  896. Id string `json:"id,omitempty"`
  897. ImportBehavior string `json:"importBehavior,omitempty"`
  898. // Kind: Resource type for Analytics custom data source.
  899. Kind string `json:"kind,omitempty"`
  900. // Name: Name of this custom data source.
  901. Name string `json:"name,omitempty"`
  902. // ParentLink: Parent link for this custom data source. Points to the
  903. // web property to which this custom data source belongs.
  904. ParentLink *CustomDataSourceParentLink `json:"parentLink,omitempty"`
  905. // ProfilesLinked: IDs of views (profiles) linked to the custom data
  906. // source.
  907. ProfilesLinked []string `json:"profilesLinked,omitempty"`
  908. // Schema: Collection of schema headers of the custom data source.
  909. Schema []string `json:"schema,omitempty"`
  910. // SelfLink: Link for this Analytics custom data source.
  911. SelfLink string `json:"selfLink,omitempty"`
  912. // Type: Type of the custom data source.
  913. Type string `json:"type,omitempty"`
  914. // Updated: Time this custom data source was last modified.
  915. Updated string `json:"updated,omitempty"`
  916. // UploadType: Upload type of the custom data source.
  917. UploadType string `json:"uploadType,omitempty"`
  918. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  919. // custom data source belongs.
  920. WebPropertyId string `json:"webPropertyId,omitempty"`
  921. // ForceSendFields is a list of field names (e.g. "AccountId") to
  922. // unconditionally include in API requests. By default, fields with
  923. // empty values are omitted from API requests. However, any non-pointer,
  924. // non-interface field appearing in ForceSendFields will be sent to the
  925. // server regardless of whether the field is empty or not. This may be
  926. // used to include empty fields in Patch requests.
  927. ForceSendFields []string `json:"-"`
  928. // NullFields is a list of field names (e.g. "AccountId") to include in
  929. // API requests with the JSON null value. By default, fields with empty
  930. // values are omitted from API requests. However, any field with an
  931. // empty value appearing in NullFields will be sent to the server as
  932. // null. It is an error if a field in this list has a non-empty value.
  933. // This may be used to include null fields in Patch requests.
  934. NullFields []string `json:"-"`
  935. }
  936. func (s *CustomDataSource) MarshalJSON() ([]byte, error) {
  937. type NoMethod CustomDataSource
  938. raw := NoMethod(*s)
  939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  940. }
  941. type CustomDataSourceChildLink struct {
  942. // Href: Link to the list of daily uploads for this custom data source.
  943. // Link to the list of uploads for this custom data source.
  944. Href string `json:"href,omitempty"`
  945. // Type: Value is "analytics#dailyUploads". Value is
  946. // "analytics#uploads".
  947. Type string `json:"type,omitempty"`
  948. // ForceSendFields is a list of field names (e.g. "Href") to
  949. // unconditionally include in API requests. By default, fields with
  950. // empty values are omitted from API requests. However, any non-pointer,
  951. // non-interface field appearing in ForceSendFields will be sent to the
  952. // server regardless of whether the field is empty or not. This may be
  953. // used to include empty fields in Patch requests.
  954. ForceSendFields []string `json:"-"`
  955. // NullFields is a list of field names (e.g. "Href") to include in API
  956. // requests with the JSON null value. By default, fields with empty
  957. // values are omitted from API requests. However, any field with an
  958. // empty value appearing in NullFields will be sent to the server as
  959. // null. It is an error if a field in this list has a non-empty value.
  960. // This may be used to include null fields in Patch requests.
  961. NullFields []string `json:"-"`
  962. }
  963. func (s *CustomDataSourceChildLink) MarshalJSON() ([]byte, error) {
  964. type NoMethod CustomDataSourceChildLink
  965. raw := NoMethod(*s)
  966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  967. }
  968. // CustomDataSourceParentLink: Parent link for this custom data source.
  969. // Points to the web property to which this custom data source belongs.
  970. type CustomDataSourceParentLink struct {
  971. // Href: Link to the web property to which this custom data source
  972. // belongs.
  973. Href string `json:"href,omitempty"`
  974. // Type: Value is "analytics#webproperty".
  975. Type string `json:"type,omitempty"`
  976. // ForceSendFields is a list of field names (e.g. "Href") to
  977. // unconditionally include in API requests. By default, fields with
  978. // empty values are omitted from API requests. However, any non-pointer,
  979. // non-interface field appearing in ForceSendFields will be sent to the
  980. // server regardless of whether the field is empty or not. This may be
  981. // used to include empty fields in Patch requests.
  982. ForceSendFields []string `json:"-"`
  983. // NullFields is a list of field names (e.g. "Href") to include in API
  984. // requests with the JSON null value. By default, fields with empty
  985. // values are omitted from API requests. However, any field with an
  986. // empty value appearing in NullFields will be sent to the server as
  987. // null. It is an error if a field in this list has a non-empty value.
  988. // This may be used to include null fields in Patch requests.
  989. NullFields []string `json:"-"`
  990. }
  991. func (s *CustomDataSourceParentLink) MarshalJSON() ([]byte, error) {
  992. type NoMethod CustomDataSourceParentLink
  993. raw := NoMethod(*s)
  994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  995. }
  996. // CustomDataSources: Lists Analytics custom data sources to which the
  997. // user has access. Each resource in the collection corresponds to a
  998. // single Analytics custom data source.
  999. type CustomDataSources struct {
  1000. // Items: Collection of custom data sources.
  1001. Items []*CustomDataSource `json:"items,omitempty"`
  1002. // ItemsPerPage: The maximum number of resources the response can
  1003. // contain, regardless of the actual number of resources returned. Its
  1004. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1005. // otherwise specified by the max-results query parameter.
  1006. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1007. // Kind: Collection type.
  1008. Kind string `json:"kind,omitempty"`
  1009. // NextLink: Link to next page for this custom data source collection.
  1010. NextLink string `json:"nextLink,omitempty"`
  1011. // PreviousLink: Link to previous page for this custom data source
  1012. // collection.
  1013. PreviousLink string `json:"previousLink,omitempty"`
  1014. // StartIndex: The starting index of the resources, which is 1 by
  1015. // default or otherwise specified by the start-index query parameter.
  1016. StartIndex int64 `json:"startIndex,omitempty"`
  1017. // TotalResults: The total number of results for the query, regardless
  1018. // of the number of results in the response.
  1019. TotalResults int64 `json:"totalResults,omitempty"`
  1020. // Username: Email ID of the authenticated user
  1021. Username string `json:"username,omitempty"`
  1022. // ServerResponse contains the HTTP response code and headers from the
  1023. // server.
  1024. googleapi.ServerResponse `json:"-"`
  1025. // ForceSendFields is a list of field names (e.g. "Items") to
  1026. // unconditionally include in API requests. By default, fields with
  1027. // empty values are omitted from API requests. However, any non-pointer,
  1028. // non-interface field appearing in ForceSendFields will be sent to the
  1029. // server regardless of whether the field is empty or not. This may be
  1030. // used to include empty fields in Patch requests.
  1031. ForceSendFields []string `json:"-"`
  1032. // NullFields is a list of field names (e.g. "Items") to include in API
  1033. // requests with the JSON null value. By default, fields with empty
  1034. // values are omitted from API requests. However, any field with an
  1035. // empty value appearing in NullFields will be sent to the server as
  1036. // null. It is an error if a field in this list has a non-empty value.
  1037. // This may be used to include null fields in Patch requests.
  1038. NullFields []string `json:"-"`
  1039. }
  1040. func (s *CustomDataSources) MarshalJSON() ([]byte, error) {
  1041. type NoMethod CustomDataSources
  1042. raw := NoMethod(*s)
  1043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1044. }
  1045. // CustomDimension: JSON template for Analytics Custom Dimension.
  1046. type CustomDimension struct {
  1047. // AccountId: Account ID.
  1048. AccountId string `json:"accountId,omitempty"`
  1049. // Active: Boolean indicating whether the custom dimension is active.
  1050. Active bool `json:"active,omitempty"`
  1051. // Created: Time the custom dimension was created.
  1052. Created string `json:"created,omitempty"`
  1053. // Id: Custom dimension ID.
  1054. Id string `json:"id,omitempty"`
  1055. // Index: Index of the custom dimension.
  1056. Index int64 `json:"index,omitempty"`
  1057. // Kind: Kind value for a custom dimension. Set to
  1058. // "analytics#customDimension". It is a read-only field.
  1059. Kind string `json:"kind,omitempty"`
  1060. // Name: Name of the custom dimension.
  1061. Name string `json:"name,omitempty"`
  1062. // ParentLink: Parent link for the custom dimension. Points to the
  1063. // property to which the custom dimension belongs.
  1064. ParentLink *CustomDimensionParentLink `json:"parentLink,omitempty"`
  1065. // Scope: Scope of the custom dimension: HIT, SESSION, USER or PRODUCT.
  1066. Scope string `json:"scope,omitempty"`
  1067. // SelfLink: Link for the custom dimension
  1068. SelfLink string `json:"selfLink,omitempty"`
  1069. // Updated: Time the custom dimension was last modified.
  1070. Updated string `json:"updated,omitempty"`
  1071. // WebPropertyId: Property ID.
  1072. WebPropertyId string `json:"webPropertyId,omitempty"`
  1073. // ServerResponse contains the HTTP response code and headers from the
  1074. // server.
  1075. googleapi.ServerResponse `json:"-"`
  1076. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1077. // unconditionally include in API requests. By default, fields with
  1078. // empty values are omitted from API requests. However, any non-pointer,
  1079. // non-interface field appearing in ForceSendFields will be sent to the
  1080. // server regardless of whether the field is empty or not. This may be
  1081. // used to include empty fields in Patch requests.
  1082. ForceSendFields []string `json:"-"`
  1083. // NullFields is a list of field names (e.g. "AccountId") to include in
  1084. // API requests with the JSON null value. By default, fields with empty
  1085. // values are omitted from API requests. However, any field with an
  1086. // empty value appearing in NullFields will be sent to the server as
  1087. // null. It is an error if a field in this list has a non-empty value.
  1088. // This may be used to include null fields in Patch requests.
  1089. NullFields []string `json:"-"`
  1090. }
  1091. func (s *CustomDimension) MarshalJSON() ([]byte, error) {
  1092. type NoMethod CustomDimension
  1093. raw := NoMethod(*s)
  1094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1095. }
  1096. // CustomDimensionParentLink: Parent link for the custom dimension.
  1097. // Points to the property to which the custom dimension belongs.
  1098. type CustomDimensionParentLink struct {
  1099. // Href: Link to the property to which the custom dimension belongs.
  1100. Href string `json:"href,omitempty"`
  1101. // Type: Type of the parent link. Set to "analytics#webproperty".
  1102. Type string `json:"type,omitempty"`
  1103. // ForceSendFields is a list of field names (e.g. "Href") to
  1104. // unconditionally include in API requests. By default, fields with
  1105. // empty values are omitted from API requests. However, any non-pointer,
  1106. // non-interface field appearing in ForceSendFields will be sent to the
  1107. // server regardless of whether the field is empty or not. This may be
  1108. // used to include empty fields in Patch requests.
  1109. ForceSendFields []string `json:"-"`
  1110. // NullFields is a list of field names (e.g. "Href") to include in API
  1111. // requests with the JSON null value. By default, fields with empty
  1112. // values are omitted from API requests. However, any field with an
  1113. // empty value appearing in NullFields will be sent to the server as
  1114. // null. It is an error if a field in this list has a non-empty value.
  1115. // This may be used to include null fields in Patch requests.
  1116. NullFields []string `json:"-"`
  1117. }
  1118. func (s *CustomDimensionParentLink) MarshalJSON() ([]byte, error) {
  1119. type NoMethod CustomDimensionParentLink
  1120. raw := NoMethod(*s)
  1121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1122. }
  1123. // CustomDimensions: A custom dimension collection lists Analytics
  1124. // custom dimensions to which the user has access. Each resource in the
  1125. // collection corresponds to a single Analytics custom dimension.
  1126. type CustomDimensions struct {
  1127. // Items: Collection of custom dimensions.
  1128. Items []*CustomDimension `json:"items,omitempty"`
  1129. // ItemsPerPage: The maximum number of resources the response can
  1130. // contain, regardless of the actual number of resources returned. Its
  1131. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1132. // otherwise specified by the max-results query parameter.
  1133. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1134. // Kind: Collection type.
  1135. Kind string `json:"kind,omitempty"`
  1136. // NextLink: Link to next page for this custom dimension collection.
  1137. NextLink string `json:"nextLink,omitempty"`
  1138. // PreviousLink: Link to previous page for this custom dimension
  1139. // collection.
  1140. PreviousLink string `json:"previousLink,omitempty"`
  1141. // StartIndex: The starting index of the resources, which is 1 by
  1142. // default or otherwise specified by the start-index query parameter.
  1143. StartIndex int64 `json:"startIndex,omitempty"`
  1144. // TotalResults: The total number of results for the query, regardless
  1145. // of the number of results in the response.
  1146. TotalResults int64 `json:"totalResults,omitempty"`
  1147. // Username: Email ID of the authenticated user
  1148. Username string `json:"username,omitempty"`
  1149. // ServerResponse contains the HTTP response code and headers from the
  1150. // server.
  1151. googleapi.ServerResponse `json:"-"`
  1152. // ForceSendFields is a list of field names (e.g. "Items") to
  1153. // unconditionally include in API requests. By default, fields with
  1154. // empty values are omitted from API requests. However, any non-pointer,
  1155. // non-interface field appearing in ForceSendFields will be sent to the
  1156. // server regardless of whether the field is empty or not. This may be
  1157. // used to include empty fields in Patch requests.
  1158. ForceSendFields []string `json:"-"`
  1159. // NullFields is a list of field names (e.g. "Items") to include in API
  1160. // requests with the JSON null value. By default, fields with empty
  1161. // values are omitted from API requests. However, any field with an
  1162. // empty value appearing in NullFields will be sent to the server as
  1163. // null. It is an error if a field in this list has a non-empty value.
  1164. // This may be used to include null fields in Patch requests.
  1165. NullFields []string `json:"-"`
  1166. }
  1167. func (s *CustomDimensions) MarshalJSON() ([]byte, error) {
  1168. type NoMethod CustomDimensions
  1169. raw := NoMethod(*s)
  1170. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1171. }
  1172. // CustomMetric: JSON template for Analytics Custom Metric.
  1173. type CustomMetric struct {
  1174. // AccountId: Account ID.
  1175. AccountId string `json:"accountId,omitempty"`
  1176. // Active: Boolean indicating whether the custom metric is active.
  1177. Active bool `json:"active,omitempty"`
  1178. // Created: Time the custom metric was created.
  1179. Created string `json:"created,omitempty"`
  1180. // Id: Custom metric ID.
  1181. Id string `json:"id,omitempty"`
  1182. // Index: Index of the custom metric.
  1183. Index int64 `json:"index,omitempty"`
  1184. // Kind: Kind value for a custom metric. Set to
  1185. // "analytics#customMetric". It is a read-only field.
  1186. Kind string `json:"kind,omitempty"`
  1187. // MaxValue: Max value of custom metric.
  1188. MaxValue string `json:"max_value,omitempty"`
  1189. // MinValue: Min value of custom metric.
  1190. MinValue string `json:"min_value,omitempty"`
  1191. // Name: Name of the custom metric.
  1192. Name string `json:"name,omitempty"`
  1193. // ParentLink: Parent link for the custom metric. Points to the property
  1194. // to which the custom metric belongs.
  1195. ParentLink *CustomMetricParentLink `json:"parentLink,omitempty"`
  1196. // Scope: Scope of the custom metric: HIT or PRODUCT.
  1197. Scope string `json:"scope,omitempty"`
  1198. // SelfLink: Link for the custom metric
  1199. SelfLink string `json:"selfLink,omitempty"`
  1200. // Type: Data type of custom metric.
  1201. Type string `json:"type,omitempty"`
  1202. // Updated: Time the custom metric was last modified.
  1203. Updated string `json:"updated,omitempty"`
  1204. // WebPropertyId: Property ID.
  1205. WebPropertyId string `json:"webPropertyId,omitempty"`
  1206. // ServerResponse contains the HTTP response code and headers from the
  1207. // server.
  1208. googleapi.ServerResponse `json:"-"`
  1209. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1210. // unconditionally include in API requests. By default, fields with
  1211. // empty values are omitted from API requests. However, any non-pointer,
  1212. // non-interface field appearing in ForceSendFields will be sent to the
  1213. // server regardless of whether the field is empty or not. This may be
  1214. // used to include empty fields in Patch requests.
  1215. ForceSendFields []string `json:"-"`
  1216. // NullFields is a list of field names (e.g. "AccountId") to include in
  1217. // API requests with the JSON null value. By default, fields with empty
  1218. // values are omitted from API requests. However, any field with an
  1219. // empty value appearing in NullFields will be sent to the server as
  1220. // null. It is an error if a field in this list has a non-empty value.
  1221. // This may be used to include null fields in Patch requests.
  1222. NullFields []string `json:"-"`
  1223. }
  1224. func (s *CustomMetric) MarshalJSON() ([]byte, error) {
  1225. type NoMethod CustomMetric
  1226. raw := NoMethod(*s)
  1227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1228. }
  1229. // CustomMetricParentLink: Parent link for the custom metric. Points to
  1230. // the property to which the custom metric belongs.
  1231. type CustomMetricParentLink struct {
  1232. // Href: Link to the property to which the custom metric belongs.
  1233. Href string `json:"href,omitempty"`
  1234. // Type: Type of the parent link. Set to "analytics#webproperty".
  1235. Type string `json:"type,omitempty"`
  1236. // ForceSendFields is a list of field names (e.g. "Href") to
  1237. // unconditionally include in API requests. By default, fields with
  1238. // empty values are omitted from API requests. However, any non-pointer,
  1239. // non-interface field appearing in ForceSendFields will be sent to the
  1240. // server regardless of whether the field is empty or not. This may be
  1241. // used to include empty fields in Patch requests.
  1242. ForceSendFields []string `json:"-"`
  1243. // NullFields is a list of field names (e.g. "Href") to include in API
  1244. // requests with the JSON null value. By default, fields with empty
  1245. // values are omitted from API requests. However, any field with an
  1246. // empty value appearing in NullFields will be sent to the server as
  1247. // null. It is an error if a field in this list has a non-empty value.
  1248. // This may be used to include null fields in Patch requests.
  1249. NullFields []string `json:"-"`
  1250. }
  1251. func (s *CustomMetricParentLink) MarshalJSON() ([]byte, error) {
  1252. type NoMethod CustomMetricParentLink
  1253. raw := NoMethod(*s)
  1254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1255. }
  1256. // CustomMetrics: A custom metric collection lists Analytics custom
  1257. // metrics to which the user has access. Each resource in the collection
  1258. // corresponds to a single Analytics custom metric.
  1259. type CustomMetrics struct {
  1260. // Items: Collection of custom metrics.
  1261. Items []*CustomMetric `json:"items,omitempty"`
  1262. // ItemsPerPage: The maximum number of resources the response can
  1263. // contain, regardless of the actual number of resources returned. Its
  1264. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1265. // otherwise specified by the max-results query parameter.
  1266. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1267. // Kind: Collection type.
  1268. Kind string `json:"kind,omitempty"`
  1269. // NextLink: Link to next page for this custom metric collection.
  1270. NextLink string `json:"nextLink,omitempty"`
  1271. // PreviousLink: Link to previous page for this custom metric
  1272. // collection.
  1273. PreviousLink string `json:"previousLink,omitempty"`
  1274. // StartIndex: The starting index of the resources, which is 1 by
  1275. // default or otherwise specified by the start-index query parameter.
  1276. StartIndex int64 `json:"startIndex,omitempty"`
  1277. // TotalResults: The total number of results for the query, regardless
  1278. // of the number of results in the response.
  1279. TotalResults int64 `json:"totalResults,omitempty"`
  1280. // Username: Email ID of the authenticated user
  1281. Username string `json:"username,omitempty"`
  1282. // ServerResponse contains the HTTP response code and headers from the
  1283. // server.
  1284. googleapi.ServerResponse `json:"-"`
  1285. // ForceSendFields is a list of field names (e.g. "Items") to
  1286. // unconditionally include in API requests. By default, fields with
  1287. // empty values are omitted from API requests. However, any non-pointer,
  1288. // non-interface field appearing in ForceSendFields will be sent to the
  1289. // server regardless of whether the field is empty or not. This may be
  1290. // used to include empty fields in Patch requests.
  1291. ForceSendFields []string `json:"-"`
  1292. // NullFields is a list of field names (e.g. "Items") to include in API
  1293. // requests with the JSON null value. By default, fields with empty
  1294. // values are omitted from API requests. However, any field with an
  1295. // empty value appearing in NullFields will be sent to the server as
  1296. // null. It is an error if a field in this list has a non-empty value.
  1297. // This may be used to include null fields in Patch requests.
  1298. NullFields []string `json:"-"`
  1299. }
  1300. func (s *CustomMetrics) MarshalJSON() ([]byte, error) {
  1301. type NoMethod CustomMetrics
  1302. raw := NoMethod(*s)
  1303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1304. }
  1305. // EntityAdWordsLink: JSON template for Analytics Entity AdWords Link.
  1306. type EntityAdWordsLink struct {
  1307. // AdWordsAccounts: A list of AdWords client accounts. These cannot be
  1308. // MCC accounts. This field is required when creating an AdWords link.
  1309. // It cannot be empty.
  1310. AdWordsAccounts []*AdWordsAccount `json:"adWordsAccounts,omitempty"`
  1311. // Entity: Web property being linked.
  1312. Entity *EntityAdWordsLinkEntity `json:"entity,omitempty"`
  1313. // Id: Entity AdWords link ID
  1314. Id string `json:"id,omitempty"`
  1315. // Kind: Resource type for entity AdWords link.
  1316. Kind string `json:"kind,omitempty"`
  1317. // Name: Name of the link. This field is required when creating an
  1318. // AdWords link.
  1319. Name string `json:"name,omitempty"`
  1320. // ProfileIds: IDs of linked Views (Profiles) represented as strings.
  1321. ProfileIds []string `json:"profileIds,omitempty"`
  1322. // SelfLink: URL link for this Google Analytics - Google AdWords link.
  1323. SelfLink string `json:"selfLink,omitempty"`
  1324. // ServerResponse contains the HTTP response code and headers from the
  1325. // server.
  1326. googleapi.ServerResponse `json:"-"`
  1327. // ForceSendFields is a list of field names (e.g. "AdWordsAccounts") to
  1328. // unconditionally include in API requests. By default, fields with
  1329. // empty values are omitted from API requests. However, any non-pointer,
  1330. // non-interface field appearing in ForceSendFields will be sent to the
  1331. // server regardless of whether the field is empty or not. This may be
  1332. // used to include empty fields in Patch requests.
  1333. ForceSendFields []string `json:"-"`
  1334. // NullFields is a list of field names (e.g. "AdWordsAccounts") to
  1335. // include in API requests with the JSON null value. By default, fields
  1336. // with empty values are omitted from API requests. However, any field
  1337. // with an empty value appearing in NullFields will be sent to the
  1338. // server as null. It is an error if a field in this list has a
  1339. // non-empty value. This may be used to include null fields in Patch
  1340. // requests.
  1341. NullFields []string `json:"-"`
  1342. }
  1343. func (s *EntityAdWordsLink) MarshalJSON() ([]byte, error) {
  1344. type NoMethod EntityAdWordsLink
  1345. raw := NoMethod(*s)
  1346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1347. }
  1348. // EntityAdWordsLinkEntity: Web property being linked.
  1349. type EntityAdWordsLinkEntity struct {
  1350. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1351. // ForceSendFields is a list of field names (e.g. "WebPropertyRef") to
  1352. // unconditionally include in API requests. By default, fields with
  1353. // empty values are omitted from API requests. However, any non-pointer,
  1354. // non-interface field appearing in ForceSendFields will be sent to the
  1355. // server regardless of whether the field is empty or not. This may be
  1356. // used to include empty fields in Patch requests.
  1357. ForceSendFields []string `json:"-"`
  1358. // NullFields is a list of field names (e.g. "WebPropertyRef") to
  1359. // include in API requests with the JSON null value. By default, fields
  1360. // with empty values are omitted from API requests. However, any field
  1361. // with an empty value appearing in NullFields will be sent to the
  1362. // server as null. It is an error if a field in this list has a
  1363. // non-empty value. This may be used to include null fields in Patch
  1364. // requests.
  1365. NullFields []string `json:"-"`
  1366. }
  1367. func (s *EntityAdWordsLinkEntity) MarshalJSON() ([]byte, error) {
  1368. type NoMethod EntityAdWordsLinkEntity
  1369. raw := NoMethod(*s)
  1370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1371. }
  1372. // EntityAdWordsLinks: An entity AdWords link collection provides a list
  1373. // of GA-AdWords links Each resource in this collection corresponds to a
  1374. // single link.
  1375. type EntityAdWordsLinks struct {
  1376. // Items: A list of entity AdWords links.
  1377. Items []*EntityAdWordsLink `json:"items,omitempty"`
  1378. // ItemsPerPage: The maximum number of entries the response can contain,
  1379. // regardless of the actual number of entries returned. Its value ranges
  1380. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1381. // specified by the max-results query parameter.
  1382. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1383. // Kind: Collection type.
  1384. Kind string `json:"kind,omitempty"`
  1385. // NextLink: Next link for this AdWords link collection.
  1386. NextLink string `json:"nextLink,omitempty"`
  1387. // PreviousLink: Previous link for this AdWords link collection.
  1388. PreviousLink string `json:"previousLink,omitempty"`
  1389. // StartIndex: The starting index of the entries, which is 1 by default
  1390. // or otherwise specified by the start-index query parameter.
  1391. StartIndex int64 `json:"startIndex,omitempty"`
  1392. // TotalResults: The total number of results for the query, regardless
  1393. // of the number of results in the response.
  1394. TotalResults int64 `json:"totalResults,omitempty"`
  1395. // ServerResponse contains the HTTP response code and headers from the
  1396. // server.
  1397. googleapi.ServerResponse `json:"-"`
  1398. // ForceSendFields is a list of field names (e.g. "Items") to
  1399. // unconditionally include in API requests. By default, fields with
  1400. // empty values are omitted from API requests. However, any non-pointer,
  1401. // non-interface field appearing in ForceSendFields will be sent to the
  1402. // server regardless of whether the field is empty or not. This may be
  1403. // used to include empty fields in Patch requests.
  1404. ForceSendFields []string `json:"-"`
  1405. // NullFields is a list of field names (e.g. "Items") to include in API
  1406. // requests with the JSON null value. By default, fields with empty
  1407. // values are omitted from API requests. However, any field with an
  1408. // empty value appearing in NullFields will be sent to the server as
  1409. // null. It is an error if a field in this list has a non-empty value.
  1410. // This may be used to include null fields in Patch requests.
  1411. NullFields []string `json:"-"`
  1412. }
  1413. func (s *EntityAdWordsLinks) MarshalJSON() ([]byte, error) {
  1414. type NoMethod EntityAdWordsLinks
  1415. raw := NoMethod(*s)
  1416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1417. }
  1418. // EntityUserLink: JSON template for an Analytics Entity-User Link.
  1419. // Returns permissions that a user has for an entity.
  1420. type EntityUserLink struct {
  1421. // Entity: Entity for this link. It can be an account, a web property,
  1422. // or a view (profile).
  1423. Entity *EntityUserLinkEntity `json:"entity,omitempty"`
  1424. // Id: Entity user link ID
  1425. Id string `json:"id,omitempty"`
  1426. // Kind: Resource type for entity user link.
  1427. Kind string `json:"kind,omitempty"`
  1428. // Permissions: Permissions the user has for this entity.
  1429. Permissions *EntityUserLinkPermissions `json:"permissions,omitempty"`
  1430. // SelfLink: Self link for this resource.
  1431. SelfLink string `json:"selfLink,omitempty"`
  1432. // UserRef: User reference.
  1433. UserRef *UserRef `json:"userRef,omitempty"`
  1434. // ServerResponse contains the HTTP response code and headers from the
  1435. // server.
  1436. googleapi.ServerResponse `json:"-"`
  1437. // ForceSendFields is a list of field names (e.g. "Entity") to
  1438. // unconditionally include in API requests. By default, fields with
  1439. // empty values are omitted from API requests. However, any non-pointer,
  1440. // non-interface field appearing in ForceSendFields will be sent to the
  1441. // server regardless of whether the field is empty or not. This may be
  1442. // used to include empty fields in Patch requests.
  1443. ForceSendFields []string `json:"-"`
  1444. // NullFields is a list of field names (e.g. "Entity") to include in API
  1445. // requests with the JSON null value. By default, fields with empty
  1446. // values are omitted from API requests. However, any field with an
  1447. // empty value appearing in NullFields will be sent to the server as
  1448. // null. It is an error if a field in this list has a non-empty value.
  1449. // This may be used to include null fields in Patch requests.
  1450. NullFields []string `json:"-"`
  1451. }
  1452. func (s *EntityUserLink) MarshalJSON() ([]byte, error) {
  1453. type NoMethod EntityUserLink
  1454. raw := NoMethod(*s)
  1455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1456. }
  1457. // EntityUserLinkEntity: Entity for this link. It can be an account, a
  1458. // web property, or a view (profile).
  1459. type EntityUserLinkEntity struct {
  1460. // AccountRef: Account for this link.
  1461. AccountRef *AccountRef `json:"accountRef,omitempty"`
  1462. // ProfileRef: View (Profile) for this link.
  1463. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  1464. // WebPropertyRef: Web property for this link.
  1465. WebPropertyRef *WebPropertyRef `json:"webPropertyRef,omitempty"`
  1466. // ForceSendFields is a list of field names (e.g. "AccountRef") to
  1467. // unconditionally include in API requests. By default, fields with
  1468. // empty values are omitted from API requests. However, any non-pointer,
  1469. // non-interface field appearing in ForceSendFields will be sent to the
  1470. // server regardless of whether the field is empty or not. This may be
  1471. // used to include empty fields in Patch requests.
  1472. ForceSendFields []string `json:"-"`
  1473. // NullFields is a list of field names (e.g. "AccountRef") to include in
  1474. // API requests with the JSON null value. By default, fields with empty
  1475. // values are omitted from API requests. However, any field with an
  1476. // empty value appearing in NullFields will be sent to the server as
  1477. // null. It is an error if a field in this list has a non-empty value.
  1478. // This may be used to include null fields in Patch requests.
  1479. NullFields []string `json:"-"`
  1480. }
  1481. func (s *EntityUserLinkEntity) MarshalJSON() ([]byte, error) {
  1482. type NoMethod EntityUserLinkEntity
  1483. raw := NoMethod(*s)
  1484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1485. }
  1486. // EntityUserLinkPermissions: Permissions the user has for this entity.
  1487. type EntityUserLinkPermissions struct {
  1488. // Effective: Effective permissions represent all the permissions that a
  1489. // user has for this entity. These include any implied permissions
  1490. // (e.g., EDIT implies VIEW) or inherited permissions from the parent
  1491. // entity. Effective permissions are read-only.
  1492. Effective []string `json:"effective,omitempty"`
  1493. // Local: Permissions that a user has been assigned at this very level.
  1494. // Does not include any implied or inherited permissions. Local
  1495. // permissions are modifiable.
  1496. Local []string `json:"local,omitempty"`
  1497. // ForceSendFields is a list of field names (e.g. "Effective") to
  1498. // unconditionally include in API requests. By default, fields with
  1499. // empty values are omitted from API requests. However, any non-pointer,
  1500. // non-interface field appearing in ForceSendFields will be sent to the
  1501. // server regardless of whether the field is empty or not. This may be
  1502. // used to include empty fields in Patch requests.
  1503. ForceSendFields []string `json:"-"`
  1504. // NullFields is a list of field names (e.g. "Effective") to include in
  1505. // API requests with the JSON null value. By default, fields with empty
  1506. // values are omitted from API requests. However, any field with an
  1507. // empty value appearing in NullFields will be sent to the server as
  1508. // null. It is an error if a field in this list has a non-empty value.
  1509. // This may be used to include null fields in Patch requests.
  1510. NullFields []string `json:"-"`
  1511. }
  1512. func (s *EntityUserLinkPermissions) MarshalJSON() ([]byte, error) {
  1513. type NoMethod EntityUserLinkPermissions
  1514. raw := NoMethod(*s)
  1515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1516. }
  1517. // EntityUserLinks: An entity user link collection provides a list of
  1518. // Analytics ACL links Each resource in this collection corresponds to a
  1519. // single link.
  1520. type EntityUserLinks struct {
  1521. // Items: A list of entity user links.
  1522. Items []*EntityUserLink `json:"items,omitempty"`
  1523. // ItemsPerPage: The maximum number of entries the response can contain,
  1524. // regardless of the actual number of entries returned. Its value ranges
  1525. // from 1 to 1000 with a value of 1000 by default, or otherwise
  1526. // specified by the max-results query parameter.
  1527. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1528. // Kind: Collection type.
  1529. Kind string `json:"kind,omitempty"`
  1530. // NextLink: Next link for this account collection.
  1531. NextLink string `json:"nextLink,omitempty"`
  1532. // PreviousLink: Previous link for this account collection.
  1533. PreviousLink string `json:"previousLink,omitempty"`
  1534. // StartIndex: The starting index of the entries, which is 1 by default
  1535. // or otherwise specified by the start-index query parameter.
  1536. StartIndex int64 `json:"startIndex,omitempty"`
  1537. // TotalResults: The total number of results for the query, regardless
  1538. // of the number of results in the response.
  1539. TotalResults int64 `json:"totalResults,omitempty"`
  1540. // ServerResponse contains the HTTP response code and headers from the
  1541. // server.
  1542. googleapi.ServerResponse `json:"-"`
  1543. // ForceSendFields is a list of field names (e.g. "Items") to
  1544. // unconditionally include in API requests. By default, fields with
  1545. // empty values are omitted from API requests. However, any non-pointer,
  1546. // non-interface field appearing in ForceSendFields will be sent to the
  1547. // server regardless of whether the field is empty or not. This may be
  1548. // used to include empty fields in Patch requests.
  1549. ForceSendFields []string `json:"-"`
  1550. // NullFields is a list of field names (e.g. "Items") to include in API
  1551. // requests with the JSON null value. By default, fields with empty
  1552. // values are omitted from API requests. However, any field with an
  1553. // empty value appearing in NullFields will be sent to the server as
  1554. // null. It is an error if a field in this list has a non-empty value.
  1555. // This may be used to include null fields in Patch requests.
  1556. NullFields []string `json:"-"`
  1557. }
  1558. func (s *EntityUserLinks) MarshalJSON() ([]byte, error) {
  1559. type NoMethod EntityUserLinks
  1560. raw := NoMethod(*s)
  1561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1562. }
  1563. // Experiment: JSON template for Analytics experiment resource.
  1564. type Experiment struct {
  1565. // AccountId: Account ID to which this experiment belongs. This field is
  1566. // read-only.
  1567. AccountId string `json:"accountId,omitempty"`
  1568. // Created: Time the experiment was created. This field is read-only.
  1569. Created string `json:"created,omitempty"`
  1570. // Description: Notes about this experiment.
  1571. Description string `json:"description,omitempty"`
  1572. // EditableInGaUi: If true, the end user will be able to edit the
  1573. // experiment via the Google Analytics user interface.
  1574. EditableInGaUi bool `json:"editableInGaUi,omitempty"`
  1575. // EndTime: The ending time of the experiment (the time the status
  1576. // changed from RUNNING to ENDED). This field is present only if the
  1577. // experiment has ended. This field is read-only.
  1578. EndTime string `json:"endTime,omitempty"`
  1579. // EqualWeighting: Boolean specifying whether to distribute traffic
  1580. // evenly across all variations. If the value is False, content
  1581. // experiments follows the default behavior of adjusting traffic
  1582. // dynamically based on variation performance. Optional -- defaults to
  1583. // False. This field may not be changed for an experiment whose status
  1584. // is ENDED.
  1585. EqualWeighting bool `json:"equalWeighting,omitempty"`
  1586. // Id: Experiment ID. Required for patch and update. Disallowed for
  1587. // create.
  1588. Id string `json:"id,omitempty"`
  1589. // InternalWebPropertyId: Internal ID for the web property to which this
  1590. // experiment belongs. This field is read-only.
  1591. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  1592. // Kind: Resource type for an Analytics experiment. This field is
  1593. // read-only.
  1594. Kind string `json:"kind,omitempty"`
  1595. // MinimumExperimentLengthInDays: An integer number in [3, 90].
  1596. // Specifies the minimum length of the experiment. Can be changed for a
  1597. // running experiment. This field may not be changed for an experiments
  1598. // whose status is ENDED.
  1599. MinimumExperimentLengthInDays int64 `json:"minimumExperimentLengthInDays,omitempty"`
  1600. // Name: Experiment name. This field may not be changed for an
  1601. // experiment whose status is ENDED. This field is required when
  1602. // creating an experiment.
  1603. Name string `json:"name,omitempty"`
  1604. // ObjectiveMetric: The metric that the experiment is optimizing. Valid
  1605. // values: "ga:goal(n)Completions", "ga:adsenseAdsClicks",
  1606. // "ga:adsenseAdsViewed", "ga:adsenseRevenue", "ga:bounces",
  1607. // "ga:pageviews", "ga:sessionDuration", "ga:transactions",
  1608. // "ga:transactionRevenue". This field is required if status is
  1609. // "RUNNING" and servingFramework is one of "REDIRECT" or "API".
  1610. ObjectiveMetric string `json:"objectiveMetric,omitempty"`
  1611. // OptimizationType: Whether the objectiveMetric should be minimized or
  1612. // maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults
  1613. // to "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be
  1614. // modified when status is "RUNNING" or "ENDED".
  1615. OptimizationType string `json:"optimizationType,omitempty"`
  1616. // ParentLink: Parent link for an experiment. Points to the view
  1617. // (profile) to which this experiment belongs.
  1618. ParentLink *ExperimentParentLink `json:"parentLink,omitempty"`
  1619. // ProfileId: View (Profile) ID to which this experiment belongs. This
  1620. // field is read-only.
  1621. ProfileId string `json:"profileId,omitempty"`
  1622. // ReasonExperimentEnded: Why the experiment ended. Possible values:
  1623. // "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED",
  1624. // "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED".
  1625. // "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no
  1626. // winner was projected to be found. If the experiment status is changed
  1627. // via the API to ENDED this field is set to STOPPED_BY_USER. This field
  1628. // is read-only.
  1629. ReasonExperimentEnded string `json:"reasonExperimentEnded,omitempty"`
  1630. // RewriteVariationUrlsAsOriginal: Boolean specifying whether variations
  1631. // URLS are rewritten to match those of the original. This field may not
  1632. // be changed for an experiments whose status is ENDED.
  1633. RewriteVariationUrlsAsOriginal bool `json:"rewriteVariationUrlsAsOriginal,omitempty"`
  1634. // SelfLink: Link for this experiment. This field is read-only.
  1635. SelfLink string `json:"selfLink,omitempty"`
  1636. // ServingFramework: The framework used to serve the experiment
  1637. // variations and evaluate the results. One of:
  1638. // - REDIRECT: Google Analytics redirects traffic to different variation
  1639. // pages, reports the chosen variation and evaluates the results.
  1640. // - API: Google Analytics chooses and reports the variation to serve
  1641. // and evaluates the results; the caller is responsible for serving the
  1642. // selected variation.
  1643. // - EXTERNAL: The variations will be served externally and the chosen
  1644. // variation reported to Google Analytics. The caller is responsible for
  1645. // serving the selected variation and evaluating the results.
  1646. ServingFramework string `json:"servingFramework,omitempty"`
  1647. // Snippet: The snippet of code to include on the control page(s). This
  1648. // field is read-only.
  1649. Snippet string `json:"snippet,omitempty"`
  1650. // StartTime: The starting time of the experiment (the time the status
  1651. // changed from READY_TO_RUN to RUNNING). This field is present only if
  1652. // the experiment has started. This field is read-only.
  1653. StartTime string `json:"startTime,omitempty"`
  1654. // Status: Experiment status. Possible values: "DRAFT", "READY_TO_RUN",
  1655. // "RUNNING", "ENDED". Experiments can be created in the "DRAFT",
  1656. // "READY_TO_RUN" or "RUNNING" state. This field is required when
  1657. // creating an experiment.
  1658. Status string `json:"status,omitempty"`
  1659. // TrafficCoverage: A floating-point number in (0, 1]. Specifies the
  1660. // fraction of the traffic that participates in the experiment. Can be
  1661. // changed for a running experiment. This field may not be changed for
  1662. // an experiments whose status is ENDED.
  1663. TrafficCoverage float64 `json:"trafficCoverage,omitempty"`
  1664. // Updated: Time the experiment was last modified. This field is
  1665. // read-only.
  1666. Updated string `json:"updated,omitempty"`
  1667. // Variations: Array of variations. The first variation in the array is
  1668. // the original. The number of variations may not change once an
  1669. // experiment is in the RUNNING state. At least two variations are
  1670. // required before status can be set to RUNNING.
  1671. Variations []*ExperimentVariations `json:"variations,omitempty"`
  1672. // WebPropertyId: Web property ID to which this experiment belongs. The
  1673. // web property ID is of the form UA-XXXXX-YY. This field is read-only.
  1674. WebPropertyId string `json:"webPropertyId,omitempty"`
  1675. // WinnerConfidenceLevel: A floating-point number in (0, 1). Specifies
  1676. // the necessary confidence level to choose a winner. This field may not
  1677. // be changed for an experiments whose status is ENDED.
  1678. WinnerConfidenceLevel float64 `json:"winnerConfidenceLevel,omitempty"`
  1679. // WinnerFound: Boolean specifying whether a winner has been found for
  1680. // this experiment. This field is read-only.
  1681. WinnerFound bool `json:"winnerFound,omitempty"`
  1682. // ServerResponse contains the HTTP response code and headers from the
  1683. // server.
  1684. googleapi.ServerResponse `json:"-"`
  1685. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1686. // unconditionally include in API requests. By default, fields with
  1687. // empty values are omitted from API requests. However, any non-pointer,
  1688. // non-interface field appearing in ForceSendFields will be sent to the
  1689. // server regardless of whether the field is empty or not. This may be
  1690. // used to include empty fields in Patch requests.
  1691. ForceSendFields []string `json:"-"`
  1692. // NullFields is a list of field names (e.g. "AccountId") to include in
  1693. // API requests with the JSON null value. By default, fields with empty
  1694. // values are omitted from API requests. However, any field with an
  1695. // empty value appearing in NullFields will be sent to the server as
  1696. // null. It is an error if a field in this list has a non-empty value.
  1697. // This may be used to include null fields in Patch requests.
  1698. NullFields []string `json:"-"`
  1699. }
  1700. func (s *Experiment) MarshalJSON() ([]byte, error) {
  1701. type NoMethod Experiment
  1702. raw := NoMethod(*s)
  1703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1704. }
  1705. func (s *Experiment) UnmarshalJSON(data []byte) error {
  1706. type NoMethod Experiment
  1707. var s1 struct {
  1708. TrafficCoverage gensupport.JSONFloat64 `json:"trafficCoverage"`
  1709. WinnerConfidenceLevel gensupport.JSONFloat64 `json:"winnerConfidenceLevel"`
  1710. *NoMethod
  1711. }
  1712. s1.NoMethod = (*NoMethod)(s)
  1713. if err := json.Unmarshal(data, &s1); err != nil {
  1714. return err
  1715. }
  1716. s.TrafficCoverage = float64(s1.TrafficCoverage)
  1717. s.WinnerConfidenceLevel = float64(s1.WinnerConfidenceLevel)
  1718. return nil
  1719. }
  1720. // ExperimentParentLink: Parent link for an experiment. Points to the
  1721. // view (profile) to which this experiment belongs.
  1722. type ExperimentParentLink struct {
  1723. // Href: Link to the view (profile) to which this experiment belongs.
  1724. // This field is read-only.
  1725. Href string `json:"href,omitempty"`
  1726. // Type: Value is "analytics#profile". This field is read-only.
  1727. Type string `json:"type,omitempty"`
  1728. // ForceSendFields is a list of field names (e.g. "Href") to
  1729. // unconditionally include in API requests. By default, fields with
  1730. // empty values are omitted from API requests. However, any non-pointer,
  1731. // non-interface field appearing in ForceSendFields will be sent to the
  1732. // server regardless of whether the field is empty or not. This may be
  1733. // used to include empty fields in Patch requests.
  1734. ForceSendFields []string `json:"-"`
  1735. // NullFields is a list of field names (e.g. "Href") to include in API
  1736. // requests with the JSON null value. By default, fields with empty
  1737. // values are omitted from API requests. However, any field with an
  1738. // empty value appearing in NullFields will be sent to the server as
  1739. // null. It is an error if a field in this list has a non-empty value.
  1740. // This may be used to include null fields in Patch requests.
  1741. NullFields []string `json:"-"`
  1742. }
  1743. func (s *ExperimentParentLink) MarshalJSON() ([]byte, error) {
  1744. type NoMethod ExperimentParentLink
  1745. raw := NoMethod(*s)
  1746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1747. }
  1748. type ExperimentVariations struct {
  1749. // Name: The name of the variation. This field is required when creating
  1750. // an experiment. This field may not be changed for an experiment whose
  1751. // status is ENDED.
  1752. Name string `json:"name,omitempty"`
  1753. // Status: Status of the variation. Possible values: "ACTIVE",
  1754. // "INACTIVE". INACTIVE variations are not served. This field may not be
  1755. // changed for an experiment whose status is ENDED.
  1756. Status string `json:"status,omitempty"`
  1757. // Url: The URL of the variation. This field may not be changed for an
  1758. // experiment whose status is RUNNING or ENDED.
  1759. Url string `json:"url,omitempty"`
  1760. // Weight: Weight that this variation should receive. Only present if
  1761. // the experiment is running. This field is read-only.
  1762. Weight float64 `json:"weight,omitempty"`
  1763. // Won: True if the experiment has ended and this variation performed
  1764. // (statistically) significantly better than the original. This field is
  1765. // read-only.
  1766. Won bool `json:"won,omitempty"`
  1767. // ForceSendFields is a list of field names (e.g. "Name") to
  1768. // unconditionally include in API requests. By default, fields with
  1769. // empty values are omitted from API requests. However, any non-pointer,
  1770. // non-interface field appearing in ForceSendFields will be sent to the
  1771. // server regardless of whether the field is empty or not. This may be
  1772. // used to include empty fields in Patch requests.
  1773. ForceSendFields []string `json:"-"`
  1774. // NullFields is a list of field names (e.g. "Name") to include in API
  1775. // requests with the JSON null value. By default, fields with empty
  1776. // values are omitted from API requests. However, any field with an
  1777. // empty value appearing in NullFields will be sent to the server as
  1778. // null. It is an error if a field in this list has a non-empty value.
  1779. // This may be used to include null fields in Patch requests.
  1780. NullFields []string `json:"-"`
  1781. }
  1782. func (s *ExperimentVariations) MarshalJSON() ([]byte, error) {
  1783. type NoMethod ExperimentVariations
  1784. raw := NoMethod(*s)
  1785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1786. }
  1787. func (s *ExperimentVariations) UnmarshalJSON(data []byte) error {
  1788. type NoMethod ExperimentVariations
  1789. var s1 struct {
  1790. Weight gensupport.JSONFloat64 `json:"weight"`
  1791. *NoMethod
  1792. }
  1793. s1.NoMethod = (*NoMethod)(s)
  1794. if err := json.Unmarshal(data, &s1); err != nil {
  1795. return err
  1796. }
  1797. s.Weight = float64(s1.Weight)
  1798. return nil
  1799. }
  1800. // Experiments: An experiment collection lists Analytics experiments to
  1801. // which the user has access. Each view (profile) can have a set of
  1802. // experiments. Each resource in the Experiment collection corresponds
  1803. // to a single Analytics experiment.
  1804. type Experiments struct {
  1805. // Items: A list of experiments.
  1806. Items []*Experiment `json:"items,omitempty"`
  1807. // ItemsPerPage: The maximum number of resources the response can
  1808. // contain, regardless of the actual number of resources returned. Its
  1809. // value ranges from 1 to 1000 with a value of 1000 by default, or
  1810. // otherwise specified by the max-results query parameter.
  1811. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  1812. // Kind: Collection type.
  1813. Kind string `json:"kind,omitempty"`
  1814. // NextLink: Link to next page for this experiment collection.
  1815. NextLink string `json:"nextLink,omitempty"`
  1816. // PreviousLink: Link to previous page for this experiment collection.
  1817. PreviousLink string `json:"previousLink,omitempty"`
  1818. // StartIndex: The starting index of the resources, which is 1 by
  1819. // default or otherwise specified by the start-index query parameter.
  1820. StartIndex int64 `json:"startIndex,omitempty"`
  1821. // TotalResults: The total number of results for the query, regardless
  1822. // of the number of resources in the result.
  1823. TotalResults int64 `json:"totalResults,omitempty"`
  1824. // Username: Email ID of the authenticated user
  1825. Username string `json:"username,omitempty"`
  1826. // ServerResponse contains the HTTP response code and headers from the
  1827. // server.
  1828. googleapi.ServerResponse `json:"-"`
  1829. // ForceSendFields is a list of field names (e.g. "Items") to
  1830. // unconditionally include in API requests. By default, fields with
  1831. // empty values are omitted from API requests. However, any non-pointer,
  1832. // non-interface field appearing in ForceSendFields will be sent to the
  1833. // server regardless of whether the field is empty or not. This may be
  1834. // used to include empty fields in Patch requests.
  1835. ForceSendFields []string `json:"-"`
  1836. // NullFields is a list of field names (e.g. "Items") to include in API
  1837. // requests with the JSON null value. By default, fields with empty
  1838. // values are omitted from API requests. However, any field with an
  1839. // empty value appearing in NullFields will be sent to the server as
  1840. // null. It is an error if a field in this list has a non-empty value.
  1841. // This may be used to include null fields in Patch requests.
  1842. NullFields []string `json:"-"`
  1843. }
  1844. func (s *Experiments) MarshalJSON() ([]byte, error) {
  1845. type NoMethod Experiments
  1846. raw := NoMethod(*s)
  1847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1848. }
  1849. // Filter: JSON template for an Analytics account filter.
  1850. type Filter struct {
  1851. // AccountId: Account ID to which this filter belongs.
  1852. AccountId string `json:"accountId,omitempty"`
  1853. // AdvancedDetails: Details for the filter of the type ADVANCED.
  1854. AdvancedDetails *FilterAdvancedDetails `json:"advancedDetails,omitempty"`
  1855. // Created: Time this filter was created.
  1856. Created string `json:"created,omitempty"`
  1857. // ExcludeDetails: Details for the filter of the type EXCLUDE.
  1858. ExcludeDetails *FilterExpression `json:"excludeDetails,omitempty"`
  1859. // Id: Filter ID.
  1860. Id string `json:"id,omitempty"`
  1861. // IncludeDetails: Details for the filter of the type INCLUDE.
  1862. IncludeDetails *FilterExpression `json:"includeDetails,omitempty"`
  1863. // Kind: Resource type for Analytics filter.
  1864. Kind string `json:"kind,omitempty"`
  1865. // LowercaseDetails: Details for the filter of the type LOWER.
  1866. LowercaseDetails *FilterLowercaseDetails `json:"lowercaseDetails,omitempty"`
  1867. // Name: Name of this filter.
  1868. Name string `json:"name,omitempty"`
  1869. // ParentLink: Parent link for this filter. Points to the account to
  1870. // which this filter belongs.
  1871. ParentLink *FilterParentLink `json:"parentLink,omitempty"`
  1872. // SearchAndReplaceDetails: Details for the filter of the type
  1873. // SEARCH_AND_REPLACE.
  1874. SearchAndReplaceDetails *FilterSearchAndReplaceDetails `json:"searchAndReplaceDetails,omitempty"`
  1875. // SelfLink: Link for this filter.
  1876. SelfLink string `json:"selfLink,omitempty"`
  1877. // Type: Type of this filter. Possible values are INCLUDE, EXCLUDE,
  1878. // LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED.
  1879. Type string `json:"type,omitempty"`
  1880. // Updated: Time this filter was last modified.
  1881. Updated string `json:"updated,omitempty"`
  1882. // UppercaseDetails: Details for the filter of the type UPPER.
  1883. UppercaseDetails *FilterUppercaseDetails `json:"uppercaseDetails,omitempty"`
  1884. // ServerResponse contains the HTTP response code and headers from the
  1885. // server.
  1886. googleapi.ServerResponse `json:"-"`
  1887. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1888. // unconditionally include in API requests. By default, fields with
  1889. // empty values are omitted from API requests. However, any non-pointer,
  1890. // non-interface field appearing in ForceSendFields will be sent to the
  1891. // server regardless of whether the field is empty or not. This may be
  1892. // used to include empty fields in Patch requests.
  1893. ForceSendFields []string `json:"-"`
  1894. // NullFields is a list of field names (e.g. "AccountId") to include in
  1895. // API requests with the JSON null value. By default, fields with empty
  1896. // values are omitted from API requests. However, any field with an
  1897. // empty value appearing in NullFields will be sent to the server as
  1898. // null. It is an error if a field in this list has a non-empty value.
  1899. // This may be used to include null fields in Patch requests.
  1900. NullFields []string `json:"-"`
  1901. }
  1902. func (s *Filter) MarshalJSON() ([]byte, error) {
  1903. type NoMethod Filter
  1904. raw := NoMethod(*s)
  1905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1906. }
  1907. // FilterAdvancedDetails: Details for the filter of the type ADVANCED.
  1908. type FilterAdvancedDetails struct {
  1909. // CaseSensitive: Indicates if the filter expressions are case
  1910. // sensitive.
  1911. CaseSensitive bool `json:"caseSensitive,omitempty"`
  1912. // ExtractA: Expression to extract from field A.
  1913. ExtractA string `json:"extractA,omitempty"`
  1914. // ExtractB: Expression to extract from field B.
  1915. ExtractB string `json:"extractB,omitempty"`
  1916. // FieldA: Field A.
  1917. FieldA string `json:"fieldA,omitempty"`
  1918. // FieldAIndex: The Index of the custom dimension. Required if field is
  1919. // a CUSTOM_DIMENSION.
  1920. FieldAIndex int64 `json:"fieldAIndex,omitempty"`
  1921. // FieldARequired: Indicates if field A is required to match.
  1922. FieldARequired bool `json:"fieldARequired,omitempty"`
  1923. // FieldB: Field B.
  1924. FieldB string `json:"fieldB,omitempty"`
  1925. // FieldBIndex: The Index of the custom dimension. Required if field is
  1926. // a CUSTOM_DIMENSION.
  1927. FieldBIndex int64 `json:"fieldBIndex,omitempty"`
  1928. // FieldBRequired: Indicates if field B is required to match.
  1929. FieldBRequired bool `json:"fieldBRequired,omitempty"`
  1930. // OutputConstructor: Expression used to construct the output value.
  1931. OutputConstructor string `json:"outputConstructor,omitempty"`
  1932. // OutputToField: Output field.
  1933. OutputToField string `json:"outputToField,omitempty"`
  1934. // OutputToFieldIndex: The Index of the custom dimension. Required if
  1935. // field is a CUSTOM_DIMENSION.
  1936. OutputToFieldIndex int64 `json:"outputToFieldIndex,omitempty"`
  1937. // OverrideOutputField: Indicates if the existing value of the output
  1938. // field, if any, should be overridden by the output expression.
  1939. OverrideOutputField bool `json:"overrideOutputField,omitempty"`
  1940. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  1941. // unconditionally include in API requests. By default, fields with
  1942. // empty values are omitted from API requests. However, any non-pointer,
  1943. // non-interface field appearing in ForceSendFields will be sent to the
  1944. // server regardless of whether the field is empty or not. This may be
  1945. // used to include empty fields in Patch requests.
  1946. ForceSendFields []string `json:"-"`
  1947. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  1948. // in API requests with the JSON null value. By default, fields with
  1949. // empty values are omitted from API requests. However, any field with
  1950. // an empty value appearing in NullFields will be sent to the server as
  1951. // null. It is an error if a field in this list has a non-empty value.
  1952. // This may be used to include null fields in Patch requests.
  1953. NullFields []string `json:"-"`
  1954. }
  1955. func (s *FilterAdvancedDetails) MarshalJSON() ([]byte, error) {
  1956. type NoMethod FilterAdvancedDetails
  1957. raw := NoMethod(*s)
  1958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1959. }
  1960. // FilterLowercaseDetails: Details for the filter of the type LOWER.
  1961. type FilterLowercaseDetails struct {
  1962. // Field: Field to use in the filter.
  1963. Field string `json:"field,omitempty"`
  1964. // FieldIndex: The Index of the custom dimension. Required if field is a
  1965. // CUSTOM_DIMENSION.
  1966. FieldIndex int64 `json:"fieldIndex,omitempty"`
  1967. // ForceSendFields is a list of field names (e.g. "Field") to
  1968. // unconditionally include in API requests. By default, fields with
  1969. // empty values are omitted from API requests. However, any non-pointer,
  1970. // non-interface field appearing in ForceSendFields will be sent to the
  1971. // server regardless of whether the field is empty or not. This may be
  1972. // used to include empty fields in Patch requests.
  1973. ForceSendFields []string `json:"-"`
  1974. // NullFields is a list of field names (e.g. "Field") to include in API
  1975. // requests with the JSON null value. By default, fields with empty
  1976. // values are omitted from API requests. However, any field with an
  1977. // empty value appearing in NullFields will be sent to the server as
  1978. // null. It is an error if a field in this list has a non-empty value.
  1979. // This may be used to include null fields in Patch requests.
  1980. NullFields []string `json:"-"`
  1981. }
  1982. func (s *FilterLowercaseDetails) MarshalJSON() ([]byte, error) {
  1983. type NoMethod FilterLowercaseDetails
  1984. raw := NoMethod(*s)
  1985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1986. }
  1987. // FilterParentLink: Parent link for this filter. Points to the account
  1988. // to which this filter belongs.
  1989. type FilterParentLink struct {
  1990. // Href: Link to the account to which this filter belongs.
  1991. Href string `json:"href,omitempty"`
  1992. // Type: Value is "analytics#account".
  1993. Type string `json:"type,omitempty"`
  1994. // ForceSendFields is a list of field names (e.g. "Href") to
  1995. // unconditionally include in API requests. By default, fields with
  1996. // empty values are omitted from API requests. However, any non-pointer,
  1997. // non-interface field appearing in ForceSendFields will be sent to the
  1998. // server regardless of whether the field is empty or not. This may be
  1999. // used to include empty fields in Patch requests.
  2000. ForceSendFields []string `json:"-"`
  2001. // NullFields is a list of field names (e.g. "Href") to include in API
  2002. // requests with the JSON null value. By default, fields with empty
  2003. // values are omitted from API requests. However, any field with an
  2004. // empty value appearing in NullFields will be sent to the server as
  2005. // null. It is an error if a field in this list has a non-empty value.
  2006. // This may be used to include null fields in Patch requests.
  2007. NullFields []string `json:"-"`
  2008. }
  2009. func (s *FilterParentLink) MarshalJSON() ([]byte, error) {
  2010. type NoMethod FilterParentLink
  2011. raw := NoMethod(*s)
  2012. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2013. }
  2014. // FilterSearchAndReplaceDetails: Details for the filter of the type
  2015. // SEARCH_AND_REPLACE.
  2016. type FilterSearchAndReplaceDetails struct {
  2017. // CaseSensitive: Determines if the filter is case sensitive.
  2018. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2019. // Field: Field to use in the filter.
  2020. Field string `json:"field,omitempty"`
  2021. // FieldIndex: The Index of the custom dimension. Required if field is a
  2022. // CUSTOM_DIMENSION.
  2023. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2024. // ReplaceString: Term to replace the search term with.
  2025. ReplaceString string `json:"replaceString,omitempty"`
  2026. // SearchString: Term to search.
  2027. SearchString string `json:"searchString,omitempty"`
  2028. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2029. // unconditionally include in API requests. By default, fields with
  2030. // empty values are omitted from API requests. However, any non-pointer,
  2031. // non-interface field appearing in ForceSendFields will be sent to the
  2032. // server regardless of whether the field is empty or not. This may be
  2033. // used to include empty fields in Patch requests.
  2034. ForceSendFields []string `json:"-"`
  2035. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2036. // in API requests with the JSON null value. By default, fields with
  2037. // empty values are omitted from API requests. However, any field with
  2038. // an empty value appearing in NullFields will be sent to the server as
  2039. // null. It is an error if a field in this list has a non-empty value.
  2040. // This may be used to include null fields in Patch requests.
  2041. NullFields []string `json:"-"`
  2042. }
  2043. func (s *FilterSearchAndReplaceDetails) MarshalJSON() ([]byte, error) {
  2044. type NoMethod FilterSearchAndReplaceDetails
  2045. raw := NoMethod(*s)
  2046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2047. }
  2048. // FilterUppercaseDetails: Details for the filter of the type UPPER.
  2049. type FilterUppercaseDetails struct {
  2050. // Field: Field to use in the filter.
  2051. Field string `json:"field,omitempty"`
  2052. // FieldIndex: The Index of the custom dimension. Required if field is a
  2053. // CUSTOM_DIMENSION.
  2054. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2055. // ForceSendFields is a list of field names (e.g. "Field") to
  2056. // unconditionally include in API requests. By default, fields with
  2057. // empty values are omitted from API requests. However, any non-pointer,
  2058. // non-interface field appearing in ForceSendFields will be sent to the
  2059. // server regardless of whether the field is empty or not. This may be
  2060. // used to include empty fields in Patch requests.
  2061. ForceSendFields []string `json:"-"`
  2062. // NullFields is a list of field names (e.g. "Field") to include in API
  2063. // requests with the JSON null value. By default, fields with empty
  2064. // values are omitted from API requests. However, any field with an
  2065. // empty value appearing in NullFields will be sent to the server as
  2066. // null. It is an error if a field in this list has a non-empty value.
  2067. // This may be used to include null fields in Patch requests.
  2068. NullFields []string `json:"-"`
  2069. }
  2070. func (s *FilterUppercaseDetails) MarshalJSON() ([]byte, error) {
  2071. type NoMethod FilterUppercaseDetails
  2072. raw := NoMethod(*s)
  2073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2074. }
  2075. // FilterExpression: JSON template for an Analytics filter expression.
  2076. type FilterExpression struct {
  2077. // CaseSensitive: Determines if the filter is case sensitive.
  2078. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2079. // ExpressionValue: Filter expression value
  2080. ExpressionValue string `json:"expressionValue,omitempty"`
  2081. // Field: Field to filter. Possible values:
  2082. // - Content and Traffic
  2083. // - PAGE_REQUEST_URI,
  2084. // - PAGE_HOSTNAME,
  2085. // - PAGE_TITLE,
  2086. // - REFERRAL,
  2087. // - COST_DATA_URI (Campaign target URL),
  2088. // - HIT_TYPE,
  2089. // - INTERNAL_SEARCH_TERM,
  2090. // - INTERNAL_SEARCH_TYPE,
  2091. // - SOURCE_PROPERTY_TRACKING_ID,
  2092. // - Campaign or AdGroup
  2093. // - CAMPAIGN_SOURCE,
  2094. // - CAMPAIGN_MEDIUM,
  2095. // - CAMPAIGN_NAME,
  2096. // - CAMPAIGN_AD_GROUP,
  2097. // - CAMPAIGN_TERM,
  2098. // - CAMPAIGN_CONTENT,
  2099. // - CAMPAIGN_CODE,
  2100. // - CAMPAIGN_REFERRAL_PATH,
  2101. // - E-Commerce
  2102. // - TRANSACTION_COUNTRY,
  2103. // - TRANSACTION_REGION,
  2104. // - TRANSACTION_CITY,
  2105. // - TRANSACTION_AFFILIATION (Store or order location),
  2106. // - ITEM_NAME,
  2107. // - ITEM_CODE,
  2108. // - ITEM_VARIATION,
  2109. // - TRANSACTION_ID,
  2110. // - TRANSACTION_CURRENCY_CODE,
  2111. // - PRODUCT_ACTION_TYPE,
  2112. // - Audience/Users
  2113. // - BROWSER,
  2114. // - BROWSER_VERSION,
  2115. // - BROWSER_SIZE,
  2116. // - PLATFORM,
  2117. // - PLATFORM_VERSION,
  2118. // - LANGUAGE,
  2119. // - SCREEN_RESOLUTION,
  2120. // - SCREEN_COLORS,
  2121. // - JAVA_ENABLED (Boolean Field),
  2122. // - FLASH_VERSION,
  2123. // - GEO_SPEED (Connection speed),
  2124. // - VISITOR_TYPE,
  2125. // - GEO_ORGANIZATION (ISP organization),
  2126. // - GEO_DOMAIN,
  2127. // - GEO_IP_ADDRESS,
  2128. // - GEO_IP_VERSION,
  2129. // - Location
  2130. // - GEO_COUNTRY,
  2131. // - GEO_REGION,
  2132. // - GEO_CITY,
  2133. // - Event
  2134. // - EVENT_CATEGORY,
  2135. // - EVENT_ACTION,
  2136. // - EVENT_LABEL,
  2137. // - Other
  2138. // - CUSTOM_FIELD_1,
  2139. // - CUSTOM_FIELD_2,
  2140. // - USER_DEFINED_VALUE,
  2141. // - Application
  2142. // - APP_ID,
  2143. // - APP_INSTALLER_ID,
  2144. // - APP_NAME,
  2145. // - APP_VERSION,
  2146. // - SCREEN,
  2147. // - IS_APP (Boolean Field),
  2148. // - IS_FATAL_EXCEPTION (Boolean Field),
  2149. // - EXCEPTION_DESCRIPTION,
  2150. // - Mobile device
  2151. // - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile),
  2152. //
  2153. // - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet),
  2154. //
  2155. // - DEVICE_CATEGORY,
  2156. // - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field),
  2157. // - MOBILE_HAS_NFC_SUPPORT (Boolean Field),
  2158. // - MOBILE_HAS_CELLULAR_RADIO (Boolean Field),
  2159. // - MOBILE_HAS_WIFI_SUPPORT (Boolean Field),
  2160. // - MOBILE_BRAND_NAME,
  2161. // - MOBILE_MODEL_NAME,
  2162. // - MOBILE_MARKETING_NAME,
  2163. // - MOBILE_POINTING_METHOD,
  2164. // - Social
  2165. // - SOCIAL_NETWORK,
  2166. // - SOCIAL_ACTION,
  2167. // - SOCIAL_ACTION_TARGET,
  2168. // - Custom dimension
  2169. // - CUSTOM_DIMENSION (See accompanying field index),
  2170. Field string `json:"field,omitempty"`
  2171. // FieldIndex: The Index of the custom dimension. Set only if the field
  2172. // is a is CUSTOM_DIMENSION.
  2173. FieldIndex int64 `json:"fieldIndex,omitempty"`
  2174. // Kind: Kind value for filter expression
  2175. Kind string `json:"kind,omitempty"`
  2176. // MatchType: Match type for this filter. Possible values are
  2177. // BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN,
  2178. // GEO_IP_ADDRESS, PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use
  2179. // any match type; all other filters must use MATCHES.
  2180. MatchType string `json:"matchType,omitempty"`
  2181. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2182. // unconditionally include in API requests. By default, fields with
  2183. // empty values are omitted from API requests. However, any non-pointer,
  2184. // non-interface field appearing in ForceSendFields will be sent to the
  2185. // server regardless of whether the field is empty or not. This may be
  2186. // used to include empty fields in Patch requests.
  2187. ForceSendFields []string `json:"-"`
  2188. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2189. // in API requests with the JSON null value. By default, fields with
  2190. // empty values are omitted from API requests. However, any field with
  2191. // an empty value appearing in NullFields will be sent to the server as
  2192. // null. It is an error if a field in this list has a non-empty value.
  2193. // This may be used to include null fields in Patch requests.
  2194. NullFields []string `json:"-"`
  2195. }
  2196. func (s *FilterExpression) MarshalJSON() ([]byte, error) {
  2197. type NoMethod FilterExpression
  2198. raw := NoMethod(*s)
  2199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2200. }
  2201. // FilterRef: JSON template for a profile filter link.
  2202. type FilterRef struct {
  2203. // AccountId: Account ID to which this filter belongs.
  2204. AccountId string `json:"accountId,omitempty"`
  2205. // Href: Link for this filter.
  2206. Href string `json:"href,omitempty"`
  2207. // Id: Filter ID.
  2208. Id string `json:"id,omitempty"`
  2209. // Kind: Kind value for filter reference.
  2210. Kind string `json:"kind,omitempty"`
  2211. // Name: Name of this filter.
  2212. Name string `json:"name,omitempty"`
  2213. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2214. // unconditionally include in API requests. By default, fields with
  2215. // empty values are omitted from API requests. However, any non-pointer,
  2216. // non-interface field appearing in ForceSendFields will be sent to the
  2217. // server regardless of whether the field is empty or not. This may be
  2218. // used to include empty fields in Patch requests.
  2219. ForceSendFields []string `json:"-"`
  2220. // NullFields is a list of field names (e.g. "AccountId") to include in
  2221. // API requests with the JSON null value. By default, fields with empty
  2222. // values are omitted from API requests. However, any field with an
  2223. // empty value appearing in NullFields will be sent to the server as
  2224. // null. It is an error if a field in this list has a non-empty value.
  2225. // This may be used to include null fields in Patch requests.
  2226. NullFields []string `json:"-"`
  2227. }
  2228. func (s *FilterRef) MarshalJSON() ([]byte, error) {
  2229. type NoMethod FilterRef
  2230. raw := NoMethod(*s)
  2231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2232. }
  2233. // Filters: A filter collection lists filters created by users in an
  2234. // Analytics account. Each resource in the collection corresponds to a
  2235. // filter.
  2236. type Filters struct {
  2237. // Items: A list of filters.
  2238. Items []*Filter `json:"items,omitempty"`
  2239. // ItemsPerPage: The maximum number of resources the response can
  2240. // contain, regardless of the actual number of resources returned. Its
  2241. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  2242. // otherwise specified by the max-results query parameter.
  2243. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2244. // Kind: Collection type.
  2245. Kind string `json:"kind,omitempty"`
  2246. // NextLink: Link to next page for this filter collection.
  2247. NextLink string `json:"nextLink,omitempty"`
  2248. // PreviousLink: Link to previous page for this filter collection.
  2249. PreviousLink string `json:"previousLink,omitempty"`
  2250. // StartIndex: The starting index of the resources, which is 1 by
  2251. // default or otherwise specified by the start-index query parameter.
  2252. StartIndex int64 `json:"startIndex,omitempty"`
  2253. // TotalResults: The total number of results for the query, regardless
  2254. // of the number of results in the response.
  2255. TotalResults int64 `json:"totalResults,omitempty"`
  2256. // Username: Email ID of the authenticated user
  2257. Username string `json:"username,omitempty"`
  2258. // ServerResponse contains the HTTP response code and headers from the
  2259. // server.
  2260. googleapi.ServerResponse `json:"-"`
  2261. // ForceSendFields is a list of field names (e.g. "Items") to
  2262. // unconditionally include in API requests. By default, fields with
  2263. // empty values are omitted from API requests. However, any non-pointer,
  2264. // non-interface field appearing in ForceSendFields will be sent to the
  2265. // server regardless of whether the field is empty or not. This may be
  2266. // used to include empty fields in Patch requests.
  2267. ForceSendFields []string `json:"-"`
  2268. // NullFields is a list of field names (e.g. "Items") to include in API
  2269. // requests with the JSON null value. By default, fields with empty
  2270. // values are omitted from API requests. However, any field with an
  2271. // empty value appearing in NullFields will be sent to the server as
  2272. // null. It is an error if a field in this list has a non-empty value.
  2273. // This may be used to include null fields in Patch requests.
  2274. NullFields []string `json:"-"`
  2275. }
  2276. func (s *Filters) MarshalJSON() ([]byte, error) {
  2277. type NoMethod Filters
  2278. raw := NoMethod(*s)
  2279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2280. }
  2281. // GaData: Analytics data for a given view (profile).
  2282. type GaData struct {
  2283. // ColumnHeaders: Column headers that list dimension names followed by
  2284. // the metric names. The order of dimensions and metrics is same as
  2285. // specified in the request.
  2286. ColumnHeaders []*GaDataColumnHeaders `json:"columnHeaders,omitempty"`
  2287. // ContainsSampledData: Determines if Analytics data contains samples.
  2288. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  2289. // DataLastRefreshed: The last refreshed time in seconds for Analytics
  2290. // data.
  2291. DataLastRefreshed int64 `json:"dataLastRefreshed,omitempty,string"`
  2292. DataTable *GaDataDataTable `json:"dataTable,omitempty"`
  2293. // Id: Unique ID for this data response.
  2294. Id string `json:"id,omitempty"`
  2295. // ItemsPerPage: The maximum number of rows the response can contain,
  2296. // regardless of the actual number of rows returned. Its value ranges
  2297. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  2298. // specified by the max-results query parameter.
  2299. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2300. // Kind: Resource type.
  2301. Kind string `json:"kind,omitempty"`
  2302. // NextLink: Link to next page for this Analytics data query.
  2303. NextLink string `json:"nextLink,omitempty"`
  2304. // PreviousLink: Link to previous page for this Analytics data query.
  2305. PreviousLink string `json:"previousLink,omitempty"`
  2306. // ProfileInfo: Information for the view (profile), for which the
  2307. // Analytics data was requested.
  2308. ProfileInfo *GaDataProfileInfo `json:"profileInfo,omitempty"`
  2309. // Query: Analytics data request query parameters.
  2310. Query *GaDataQuery `json:"query,omitempty"`
  2311. // Rows: Analytics data rows, where each row contains a list of
  2312. // dimension values followed by the metric values. The order of
  2313. // dimensions and metrics is same as specified in the request.
  2314. Rows [][]string `json:"rows,omitempty"`
  2315. // SampleSize: The number of samples used to calculate the result.
  2316. SampleSize int64 `json:"sampleSize,omitempty,string"`
  2317. // SampleSpace: Total size of the sample space from which the samples
  2318. // were selected.
  2319. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  2320. // SelfLink: Link to this page.
  2321. SelfLink string `json:"selfLink,omitempty"`
  2322. // TotalResults: The total number of rows for the query, regardless of
  2323. // the number of rows in the response.
  2324. TotalResults int64 `json:"totalResults,omitempty"`
  2325. // TotalsForAllResults: Total values for the requested metrics over all
  2326. // the results, not just the results returned in this response. The
  2327. // order of the metric totals is same as the metric order specified in
  2328. // the request.
  2329. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  2330. // ServerResponse contains the HTTP response code and headers from the
  2331. // server.
  2332. googleapi.ServerResponse `json:"-"`
  2333. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  2334. // unconditionally include in API requests. By default, fields with
  2335. // empty values are omitted from API requests. However, any non-pointer,
  2336. // non-interface field appearing in ForceSendFields will be sent to the
  2337. // server regardless of whether the field is empty or not. This may be
  2338. // used to include empty fields in Patch requests.
  2339. ForceSendFields []string `json:"-"`
  2340. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  2341. // in API requests with the JSON null value. By default, fields with
  2342. // empty values are omitted from API requests. However, any field with
  2343. // an empty value appearing in NullFields will be sent to the server as
  2344. // null. It is an error if a field in this list has a non-empty value.
  2345. // This may be used to include null fields in Patch requests.
  2346. NullFields []string `json:"-"`
  2347. }
  2348. func (s *GaData) MarshalJSON() ([]byte, error) {
  2349. type NoMethod GaData
  2350. raw := NoMethod(*s)
  2351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2352. }
  2353. type GaDataColumnHeaders struct {
  2354. // ColumnType: Column Type. Either DIMENSION or METRIC.
  2355. ColumnType string `json:"columnType,omitempty"`
  2356. // DataType: Data type. Dimension column headers have only STRING as the
  2357. // data type. Metric column headers have data types for metric values
  2358. // such as INTEGER, DOUBLE, CURRENCY etc.
  2359. DataType string `json:"dataType,omitempty"`
  2360. // Name: Column name.
  2361. Name string `json:"name,omitempty"`
  2362. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  2363. // unconditionally include in API requests. By default, fields with
  2364. // empty values are omitted from API requests. However, any non-pointer,
  2365. // non-interface field appearing in ForceSendFields will be sent to the
  2366. // server regardless of whether the field is empty or not. This may be
  2367. // used to include empty fields in Patch requests.
  2368. ForceSendFields []string `json:"-"`
  2369. // NullFields is a list of field names (e.g. "ColumnType") to include in
  2370. // API requests with the JSON null value. By default, fields with empty
  2371. // values are omitted from API requests. However, any field with an
  2372. // empty value appearing in NullFields will be sent to the server as
  2373. // null. It is an error if a field in this list has a non-empty value.
  2374. // This may be used to include null fields in Patch requests.
  2375. NullFields []string `json:"-"`
  2376. }
  2377. func (s *GaDataColumnHeaders) MarshalJSON() ([]byte, error) {
  2378. type NoMethod GaDataColumnHeaders
  2379. raw := NoMethod(*s)
  2380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2381. }
  2382. type GaDataDataTable struct {
  2383. Cols []*GaDataDataTableCols `json:"cols,omitempty"`
  2384. Rows []*GaDataDataTableRows `json:"rows,omitempty"`
  2385. // ForceSendFields is a list of field names (e.g. "Cols") to
  2386. // unconditionally include in API requests. By default, fields with
  2387. // empty values are omitted from API requests. However, any non-pointer,
  2388. // non-interface field appearing in ForceSendFields will be sent to the
  2389. // server regardless of whether the field is empty or not. This may be
  2390. // used to include empty fields in Patch requests.
  2391. ForceSendFields []string `json:"-"`
  2392. // NullFields is a list of field names (e.g. "Cols") to include in API
  2393. // requests with the JSON null value. By default, fields with empty
  2394. // values are omitted from API requests. However, any field with an
  2395. // empty value appearing in NullFields will be sent to the server as
  2396. // null. It is an error if a field in this list has a non-empty value.
  2397. // This may be used to include null fields in Patch requests.
  2398. NullFields []string `json:"-"`
  2399. }
  2400. func (s *GaDataDataTable) MarshalJSON() ([]byte, error) {
  2401. type NoMethod GaDataDataTable
  2402. raw := NoMethod(*s)
  2403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2404. }
  2405. type GaDataDataTableCols struct {
  2406. Id string `json:"id,omitempty"`
  2407. Label string `json:"label,omitempty"`
  2408. Type string `json:"type,omitempty"`
  2409. // ForceSendFields is a list of field names (e.g. "Id") to
  2410. // unconditionally include in API requests. By default, fields with
  2411. // empty values are omitted from API requests. However, any non-pointer,
  2412. // non-interface field appearing in ForceSendFields will be sent to the
  2413. // server regardless of whether the field is empty or not. This may be
  2414. // used to include empty fields in Patch requests.
  2415. ForceSendFields []string `json:"-"`
  2416. // NullFields is a list of field names (e.g. "Id") to include in API
  2417. // requests with the JSON null value. By default, fields with empty
  2418. // values are omitted from API requests. However, any field with an
  2419. // empty value appearing in NullFields will be sent to the server as
  2420. // null. It is an error if a field in this list has a non-empty value.
  2421. // This may be used to include null fields in Patch requests.
  2422. NullFields []string `json:"-"`
  2423. }
  2424. func (s *GaDataDataTableCols) MarshalJSON() ([]byte, error) {
  2425. type NoMethod GaDataDataTableCols
  2426. raw := NoMethod(*s)
  2427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2428. }
  2429. type GaDataDataTableRows struct {
  2430. C []*GaDataDataTableRowsC `json:"c,omitempty"`
  2431. // ForceSendFields is a list of field names (e.g. "C") to
  2432. // unconditionally include in API requests. By default, fields with
  2433. // empty values are omitted from API requests. However, any non-pointer,
  2434. // non-interface field appearing in ForceSendFields will be sent to the
  2435. // server regardless of whether the field is empty or not. This may be
  2436. // used to include empty fields in Patch requests.
  2437. ForceSendFields []string `json:"-"`
  2438. // NullFields is a list of field names (e.g. "C") to include in API
  2439. // requests with the JSON null value. By default, fields with empty
  2440. // values are omitted from API requests. However, any field with an
  2441. // empty value appearing in NullFields will be sent to the server as
  2442. // null. It is an error if a field in this list has a non-empty value.
  2443. // This may be used to include null fields in Patch requests.
  2444. NullFields []string `json:"-"`
  2445. }
  2446. func (s *GaDataDataTableRows) MarshalJSON() ([]byte, error) {
  2447. type NoMethod GaDataDataTableRows
  2448. raw := NoMethod(*s)
  2449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2450. }
  2451. type GaDataDataTableRowsC struct {
  2452. V string `json:"v,omitempty"`
  2453. // ForceSendFields is a list of field names (e.g. "V") to
  2454. // unconditionally include in API requests. By default, fields with
  2455. // empty values are omitted from API requests. However, any non-pointer,
  2456. // non-interface field appearing in ForceSendFields will be sent to the
  2457. // server regardless of whether the field is empty or not. This may be
  2458. // used to include empty fields in Patch requests.
  2459. ForceSendFields []string `json:"-"`
  2460. // NullFields is a list of field names (e.g. "V") to include in API
  2461. // requests with the JSON null value. By default, fields with empty
  2462. // values are omitted from API requests. However, any field with an
  2463. // empty value appearing in NullFields will be sent to the server as
  2464. // null. It is an error if a field in this list has a non-empty value.
  2465. // This may be used to include null fields in Patch requests.
  2466. NullFields []string `json:"-"`
  2467. }
  2468. func (s *GaDataDataTableRowsC) MarshalJSON() ([]byte, error) {
  2469. type NoMethod GaDataDataTableRowsC
  2470. raw := NoMethod(*s)
  2471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2472. }
  2473. // GaDataProfileInfo: Information for the view (profile), for which the
  2474. // Analytics data was requested.
  2475. type GaDataProfileInfo struct {
  2476. // AccountId: Account ID to which this view (profile) belongs.
  2477. AccountId string `json:"accountId,omitempty"`
  2478. // InternalWebPropertyId: Internal ID for the web property to which this
  2479. // view (profile) belongs.
  2480. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2481. // ProfileId: View (Profile) ID.
  2482. ProfileId string `json:"profileId,omitempty"`
  2483. // ProfileName: View (Profile) name.
  2484. ProfileName string `json:"profileName,omitempty"`
  2485. // TableId: Table ID for view (profile).
  2486. TableId string `json:"tableId,omitempty"`
  2487. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  2488. WebPropertyId string `json:"webPropertyId,omitempty"`
  2489. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2490. // unconditionally include in API requests. By default, fields with
  2491. // empty values are omitted from API requests. However, any non-pointer,
  2492. // non-interface field appearing in ForceSendFields will be sent to the
  2493. // server regardless of whether the field is empty or not. This may be
  2494. // used to include empty fields in Patch requests.
  2495. ForceSendFields []string `json:"-"`
  2496. // NullFields is a list of field names (e.g. "AccountId") to include in
  2497. // API requests with the JSON null value. By default, fields with empty
  2498. // values are omitted from API requests. However, any field with an
  2499. // empty value appearing in NullFields will be sent to the server as
  2500. // null. It is an error if a field in this list has a non-empty value.
  2501. // This may be used to include null fields in Patch requests.
  2502. NullFields []string `json:"-"`
  2503. }
  2504. func (s *GaDataProfileInfo) MarshalJSON() ([]byte, error) {
  2505. type NoMethod GaDataProfileInfo
  2506. raw := NoMethod(*s)
  2507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2508. }
  2509. // GaDataQuery: Analytics data request query parameters.
  2510. type GaDataQuery struct {
  2511. // Dimensions: List of analytics dimensions.
  2512. Dimensions string `json:"dimensions,omitempty"`
  2513. // EndDate: End date.
  2514. EndDate string `json:"end-date,omitempty"`
  2515. // Filters: Comma-separated list of dimension or metric filters.
  2516. Filters string `json:"filters,omitempty"`
  2517. // Ids: Unique table ID.
  2518. Ids string `json:"ids,omitempty"`
  2519. // MaxResults: Maximum results per page.
  2520. MaxResults int64 `json:"max-results,omitempty"`
  2521. // Metrics: List of analytics metrics.
  2522. Metrics []string `json:"metrics,omitempty"`
  2523. // SamplingLevel: Desired sampling level
  2524. SamplingLevel string `json:"samplingLevel,omitempty"`
  2525. // Segment: Analytics advanced segment.
  2526. Segment string `json:"segment,omitempty"`
  2527. // Sort: List of dimensions or metrics based on which Analytics data is
  2528. // sorted.
  2529. Sort []string `json:"sort,omitempty"`
  2530. // StartDate: Start date.
  2531. StartDate string `json:"start-date,omitempty"`
  2532. // StartIndex: Start index.
  2533. StartIndex int64 `json:"start-index,omitempty"`
  2534. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  2535. // unconditionally include in API requests. By default, fields with
  2536. // empty values are omitted from API requests. However, any non-pointer,
  2537. // non-interface field appearing in ForceSendFields will be sent to the
  2538. // server regardless of whether the field is empty or not. This may be
  2539. // used to include empty fields in Patch requests.
  2540. ForceSendFields []string `json:"-"`
  2541. // NullFields is a list of field names (e.g. "Dimensions") to include in
  2542. // API requests with the JSON null value. By default, fields with empty
  2543. // values are omitted from API requests. However, any field with an
  2544. // empty value appearing in NullFields will be sent to the server as
  2545. // null. It is an error if a field in this list has a non-empty value.
  2546. // This may be used to include null fields in Patch requests.
  2547. NullFields []string `json:"-"`
  2548. }
  2549. func (s *GaDataQuery) MarshalJSON() ([]byte, error) {
  2550. type NoMethod GaDataQuery
  2551. raw := NoMethod(*s)
  2552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2553. }
  2554. // Goal: JSON template for Analytics goal resource.
  2555. type Goal struct {
  2556. // AccountId: Account ID to which this goal belongs.
  2557. AccountId string `json:"accountId,omitempty"`
  2558. // Active: Determines whether this goal is active.
  2559. Active bool `json:"active,omitempty"`
  2560. // Created: Time this goal was created.
  2561. Created string `json:"created,omitempty"`
  2562. // EventDetails: Details for the goal of the type EVENT.
  2563. EventDetails *GoalEventDetails `json:"eventDetails,omitempty"`
  2564. // Id: Goal ID.
  2565. Id string `json:"id,omitempty"`
  2566. // InternalWebPropertyId: Internal ID for the web property to which this
  2567. // goal belongs.
  2568. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2569. // Kind: Resource type for an Analytics goal.
  2570. Kind string `json:"kind,omitempty"`
  2571. // Name: Goal name.
  2572. Name string `json:"name,omitempty"`
  2573. // ParentLink: Parent link for a goal. Points to the view (profile) to
  2574. // which this goal belongs.
  2575. ParentLink *GoalParentLink `json:"parentLink,omitempty"`
  2576. // ProfileId: View (Profile) ID to which this goal belongs.
  2577. ProfileId string `json:"profileId,omitempty"`
  2578. // SelfLink: Link for this goal.
  2579. SelfLink string `json:"selfLink,omitempty"`
  2580. // Type: Goal type. Possible values are URL_DESTINATION,
  2581. // VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT.
  2582. Type string `json:"type,omitempty"`
  2583. // Updated: Time this goal was last modified.
  2584. Updated string `json:"updated,omitempty"`
  2585. // UrlDestinationDetails: Details for the goal of the type
  2586. // URL_DESTINATION.
  2587. UrlDestinationDetails *GoalUrlDestinationDetails `json:"urlDestinationDetails,omitempty"`
  2588. // Value: Goal value.
  2589. Value float64 `json:"value,omitempty"`
  2590. // VisitNumPagesDetails: Details for the goal of the type
  2591. // VISIT_NUM_PAGES.
  2592. VisitNumPagesDetails *GoalVisitNumPagesDetails `json:"visitNumPagesDetails,omitempty"`
  2593. // VisitTimeOnSiteDetails: Details for the goal of the type
  2594. // VISIT_TIME_ON_SITE.
  2595. VisitTimeOnSiteDetails *GoalVisitTimeOnSiteDetails `json:"visitTimeOnSiteDetails,omitempty"`
  2596. // WebPropertyId: Web property ID to which this goal belongs. The web
  2597. // property ID is of the form UA-XXXXX-YY.
  2598. WebPropertyId string `json:"webPropertyId,omitempty"`
  2599. // ServerResponse contains the HTTP response code and headers from the
  2600. // server.
  2601. googleapi.ServerResponse `json:"-"`
  2602. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2603. // unconditionally include in API requests. By default, fields with
  2604. // empty values are omitted from API requests. However, any non-pointer,
  2605. // non-interface field appearing in ForceSendFields will be sent to the
  2606. // server regardless of whether the field is empty or not. This may be
  2607. // used to include empty fields in Patch requests.
  2608. ForceSendFields []string `json:"-"`
  2609. // NullFields is a list of field names (e.g. "AccountId") to include in
  2610. // API requests with the JSON null value. By default, fields with empty
  2611. // values are omitted from API requests. However, any field with an
  2612. // empty value appearing in NullFields will be sent to the server as
  2613. // null. It is an error if a field in this list has a non-empty value.
  2614. // This may be used to include null fields in Patch requests.
  2615. NullFields []string `json:"-"`
  2616. }
  2617. func (s *Goal) MarshalJSON() ([]byte, error) {
  2618. type NoMethod Goal
  2619. raw := NoMethod(*s)
  2620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2621. }
  2622. func (s *Goal) UnmarshalJSON(data []byte) error {
  2623. type NoMethod Goal
  2624. var s1 struct {
  2625. Value gensupport.JSONFloat64 `json:"value"`
  2626. *NoMethod
  2627. }
  2628. s1.NoMethod = (*NoMethod)(s)
  2629. if err := json.Unmarshal(data, &s1); err != nil {
  2630. return err
  2631. }
  2632. s.Value = float64(s1.Value)
  2633. return nil
  2634. }
  2635. // GoalEventDetails: Details for the goal of the type EVENT.
  2636. type GoalEventDetails struct {
  2637. // EventConditions: List of event conditions.
  2638. EventConditions []*GoalEventDetailsEventConditions `json:"eventConditions,omitempty"`
  2639. // UseEventValue: Determines if the event value should be used as the
  2640. // value for this goal.
  2641. UseEventValue bool `json:"useEventValue,omitempty"`
  2642. // ForceSendFields is a list of field names (e.g. "EventConditions") to
  2643. // unconditionally include in API requests. By default, fields with
  2644. // empty values are omitted from API requests. However, any non-pointer,
  2645. // non-interface field appearing in ForceSendFields will be sent to the
  2646. // server regardless of whether the field is empty or not. This may be
  2647. // used to include empty fields in Patch requests.
  2648. ForceSendFields []string `json:"-"`
  2649. // NullFields is a list of field names (e.g. "EventConditions") to
  2650. // include in API requests with the JSON null value. By default, fields
  2651. // with empty values are omitted from API requests. However, any field
  2652. // with an empty value appearing in NullFields will be sent to the
  2653. // server as null. It is an error if a field in this list has a
  2654. // non-empty value. This may be used to include null fields in Patch
  2655. // requests.
  2656. NullFields []string `json:"-"`
  2657. }
  2658. func (s *GoalEventDetails) MarshalJSON() ([]byte, error) {
  2659. type NoMethod GoalEventDetails
  2660. raw := NoMethod(*s)
  2661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2662. }
  2663. type GoalEventDetailsEventConditions struct {
  2664. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2665. // GREATER_THAN or EQUAL.
  2666. ComparisonType string `json:"comparisonType,omitempty"`
  2667. // ComparisonValue: Value used for this comparison.
  2668. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2669. // Expression: Expression used for this match.
  2670. Expression string `json:"expression,omitempty"`
  2671. // MatchType: Type of the match to be performed. Possible values are
  2672. // REGEXP, BEGINS_WITH, or EXACT.
  2673. MatchType string `json:"matchType,omitempty"`
  2674. // Type: Type of this event condition. Possible values are CATEGORY,
  2675. // ACTION, LABEL, or VALUE.
  2676. Type string `json:"type,omitempty"`
  2677. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2678. // unconditionally include in API requests. By default, fields with
  2679. // empty values are omitted from API requests. However, any non-pointer,
  2680. // non-interface field appearing in ForceSendFields will be sent to the
  2681. // server regardless of whether the field is empty or not. This may be
  2682. // used to include empty fields in Patch requests.
  2683. ForceSendFields []string `json:"-"`
  2684. // NullFields is a list of field names (e.g. "ComparisonType") to
  2685. // include in API requests with the JSON null value. By default, fields
  2686. // with empty values are omitted from API requests. However, any field
  2687. // with an empty value appearing in NullFields will be sent to the
  2688. // server as null. It is an error if a field in this list has a
  2689. // non-empty value. This may be used to include null fields in Patch
  2690. // requests.
  2691. NullFields []string `json:"-"`
  2692. }
  2693. func (s *GoalEventDetailsEventConditions) MarshalJSON() ([]byte, error) {
  2694. type NoMethod GoalEventDetailsEventConditions
  2695. raw := NoMethod(*s)
  2696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2697. }
  2698. // GoalParentLink: Parent link for a goal. Points to the view (profile)
  2699. // to which this goal belongs.
  2700. type GoalParentLink struct {
  2701. // Href: Link to the view (profile) to which this goal belongs.
  2702. Href string `json:"href,omitempty"`
  2703. // Type: Value is "analytics#profile".
  2704. Type string `json:"type,omitempty"`
  2705. // ForceSendFields is a list of field names (e.g. "Href") to
  2706. // unconditionally include in API requests. By default, fields with
  2707. // empty values are omitted from API requests. However, any non-pointer,
  2708. // non-interface field appearing in ForceSendFields will be sent to the
  2709. // server regardless of whether the field is empty or not. This may be
  2710. // used to include empty fields in Patch requests.
  2711. ForceSendFields []string `json:"-"`
  2712. // NullFields is a list of field names (e.g. "Href") to include in API
  2713. // requests with the JSON null value. By default, fields with empty
  2714. // values are omitted from API requests. However, any field with an
  2715. // empty value appearing in NullFields will be sent to the server as
  2716. // null. It is an error if a field in this list has a non-empty value.
  2717. // This may be used to include null fields in Patch requests.
  2718. NullFields []string `json:"-"`
  2719. }
  2720. func (s *GoalParentLink) MarshalJSON() ([]byte, error) {
  2721. type NoMethod GoalParentLink
  2722. raw := NoMethod(*s)
  2723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2724. }
  2725. // GoalUrlDestinationDetails: Details for the goal of the type
  2726. // URL_DESTINATION.
  2727. type GoalUrlDestinationDetails struct {
  2728. // CaseSensitive: Determines if the goal URL must exactly match the
  2729. // capitalization of visited URLs.
  2730. CaseSensitive bool `json:"caseSensitive,omitempty"`
  2731. // FirstStepRequired: Determines if the first step in this goal is
  2732. // required.
  2733. FirstStepRequired bool `json:"firstStepRequired,omitempty"`
  2734. // MatchType: Match type for the goal URL. Possible values are HEAD,
  2735. // EXACT, or REGEX.
  2736. MatchType string `json:"matchType,omitempty"`
  2737. // Steps: List of steps configured for this goal funnel.
  2738. Steps []*GoalUrlDestinationDetailsSteps `json:"steps,omitempty"`
  2739. // Url: URL for this goal.
  2740. Url string `json:"url,omitempty"`
  2741. // ForceSendFields is a list of field names (e.g. "CaseSensitive") to
  2742. // unconditionally include in API requests. By default, fields with
  2743. // empty values are omitted from API requests. However, any non-pointer,
  2744. // non-interface field appearing in ForceSendFields will be sent to the
  2745. // server regardless of whether the field is empty or not. This may be
  2746. // used to include empty fields in Patch requests.
  2747. ForceSendFields []string `json:"-"`
  2748. // NullFields is a list of field names (e.g. "CaseSensitive") to include
  2749. // in API requests with the JSON null value. By default, fields with
  2750. // empty values are omitted from API requests. However, any field with
  2751. // an empty value appearing in NullFields will be sent to the server as
  2752. // null. It is an error if a field in this list has a non-empty value.
  2753. // This may be used to include null fields in Patch requests.
  2754. NullFields []string `json:"-"`
  2755. }
  2756. func (s *GoalUrlDestinationDetails) MarshalJSON() ([]byte, error) {
  2757. type NoMethod GoalUrlDestinationDetails
  2758. raw := NoMethod(*s)
  2759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2760. }
  2761. type GoalUrlDestinationDetailsSteps struct {
  2762. // Name: Step name.
  2763. Name string `json:"name,omitempty"`
  2764. // Number: Step number.
  2765. Number int64 `json:"number,omitempty"`
  2766. // Url: URL for this step.
  2767. Url string `json:"url,omitempty"`
  2768. // ForceSendFields is a list of field names (e.g. "Name") to
  2769. // unconditionally include in API requests. By default, fields with
  2770. // empty values are omitted from API requests. However, any non-pointer,
  2771. // non-interface field appearing in ForceSendFields will be sent to the
  2772. // server regardless of whether the field is empty or not. This may be
  2773. // used to include empty fields in Patch requests.
  2774. ForceSendFields []string `json:"-"`
  2775. // NullFields is a list of field names (e.g. "Name") to include in API
  2776. // requests with the JSON null value. By default, fields with empty
  2777. // values are omitted from API requests. However, any field with an
  2778. // empty value appearing in NullFields will be sent to the server as
  2779. // null. It is an error if a field in this list has a non-empty value.
  2780. // This may be used to include null fields in Patch requests.
  2781. NullFields []string `json:"-"`
  2782. }
  2783. func (s *GoalUrlDestinationDetailsSteps) MarshalJSON() ([]byte, error) {
  2784. type NoMethod GoalUrlDestinationDetailsSteps
  2785. raw := NoMethod(*s)
  2786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2787. }
  2788. // GoalVisitNumPagesDetails: Details for the goal of the type
  2789. // VISIT_NUM_PAGES.
  2790. type GoalVisitNumPagesDetails struct {
  2791. // ComparisonType: Type of comparison. Possible values are LESS_THAN,
  2792. // GREATER_THAN, or EQUAL.
  2793. ComparisonType string `json:"comparisonType,omitempty"`
  2794. // ComparisonValue: Value used for this comparison.
  2795. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2796. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2797. // unconditionally include in API requests. By default, fields with
  2798. // empty values are omitted from API requests. However, any non-pointer,
  2799. // non-interface field appearing in ForceSendFields will be sent to the
  2800. // server regardless of whether the field is empty or not. This may be
  2801. // used to include empty fields in Patch requests.
  2802. ForceSendFields []string `json:"-"`
  2803. // NullFields is a list of field names (e.g. "ComparisonType") to
  2804. // include in API requests with the JSON null value. By default, fields
  2805. // with empty values are omitted from API requests. However, any field
  2806. // with an empty value appearing in NullFields will be sent to the
  2807. // server as null. It is an error if a field in this list has a
  2808. // non-empty value. This may be used to include null fields in Patch
  2809. // requests.
  2810. NullFields []string `json:"-"`
  2811. }
  2812. func (s *GoalVisitNumPagesDetails) MarshalJSON() ([]byte, error) {
  2813. type NoMethod GoalVisitNumPagesDetails
  2814. raw := NoMethod(*s)
  2815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2816. }
  2817. // GoalVisitTimeOnSiteDetails: Details for the goal of the type
  2818. // VISIT_TIME_ON_SITE.
  2819. type GoalVisitTimeOnSiteDetails struct {
  2820. // ComparisonType: Type of comparison. Possible values are LESS_THAN or
  2821. // GREATER_THAN.
  2822. ComparisonType string `json:"comparisonType,omitempty"`
  2823. // ComparisonValue: Value used for this comparison.
  2824. ComparisonValue int64 `json:"comparisonValue,omitempty,string"`
  2825. // ForceSendFields is a list of field names (e.g. "ComparisonType") to
  2826. // unconditionally include in API requests. By default, fields with
  2827. // empty values are omitted from API requests. However, any non-pointer,
  2828. // non-interface field appearing in ForceSendFields will be sent to the
  2829. // server regardless of whether the field is empty or not. This may be
  2830. // used to include empty fields in Patch requests.
  2831. ForceSendFields []string `json:"-"`
  2832. // NullFields is a list of field names (e.g. "ComparisonType") to
  2833. // include in API requests with the JSON null value. By default, fields
  2834. // with empty values are omitted from API requests. However, any field
  2835. // with an empty value appearing in NullFields will be sent to the
  2836. // server as null. It is an error if a field in this list has a
  2837. // non-empty value. This may be used to include null fields in Patch
  2838. // requests.
  2839. NullFields []string `json:"-"`
  2840. }
  2841. func (s *GoalVisitTimeOnSiteDetails) MarshalJSON() ([]byte, error) {
  2842. type NoMethod GoalVisitTimeOnSiteDetails
  2843. raw := NoMethod(*s)
  2844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2845. }
  2846. // Goals: A goal collection lists Analytics goals to which the user has
  2847. // access. Each view (profile) can have a set of goals. Each resource in
  2848. // the Goal collection corresponds to a single Analytics goal.
  2849. type Goals struct {
  2850. // Items: A list of goals.
  2851. Items []*Goal `json:"items,omitempty"`
  2852. // ItemsPerPage: The maximum number of resources the response can
  2853. // contain, regardless of the actual number of resources returned. Its
  2854. // value ranges from 1 to 1000 with a value of 1000 by default, or
  2855. // otherwise specified by the max-results query parameter.
  2856. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  2857. // Kind: Collection type.
  2858. Kind string `json:"kind,omitempty"`
  2859. // NextLink: Link to next page for this goal collection.
  2860. NextLink string `json:"nextLink,omitempty"`
  2861. // PreviousLink: Link to previous page for this goal collection.
  2862. PreviousLink string `json:"previousLink,omitempty"`
  2863. // StartIndex: The starting index of the resources, which is 1 by
  2864. // default or otherwise specified by the start-index query parameter.
  2865. StartIndex int64 `json:"startIndex,omitempty"`
  2866. // TotalResults: The total number of results for the query, regardless
  2867. // of the number of resources in the result.
  2868. TotalResults int64 `json:"totalResults,omitempty"`
  2869. // Username: Email ID of the authenticated user
  2870. Username string `json:"username,omitempty"`
  2871. // ServerResponse contains the HTTP response code and headers from the
  2872. // server.
  2873. googleapi.ServerResponse `json:"-"`
  2874. // ForceSendFields is a list of field names (e.g. "Items") to
  2875. // unconditionally include in API requests. By default, fields with
  2876. // empty values are omitted from API requests. However, any non-pointer,
  2877. // non-interface field appearing in ForceSendFields will be sent to the
  2878. // server regardless of whether the field is empty or not. This may be
  2879. // used to include empty fields in Patch requests.
  2880. ForceSendFields []string `json:"-"`
  2881. // NullFields is a list of field names (e.g. "Items") to include in API
  2882. // requests with the JSON null value. By default, fields with empty
  2883. // values are omitted from API requests. However, any field with an
  2884. // empty value appearing in NullFields will be sent to the server as
  2885. // null. It is an error if a field in this list has a non-empty value.
  2886. // This may be used to include null fields in Patch requests.
  2887. NullFields []string `json:"-"`
  2888. }
  2889. func (s *Goals) MarshalJSON() ([]byte, error) {
  2890. type NoMethod Goals
  2891. raw := NoMethod(*s)
  2892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2893. }
  2894. // IncludeConditions: JSON template for an Analytics Remarketing Include
  2895. // Conditions.
  2896. type IncludeConditions struct {
  2897. // DaysToLookBack: The look-back window lets you specify a time frame
  2898. // for evaluating the behavior that qualifies users for your audience.
  2899. // For example, if your filters include users from Central Asia, and
  2900. // Transactions Greater than 2, and you set the look-back window to 14
  2901. // days, then any user from Central Asia whose cumulative transactions
  2902. // exceed 2 during the last 14 days is added to the audience.
  2903. DaysToLookBack int64 `json:"daysToLookBack,omitempty"`
  2904. // IsSmartList: Boolean indicating whether this segment is a smart list.
  2905. // https://support.google.com/analytics/answer/4628577
  2906. IsSmartList bool `json:"isSmartList,omitempty"`
  2907. // Kind: Resource type for include conditions.
  2908. Kind string `json:"kind,omitempty"`
  2909. // MembershipDurationDays: Number of days (in the range 1 to 540) a user
  2910. // remains in the audience.
  2911. MembershipDurationDays int64 `json:"membershipDurationDays,omitempty"`
  2912. // Segment: The segment condition that will cause a user to be added to
  2913. // an audience.
  2914. Segment string `json:"segment,omitempty"`
  2915. // ForceSendFields is a list of field names (e.g. "DaysToLookBack") 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. "DaysToLookBack") to
  2923. // include in API requests with the JSON null value. By default, fields
  2924. // with empty values are omitted from API requests. However, any field
  2925. // with an empty value appearing in NullFields will be sent to the
  2926. // server as null. It is an error if a field in this list has a
  2927. // non-empty value. This may be used to include null fields in Patch
  2928. // requests.
  2929. NullFields []string `json:"-"`
  2930. }
  2931. func (s *IncludeConditions) MarshalJSON() ([]byte, error) {
  2932. type NoMethod IncludeConditions
  2933. raw := NoMethod(*s)
  2934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2935. }
  2936. // LinkedForeignAccount: JSON template for an Analytics Remarketing
  2937. // Audience Foreign Link.
  2938. type LinkedForeignAccount struct {
  2939. // AccountId: Account ID to which this linked foreign account belongs.
  2940. AccountId string `json:"accountId,omitempty"`
  2941. // EligibleForSearch: Boolean indicating whether this is eligible for
  2942. // search.
  2943. EligibleForSearch bool `json:"eligibleForSearch,omitempty"`
  2944. // Id: Entity ad account link ID.
  2945. Id string `json:"id,omitempty"`
  2946. // InternalWebPropertyId: Internal ID for the web property to which this
  2947. // linked foreign account belongs.
  2948. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  2949. // Kind: Resource type for linked foreign account.
  2950. Kind string `json:"kind,omitempty"`
  2951. // LinkedAccountId: The foreign account ID. For example the an AdWords
  2952. // `linkedAccountId` has the following format XXX-XXX-XXXX.
  2953. LinkedAccountId string `json:"linkedAccountId,omitempty"`
  2954. // RemarketingAudienceId: Remarketing audience ID to which this linked
  2955. // foreign account belongs.
  2956. RemarketingAudienceId string `json:"remarketingAudienceId,omitempty"`
  2957. // Status: The status of this foreign account link.
  2958. Status string `json:"status,omitempty"`
  2959. // Type: The type of the foreign account. For example, `ADWORDS_LINKS`,
  2960. // `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`.
  2961. Type string `json:"type,omitempty"`
  2962. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  2963. // linked foreign account belongs.
  2964. WebPropertyId string `json:"webPropertyId,omitempty"`
  2965. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2966. // unconditionally include in API requests. By default, fields with
  2967. // empty values are omitted from API requests. However, any non-pointer,
  2968. // non-interface field appearing in ForceSendFields will be sent to the
  2969. // server regardless of whether the field is empty or not. This may be
  2970. // used to include empty fields in Patch requests.
  2971. ForceSendFields []string `json:"-"`
  2972. // NullFields is a list of field names (e.g. "AccountId") to include in
  2973. // API requests with the JSON null value. By default, fields with empty
  2974. // values are omitted from API requests. However, any field with an
  2975. // empty value appearing in NullFields will be sent to the server as
  2976. // null. It is an error if a field in this list has a non-empty value.
  2977. // This may be used to include null fields in Patch requests.
  2978. NullFields []string `json:"-"`
  2979. }
  2980. func (s *LinkedForeignAccount) MarshalJSON() ([]byte, error) {
  2981. type NoMethod LinkedForeignAccount
  2982. raw := NoMethod(*s)
  2983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2984. }
  2985. // McfData: Multi-Channel Funnels data for a given view (profile).
  2986. type McfData struct {
  2987. // ColumnHeaders: Column headers that list dimension names followed by
  2988. // the metric names. The order of dimensions and metrics is same as
  2989. // specified in the request.
  2990. ColumnHeaders []*McfDataColumnHeaders `json:"columnHeaders,omitempty"`
  2991. // ContainsSampledData: Determines if the Analytics data contains
  2992. // sampled data.
  2993. ContainsSampledData bool `json:"containsSampledData,omitempty"`
  2994. // Id: Unique ID for this data response.
  2995. Id string `json:"id,omitempty"`
  2996. // ItemsPerPage: The maximum number of rows the response can contain,
  2997. // regardless of the actual number of rows returned. Its value ranges
  2998. // from 1 to 10,000 with a value of 1000 by default, or otherwise
  2999. // specified by the max-results query parameter.
  3000. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3001. // Kind: Resource type.
  3002. Kind string `json:"kind,omitempty"`
  3003. // NextLink: Link to next page for this Analytics data query.
  3004. NextLink string `json:"nextLink,omitempty"`
  3005. // PreviousLink: Link to previous page for this Analytics data query.
  3006. PreviousLink string `json:"previousLink,omitempty"`
  3007. // ProfileInfo: Information for the view (profile), for which the
  3008. // Analytics data was requested.
  3009. ProfileInfo *McfDataProfileInfo `json:"profileInfo,omitempty"`
  3010. // Query: Analytics data request query parameters.
  3011. Query *McfDataQuery `json:"query,omitempty"`
  3012. // Rows: Analytics data rows, where each row contains a list of
  3013. // dimension values followed by the metric values. The order of
  3014. // dimensions and metrics is same as specified in the request.
  3015. Rows [][]*McfDataRowsItem `json:"rows,omitempty"`
  3016. // SampleSize: The number of samples used to calculate the result.
  3017. SampleSize int64 `json:"sampleSize,omitempty,string"`
  3018. // SampleSpace: Total size of the sample space from which the samples
  3019. // were selected.
  3020. SampleSpace int64 `json:"sampleSpace,omitempty,string"`
  3021. // SelfLink: Link to this page.
  3022. SelfLink string `json:"selfLink,omitempty"`
  3023. // TotalResults: The total number of rows for the query, regardless of
  3024. // the number of rows in the response.
  3025. TotalResults int64 `json:"totalResults,omitempty"`
  3026. // TotalsForAllResults: Total values for the requested metrics over all
  3027. // the results, not just the results returned in this response. The
  3028. // order of the metric totals is same as the metric order specified in
  3029. // the request.
  3030. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  3031. // ServerResponse contains the HTTP response code and headers from the
  3032. // server.
  3033. googleapi.ServerResponse `json:"-"`
  3034. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  3035. // unconditionally include in API requests. By default, fields with
  3036. // empty values are omitted from API requests. However, any non-pointer,
  3037. // non-interface field appearing in ForceSendFields will be sent to the
  3038. // server regardless of whether the field is empty or not. This may be
  3039. // used to include empty fields in Patch requests.
  3040. ForceSendFields []string `json:"-"`
  3041. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  3042. // in API requests with the JSON null value. By default, fields with
  3043. // empty values are omitted from API requests. However, any field with
  3044. // an empty value appearing in NullFields will be sent to the server as
  3045. // null. It is an error if a field in this list has a non-empty value.
  3046. // This may be used to include null fields in Patch requests.
  3047. NullFields []string `json:"-"`
  3048. }
  3049. func (s *McfData) MarshalJSON() ([]byte, error) {
  3050. type NoMethod McfData
  3051. raw := NoMethod(*s)
  3052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3053. }
  3054. type McfDataColumnHeaders struct {
  3055. // ColumnType: Column Type. Either DIMENSION or METRIC.
  3056. ColumnType string `json:"columnType,omitempty"`
  3057. // DataType: Data type. Dimension and metric values data types such as
  3058. // INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc.
  3059. DataType string `json:"dataType,omitempty"`
  3060. // Name: Column name.
  3061. Name string `json:"name,omitempty"`
  3062. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  3063. // unconditionally include in API requests. By default, fields with
  3064. // empty values are omitted from API requests. However, any non-pointer,
  3065. // non-interface field appearing in ForceSendFields will be sent to the
  3066. // server regardless of whether the field is empty or not. This may be
  3067. // used to include empty fields in Patch requests.
  3068. ForceSendFields []string `json:"-"`
  3069. // NullFields is a list of field names (e.g. "ColumnType") to include in
  3070. // API requests with the JSON null value. By default, fields with empty
  3071. // values are omitted from API requests. However, any field with an
  3072. // empty value appearing in NullFields will be sent to the server as
  3073. // null. It is an error if a field in this list has a non-empty value.
  3074. // This may be used to include null fields in Patch requests.
  3075. NullFields []string `json:"-"`
  3076. }
  3077. func (s *McfDataColumnHeaders) MarshalJSON() ([]byte, error) {
  3078. type NoMethod McfDataColumnHeaders
  3079. raw := NoMethod(*s)
  3080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3081. }
  3082. // McfDataProfileInfo: Information for the view (profile), for which the
  3083. // Analytics data was requested.
  3084. type McfDataProfileInfo struct {
  3085. // AccountId: Account ID to which this view (profile) belongs.
  3086. AccountId string `json:"accountId,omitempty"`
  3087. // InternalWebPropertyId: Internal ID for the web property to which this
  3088. // view (profile) belongs.
  3089. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3090. // ProfileId: View (Profile) ID.
  3091. ProfileId string `json:"profileId,omitempty"`
  3092. // ProfileName: View (Profile) name.
  3093. ProfileName string `json:"profileName,omitempty"`
  3094. // TableId: Table ID for view (profile).
  3095. TableId string `json:"tableId,omitempty"`
  3096. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  3097. WebPropertyId string `json:"webPropertyId,omitempty"`
  3098. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3099. // unconditionally include in API requests. By default, fields with
  3100. // empty values are omitted from API requests. However, any non-pointer,
  3101. // non-interface field appearing in ForceSendFields will be sent to the
  3102. // server regardless of whether the field is empty or not. This may be
  3103. // used to include empty fields in Patch requests.
  3104. ForceSendFields []string `json:"-"`
  3105. // NullFields is a list of field names (e.g. "AccountId") to include in
  3106. // API requests with the JSON null value. By default, fields with empty
  3107. // values are omitted from API requests. However, any field with an
  3108. // empty value appearing in NullFields will be sent to the server as
  3109. // null. It is an error if a field in this list has a non-empty value.
  3110. // This may be used to include null fields in Patch requests.
  3111. NullFields []string `json:"-"`
  3112. }
  3113. func (s *McfDataProfileInfo) MarshalJSON() ([]byte, error) {
  3114. type NoMethod McfDataProfileInfo
  3115. raw := NoMethod(*s)
  3116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3117. }
  3118. // McfDataQuery: Analytics data request query parameters.
  3119. type McfDataQuery struct {
  3120. // Dimensions: List of analytics dimensions.
  3121. Dimensions string `json:"dimensions,omitempty"`
  3122. // EndDate: End date.
  3123. EndDate string `json:"end-date,omitempty"`
  3124. // Filters: Comma-separated list of dimension or metric filters.
  3125. Filters string `json:"filters,omitempty"`
  3126. // Ids: Unique table ID.
  3127. Ids string `json:"ids,omitempty"`
  3128. // MaxResults: Maximum results per page.
  3129. MaxResults int64 `json:"max-results,omitempty"`
  3130. // Metrics: List of analytics metrics.
  3131. Metrics []string `json:"metrics,omitempty"`
  3132. // SamplingLevel: Desired sampling level
  3133. SamplingLevel string `json:"samplingLevel,omitempty"`
  3134. // Segment: Analytics advanced segment.
  3135. Segment string `json:"segment,omitempty"`
  3136. // Sort: List of dimensions or metrics based on which Analytics data is
  3137. // sorted.
  3138. Sort []string `json:"sort,omitempty"`
  3139. // StartDate: Start date.
  3140. StartDate string `json:"start-date,omitempty"`
  3141. // StartIndex: Start index.
  3142. StartIndex int64 `json:"start-index,omitempty"`
  3143. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  3144. // unconditionally include in API requests. By default, fields with
  3145. // empty values are omitted from API requests. However, any non-pointer,
  3146. // non-interface field appearing in ForceSendFields will be sent to the
  3147. // server regardless of whether the field is empty or not. This may be
  3148. // used to include empty fields in Patch requests.
  3149. ForceSendFields []string `json:"-"`
  3150. // NullFields is a list of field names (e.g. "Dimensions") to include in
  3151. // API requests with the JSON null value. By default, fields with empty
  3152. // values are omitted from API requests. However, any field with an
  3153. // empty value appearing in NullFields will be sent to the server as
  3154. // null. It is an error if a field in this list has a non-empty value.
  3155. // This may be used to include null fields in Patch requests.
  3156. NullFields []string `json:"-"`
  3157. }
  3158. func (s *McfDataQuery) MarshalJSON() ([]byte, error) {
  3159. type NoMethod McfDataQuery
  3160. raw := NoMethod(*s)
  3161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3162. }
  3163. // McfDataRowsItem: A union object representing a dimension or metric
  3164. // value. Only one of "primitiveValue" or "conversionPathValue"
  3165. // attribute will be populated.
  3166. type McfDataRowsItem struct {
  3167. // ConversionPathValue: A conversion path dimension value, containing a
  3168. // list of interactions with their attributes.
  3169. ConversionPathValue []*McfDataRowsItemConversionPathValue `json:"conversionPathValue,omitempty"`
  3170. // PrimitiveValue: A primitive dimension value. A primitive metric
  3171. // value.
  3172. PrimitiveValue string `json:"primitiveValue,omitempty"`
  3173. // ForceSendFields is a list of field names (e.g. "ConversionPathValue")
  3174. // to unconditionally include in API requests. By default, fields with
  3175. // empty values are omitted from API requests. However, any non-pointer,
  3176. // non-interface field appearing in ForceSendFields will be sent to the
  3177. // server regardless of whether the field is empty or not. This may be
  3178. // used to include empty fields in Patch requests.
  3179. ForceSendFields []string `json:"-"`
  3180. // NullFields is a list of field names (e.g. "ConversionPathValue") to
  3181. // include in API requests with the JSON null value. By default, fields
  3182. // with empty values are omitted from API requests. However, any field
  3183. // with an empty value appearing in NullFields will be sent to the
  3184. // server as null. It is an error if a field in this list has a
  3185. // non-empty value. This may be used to include null fields in Patch
  3186. // requests.
  3187. NullFields []string `json:"-"`
  3188. }
  3189. func (s *McfDataRowsItem) MarshalJSON() ([]byte, error) {
  3190. type NoMethod McfDataRowsItem
  3191. raw := NoMethod(*s)
  3192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3193. }
  3194. type McfDataRowsItemConversionPathValue struct {
  3195. // InteractionType: Type of an interaction on conversion path. Such as
  3196. // CLICK, IMPRESSION etc.
  3197. InteractionType string `json:"interactionType,omitempty"`
  3198. // NodeValue: Node value of an interaction on conversion path. Such as
  3199. // source, medium etc.
  3200. NodeValue string `json:"nodeValue,omitempty"`
  3201. // ForceSendFields is a list of field names (e.g. "InteractionType") to
  3202. // unconditionally include in API requests. By default, fields with
  3203. // empty values are omitted from API requests. However, any non-pointer,
  3204. // non-interface field appearing in ForceSendFields will be sent to the
  3205. // server regardless of whether the field is empty or not. This may be
  3206. // used to include empty fields in Patch requests.
  3207. ForceSendFields []string `json:"-"`
  3208. // NullFields is a list of field names (e.g. "InteractionType") to
  3209. // include in API requests with the JSON null value. By default, fields
  3210. // with empty values are omitted from API requests. However, any field
  3211. // with an empty value appearing in NullFields will be sent to the
  3212. // server as null. It is an error if a field in this list has a
  3213. // non-empty value. This may be used to include null fields in Patch
  3214. // requests.
  3215. NullFields []string `json:"-"`
  3216. }
  3217. func (s *McfDataRowsItemConversionPathValue) MarshalJSON() ([]byte, error) {
  3218. type NoMethod McfDataRowsItemConversionPathValue
  3219. raw := NoMethod(*s)
  3220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3221. }
  3222. // Profile: JSON template for an Analytics view (profile).
  3223. type Profile struct {
  3224. // AccountId: Account ID to which this view (profile) belongs.
  3225. AccountId string `json:"accountId,omitempty"`
  3226. // BotFilteringEnabled: Indicates whether bot filtering is enabled for
  3227. // this view (profile).
  3228. BotFilteringEnabled bool `json:"botFilteringEnabled,omitempty"`
  3229. // ChildLink: Child link for this view (profile). Points to the list of
  3230. // goals for this view (profile).
  3231. ChildLink *ProfileChildLink `json:"childLink,omitempty"`
  3232. // Created: Time this view (profile) was created.
  3233. Created string `json:"created,omitempty"`
  3234. // Currency: The currency type associated with this view (profile),
  3235. // defaults to USD. The supported values are:
  3236. // USD, JPY, EUR, GBP, AUD, KRW, BRL, CNY, DKK, RUB, SEK, NOK, PLN, TRY,
  3237. // TWD, HKD, THB, IDR, ARS, MXN, VND, PHP, INR, CHF, CAD, CZK, NZD, HUF,
  3238. // BGN, LTL, ZAR, UAH, AED, BOB, CLP, COP, EGP, HRK, ILS, MAD, MYR, PEN,
  3239. // PKR, RON, RSD, SAR, SGD, VEF, LVL
  3240. Currency string `json:"currency,omitempty"`
  3241. // DefaultPage: Default page for this view (profile).
  3242. DefaultPage string `json:"defaultPage,omitempty"`
  3243. // ECommerceTracking: Indicates whether ecommerce tracking is enabled
  3244. // for this view (profile).
  3245. ECommerceTracking bool `json:"eCommerceTracking,omitempty"`
  3246. // EnhancedECommerceTracking: Indicates whether enhanced ecommerce
  3247. // tracking is enabled for this view (profile). This property can only
  3248. // be enabled if ecommerce tracking is enabled.
  3249. EnhancedECommerceTracking bool `json:"enhancedECommerceTracking,omitempty"`
  3250. // ExcludeQueryParameters: The query parameters that are excluded from
  3251. // this view (profile).
  3252. ExcludeQueryParameters string `json:"excludeQueryParameters,omitempty"`
  3253. // Id: View (Profile) ID.
  3254. Id string `json:"id,omitempty"`
  3255. // InternalWebPropertyId: Internal ID for the web property to which this
  3256. // view (profile) belongs.
  3257. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3258. // Kind: Resource type for Analytics view (profile).
  3259. Kind string `json:"kind,omitempty"`
  3260. // Name: Name of this view (profile).
  3261. Name string `json:"name,omitempty"`
  3262. // ParentLink: Parent link for this view (profile). Points to the web
  3263. // property to which this view (profile) belongs.
  3264. ParentLink *ProfileParentLink `json:"parentLink,omitempty"`
  3265. // Permissions: Permissions the user has for this view (profile).
  3266. Permissions *ProfilePermissions `json:"permissions,omitempty"`
  3267. // SelfLink: Link for this view (profile).
  3268. SelfLink string `json:"selfLink,omitempty"`
  3269. // SiteSearchCategoryParameters: Site search category parameters for
  3270. // this view (profile).
  3271. SiteSearchCategoryParameters string `json:"siteSearchCategoryParameters,omitempty"`
  3272. // SiteSearchQueryParameters: The site search query parameters for this
  3273. // view (profile).
  3274. SiteSearchQueryParameters string `json:"siteSearchQueryParameters,omitempty"`
  3275. // Starred: Indicates whether this view (profile) is starred or not.
  3276. Starred bool `json:"starred,omitempty"`
  3277. // StripSiteSearchCategoryParameters: Whether or not Analytics will
  3278. // strip search category parameters from the URLs in your reports.
  3279. StripSiteSearchCategoryParameters bool `json:"stripSiteSearchCategoryParameters,omitempty"`
  3280. // StripSiteSearchQueryParameters: Whether or not Analytics will strip
  3281. // search query parameters from the URLs in your reports.
  3282. StripSiteSearchQueryParameters bool `json:"stripSiteSearchQueryParameters,omitempty"`
  3283. // Timezone: Time zone for which this view (profile) has been
  3284. // configured. Time zones are identified by strings from the TZ
  3285. // database.
  3286. Timezone string `json:"timezone,omitempty"`
  3287. // Type: View (Profile) type. Supported types: WEB or APP.
  3288. Type string `json:"type,omitempty"`
  3289. // Updated: Time this view (profile) was last modified.
  3290. Updated string `json:"updated,omitempty"`
  3291. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3292. // view (profile) belongs.
  3293. WebPropertyId string `json:"webPropertyId,omitempty"`
  3294. // WebsiteUrl: Website URL for this view (profile).
  3295. WebsiteUrl string `json:"websiteUrl,omitempty"`
  3296. // ServerResponse contains the HTTP response code and headers from the
  3297. // server.
  3298. googleapi.ServerResponse `json:"-"`
  3299. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3300. // unconditionally include in API requests. By default, fields with
  3301. // empty values are omitted from API requests. However, any non-pointer,
  3302. // non-interface field appearing in ForceSendFields will be sent to the
  3303. // server regardless of whether the field is empty or not. This may be
  3304. // used to include empty fields in Patch requests.
  3305. ForceSendFields []string `json:"-"`
  3306. // NullFields is a list of field names (e.g. "AccountId") to include in
  3307. // API requests with the JSON null value. By default, fields with empty
  3308. // values are omitted from API requests. However, any field with an
  3309. // empty value appearing in NullFields will be sent to the server as
  3310. // null. It is an error if a field in this list has a non-empty value.
  3311. // This may be used to include null fields in Patch requests.
  3312. NullFields []string `json:"-"`
  3313. }
  3314. func (s *Profile) MarshalJSON() ([]byte, error) {
  3315. type NoMethod Profile
  3316. raw := NoMethod(*s)
  3317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3318. }
  3319. // ProfileChildLink: Child link for this view (profile). Points to the
  3320. // list of goals for this view (profile).
  3321. type ProfileChildLink struct {
  3322. // Href: Link to the list of goals for this view (profile).
  3323. Href string `json:"href,omitempty"`
  3324. // Type: Value is "analytics#goals".
  3325. Type string `json:"type,omitempty"`
  3326. // ForceSendFields is a list of field names (e.g. "Href") to
  3327. // unconditionally include in API requests. By default, fields with
  3328. // empty values are omitted from API requests. However, any non-pointer,
  3329. // non-interface field appearing in ForceSendFields will be sent to the
  3330. // server regardless of whether the field is empty or not. This may be
  3331. // used to include empty fields in Patch requests.
  3332. ForceSendFields []string `json:"-"`
  3333. // NullFields is a list of field names (e.g. "Href") to include in API
  3334. // requests with the JSON null value. By default, fields with empty
  3335. // values are omitted from API requests. However, any field with an
  3336. // empty value appearing in NullFields will be sent to the server as
  3337. // null. It is an error if a field in this list has a non-empty value.
  3338. // This may be used to include null fields in Patch requests.
  3339. NullFields []string `json:"-"`
  3340. }
  3341. func (s *ProfileChildLink) MarshalJSON() ([]byte, error) {
  3342. type NoMethod ProfileChildLink
  3343. raw := NoMethod(*s)
  3344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3345. }
  3346. // ProfileParentLink: Parent link for this view (profile). Points to the
  3347. // web property to which this view (profile) belongs.
  3348. type ProfileParentLink struct {
  3349. // Href: Link to the web property to which this view (profile) belongs.
  3350. Href string `json:"href,omitempty"`
  3351. // Type: Value is "analytics#webproperty".
  3352. Type string `json:"type,omitempty"`
  3353. // ForceSendFields is a list of field names (e.g. "Href") to
  3354. // unconditionally include in API requests. By default, fields with
  3355. // empty values are omitted from API requests. However, any non-pointer,
  3356. // non-interface field appearing in ForceSendFields will be sent to the
  3357. // server regardless of whether the field is empty or not. This may be
  3358. // used to include empty fields in Patch requests.
  3359. ForceSendFields []string `json:"-"`
  3360. // NullFields is a list of field names (e.g. "Href") to include in API
  3361. // requests with the JSON null value. By default, fields with empty
  3362. // values are omitted from API requests. However, any field with an
  3363. // empty value appearing in NullFields will be sent to the server as
  3364. // null. It is an error if a field in this list has a non-empty value.
  3365. // This may be used to include null fields in Patch requests.
  3366. NullFields []string `json:"-"`
  3367. }
  3368. func (s *ProfileParentLink) MarshalJSON() ([]byte, error) {
  3369. type NoMethod ProfileParentLink
  3370. raw := NoMethod(*s)
  3371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3372. }
  3373. // ProfilePermissions: Permissions the user has for this view (profile).
  3374. type ProfilePermissions struct {
  3375. // Effective: All the permissions that the user has for this view
  3376. // (profile). These include any implied permissions (e.g., EDIT implies
  3377. // VIEW) or inherited permissions from the parent web property.
  3378. Effective []string `json:"effective,omitempty"`
  3379. // ForceSendFields is a list of field names (e.g. "Effective") to
  3380. // unconditionally include in API requests. By default, fields with
  3381. // empty values are omitted from API requests. However, any non-pointer,
  3382. // non-interface field appearing in ForceSendFields will be sent to the
  3383. // server regardless of whether the field is empty or not. This may be
  3384. // used to include empty fields in Patch requests.
  3385. ForceSendFields []string `json:"-"`
  3386. // NullFields is a list of field names (e.g. "Effective") to include in
  3387. // API requests with the JSON null value. By default, fields with empty
  3388. // values are omitted from API requests. However, any field with an
  3389. // empty value appearing in NullFields will be sent to the server as
  3390. // null. It is an error if a field in this list has a non-empty value.
  3391. // This may be used to include null fields in Patch requests.
  3392. NullFields []string `json:"-"`
  3393. }
  3394. func (s *ProfilePermissions) MarshalJSON() ([]byte, error) {
  3395. type NoMethod ProfilePermissions
  3396. raw := NoMethod(*s)
  3397. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3398. }
  3399. // ProfileFilterLink: JSON template for an Analytics profile filter
  3400. // link.
  3401. type ProfileFilterLink struct {
  3402. // FilterRef: Filter for this link.
  3403. FilterRef *FilterRef `json:"filterRef,omitempty"`
  3404. // Id: Profile filter link ID.
  3405. Id string `json:"id,omitempty"`
  3406. // Kind: Resource type for Analytics filter.
  3407. Kind string `json:"kind,omitempty"`
  3408. // ProfileRef: View (Profile) for this link.
  3409. ProfileRef *ProfileRef `json:"profileRef,omitempty"`
  3410. // Rank: The rank of this profile filter link relative to the other
  3411. // filters linked to the same profile.
  3412. // For readonly (i.e., list and get) operations, the rank always starts
  3413. // at 1.
  3414. // For write (i.e., create, update, or delete) operations, you may
  3415. // specify a value between 0 and 255 inclusively, [0, 255]. In order to
  3416. // insert a link at the end of the list, either don't specify a rank or
  3417. // set a rank to a number greater than the largest rank in the list. In
  3418. // order to insert a link to the beginning of the list specify a rank
  3419. // that is less than or equal to 1. The new link will move all existing
  3420. // filters with the same or lower rank down the list. After the link is
  3421. // inserted/updated/deleted all profile filter links will be renumbered
  3422. // starting at 1.
  3423. Rank int64 `json:"rank,omitempty"`
  3424. // SelfLink: Link for this profile filter link.
  3425. SelfLink string `json:"selfLink,omitempty"`
  3426. // ServerResponse contains the HTTP response code and headers from the
  3427. // server.
  3428. googleapi.ServerResponse `json:"-"`
  3429. // ForceSendFields is a list of field names (e.g. "FilterRef") to
  3430. // unconditionally include in API requests. By default, fields with
  3431. // empty values are omitted from API requests. However, any non-pointer,
  3432. // non-interface field appearing in ForceSendFields will be sent to the
  3433. // server regardless of whether the field is empty or not. This may be
  3434. // used to include empty fields in Patch requests.
  3435. ForceSendFields []string `json:"-"`
  3436. // NullFields is a list of field names (e.g. "FilterRef") to include in
  3437. // API requests with the JSON null value. By default, fields with empty
  3438. // values are omitted from API requests. However, any field with an
  3439. // empty value appearing in NullFields will be sent to the server as
  3440. // null. It is an error if a field in this list has a non-empty value.
  3441. // This may be used to include null fields in Patch requests.
  3442. NullFields []string `json:"-"`
  3443. }
  3444. func (s *ProfileFilterLink) MarshalJSON() ([]byte, error) {
  3445. type NoMethod ProfileFilterLink
  3446. raw := NoMethod(*s)
  3447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3448. }
  3449. // ProfileFilterLinks: A profile filter link collection lists profile
  3450. // filter links between profiles and filters. Each resource in the
  3451. // collection corresponds to a profile filter link.
  3452. type ProfileFilterLinks struct {
  3453. // Items: A list of profile filter links.
  3454. Items []*ProfileFilterLink `json:"items,omitempty"`
  3455. // ItemsPerPage: The maximum number of resources the response can
  3456. // contain, regardless of the actual number of resources returned. Its
  3457. // value ranges from 1 to 1,000 with a value of 1000 by default, or
  3458. // otherwise specified by the max-results query parameter.
  3459. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3460. // Kind: Collection type.
  3461. Kind string `json:"kind,omitempty"`
  3462. // NextLink: Link to next page for this profile filter link collection.
  3463. NextLink string `json:"nextLink,omitempty"`
  3464. // PreviousLink: Link to previous page for this profile filter link
  3465. // collection.
  3466. PreviousLink string `json:"previousLink,omitempty"`
  3467. // StartIndex: The starting index of the resources, which is 1 by
  3468. // default or otherwise specified by the start-index query parameter.
  3469. StartIndex int64 `json:"startIndex,omitempty"`
  3470. // TotalResults: The total number of results for the query, regardless
  3471. // of the number of results in the response.
  3472. TotalResults int64 `json:"totalResults,omitempty"`
  3473. // Username: Email ID of the authenticated user
  3474. Username string `json:"username,omitempty"`
  3475. // ServerResponse contains the HTTP response code and headers from the
  3476. // server.
  3477. googleapi.ServerResponse `json:"-"`
  3478. // ForceSendFields is a list of field names (e.g. "Items") to
  3479. // unconditionally include in API requests. By default, fields with
  3480. // empty values are omitted from API requests. However, any non-pointer,
  3481. // non-interface field appearing in ForceSendFields will be sent to the
  3482. // server regardless of whether the field is empty or not. This may be
  3483. // used to include empty fields in Patch requests.
  3484. ForceSendFields []string `json:"-"`
  3485. // NullFields is a list of field names (e.g. "Items") to include in API
  3486. // requests with the JSON null value. By default, fields with empty
  3487. // values are omitted from API requests. However, any field with an
  3488. // empty value appearing in NullFields will be sent to the server as
  3489. // null. It is an error if a field in this list has a non-empty value.
  3490. // This may be used to include null fields in Patch requests.
  3491. NullFields []string `json:"-"`
  3492. }
  3493. func (s *ProfileFilterLinks) MarshalJSON() ([]byte, error) {
  3494. type NoMethod ProfileFilterLinks
  3495. raw := NoMethod(*s)
  3496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3497. }
  3498. // ProfileRef: JSON template for a linked view (profile).
  3499. type ProfileRef struct {
  3500. // AccountId: Account ID to which this view (profile) belongs.
  3501. AccountId string `json:"accountId,omitempty"`
  3502. // Href: Link for this view (profile).
  3503. Href string `json:"href,omitempty"`
  3504. // Id: View (Profile) ID.
  3505. Id string `json:"id,omitempty"`
  3506. // InternalWebPropertyId: Internal ID for the web property to which this
  3507. // view (profile) belongs.
  3508. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3509. // Kind: Analytics view (profile) reference.
  3510. Kind string `json:"kind,omitempty"`
  3511. // Name: Name of this view (profile).
  3512. Name string `json:"name,omitempty"`
  3513. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3514. // view (profile) belongs.
  3515. WebPropertyId string `json:"webPropertyId,omitempty"`
  3516. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3517. // unconditionally include in API requests. By default, fields with
  3518. // empty values are omitted from API requests. However, any non-pointer,
  3519. // non-interface field appearing in ForceSendFields will be sent to the
  3520. // server regardless of whether the field is empty or not. This may be
  3521. // used to include empty fields in Patch requests.
  3522. ForceSendFields []string `json:"-"`
  3523. // NullFields is a list of field names (e.g. "AccountId") to include in
  3524. // API requests with the JSON null value. By default, fields with empty
  3525. // values are omitted from API requests. However, any field with an
  3526. // empty value appearing in NullFields will be sent to the server as
  3527. // null. It is an error if a field in this list has a non-empty value.
  3528. // This may be used to include null fields in Patch requests.
  3529. NullFields []string `json:"-"`
  3530. }
  3531. func (s *ProfileRef) MarshalJSON() ([]byte, error) {
  3532. type NoMethod ProfileRef
  3533. raw := NoMethod(*s)
  3534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3535. }
  3536. // ProfileSummary: JSON template for an Analytics ProfileSummary.
  3537. // ProfileSummary returns basic information (i.e., summary) for a
  3538. // profile.
  3539. type ProfileSummary struct {
  3540. // Id: View (profile) ID.
  3541. Id string `json:"id,omitempty"`
  3542. // Kind: Resource type for Analytics ProfileSummary.
  3543. Kind string `json:"kind,omitempty"`
  3544. // Name: View (profile) name.
  3545. Name string `json:"name,omitempty"`
  3546. // Starred: Indicates whether this view (profile) is starred or not.
  3547. Starred bool `json:"starred,omitempty"`
  3548. // Type: View (Profile) type. Supported types: WEB or APP.
  3549. Type string `json:"type,omitempty"`
  3550. // ForceSendFields is a list of field names (e.g. "Id") to
  3551. // unconditionally include in API requests. By default, fields with
  3552. // empty values are omitted from API requests. However, any non-pointer,
  3553. // non-interface field appearing in ForceSendFields will be sent to the
  3554. // server regardless of whether the field is empty or not. This may be
  3555. // used to include empty fields in Patch requests.
  3556. ForceSendFields []string `json:"-"`
  3557. // NullFields is a list of field names (e.g. "Id") to include in API
  3558. // requests with the JSON null value. By default, fields with empty
  3559. // values are omitted from API requests. However, any field with an
  3560. // empty value appearing in NullFields will be sent to the server as
  3561. // null. It is an error if a field in this list has a non-empty value.
  3562. // This may be used to include null fields in Patch requests.
  3563. NullFields []string `json:"-"`
  3564. }
  3565. func (s *ProfileSummary) MarshalJSON() ([]byte, error) {
  3566. type NoMethod ProfileSummary
  3567. raw := NoMethod(*s)
  3568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3569. }
  3570. // Profiles: A view (profile) collection lists Analytics views
  3571. // (profiles) to which the user has access. Each resource in the
  3572. // collection corresponds to a single Analytics view (profile).
  3573. type Profiles struct {
  3574. // Items: A list of views (profiles).
  3575. Items []*Profile `json:"items,omitempty"`
  3576. // ItemsPerPage: The maximum number of resources the response can
  3577. // contain, regardless of the actual number of resources returned. Its
  3578. // value ranges from 1 to 1000 with a value of 1000 by default, or
  3579. // otherwise specified by the max-results query parameter.
  3580. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3581. // Kind: Collection type.
  3582. Kind string `json:"kind,omitempty"`
  3583. // NextLink: Link to next page for this view (profile) collection.
  3584. NextLink string `json:"nextLink,omitempty"`
  3585. // PreviousLink: Link to previous page for this view (profile)
  3586. // collection.
  3587. PreviousLink string `json:"previousLink,omitempty"`
  3588. // StartIndex: The starting index of the resources, which is 1 by
  3589. // default or otherwise specified by the start-index query parameter.
  3590. StartIndex int64 `json:"startIndex,omitempty"`
  3591. // TotalResults: The total number of results for the query, regardless
  3592. // of the number of results in the response.
  3593. TotalResults int64 `json:"totalResults,omitempty"`
  3594. // Username: Email ID of the authenticated user
  3595. Username string `json:"username,omitempty"`
  3596. // ServerResponse contains the HTTP response code and headers from the
  3597. // server.
  3598. googleapi.ServerResponse `json:"-"`
  3599. // ForceSendFields is a list of field names (e.g. "Items") to
  3600. // unconditionally include in API requests. By default, fields with
  3601. // empty values are omitted from API requests. However, any non-pointer,
  3602. // non-interface field appearing in ForceSendFields will be sent to the
  3603. // server regardless of whether the field is empty or not. This may be
  3604. // used to include empty fields in Patch requests.
  3605. ForceSendFields []string `json:"-"`
  3606. // NullFields is a list of field names (e.g. "Items") to include in API
  3607. // requests with the JSON null value. By default, fields with empty
  3608. // values are omitted from API requests. However, any field with an
  3609. // empty value appearing in NullFields will be sent to the server as
  3610. // null. It is an error if a field in this list has a non-empty value.
  3611. // This may be used to include null fields in Patch requests.
  3612. NullFields []string `json:"-"`
  3613. }
  3614. func (s *Profiles) MarshalJSON() ([]byte, error) {
  3615. type NoMethod Profiles
  3616. raw := NoMethod(*s)
  3617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3618. }
  3619. // RealtimeData: Real time data for a given view (profile).
  3620. type RealtimeData struct {
  3621. // ColumnHeaders: Column headers that list dimension names followed by
  3622. // the metric names. The order of dimensions and metrics is same as
  3623. // specified in the request.
  3624. ColumnHeaders []*RealtimeDataColumnHeaders `json:"columnHeaders,omitempty"`
  3625. // Id: Unique ID for this data response.
  3626. Id string `json:"id,omitempty"`
  3627. // Kind: Resource type.
  3628. Kind string `json:"kind,omitempty"`
  3629. // ProfileInfo: Information for the view (profile), for which the real
  3630. // time data was requested.
  3631. ProfileInfo *RealtimeDataProfileInfo `json:"profileInfo,omitempty"`
  3632. // Query: Real time data request query parameters.
  3633. Query *RealtimeDataQuery `json:"query,omitempty"`
  3634. // Rows: Real time data rows, where each row contains a list of
  3635. // dimension values followed by the metric values. The order of
  3636. // dimensions and metrics is same as specified in the request.
  3637. Rows [][]string `json:"rows,omitempty"`
  3638. // SelfLink: Link to this page.
  3639. SelfLink string `json:"selfLink,omitempty"`
  3640. // TotalResults: The total number of rows for the query, regardless of
  3641. // the number of rows in the response.
  3642. TotalResults int64 `json:"totalResults,omitempty"`
  3643. // TotalsForAllResults: Total values for the requested metrics over all
  3644. // the results, not just the results returned in this response. The
  3645. // order of the metric totals is same as the metric order specified in
  3646. // the request.
  3647. TotalsForAllResults map[string]string `json:"totalsForAllResults,omitempty"`
  3648. // ServerResponse contains the HTTP response code and headers from the
  3649. // server.
  3650. googleapi.ServerResponse `json:"-"`
  3651. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  3652. // unconditionally include in API requests. By default, fields with
  3653. // empty values are omitted from API requests. However, any non-pointer,
  3654. // non-interface field appearing in ForceSendFields will be sent to the
  3655. // server regardless of whether the field is empty or not. This may be
  3656. // used to include empty fields in Patch requests.
  3657. ForceSendFields []string `json:"-"`
  3658. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  3659. // in API requests with the JSON null value. By default, fields with
  3660. // empty values are omitted from API requests. However, any field with
  3661. // an empty value appearing in NullFields will be sent to the server as
  3662. // null. It is an error if a field in this list has a non-empty value.
  3663. // This may be used to include null fields in Patch requests.
  3664. NullFields []string `json:"-"`
  3665. }
  3666. func (s *RealtimeData) MarshalJSON() ([]byte, error) {
  3667. type NoMethod RealtimeData
  3668. raw := NoMethod(*s)
  3669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3670. }
  3671. type RealtimeDataColumnHeaders struct {
  3672. // ColumnType: Column Type. Either DIMENSION or METRIC.
  3673. ColumnType string `json:"columnType,omitempty"`
  3674. // DataType: Data type. Dimension column headers have only STRING as the
  3675. // data type. Metric column headers have data types for metric values
  3676. // such as INTEGER, DOUBLE, CURRENCY etc.
  3677. DataType string `json:"dataType,omitempty"`
  3678. // Name: Column name.
  3679. Name string `json:"name,omitempty"`
  3680. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  3681. // unconditionally include in API requests. By default, fields with
  3682. // empty values are omitted from API requests. However, any non-pointer,
  3683. // non-interface field appearing in ForceSendFields will be sent to the
  3684. // server regardless of whether the field is empty or not. This may be
  3685. // used to include empty fields in Patch requests.
  3686. ForceSendFields []string `json:"-"`
  3687. // NullFields is a list of field names (e.g. "ColumnType") to include in
  3688. // API requests with the JSON null value. By default, fields with empty
  3689. // values are omitted from API requests. However, any field with an
  3690. // empty value appearing in NullFields will be sent to the server as
  3691. // null. It is an error if a field in this list has a non-empty value.
  3692. // This may be used to include null fields in Patch requests.
  3693. NullFields []string `json:"-"`
  3694. }
  3695. func (s *RealtimeDataColumnHeaders) MarshalJSON() ([]byte, error) {
  3696. type NoMethod RealtimeDataColumnHeaders
  3697. raw := NoMethod(*s)
  3698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3699. }
  3700. // RealtimeDataProfileInfo: Information for the view (profile), for
  3701. // which the real time data was requested.
  3702. type RealtimeDataProfileInfo struct {
  3703. // AccountId: Account ID to which this view (profile) belongs.
  3704. AccountId string `json:"accountId,omitempty"`
  3705. // InternalWebPropertyId: Internal ID for the web property to which this
  3706. // view (profile) belongs.
  3707. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3708. // ProfileId: View (Profile) ID.
  3709. ProfileId string `json:"profileId,omitempty"`
  3710. // ProfileName: View (Profile) name.
  3711. ProfileName string `json:"profileName,omitempty"`
  3712. // TableId: Table ID for view (profile).
  3713. TableId string `json:"tableId,omitempty"`
  3714. // WebPropertyId: Web Property ID to which this view (profile) belongs.
  3715. WebPropertyId string `json:"webPropertyId,omitempty"`
  3716. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3717. // unconditionally include in API requests. By default, fields with
  3718. // empty values are omitted from API requests. However, any non-pointer,
  3719. // non-interface field appearing in ForceSendFields will be sent to the
  3720. // server regardless of whether the field is empty or not. This may be
  3721. // used to include empty fields in Patch requests.
  3722. ForceSendFields []string `json:"-"`
  3723. // NullFields is a list of field names (e.g. "AccountId") to include in
  3724. // API requests with the JSON null value. By default, fields with empty
  3725. // values are omitted from API requests. However, any field with an
  3726. // empty value appearing in NullFields will be sent to the server as
  3727. // null. It is an error if a field in this list has a non-empty value.
  3728. // This may be used to include null fields in Patch requests.
  3729. NullFields []string `json:"-"`
  3730. }
  3731. func (s *RealtimeDataProfileInfo) MarshalJSON() ([]byte, error) {
  3732. type NoMethod RealtimeDataProfileInfo
  3733. raw := NoMethod(*s)
  3734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3735. }
  3736. // RealtimeDataQuery: Real time data request query parameters.
  3737. type RealtimeDataQuery struct {
  3738. // Dimensions: List of real time dimensions.
  3739. Dimensions string `json:"dimensions,omitempty"`
  3740. // Filters: Comma-separated list of dimension or metric filters.
  3741. Filters string `json:"filters,omitempty"`
  3742. // Ids: Unique table ID.
  3743. Ids string `json:"ids,omitempty"`
  3744. // MaxResults: Maximum results per page.
  3745. MaxResults int64 `json:"max-results,omitempty"`
  3746. // Metrics: List of real time metrics.
  3747. Metrics []string `json:"metrics,omitempty"`
  3748. // Sort: List of dimensions or metrics based on which real time data is
  3749. // sorted.
  3750. Sort []string `json:"sort,omitempty"`
  3751. // ForceSendFields is a list of field names (e.g. "Dimensions") 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. "Dimensions") 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 *RealtimeDataQuery) MarshalJSON() ([]byte, error) {
  3767. type NoMethod RealtimeDataQuery
  3768. raw := NoMethod(*s)
  3769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3770. }
  3771. // RemarketingAudience: JSON template for an Analytics remarketing
  3772. // audience.
  3773. type RemarketingAudience struct {
  3774. // AccountId: Account ID to which this remarketing audience belongs.
  3775. AccountId string `json:"accountId,omitempty"`
  3776. // AudienceDefinition: The simple audience definition that will cause a
  3777. // user to be added to an audience.
  3778. AudienceDefinition *RemarketingAudienceAudienceDefinition `json:"audienceDefinition,omitempty"`
  3779. // AudienceType: The type of audience, either SIMPLE or STATE_BASED.
  3780. AudienceType string `json:"audienceType,omitempty"`
  3781. // Created: Time this remarketing audience was created.
  3782. Created string `json:"created,omitempty"`
  3783. // Description: The description of this remarketing audience.
  3784. Description string `json:"description,omitempty"`
  3785. // Id: Remarketing Audience ID.
  3786. Id string `json:"id,omitempty"`
  3787. // InternalWebPropertyId: Internal ID for the web property to which this
  3788. // remarketing audience belongs.
  3789. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  3790. // Kind: Collection type.
  3791. Kind string `json:"kind,omitempty"`
  3792. // LinkedAdAccounts: The linked ad accounts associated with this
  3793. // remarketing audience. A remarketing audience can have only one
  3794. // linkedAdAccount currently.
  3795. LinkedAdAccounts []*LinkedForeignAccount `json:"linkedAdAccounts,omitempty"`
  3796. // LinkedViews: The views (profiles) that this remarketing audience is
  3797. // linked to.
  3798. LinkedViews []string `json:"linkedViews,omitempty"`
  3799. // Name: The name of this remarketing audience.
  3800. Name string `json:"name,omitempty"`
  3801. // StateBasedAudienceDefinition: A state based audience definition that
  3802. // will cause a user to be added or removed from an audience.
  3803. StateBasedAudienceDefinition *RemarketingAudienceStateBasedAudienceDefinition `json:"stateBasedAudienceDefinition,omitempty"`
  3804. // Updated: Time this remarketing audience was last modified.
  3805. Updated string `json:"updated,omitempty"`
  3806. // WebPropertyId: Web property ID of the form UA-XXXXX-YY to which this
  3807. // remarketing audience belongs.
  3808. WebPropertyId string `json:"webPropertyId,omitempty"`
  3809. // ServerResponse contains the HTTP response code and headers from the
  3810. // server.
  3811. googleapi.ServerResponse `json:"-"`
  3812. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3813. // unconditionally include in API requests. By default, fields with
  3814. // empty values are omitted from API requests. However, any non-pointer,
  3815. // non-interface field appearing in ForceSendFields will be sent to the
  3816. // server regardless of whether the field is empty or not. This may be
  3817. // used to include empty fields in Patch requests.
  3818. ForceSendFields []string `json:"-"`
  3819. // NullFields is a list of field names (e.g. "AccountId") to include in
  3820. // API requests with the JSON null value. By default, fields with empty
  3821. // values are omitted from API requests. However, any field with an
  3822. // empty value appearing in NullFields will be sent to the server as
  3823. // null. It is an error if a field in this list has a non-empty value.
  3824. // This may be used to include null fields in Patch requests.
  3825. NullFields []string `json:"-"`
  3826. }
  3827. func (s *RemarketingAudience) MarshalJSON() ([]byte, error) {
  3828. type NoMethod RemarketingAudience
  3829. raw := NoMethod(*s)
  3830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3831. }
  3832. // RemarketingAudienceAudienceDefinition: The simple audience definition
  3833. // that will cause a user to be added to an audience.
  3834. type RemarketingAudienceAudienceDefinition struct {
  3835. // IncludeConditions: Defines the conditions to include users to the
  3836. // audience.
  3837. IncludeConditions *IncludeConditions `json:"includeConditions,omitempty"`
  3838. // ForceSendFields is a list of field names (e.g. "IncludeConditions")
  3839. // to unconditionally include in API requests. By default, fields with
  3840. // empty values are omitted from API requests. However, any non-pointer,
  3841. // non-interface field appearing in ForceSendFields will be sent to the
  3842. // server regardless of whether the field is empty or not. This may be
  3843. // used to include empty fields in Patch requests.
  3844. ForceSendFields []string `json:"-"`
  3845. // NullFields is a list of field names (e.g. "IncludeConditions") to
  3846. // include in API requests with the JSON null value. By default, fields
  3847. // with empty values are omitted from API requests. However, any field
  3848. // with an empty value appearing in NullFields will be sent to the
  3849. // server as null. It is an error if a field in this list has a
  3850. // non-empty value. This may be used to include null fields in Patch
  3851. // requests.
  3852. NullFields []string `json:"-"`
  3853. }
  3854. func (s *RemarketingAudienceAudienceDefinition) MarshalJSON() ([]byte, error) {
  3855. type NoMethod RemarketingAudienceAudienceDefinition
  3856. raw := NoMethod(*s)
  3857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3858. }
  3859. // RemarketingAudienceStateBasedAudienceDefinition: A state based
  3860. // audience definition that will cause a user to be added or removed
  3861. // from an audience.
  3862. type RemarketingAudienceStateBasedAudienceDefinition struct {
  3863. // ExcludeConditions: Defines the conditions to exclude users from the
  3864. // audience.
  3865. ExcludeConditions *RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions `json:"excludeConditions,omitempty"`
  3866. // IncludeConditions: Defines the conditions to include users to the
  3867. // audience.
  3868. IncludeConditions *IncludeConditions `json:"includeConditions,omitempty"`
  3869. // ForceSendFields is a list of field names (e.g. "ExcludeConditions")
  3870. // to unconditionally include in API requests. By default, fields with
  3871. // empty values are omitted from API requests. However, any non-pointer,
  3872. // non-interface field appearing in ForceSendFields will be sent to the
  3873. // server regardless of whether the field is empty or not. This may be
  3874. // used to include empty fields in Patch requests.
  3875. ForceSendFields []string `json:"-"`
  3876. // NullFields is a list of field names (e.g. "ExcludeConditions") to
  3877. // include in API requests with the JSON null value. By default, fields
  3878. // with empty values are omitted from API requests. However, any field
  3879. // with an empty value appearing in NullFields will be sent to the
  3880. // server as null. It is an error if a field in this list has a
  3881. // non-empty value. This may be used to include null fields in Patch
  3882. // requests.
  3883. NullFields []string `json:"-"`
  3884. }
  3885. func (s *RemarketingAudienceStateBasedAudienceDefinition) MarshalJSON() ([]byte, error) {
  3886. type NoMethod RemarketingAudienceStateBasedAudienceDefinition
  3887. raw := NoMethod(*s)
  3888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3889. }
  3890. // RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions:
  3891. // Defines the conditions to exclude users from the audience.
  3892. type RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions struct {
  3893. // ExclusionDuration: Whether to make the exclusion TEMPORARY or
  3894. // PERMANENT.
  3895. ExclusionDuration string `json:"exclusionDuration,omitempty"`
  3896. // Segment: The segment condition that will cause a user to be removed
  3897. // from an audience.
  3898. Segment string `json:"segment,omitempty"`
  3899. // ForceSendFields is a list of field names (e.g. "ExclusionDuration")
  3900. // to unconditionally include in API requests. By default, fields with
  3901. // empty values are omitted from API requests. However, any non-pointer,
  3902. // non-interface field appearing in ForceSendFields will be sent to the
  3903. // server regardless of whether the field is empty or not. This may be
  3904. // used to include empty fields in Patch requests.
  3905. ForceSendFields []string `json:"-"`
  3906. // NullFields is a list of field names (e.g. "ExclusionDuration") to
  3907. // include in API requests with the JSON null value. By default, fields
  3908. // with empty values are omitted from API requests. However, any field
  3909. // with an empty value appearing in NullFields will be sent to the
  3910. // server as null. It is an error if a field in this list has a
  3911. // non-empty value. This may be used to include null fields in Patch
  3912. // requests.
  3913. NullFields []string `json:"-"`
  3914. }
  3915. func (s *RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions) MarshalJSON() ([]byte, error) {
  3916. type NoMethod RemarketingAudienceStateBasedAudienceDefinitionExcludeConditions
  3917. raw := NoMethod(*s)
  3918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3919. }
  3920. // RemarketingAudiences: A remarketing audience collection lists
  3921. // Analytics remarketing audiences to which the user has access. Each
  3922. // resource in the collection corresponds to a single Analytics
  3923. // remarketing audience.
  3924. type RemarketingAudiences struct {
  3925. // Items: A list of remarketing audiences.
  3926. Items []*RemarketingAudience `json:"items,omitempty"`
  3927. // ItemsPerPage: The maximum number of resources the response can
  3928. // contain, regardless of the actual number of resources returned. Its
  3929. // value ranges from 1 to 1000 with a value of 1000 by default, or
  3930. // otherwise specified by the max-results query parameter.
  3931. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  3932. // Kind: Collection type.
  3933. Kind string `json:"kind,omitempty"`
  3934. // NextLink: Link to next page for this remarketing audience collection.
  3935. NextLink string `json:"nextLink,omitempty"`
  3936. // PreviousLink: Link to previous page for this view (profile)
  3937. // collection.
  3938. PreviousLink string `json:"previousLink,omitempty"`
  3939. // StartIndex: The starting index of the resources, which is 1 by
  3940. // default or otherwise specified by the start-index query parameter.
  3941. StartIndex int64 `json:"startIndex,omitempty"`
  3942. // TotalResults: The total number of results for the query, regardless
  3943. // of the number of results in the response.
  3944. TotalResults int64 `json:"totalResults,omitempty"`
  3945. // Username: Email ID of the authenticated user
  3946. Username string `json:"username,omitempty"`
  3947. // ServerResponse contains the HTTP response code and headers from the
  3948. // server.
  3949. googleapi.ServerResponse `json:"-"`
  3950. // ForceSendFields is a list of field names (e.g. "Items") to
  3951. // unconditionally include in API requests. By default, fields with
  3952. // empty values are omitted from API requests. However, any non-pointer,
  3953. // non-interface field appearing in ForceSendFields will be sent to the
  3954. // server regardless of whether the field is empty or not. This may be
  3955. // used to include empty fields in Patch requests.
  3956. ForceSendFields []string `json:"-"`
  3957. // NullFields is a list of field names (e.g. "Items") to include in API
  3958. // requests with the JSON null value. By default, fields with empty
  3959. // values are omitted from API requests. However, any field with an
  3960. // empty value appearing in NullFields will be sent to the server as
  3961. // null. It is an error if a field in this list has a non-empty value.
  3962. // This may be used to include null fields in Patch requests.
  3963. NullFields []string `json:"-"`
  3964. }
  3965. func (s *RemarketingAudiences) MarshalJSON() ([]byte, error) {
  3966. type NoMethod RemarketingAudiences
  3967. raw := NoMethod(*s)
  3968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3969. }
  3970. // Segment: JSON template for an Analytics segment.
  3971. type Segment struct {
  3972. // Created: Time the segment was created.
  3973. Created string `json:"created,omitempty"`
  3974. // Definition: Segment definition.
  3975. Definition string `json:"definition,omitempty"`
  3976. // Id: Segment ID.
  3977. Id string `json:"id,omitempty"`
  3978. // Kind: Resource type for Analytics segment.
  3979. Kind string `json:"kind,omitempty"`
  3980. // Name: Segment name.
  3981. Name string `json:"name,omitempty"`
  3982. // SegmentId: Segment ID. Can be used with the 'segment' parameter in
  3983. // Core Reporting API.
  3984. SegmentId string `json:"segmentId,omitempty"`
  3985. // SelfLink: Link for this segment.
  3986. SelfLink string `json:"selfLink,omitempty"`
  3987. // Type: Type for a segment. Possible values are "BUILT_IN" or "CUSTOM".
  3988. Type string `json:"type,omitempty"`
  3989. // Updated: Time the segment was last modified.
  3990. Updated string `json:"updated,omitempty"`
  3991. // ForceSendFields is a list of field names (e.g. "Created") to
  3992. // unconditionally include in API requests. By default, fields with
  3993. // empty values are omitted from API requests. However, any non-pointer,
  3994. // non-interface field appearing in ForceSendFields will be sent to the
  3995. // server regardless of whether the field is empty or not. This may be
  3996. // used to include empty fields in Patch requests.
  3997. ForceSendFields []string `json:"-"`
  3998. // NullFields is a list of field names (e.g. "Created") to include in
  3999. // API requests with the JSON null value. By default, fields with empty
  4000. // values are omitted from API requests. However, any field with an
  4001. // empty value appearing in NullFields will be sent to the server as
  4002. // null. It is an error if a field in this list has a non-empty value.
  4003. // This may be used to include null fields in Patch requests.
  4004. NullFields []string `json:"-"`
  4005. }
  4006. func (s *Segment) MarshalJSON() ([]byte, error) {
  4007. type NoMethod Segment
  4008. raw := NoMethod(*s)
  4009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4010. }
  4011. // Segments: An segment collection lists Analytics segments that the
  4012. // user has access to. Each resource in the collection corresponds to a
  4013. // single Analytics segment.
  4014. type Segments struct {
  4015. // Items: A list of segments.
  4016. Items []*Segment `json:"items,omitempty"`
  4017. // ItemsPerPage: The maximum number of resources the response can
  4018. // contain, regardless of the actual number of resources returned. Its
  4019. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4020. // otherwise specified by the max-results query parameter.
  4021. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4022. // Kind: Collection type for segments.
  4023. Kind string `json:"kind,omitempty"`
  4024. // NextLink: Link to next page for this segment collection.
  4025. NextLink string `json:"nextLink,omitempty"`
  4026. // PreviousLink: Link to previous page for this segment collection.
  4027. PreviousLink string `json:"previousLink,omitempty"`
  4028. // StartIndex: The starting index of the resources, which is 1 by
  4029. // default or otherwise specified by the start-index query parameter.
  4030. StartIndex int64 `json:"startIndex,omitempty"`
  4031. // TotalResults: The total number of results for the query, regardless
  4032. // of the number of results in the response.
  4033. TotalResults int64 `json:"totalResults,omitempty"`
  4034. // Username: Email ID of the authenticated user
  4035. Username string `json:"username,omitempty"`
  4036. // ServerResponse contains the HTTP response code and headers from the
  4037. // server.
  4038. googleapi.ServerResponse `json:"-"`
  4039. // ForceSendFields is a list of field names (e.g. "Items") to
  4040. // unconditionally include in API requests. By default, fields with
  4041. // empty values are omitted from API requests. However, any non-pointer,
  4042. // non-interface field appearing in ForceSendFields will be sent to the
  4043. // server regardless of whether the field is empty or not. This may be
  4044. // used to include empty fields in Patch requests.
  4045. ForceSendFields []string `json:"-"`
  4046. // NullFields is a list of field names (e.g. "Items") to include in API
  4047. // requests with the JSON null value. By default, fields with empty
  4048. // values are omitted from API requests. However, any field with an
  4049. // empty value appearing in NullFields will be sent to the server as
  4050. // null. It is an error if a field in this list has a non-empty value.
  4051. // This may be used to include null fields in Patch requests.
  4052. NullFields []string `json:"-"`
  4053. }
  4054. func (s *Segments) MarshalJSON() ([]byte, error) {
  4055. type NoMethod Segments
  4056. raw := NoMethod(*s)
  4057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4058. }
  4059. // UnsampledReport: JSON template for Analytics unsampled report
  4060. // resource.
  4061. type UnsampledReport struct {
  4062. // AccountId: Account ID to which this unsampled report belongs.
  4063. AccountId string `json:"accountId,omitempty"`
  4064. // CloudStorageDownloadDetails: Download details for a file stored in
  4065. // Google Cloud Storage.
  4066. CloudStorageDownloadDetails *UnsampledReportCloudStorageDownloadDetails `json:"cloudStorageDownloadDetails,omitempty"`
  4067. // Created: Time this unsampled report was created.
  4068. Created string `json:"created,omitempty"`
  4069. // Dimensions: The dimensions for the unsampled report.
  4070. Dimensions string `json:"dimensions,omitempty"`
  4071. // DownloadType: The type of download you need to use for the report
  4072. // data file. Possible values include `GOOGLE_DRIVE` and
  4073. // `GOOGLE_CLOUD_STORAGE`. If the value is `GOOGLE_DRIVE`, see the
  4074. // `driveDownloadDetails` field. If the value is `GOOGLE_CLOUD_STORAGE`,
  4075. // see the `cloudStorageDownloadDetails` field.
  4076. DownloadType string `json:"downloadType,omitempty"`
  4077. // DriveDownloadDetails: Download details for a file stored in Google
  4078. // Drive.
  4079. DriveDownloadDetails *UnsampledReportDriveDownloadDetails `json:"driveDownloadDetails,omitempty"`
  4080. // EndDate: The end date for the unsampled report.
  4081. EndDate string `json:"end-date,omitempty"`
  4082. // Filters: The filters for the unsampled report.
  4083. Filters string `json:"filters,omitempty"`
  4084. // Id: Unsampled report ID.
  4085. Id string `json:"id,omitempty"`
  4086. // Kind: Resource type for an Analytics unsampled report.
  4087. Kind string `json:"kind,omitempty"`
  4088. // Metrics: The metrics for the unsampled report.
  4089. Metrics string `json:"metrics,omitempty"`
  4090. // ProfileId: View (Profile) ID to which this unsampled report belongs.
  4091. ProfileId string `json:"profileId,omitempty"`
  4092. // Segment: The segment for the unsampled report.
  4093. Segment string `json:"segment,omitempty"`
  4094. // SelfLink: Link for this unsampled report.
  4095. SelfLink string `json:"selfLink,omitempty"`
  4096. // StartDate: The start date for the unsampled report.
  4097. StartDate string `json:"start-date,omitempty"`
  4098. // Status: Status of this unsampled report. Possible values are PENDING,
  4099. // COMPLETED, or FAILED.
  4100. Status string `json:"status,omitempty"`
  4101. // Title: Title of the unsampled report.
  4102. Title string `json:"title,omitempty"`
  4103. // Updated: Time this unsampled report was last modified.
  4104. Updated string `json:"updated,omitempty"`
  4105. // WebPropertyId: Web property ID to which this unsampled report
  4106. // belongs. The web property ID is of the form UA-XXXXX-YY.
  4107. WebPropertyId string `json:"webPropertyId,omitempty"`
  4108. // ServerResponse contains the HTTP response code and headers from the
  4109. // server.
  4110. googleapi.ServerResponse `json:"-"`
  4111. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4112. // unconditionally include in API requests. By default, fields with
  4113. // empty values are omitted from API requests. However, any non-pointer,
  4114. // non-interface field appearing in ForceSendFields will be sent to the
  4115. // server regardless of whether the field is empty or not. This may be
  4116. // used to include empty fields in Patch requests.
  4117. ForceSendFields []string `json:"-"`
  4118. // NullFields is a list of field names (e.g. "AccountId") to include in
  4119. // API requests with the JSON null value. By default, fields with empty
  4120. // values are omitted from API requests. However, any field with an
  4121. // empty value appearing in NullFields will be sent to the server as
  4122. // null. It is an error if a field in this list has a non-empty value.
  4123. // This may be used to include null fields in Patch requests.
  4124. NullFields []string `json:"-"`
  4125. }
  4126. func (s *UnsampledReport) MarshalJSON() ([]byte, error) {
  4127. type NoMethod UnsampledReport
  4128. raw := NoMethod(*s)
  4129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4130. }
  4131. // UnsampledReportCloudStorageDownloadDetails: Download details for a
  4132. // file stored in Google Cloud Storage.
  4133. type UnsampledReportCloudStorageDownloadDetails struct {
  4134. // BucketId: Id of the bucket the file object is stored in.
  4135. BucketId string `json:"bucketId,omitempty"`
  4136. // ObjectId: Id of the file object containing the report data.
  4137. ObjectId string `json:"objectId,omitempty"`
  4138. // ForceSendFields is a list of field names (e.g. "BucketId") to
  4139. // unconditionally include in API requests. By default, fields with
  4140. // empty values are omitted from API requests. However, any non-pointer,
  4141. // non-interface field appearing in ForceSendFields will be sent to the
  4142. // server regardless of whether the field is empty or not. This may be
  4143. // used to include empty fields in Patch requests.
  4144. ForceSendFields []string `json:"-"`
  4145. // NullFields is a list of field names (e.g. "BucketId") to include in
  4146. // API requests with the JSON null value. By default, fields with empty
  4147. // values are omitted from API requests. However, any field with an
  4148. // empty value appearing in NullFields will be sent to the server as
  4149. // null. It is an error if a field in this list has a non-empty value.
  4150. // This may be used to include null fields in Patch requests.
  4151. NullFields []string `json:"-"`
  4152. }
  4153. func (s *UnsampledReportCloudStorageDownloadDetails) MarshalJSON() ([]byte, error) {
  4154. type NoMethod UnsampledReportCloudStorageDownloadDetails
  4155. raw := NoMethod(*s)
  4156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4157. }
  4158. // UnsampledReportDriveDownloadDetails: Download details for a file
  4159. // stored in Google Drive.
  4160. type UnsampledReportDriveDownloadDetails struct {
  4161. // DocumentId: Id of the document/file containing the report data.
  4162. DocumentId string `json:"documentId,omitempty"`
  4163. // ForceSendFields is a list of field names (e.g. "DocumentId") to
  4164. // unconditionally include in API requests. By default, fields with
  4165. // empty values are omitted from API requests. However, any non-pointer,
  4166. // non-interface field appearing in ForceSendFields will be sent to the
  4167. // server regardless of whether the field is empty or not. This may be
  4168. // used to include empty fields in Patch requests.
  4169. ForceSendFields []string `json:"-"`
  4170. // NullFields is a list of field names (e.g. "DocumentId") to include in
  4171. // API requests with the JSON null value. By default, fields with empty
  4172. // values are omitted from API requests. However, any field with an
  4173. // empty value appearing in NullFields will be sent to the server as
  4174. // null. It is an error if a field in this list has a non-empty value.
  4175. // This may be used to include null fields in Patch requests.
  4176. NullFields []string `json:"-"`
  4177. }
  4178. func (s *UnsampledReportDriveDownloadDetails) MarshalJSON() ([]byte, error) {
  4179. type NoMethod UnsampledReportDriveDownloadDetails
  4180. raw := NoMethod(*s)
  4181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4182. }
  4183. // UnsampledReports: An unsampled report collection lists Analytics
  4184. // unsampled reports to which the user has access. Each view (profile)
  4185. // can have a set of unsampled reports. Each resource in the unsampled
  4186. // report collection corresponds to a single Analytics unsampled report.
  4187. type UnsampledReports struct {
  4188. // Items: A list of unsampled reports.
  4189. Items []*UnsampledReport `json:"items,omitempty"`
  4190. // ItemsPerPage: The maximum number of resources the response can
  4191. // contain, regardless of the actual number of resources returned. Its
  4192. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4193. // otherwise specified by the max-results query parameter.
  4194. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4195. // Kind: Collection type.
  4196. Kind string `json:"kind,omitempty"`
  4197. // NextLink: Link to next page for this unsampled report collection.
  4198. NextLink string `json:"nextLink,omitempty"`
  4199. // PreviousLink: Link to previous page for this unsampled report
  4200. // collection.
  4201. PreviousLink string `json:"previousLink,omitempty"`
  4202. // StartIndex: The starting index of the resources, which is 1 by
  4203. // default or otherwise specified by the start-index query parameter.
  4204. StartIndex int64 `json:"startIndex,omitempty"`
  4205. // TotalResults: The total number of results for the query, regardless
  4206. // of the number of resources in the result.
  4207. TotalResults int64 `json:"totalResults,omitempty"`
  4208. // Username: Email ID of the authenticated user
  4209. Username string `json:"username,omitempty"`
  4210. // ServerResponse contains the HTTP response code and headers from the
  4211. // server.
  4212. googleapi.ServerResponse `json:"-"`
  4213. // ForceSendFields is a list of field names (e.g. "Items") to
  4214. // unconditionally include in API requests. By default, fields with
  4215. // empty values are omitted from API requests. However, any non-pointer,
  4216. // non-interface field appearing in ForceSendFields will be sent to the
  4217. // server regardless of whether the field is empty or not. This may be
  4218. // used to include empty fields in Patch requests.
  4219. ForceSendFields []string `json:"-"`
  4220. // NullFields is a list of field names (e.g. "Items") to include in API
  4221. // requests with the JSON null value. By default, fields with empty
  4222. // values are omitted from API requests. However, any field with an
  4223. // empty value appearing in NullFields will be sent to the server as
  4224. // null. It is an error if a field in this list has a non-empty value.
  4225. // This may be used to include null fields in Patch requests.
  4226. NullFields []string `json:"-"`
  4227. }
  4228. func (s *UnsampledReports) MarshalJSON() ([]byte, error) {
  4229. type NoMethod UnsampledReports
  4230. raw := NoMethod(*s)
  4231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4232. }
  4233. // Upload: Metadata returned for an upload operation.
  4234. type Upload struct {
  4235. // AccountId: Account Id to which this upload belongs.
  4236. AccountId int64 `json:"accountId,omitempty,string"`
  4237. // CustomDataSourceId: Custom data source Id to which this data import
  4238. // belongs.
  4239. CustomDataSourceId string `json:"customDataSourceId,omitempty"`
  4240. // Errors: Data import errors collection.
  4241. Errors []string `json:"errors,omitempty"`
  4242. // Id: A unique ID for this upload.
  4243. Id string `json:"id,omitempty"`
  4244. // Kind: Resource type for Analytics upload.
  4245. Kind string `json:"kind,omitempty"`
  4246. // Status: Upload status. Possible values: PENDING, COMPLETED, FAILED,
  4247. // DELETING, DELETED.
  4248. Status string `json:"status,omitempty"`
  4249. // UploadTime: Time this file is uploaded.
  4250. UploadTime string `json:"uploadTime,omitempty"`
  4251. // ServerResponse contains the HTTP response code and headers from the
  4252. // server.
  4253. googleapi.ServerResponse `json:"-"`
  4254. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4255. // unconditionally include in API requests. By default, fields with
  4256. // empty values are omitted from API requests. However, any non-pointer,
  4257. // non-interface field appearing in ForceSendFields will be sent to the
  4258. // server regardless of whether the field is empty or not. This may be
  4259. // used to include empty fields in Patch requests.
  4260. ForceSendFields []string `json:"-"`
  4261. // NullFields is a list of field names (e.g. "AccountId") to include in
  4262. // API requests with the JSON null value. By default, fields with empty
  4263. // values are omitted from API requests. However, any field with an
  4264. // empty value appearing in NullFields will be sent to the server as
  4265. // null. It is an error if a field in this list has a non-empty value.
  4266. // This may be used to include null fields in Patch requests.
  4267. NullFields []string `json:"-"`
  4268. }
  4269. func (s *Upload) MarshalJSON() ([]byte, error) {
  4270. type NoMethod Upload
  4271. raw := NoMethod(*s)
  4272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4273. }
  4274. // Uploads: Upload collection lists Analytics uploads to which the user
  4275. // has access. Each custom data source can have a set of uploads. Each
  4276. // resource in the upload collection corresponds to a single Analytics
  4277. // data upload.
  4278. type Uploads struct {
  4279. // Items: A list of uploads.
  4280. Items []*Upload `json:"items,omitempty"`
  4281. // ItemsPerPage: The maximum number of resources the response can
  4282. // contain, regardless of the actual number of resources returned. Its
  4283. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4284. // otherwise specified by the max-results query parameter.
  4285. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4286. // Kind: Collection type.
  4287. Kind string `json:"kind,omitempty"`
  4288. // NextLink: Link to next page for this upload collection.
  4289. NextLink string `json:"nextLink,omitempty"`
  4290. // PreviousLink: Link to previous page for this upload collection.
  4291. PreviousLink string `json:"previousLink,omitempty"`
  4292. // StartIndex: The starting index of the resources, which is 1 by
  4293. // default or otherwise specified by the start-index query parameter.
  4294. StartIndex int64 `json:"startIndex,omitempty"`
  4295. // TotalResults: The total number of results for the query, regardless
  4296. // of the number of resources in the result.
  4297. TotalResults int64 `json:"totalResults,omitempty"`
  4298. // ServerResponse contains the HTTP response code and headers from the
  4299. // server.
  4300. googleapi.ServerResponse `json:"-"`
  4301. // ForceSendFields is a list of field names (e.g. "Items") to
  4302. // unconditionally include in API requests. By default, fields with
  4303. // empty values are omitted from API requests. However, any non-pointer,
  4304. // non-interface field appearing in ForceSendFields will be sent to the
  4305. // server regardless of whether the field is empty or not. This may be
  4306. // used to include empty fields in Patch requests.
  4307. ForceSendFields []string `json:"-"`
  4308. // NullFields is a list of field names (e.g. "Items") to include in API
  4309. // requests with the JSON null value. By default, fields with empty
  4310. // values are omitted from API requests. However, any field with an
  4311. // empty value appearing in NullFields will be sent to the server as
  4312. // null. It is an error if a field in this list has a non-empty value.
  4313. // This may be used to include null fields in Patch requests.
  4314. NullFields []string `json:"-"`
  4315. }
  4316. func (s *Uploads) MarshalJSON() ([]byte, error) {
  4317. type NoMethod Uploads
  4318. raw := NoMethod(*s)
  4319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4320. }
  4321. // UserDeletionRequest: JSON template for a user deletion request
  4322. // resource.
  4323. type UserDeletionRequest struct {
  4324. // DeletionRequestTime: This marks the point in time for which all user
  4325. // data before should be deleted
  4326. DeletionRequestTime string `json:"deletionRequestTime,omitempty"`
  4327. // FirebaseProjectId: Firebase Project Id
  4328. FirebaseProjectId string `json:"firebaseProjectId,omitempty"`
  4329. // Id: User ID.
  4330. Id *UserDeletionRequestId `json:"id,omitempty"`
  4331. // Kind: Value is "analytics#userDeletionRequest".
  4332. Kind string `json:"kind,omitempty"`
  4333. // WebPropertyId: Web property ID of the form UA-XXXXX-YY.
  4334. WebPropertyId string `json:"webPropertyId,omitempty"`
  4335. // ServerResponse contains the HTTP response code and headers from the
  4336. // server.
  4337. googleapi.ServerResponse `json:"-"`
  4338. // ForceSendFields is a list of field names (e.g. "DeletionRequestTime")
  4339. // to unconditionally include in API requests. By default, fields with
  4340. // empty values are omitted from API requests. However, any non-pointer,
  4341. // non-interface field appearing in ForceSendFields will be sent to the
  4342. // server regardless of whether the field is empty or not. This may be
  4343. // used to include empty fields in Patch requests.
  4344. ForceSendFields []string `json:"-"`
  4345. // NullFields is a list of field names (e.g. "DeletionRequestTime") to
  4346. // include in API requests with the JSON null value. By default, fields
  4347. // with empty values are omitted from API requests. However, any field
  4348. // with an empty value appearing in NullFields will be sent to the
  4349. // server as null. It is an error if a field in this list has a
  4350. // non-empty value. This may be used to include null fields in Patch
  4351. // requests.
  4352. NullFields []string `json:"-"`
  4353. }
  4354. func (s *UserDeletionRequest) MarshalJSON() ([]byte, error) {
  4355. type NoMethod UserDeletionRequest
  4356. raw := NoMethod(*s)
  4357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4358. }
  4359. // UserDeletionRequestId: User ID.
  4360. type UserDeletionRequestId struct {
  4361. // Type: Type of user
  4362. Type string `json:"type,omitempty"`
  4363. // UserId: The User's id
  4364. UserId string `json:"userId,omitempty"`
  4365. // ForceSendFields is a list of field names (e.g. "Type") to
  4366. // unconditionally include in API requests. By default, fields with
  4367. // empty values are omitted from API requests. However, any non-pointer,
  4368. // non-interface field appearing in ForceSendFields will be sent to the
  4369. // server regardless of whether the field is empty or not. This may be
  4370. // used to include empty fields in Patch requests.
  4371. ForceSendFields []string `json:"-"`
  4372. // NullFields is a list of field names (e.g. "Type") to include in API
  4373. // requests with the JSON null value. By default, fields with empty
  4374. // values are omitted from API requests. However, any field with an
  4375. // empty value appearing in NullFields will be sent to the server as
  4376. // null. It is an error if a field in this list has a non-empty value.
  4377. // This may be used to include null fields in Patch requests.
  4378. NullFields []string `json:"-"`
  4379. }
  4380. func (s *UserDeletionRequestId) MarshalJSON() ([]byte, error) {
  4381. type NoMethod UserDeletionRequestId
  4382. raw := NoMethod(*s)
  4383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4384. }
  4385. // UserRef: JSON template for a user reference.
  4386. type UserRef struct {
  4387. // Email: Email ID of this user.
  4388. Email string `json:"email,omitempty"`
  4389. // Id: User ID.
  4390. Id string `json:"id,omitempty"`
  4391. Kind string `json:"kind,omitempty"`
  4392. // ForceSendFields is a list of field names (e.g. "Email") to
  4393. // unconditionally include in API requests. By default, fields with
  4394. // empty values are omitted from API requests. However, any non-pointer,
  4395. // non-interface field appearing in ForceSendFields will be sent to the
  4396. // server regardless of whether the field is empty or not. This may be
  4397. // used to include empty fields in Patch requests.
  4398. ForceSendFields []string `json:"-"`
  4399. // NullFields is a list of field names (e.g. "Email") to include in API
  4400. // requests with the JSON null value. By default, fields with empty
  4401. // values are omitted from API requests. However, any field with an
  4402. // empty value appearing in NullFields will be sent to the server as
  4403. // null. It is an error if a field in this list has a non-empty value.
  4404. // This may be used to include null fields in Patch requests.
  4405. NullFields []string `json:"-"`
  4406. }
  4407. func (s *UserRef) MarshalJSON() ([]byte, error) {
  4408. type NoMethod UserRef
  4409. raw := NoMethod(*s)
  4410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4411. }
  4412. // WebPropertyRef: JSON template for a web property reference.
  4413. type WebPropertyRef struct {
  4414. // AccountId: Account ID to which this web property belongs.
  4415. AccountId string `json:"accountId,omitempty"`
  4416. // Href: Link for this web property.
  4417. Href string `json:"href,omitempty"`
  4418. // Id: Web property ID of the form UA-XXXXX-YY.
  4419. Id string `json:"id,omitempty"`
  4420. // InternalWebPropertyId: Internal ID for this web property.
  4421. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4422. // Kind: Analytics web property reference.
  4423. Kind string `json:"kind,omitempty"`
  4424. // Name: Name of this web property.
  4425. Name string `json:"name,omitempty"`
  4426. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4427. // unconditionally include in API requests. By default, fields with
  4428. // empty values are omitted from API requests. However, any non-pointer,
  4429. // non-interface field appearing in ForceSendFields will be sent to the
  4430. // server regardless of whether the field is empty or not. This may be
  4431. // used to include empty fields in Patch requests.
  4432. ForceSendFields []string `json:"-"`
  4433. // NullFields is a list of field names (e.g. "AccountId") to include in
  4434. // API requests with the JSON null value. By default, fields with empty
  4435. // values are omitted from API requests. However, any field with an
  4436. // empty value appearing in NullFields will be sent to the server as
  4437. // null. It is an error if a field in this list has a non-empty value.
  4438. // This may be used to include null fields in Patch requests.
  4439. NullFields []string `json:"-"`
  4440. }
  4441. func (s *WebPropertyRef) MarshalJSON() ([]byte, error) {
  4442. type NoMethod WebPropertyRef
  4443. raw := NoMethod(*s)
  4444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4445. }
  4446. // WebPropertySummary: JSON template for an Analytics
  4447. // WebPropertySummary. WebPropertySummary returns basic information
  4448. // (i.e., summary) for a web property.
  4449. type WebPropertySummary struct {
  4450. // Id: Web property ID of the form UA-XXXXX-YY.
  4451. Id string `json:"id,omitempty"`
  4452. // InternalWebPropertyId: Internal ID for this web property.
  4453. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4454. // Kind: Resource type for Analytics WebPropertySummary.
  4455. Kind string `json:"kind,omitempty"`
  4456. // Level: Level for this web property. Possible values are STANDARD or
  4457. // PREMIUM.
  4458. Level string `json:"level,omitempty"`
  4459. // Name: Web property name.
  4460. Name string `json:"name,omitempty"`
  4461. // Profiles: List of profiles under this web property.
  4462. Profiles []*ProfileSummary `json:"profiles,omitempty"`
  4463. // Starred: Indicates whether this web property is starred or not.
  4464. Starred bool `json:"starred,omitempty"`
  4465. // WebsiteUrl: Website url for this web property.
  4466. WebsiteUrl string `json:"websiteUrl,omitempty"`
  4467. // ForceSendFields is a list of field names (e.g. "Id") to
  4468. // unconditionally include in API requests. By default, fields with
  4469. // empty values are omitted from API requests. However, any non-pointer,
  4470. // non-interface field appearing in ForceSendFields will be sent to the
  4471. // server regardless of whether the field is empty or not. This may be
  4472. // used to include empty fields in Patch requests.
  4473. ForceSendFields []string `json:"-"`
  4474. // NullFields is a list of field names (e.g. "Id") to include in API
  4475. // requests with the JSON null value. By default, fields with empty
  4476. // values are omitted from API requests. However, any field with an
  4477. // empty value appearing in NullFields will be sent to the server as
  4478. // null. It is an error if a field in this list has a non-empty value.
  4479. // This may be used to include null fields in Patch requests.
  4480. NullFields []string `json:"-"`
  4481. }
  4482. func (s *WebPropertySummary) MarshalJSON() ([]byte, error) {
  4483. type NoMethod WebPropertySummary
  4484. raw := NoMethod(*s)
  4485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4486. }
  4487. // Webproperties: A web property collection lists Analytics web
  4488. // properties to which the user has access. Each resource in the
  4489. // collection corresponds to a single Analytics web property.
  4490. type Webproperties struct {
  4491. // Items: A list of web properties.
  4492. Items []*Webproperty `json:"items,omitempty"`
  4493. // ItemsPerPage: The maximum number of resources the response can
  4494. // contain, regardless of the actual number of resources returned. Its
  4495. // value ranges from 1 to 1000 with a value of 1000 by default, or
  4496. // otherwise specified by the max-results query parameter.
  4497. ItemsPerPage int64 `json:"itemsPerPage,omitempty"`
  4498. // Kind: Collection type.
  4499. Kind string `json:"kind,omitempty"`
  4500. // NextLink: Link to next page for this web property collection.
  4501. NextLink string `json:"nextLink,omitempty"`
  4502. // PreviousLink: Link to previous page for this web property collection.
  4503. PreviousLink string `json:"previousLink,omitempty"`
  4504. // StartIndex: The starting index of the resources, which is 1 by
  4505. // default or otherwise specified by the start-index query parameter.
  4506. StartIndex int64 `json:"startIndex,omitempty"`
  4507. // TotalResults: The total number of results for the query, regardless
  4508. // of the number of results in the response.
  4509. TotalResults int64 `json:"totalResults,omitempty"`
  4510. // Username: Email ID of the authenticated user
  4511. Username string `json:"username,omitempty"`
  4512. // ServerResponse contains the HTTP response code and headers from the
  4513. // server.
  4514. googleapi.ServerResponse `json:"-"`
  4515. // ForceSendFields is a list of field names (e.g. "Items") to
  4516. // unconditionally include in API requests. By default, fields with
  4517. // empty values are omitted from API requests. However, any non-pointer,
  4518. // non-interface field appearing in ForceSendFields will be sent to the
  4519. // server regardless of whether the field is empty or not. This may be
  4520. // used to include empty fields in Patch requests.
  4521. ForceSendFields []string `json:"-"`
  4522. // NullFields is a list of field names (e.g. "Items") to include in API
  4523. // requests with the JSON null value. By default, fields with empty
  4524. // values are omitted from API requests. However, any field with an
  4525. // empty value appearing in NullFields will be sent to the server as
  4526. // null. It is an error if a field in this list has a non-empty value.
  4527. // This may be used to include null fields in Patch requests.
  4528. NullFields []string `json:"-"`
  4529. }
  4530. func (s *Webproperties) MarshalJSON() ([]byte, error) {
  4531. type NoMethod Webproperties
  4532. raw := NoMethod(*s)
  4533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4534. }
  4535. // Webproperty: JSON template for an Analytics web property.
  4536. type Webproperty struct {
  4537. // AccountId: Account ID to which this web property belongs.
  4538. AccountId string `json:"accountId,omitempty"`
  4539. // ChildLink: Child link for this web property. Points to the list of
  4540. // views (profiles) for this web property.
  4541. ChildLink *WebpropertyChildLink `json:"childLink,omitempty"`
  4542. // Created: Time this web property was created.
  4543. Created string `json:"created,omitempty"`
  4544. // DataRetentionResetOnNewActivity: Set to true to reset the retention
  4545. // period of the user identifier with each new event from that user
  4546. // (thus setting the expiration date to current time plus retention
  4547. // period).
  4548. // Set to false to delete data associated with the user identifer
  4549. // automatically after the rentention period.
  4550. // This property cannot be set on insert.
  4551. DataRetentionResetOnNewActivity bool `json:"dataRetentionResetOnNewActivity,omitempty"`
  4552. // DataRetentionTtl: The length of time for which user and event data is
  4553. // retained.
  4554. // This property cannot be set on insert.
  4555. DataRetentionTtl string `json:"dataRetentionTtl,omitempty"`
  4556. // DefaultProfileId: Default view (profile) ID.
  4557. DefaultProfileId int64 `json:"defaultProfileId,omitempty,string"`
  4558. // Id: Web property ID of the form UA-XXXXX-YY.
  4559. Id string `json:"id,omitempty"`
  4560. // IndustryVertical: The industry vertical/category selected for this
  4561. // web property.
  4562. IndustryVertical string `json:"industryVertical,omitempty"`
  4563. // InternalWebPropertyId: Internal ID for this web property.
  4564. InternalWebPropertyId string `json:"internalWebPropertyId,omitempty"`
  4565. // Kind: Resource type for Analytics WebProperty.
  4566. Kind string `json:"kind,omitempty"`
  4567. // Level: Level for this web property. Possible values are STANDARD or
  4568. // PREMIUM.
  4569. Level string `json:"level,omitempty"`
  4570. // Name: Name of this web property.
  4571. Name string `json:"name,omitempty"`
  4572. // ParentLink: Parent link for this web property. Points to the account
  4573. // to which this web property belongs.
  4574. ParentLink *WebpropertyParentLink `json:"parentLink,omitempty"`
  4575. // Permissions: Permissions the user has for this web property.
  4576. Permissions *WebpropertyPermissions `json:"permissions,omitempty"`
  4577. // ProfileCount: View (Profile) count for this web property.
  4578. ProfileCount int64 `json:"profileCount,omitempty"`
  4579. // SelfLink: Link for this web property.
  4580. SelfLink string `json:"selfLink,omitempty"`
  4581. // Starred: Indicates whether this web property is starred or not.
  4582. Starred bool `json:"starred,omitempty"`
  4583. // Updated: Time this web property was last modified.
  4584. Updated string `json:"updated,omitempty"`
  4585. // WebsiteUrl: Website url for this web property.
  4586. WebsiteUrl string `json:"websiteUrl,omitempty"`
  4587. // ServerResponse contains the HTTP response code and headers from the
  4588. // server.
  4589. googleapi.ServerResponse `json:"-"`
  4590. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4591. // unconditionally include in API requests. By default, fields with
  4592. // empty values are omitted from API requests. However, any non-pointer,
  4593. // non-interface field appearing in ForceSendFields will be sent to the
  4594. // server regardless of whether the field is empty or not. This may be
  4595. // used to include empty fields in Patch requests.
  4596. ForceSendFields []string `json:"-"`
  4597. // NullFields is a list of field names (e.g. "AccountId") to include in
  4598. // API requests with the JSON null value. By default, fields with empty
  4599. // values are omitted from API requests. However, any field with an
  4600. // empty value appearing in NullFields will be sent to the server as
  4601. // null. It is an error if a field in this list has a non-empty value.
  4602. // This may be used to include null fields in Patch requests.
  4603. NullFields []string `json:"-"`
  4604. }
  4605. func (s *Webproperty) MarshalJSON() ([]byte, error) {
  4606. type NoMethod Webproperty
  4607. raw := NoMethod(*s)
  4608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4609. }
  4610. // WebpropertyChildLink: Child link for this web property. Points to the
  4611. // list of views (profiles) for this web property.
  4612. type WebpropertyChildLink struct {
  4613. // Href: Link to the list of views (profiles) for this web property.
  4614. Href string `json:"href,omitempty"`
  4615. // Type: Type of the parent link. Its value is "analytics#profiles".
  4616. Type string `json:"type,omitempty"`
  4617. // ForceSendFields is a list of field names (e.g. "Href") to
  4618. // unconditionally include in API requests. By default, fields with
  4619. // empty values are omitted from API requests. However, any non-pointer,
  4620. // non-interface field appearing in ForceSendFields will be sent to the
  4621. // server regardless of whether the field is empty or not. This may be
  4622. // used to include empty fields in Patch requests.
  4623. ForceSendFields []string `json:"-"`
  4624. // NullFields is a list of field names (e.g. "Href") to include in API
  4625. // requests with the JSON null value. By default, fields with empty
  4626. // values are omitted from API requests. However, any field with an
  4627. // empty value appearing in NullFields will be sent to the server as
  4628. // null. It is an error if a field in this list has a non-empty value.
  4629. // This may be used to include null fields in Patch requests.
  4630. NullFields []string `json:"-"`
  4631. }
  4632. func (s *WebpropertyChildLink) MarshalJSON() ([]byte, error) {
  4633. type NoMethod WebpropertyChildLink
  4634. raw := NoMethod(*s)
  4635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4636. }
  4637. // WebpropertyParentLink: Parent link for this web property. Points to
  4638. // the account to which this web property belongs.
  4639. type WebpropertyParentLink struct {
  4640. // Href: Link to the account for this web property.
  4641. Href string `json:"href,omitempty"`
  4642. // Type: Type of the parent link. Its value is "analytics#account".
  4643. Type string `json:"type,omitempty"`
  4644. // ForceSendFields is a list of field names (e.g. "Href") to
  4645. // unconditionally include in API requests. By default, fields with
  4646. // empty values are omitted from API requests. However, any non-pointer,
  4647. // non-interface field appearing in ForceSendFields will be sent to the
  4648. // server regardless of whether the field is empty or not. This may be
  4649. // used to include empty fields in Patch requests.
  4650. ForceSendFields []string `json:"-"`
  4651. // NullFields is a list of field names (e.g. "Href") to include in API
  4652. // requests with the JSON null value. By default, fields with empty
  4653. // values are omitted from API requests. However, any field with an
  4654. // empty value appearing in NullFields will be sent to the server as
  4655. // null. It is an error if a field in this list has a non-empty value.
  4656. // This may be used to include null fields in Patch requests.
  4657. NullFields []string `json:"-"`
  4658. }
  4659. func (s *WebpropertyParentLink) MarshalJSON() ([]byte, error) {
  4660. type NoMethod WebpropertyParentLink
  4661. raw := NoMethod(*s)
  4662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4663. }
  4664. // WebpropertyPermissions: Permissions the user has for this web
  4665. // property.
  4666. type WebpropertyPermissions struct {
  4667. // Effective: All the permissions that the user has for this web
  4668. // property. These include any implied permissions (e.g., EDIT implies
  4669. // VIEW) or inherited permissions from the parent account.
  4670. Effective []string `json:"effective,omitempty"`
  4671. // ForceSendFields is a list of field names (e.g. "Effective") to
  4672. // unconditionally include in API requests. By default, fields with
  4673. // empty values are omitted from API requests. However, any non-pointer,
  4674. // non-interface field appearing in ForceSendFields will be sent to the
  4675. // server regardless of whether the field is empty or not. This may be
  4676. // used to include empty fields in Patch requests.
  4677. ForceSendFields []string `json:"-"`
  4678. // NullFields is a list of field names (e.g. "Effective") to include in
  4679. // API requests with the JSON null value. By default, fields with empty
  4680. // values are omitted from API requests. However, any field with an
  4681. // empty value appearing in NullFields will be sent to the server as
  4682. // null. It is an error if a field in this list has a non-empty value.
  4683. // This may be used to include null fields in Patch requests.
  4684. NullFields []string `json:"-"`
  4685. }
  4686. func (s *WebpropertyPermissions) MarshalJSON() ([]byte, error) {
  4687. type NoMethod WebpropertyPermissions
  4688. raw := NoMethod(*s)
  4689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4690. }
  4691. // method id "analytics.data.ga.get":
  4692. type DataGaGetCall struct {
  4693. s *Service
  4694. urlParams_ gensupport.URLParams
  4695. ifNoneMatch_ string
  4696. ctx_ context.Context
  4697. header_ http.Header
  4698. }
  4699. // Get: Returns Analytics data for a view (profile).
  4700. func (r *DataGaService) Get(ids string, startDate string, endDate string, metrics string) *DataGaGetCall {
  4701. c := &DataGaGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4702. c.urlParams_.Set("ids", ids)
  4703. c.urlParams_.Set("start-date", startDate)
  4704. c.urlParams_.Set("end-date", endDate)
  4705. c.urlParams_.Set("metrics", metrics)
  4706. return c
  4707. }
  4708. // Dimensions sets the optional parameter "dimensions": A
  4709. // comma-separated list of Analytics dimensions. E.g.,
  4710. // 'ga:browser,ga:city'.
  4711. func (c *DataGaGetCall) Dimensions(dimensions string) *DataGaGetCall {
  4712. c.urlParams_.Set("dimensions", dimensions)
  4713. return c
  4714. }
  4715. // Filters sets the optional parameter "filters": A comma-separated list
  4716. // of dimension or metric filters to be applied to Analytics data.
  4717. func (c *DataGaGetCall) Filters(filters string) *DataGaGetCall {
  4718. c.urlParams_.Set("filters", filters)
  4719. return c
  4720. }
  4721. // IncludeEmptyRows sets the optional parameter "include-empty-rows":
  4722. // The response will include empty rows if this parameter is set to
  4723. // true, the default is true
  4724. func (c *DataGaGetCall) IncludeEmptyRows(includeEmptyRows bool) *DataGaGetCall {
  4725. c.urlParams_.Set("include-empty-rows", fmt.Sprint(includeEmptyRows))
  4726. return c
  4727. }
  4728. // MaxResults sets the optional parameter "max-results": The maximum
  4729. // number of entries to include in this feed.
  4730. func (c *DataGaGetCall) MaxResults(maxResults int64) *DataGaGetCall {
  4731. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  4732. return c
  4733. }
  4734. // Output sets the optional parameter "output": The selected format for
  4735. // the response. Default format is JSON.
  4736. //
  4737. // Possible values:
  4738. // "dataTable" - Returns the response in Google Charts Data Table
  4739. // format. This is useful in creating visualization using Google Charts.
  4740. // "json" - Returns the response in standard JSON format.
  4741. func (c *DataGaGetCall) Output(output string) *DataGaGetCall {
  4742. c.urlParams_.Set("output", output)
  4743. return c
  4744. }
  4745. // SamplingLevel sets the optional parameter "samplingLevel": The
  4746. // desired sampling level.
  4747. //
  4748. // Possible values:
  4749. // "DEFAULT" - Returns response with a sample size that balances speed
  4750. // and accuracy.
  4751. // "FASTER" - Returns a fast response with a smaller sample size.
  4752. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  4753. // sample size, but this may result in the response being slower.
  4754. func (c *DataGaGetCall) SamplingLevel(samplingLevel string) *DataGaGetCall {
  4755. c.urlParams_.Set("samplingLevel", samplingLevel)
  4756. return c
  4757. }
  4758. // Segment sets the optional parameter "segment": An Analytics segment
  4759. // to be applied to data.
  4760. func (c *DataGaGetCall) Segment(segment string) *DataGaGetCall {
  4761. c.urlParams_.Set("segment", segment)
  4762. return c
  4763. }
  4764. // Sort sets the optional parameter "sort": A comma-separated list of
  4765. // dimensions or metrics that determine the sort order for Analytics
  4766. // data.
  4767. func (c *DataGaGetCall) Sort(sort string) *DataGaGetCall {
  4768. c.urlParams_.Set("sort", sort)
  4769. return c
  4770. }
  4771. // StartIndex sets the optional parameter "start-index": An index of the
  4772. // first entity to retrieve. Use this parameter as a pagination
  4773. // mechanism along with the max-results parameter.
  4774. func (c *DataGaGetCall) StartIndex(startIndex int64) *DataGaGetCall {
  4775. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  4776. return c
  4777. }
  4778. // Fields allows partial responses to be retrieved. See
  4779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4780. // for more information.
  4781. func (c *DataGaGetCall) Fields(s ...googleapi.Field) *DataGaGetCall {
  4782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4783. return c
  4784. }
  4785. // IfNoneMatch sets the optional parameter which makes the operation
  4786. // fail if the object's ETag matches the given value. This is useful for
  4787. // getting updates only after the object has changed since the last
  4788. // request. Use googleapi.IsNotModified to check whether the response
  4789. // error from Do is the result of In-None-Match.
  4790. func (c *DataGaGetCall) IfNoneMatch(entityTag string) *DataGaGetCall {
  4791. c.ifNoneMatch_ = entityTag
  4792. return c
  4793. }
  4794. // Context sets the context to be used in this call's Do method. Any
  4795. // pending HTTP request will be aborted if the provided context is
  4796. // canceled.
  4797. func (c *DataGaGetCall) Context(ctx context.Context) *DataGaGetCall {
  4798. c.ctx_ = ctx
  4799. return c
  4800. }
  4801. // Header returns an http.Header that can be modified by the caller to
  4802. // add HTTP headers to the request.
  4803. func (c *DataGaGetCall) Header() http.Header {
  4804. if c.header_ == nil {
  4805. c.header_ = make(http.Header)
  4806. }
  4807. return c.header_
  4808. }
  4809. func (c *DataGaGetCall) doRequest(alt string) (*http.Response, error) {
  4810. reqHeaders := make(http.Header)
  4811. for k, v := range c.header_ {
  4812. reqHeaders[k] = v
  4813. }
  4814. reqHeaders.Set("User-Agent", c.s.userAgent())
  4815. if c.ifNoneMatch_ != "" {
  4816. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4817. }
  4818. var body io.Reader = nil
  4819. c.urlParams_.Set("alt", alt)
  4820. urls := googleapi.ResolveRelative(c.s.BasePath, "data/ga")
  4821. urls += "?" + c.urlParams_.Encode()
  4822. req, _ := http.NewRequest("GET", urls, body)
  4823. req.Header = reqHeaders
  4824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4825. }
  4826. // Do executes the "analytics.data.ga.get" call.
  4827. // Exactly one of *GaData or error will be non-nil. Any non-2xx status
  4828. // code is an error. Response headers are in either
  4829. // *GaData.ServerResponse.Header or (if a response was returned at all)
  4830. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4831. // check whether the returned error was because http.StatusNotModified
  4832. // was returned.
  4833. func (c *DataGaGetCall) Do(opts ...googleapi.CallOption) (*GaData, error) {
  4834. gensupport.SetOptions(c.urlParams_, opts...)
  4835. res, err := c.doRequest("json")
  4836. if res != nil && res.StatusCode == http.StatusNotModified {
  4837. if res.Body != nil {
  4838. res.Body.Close()
  4839. }
  4840. return nil, &googleapi.Error{
  4841. Code: res.StatusCode,
  4842. Header: res.Header,
  4843. }
  4844. }
  4845. if err != nil {
  4846. return nil, err
  4847. }
  4848. defer googleapi.CloseBody(res)
  4849. if err := googleapi.CheckResponse(res); err != nil {
  4850. return nil, err
  4851. }
  4852. ret := &GaData{
  4853. ServerResponse: googleapi.ServerResponse{
  4854. Header: res.Header,
  4855. HTTPStatusCode: res.StatusCode,
  4856. },
  4857. }
  4858. target := &ret
  4859. if err := gensupport.DecodeResponse(target, res); err != nil {
  4860. return nil, err
  4861. }
  4862. return ret, nil
  4863. // {
  4864. // "description": "Returns Analytics data for a view (profile).",
  4865. // "httpMethod": "GET",
  4866. // "id": "analytics.data.ga.get",
  4867. // "parameterOrder": [
  4868. // "ids",
  4869. // "start-date",
  4870. // "end-date",
  4871. // "metrics"
  4872. // ],
  4873. // "parameters": {
  4874. // "dimensions": {
  4875. // "description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.",
  4876. // "location": "query",
  4877. // "pattern": "(ga:.+)?",
  4878. // "type": "string"
  4879. // },
  4880. // "end-date": {
  4881. // "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.",
  4882. // "location": "query",
  4883. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  4884. // "required": true,
  4885. // "type": "string"
  4886. // },
  4887. // "filters": {
  4888. // "description": "A comma-separated list of dimension or metric filters to be applied to Analytics data.",
  4889. // "location": "query",
  4890. // "pattern": "ga:.+",
  4891. // "type": "string"
  4892. // },
  4893. // "ids": {
  4894. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  4895. // "location": "query",
  4896. // "pattern": "ga:[0-9]+",
  4897. // "required": true,
  4898. // "type": "string"
  4899. // },
  4900. // "include-empty-rows": {
  4901. // "description": "The response will include empty rows if this parameter is set to true, the default is true",
  4902. // "location": "query",
  4903. // "type": "boolean"
  4904. // },
  4905. // "max-results": {
  4906. // "description": "The maximum number of entries to include in this feed.",
  4907. // "format": "int32",
  4908. // "location": "query",
  4909. // "type": "integer"
  4910. // },
  4911. // "metrics": {
  4912. // "description": "A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified.",
  4913. // "location": "query",
  4914. // "pattern": "ga:.+",
  4915. // "required": true,
  4916. // "type": "string"
  4917. // },
  4918. // "output": {
  4919. // "description": "The selected format for the response. Default format is JSON.",
  4920. // "enum": [
  4921. // "dataTable",
  4922. // "json"
  4923. // ],
  4924. // "enumDescriptions": [
  4925. // "Returns the response in Google Charts Data Table format. This is useful in creating visualization using Google Charts.",
  4926. // "Returns the response in standard JSON format."
  4927. // ],
  4928. // "location": "query",
  4929. // "type": "string"
  4930. // },
  4931. // "samplingLevel": {
  4932. // "description": "The desired sampling level.",
  4933. // "enum": [
  4934. // "DEFAULT",
  4935. // "FASTER",
  4936. // "HIGHER_PRECISION"
  4937. // ],
  4938. // "enumDescriptions": [
  4939. // "Returns response with a sample size that balances speed and accuracy.",
  4940. // "Returns a fast response with a smaller sample size.",
  4941. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  4942. // ],
  4943. // "location": "query",
  4944. // "type": "string"
  4945. // },
  4946. // "segment": {
  4947. // "description": "An Analytics segment to be applied to data.",
  4948. // "location": "query",
  4949. // "type": "string"
  4950. // },
  4951. // "sort": {
  4952. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.",
  4953. // "location": "query",
  4954. // "pattern": "(-)?ga:.+",
  4955. // "type": "string"
  4956. // },
  4957. // "start-date": {
  4958. // "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.",
  4959. // "location": "query",
  4960. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  4961. // "required": true,
  4962. // "type": "string"
  4963. // },
  4964. // "start-index": {
  4965. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  4966. // "format": "int32",
  4967. // "location": "query",
  4968. // "minimum": "1",
  4969. // "type": "integer"
  4970. // }
  4971. // },
  4972. // "path": "data/ga",
  4973. // "response": {
  4974. // "$ref": "GaData"
  4975. // },
  4976. // "scopes": [
  4977. // "https://www.googleapis.com/auth/analytics",
  4978. // "https://www.googleapis.com/auth/analytics.readonly"
  4979. // ]
  4980. // }
  4981. }
  4982. // method id "analytics.data.mcf.get":
  4983. type DataMcfGetCall struct {
  4984. s *Service
  4985. urlParams_ gensupport.URLParams
  4986. ifNoneMatch_ string
  4987. ctx_ context.Context
  4988. header_ http.Header
  4989. }
  4990. // Get: Returns Analytics Multi-Channel Funnels data for a view
  4991. // (profile).
  4992. func (r *DataMcfService) Get(ids string, startDate string, endDate string, metrics string) *DataMcfGetCall {
  4993. c := &DataMcfGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4994. c.urlParams_.Set("ids", ids)
  4995. c.urlParams_.Set("start-date", startDate)
  4996. c.urlParams_.Set("end-date", endDate)
  4997. c.urlParams_.Set("metrics", metrics)
  4998. return c
  4999. }
  5000. // Dimensions sets the optional parameter "dimensions": A
  5001. // comma-separated list of Multi-Channel Funnels dimensions. E.g.,
  5002. // 'mcf:source,mcf:medium'.
  5003. func (c *DataMcfGetCall) Dimensions(dimensions string) *DataMcfGetCall {
  5004. c.urlParams_.Set("dimensions", dimensions)
  5005. return c
  5006. }
  5007. // Filters sets the optional parameter "filters": A comma-separated list
  5008. // of dimension or metric filters to be applied to the Analytics data.
  5009. func (c *DataMcfGetCall) Filters(filters string) *DataMcfGetCall {
  5010. c.urlParams_.Set("filters", filters)
  5011. return c
  5012. }
  5013. // MaxResults sets the optional parameter "max-results": The maximum
  5014. // number of entries to include in this feed.
  5015. func (c *DataMcfGetCall) MaxResults(maxResults int64) *DataMcfGetCall {
  5016. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5017. return c
  5018. }
  5019. // SamplingLevel sets the optional parameter "samplingLevel": The
  5020. // desired sampling level.
  5021. //
  5022. // Possible values:
  5023. // "DEFAULT" - Returns response with a sample size that balances speed
  5024. // and accuracy.
  5025. // "FASTER" - Returns a fast response with a smaller sample size.
  5026. // "HIGHER_PRECISION" - Returns a more accurate response using a large
  5027. // sample size, but this may result in the response being slower.
  5028. func (c *DataMcfGetCall) SamplingLevel(samplingLevel string) *DataMcfGetCall {
  5029. c.urlParams_.Set("samplingLevel", samplingLevel)
  5030. return c
  5031. }
  5032. // Sort sets the optional parameter "sort": A comma-separated list of
  5033. // dimensions or metrics that determine the sort order for the Analytics
  5034. // data.
  5035. func (c *DataMcfGetCall) Sort(sort string) *DataMcfGetCall {
  5036. c.urlParams_.Set("sort", sort)
  5037. return c
  5038. }
  5039. // StartIndex sets the optional parameter "start-index": An index of the
  5040. // first entity to retrieve. Use this parameter as a pagination
  5041. // mechanism along with the max-results parameter.
  5042. func (c *DataMcfGetCall) StartIndex(startIndex int64) *DataMcfGetCall {
  5043. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5044. return c
  5045. }
  5046. // Fields allows partial responses to be retrieved. See
  5047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5048. // for more information.
  5049. func (c *DataMcfGetCall) Fields(s ...googleapi.Field) *DataMcfGetCall {
  5050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5051. return c
  5052. }
  5053. // IfNoneMatch sets the optional parameter which makes the operation
  5054. // fail if the object's ETag matches the given value. This is useful for
  5055. // getting updates only after the object has changed since the last
  5056. // request. Use googleapi.IsNotModified to check whether the response
  5057. // error from Do is the result of In-None-Match.
  5058. func (c *DataMcfGetCall) IfNoneMatch(entityTag string) *DataMcfGetCall {
  5059. c.ifNoneMatch_ = entityTag
  5060. return c
  5061. }
  5062. // Context sets the context to be used in this call's Do method. Any
  5063. // pending HTTP request will be aborted if the provided context is
  5064. // canceled.
  5065. func (c *DataMcfGetCall) Context(ctx context.Context) *DataMcfGetCall {
  5066. c.ctx_ = ctx
  5067. return c
  5068. }
  5069. // Header returns an http.Header that can be modified by the caller to
  5070. // add HTTP headers to the request.
  5071. func (c *DataMcfGetCall) Header() http.Header {
  5072. if c.header_ == nil {
  5073. c.header_ = make(http.Header)
  5074. }
  5075. return c.header_
  5076. }
  5077. func (c *DataMcfGetCall) doRequest(alt string) (*http.Response, error) {
  5078. reqHeaders := make(http.Header)
  5079. for k, v := range c.header_ {
  5080. reqHeaders[k] = v
  5081. }
  5082. reqHeaders.Set("User-Agent", c.s.userAgent())
  5083. if c.ifNoneMatch_ != "" {
  5084. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5085. }
  5086. var body io.Reader = nil
  5087. c.urlParams_.Set("alt", alt)
  5088. urls := googleapi.ResolveRelative(c.s.BasePath, "data/mcf")
  5089. urls += "?" + c.urlParams_.Encode()
  5090. req, _ := http.NewRequest("GET", urls, body)
  5091. req.Header = reqHeaders
  5092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5093. }
  5094. // Do executes the "analytics.data.mcf.get" call.
  5095. // Exactly one of *McfData or error will be non-nil. Any non-2xx status
  5096. // code is an error. Response headers are in either
  5097. // *McfData.ServerResponse.Header or (if a response was returned at all)
  5098. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5099. // check whether the returned error was because http.StatusNotModified
  5100. // was returned.
  5101. func (c *DataMcfGetCall) Do(opts ...googleapi.CallOption) (*McfData, error) {
  5102. gensupport.SetOptions(c.urlParams_, opts...)
  5103. res, err := c.doRequest("json")
  5104. if res != nil && res.StatusCode == http.StatusNotModified {
  5105. if res.Body != nil {
  5106. res.Body.Close()
  5107. }
  5108. return nil, &googleapi.Error{
  5109. Code: res.StatusCode,
  5110. Header: res.Header,
  5111. }
  5112. }
  5113. if err != nil {
  5114. return nil, err
  5115. }
  5116. defer googleapi.CloseBody(res)
  5117. if err := googleapi.CheckResponse(res); err != nil {
  5118. return nil, err
  5119. }
  5120. ret := &McfData{
  5121. ServerResponse: googleapi.ServerResponse{
  5122. Header: res.Header,
  5123. HTTPStatusCode: res.StatusCode,
  5124. },
  5125. }
  5126. target := &ret
  5127. if err := gensupport.DecodeResponse(target, res); err != nil {
  5128. return nil, err
  5129. }
  5130. return ret, nil
  5131. // {
  5132. // "description": "Returns Analytics Multi-Channel Funnels data for a view (profile).",
  5133. // "httpMethod": "GET",
  5134. // "id": "analytics.data.mcf.get",
  5135. // "parameterOrder": [
  5136. // "ids",
  5137. // "start-date",
  5138. // "end-date",
  5139. // "metrics"
  5140. // ],
  5141. // "parameters": {
  5142. // "dimensions": {
  5143. // "description": "A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'.",
  5144. // "location": "query",
  5145. // "pattern": "(mcf:.+)?",
  5146. // "type": "string"
  5147. // },
  5148. // "end-date": {
  5149. // "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.",
  5150. // "location": "query",
  5151. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5152. // "required": true,
  5153. // "type": "string"
  5154. // },
  5155. // "filters": {
  5156. // "description": "A comma-separated list of dimension or metric filters to be applied to the Analytics data.",
  5157. // "location": "query",
  5158. // "pattern": "mcf:.+",
  5159. // "type": "string"
  5160. // },
  5161. // "ids": {
  5162. // "description": "Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
  5163. // "location": "query",
  5164. // "pattern": "ga:[0-9]+",
  5165. // "required": true,
  5166. // "type": "string"
  5167. // },
  5168. // "max-results": {
  5169. // "description": "The maximum number of entries to include in this feed.",
  5170. // "format": "int32",
  5171. // "location": "query",
  5172. // "type": "integer"
  5173. // },
  5174. // "metrics": {
  5175. // "description": "A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified.",
  5176. // "location": "query",
  5177. // "pattern": "mcf:.+",
  5178. // "required": true,
  5179. // "type": "string"
  5180. // },
  5181. // "samplingLevel": {
  5182. // "description": "The desired sampling level.",
  5183. // "enum": [
  5184. // "DEFAULT",
  5185. // "FASTER",
  5186. // "HIGHER_PRECISION"
  5187. // ],
  5188. // "enumDescriptions": [
  5189. // "Returns response with a sample size that balances speed and accuracy.",
  5190. // "Returns a fast response with a smaller sample size.",
  5191. // "Returns a more accurate response using a large sample size, but this may result in the response being slower."
  5192. // ],
  5193. // "location": "query",
  5194. // "type": "string"
  5195. // },
  5196. // "sort": {
  5197. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data.",
  5198. // "location": "query",
  5199. // "pattern": "(-)?mcf:.+",
  5200. // "type": "string"
  5201. // },
  5202. // "start-date": {
  5203. // "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.",
  5204. // "location": "query",
  5205. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)",
  5206. // "required": true,
  5207. // "type": "string"
  5208. // },
  5209. // "start-index": {
  5210. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5211. // "format": "int32",
  5212. // "location": "query",
  5213. // "minimum": "1",
  5214. // "type": "integer"
  5215. // }
  5216. // },
  5217. // "path": "data/mcf",
  5218. // "response": {
  5219. // "$ref": "McfData"
  5220. // },
  5221. // "scopes": [
  5222. // "https://www.googleapis.com/auth/analytics",
  5223. // "https://www.googleapis.com/auth/analytics.readonly"
  5224. // ]
  5225. // }
  5226. }
  5227. // method id "analytics.data.realtime.get":
  5228. type DataRealtimeGetCall struct {
  5229. s *Service
  5230. urlParams_ gensupport.URLParams
  5231. ifNoneMatch_ string
  5232. ctx_ context.Context
  5233. header_ http.Header
  5234. }
  5235. // Get: Returns real time data for a view (profile).
  5236. func (r *DataRealtimeService) Get(ids string, metrics string) *DataRealtimeGetCall {
  5237. c := &DataRealtimeGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5238. c.urlParams_.Set("ids", ids)
  5239. c.urlParams_.Set("metrics", metrics)
  5240. return c
  5241. }
  5242. // Dimensions sets the optional parameter "dimensions": A
  5243. // comma-separated list of real time dimensions. E.g.,
  5244. // 'rt:medium,rt:city'.
  5245. func (c *DataRealtimeGetCall) Dimensions(dimensions string) *DataRealtimeGetCall {
  5246. c.urlParams_.Set("dimensions", dimensions)
  5247. return c
  5248. }
  5249. // Filters sets the optional parameter "filters": A comma-separated list
  5250. // of dimension or metric filters to be applied to real time data.
  5251. func (c *DataRealtimeGetCall) Filters(filters string) *DataRealtimeGetCall {
  5252. c.urlParams_.Set("filters", filters)
  5253. return c
  5254. }
  5255. // MaxResults sets the optional parameter "max-results": The maximum
  5256. // number of entries to include in this feed.
  5257. func (c *DataRealtimeGetCall) MaxResults(maxResults int64) *DataRealtimeGetCall {
  5258. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5259. return c
  5260. }
  5261. // Sort sets the optional parameter "sort": A comma-separated list of
  5262. // dimensions or metrics that determine the sort order for real time
  5263. // data.
  5264. func (c *DataRealtimeGetCall) Sort(sort string) *DataRealtimeGetCall {
  5265. c.urlParams_.Set("sort", sort)
  5266. return c
  5267. }
  5268. // Fields allows partial responses to be retrieved. See
  5269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5270. // for more information.
  5271. func (c *DataRealtimeGetCall) Fields(s ...googleapi.Field) *DataRealtimeGetCall {
  5272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5273. return c
  5274. }
  5275. // IfNoneMatch sets the optional parameter which makes the operation
  5276. // fail if the object's ETag matches the given value. This is useful for
  5277. // getting updates only after the object has changed since the last
  5278. // request. Use googleapi.IsNotModified to check whether the response
  5279. // error from Do is the result of In-None-Match.
  5280. func (c *DataRealtimeGetCall) IfNoneMatch(entityTag string) *DataRealtimeGetCall {
  5281. c.ifNoneMatch_ = entityTag
  5282. return c
  5283. }
  5284. // Context sets the context to be used in this call's Do method. Any
  5285. // pending HTTP request will be aborted if the provided context is
  5286. // canceled.
  5287. func (c *DataRealtimeGetCall) Context(ctx context.Context) *DataRealtimeGetCall {
  5288. c.ctx_ = ctx
  5289. return c
  5290. }
  5291. // Header returns an http.Header that can be modified by the caller to
  5292. // add HTTP headers to the request.
  5293. func (c *DataRealtimeGetCall) Header() http.Header {
  5294. if c.header_ == nil {
  5295. c.header_ = make(http.Header)
  5296. }
  5297. return c.header_
  5298. }
  5299. func (c *DataRealtimeGetCall) doRequest(alt string) (*http.Response, error) {
  5300. reqHeaders := make(http.Header)
  5301. for k, v := range c.header_ {
  5302. reqHeaders[k] = v
  5303. }
  5304. reqHeaders.Set("User-Agent", c.s.userAgent())
  5305. if c.ifNoneMatch_ != "" {
  5306. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5307. }
  5308. var body io.Reader = nil
  5309. c.urlParams_.Set("alt", alt)
  5310. urls := googleapi.ResolveRelative(c.s.BasePath, "data/realtime")
  5311. urls += "?" + c.urlParams_.Encode()
  5312. req, _ := http.NewRequest("GET", urls, body)
  5313. req.Header = reqHeaders
  5314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5315. }
  5316. // Do executes the "analytics.data.realtime.get" call.
  5317. // Exactly one of *RealtimeData or error will be non-nil. Any non-2xx
  5318. // status code is an error. Response headers are in either
  5319. // *RealtimeData.ServerResponse.Header or (if a response was returned at
  5320. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5321. // to check whether the returned error was because
  5322. // http.StatusNotModified was returned.
  5323. func (c *DataRealtimeGetCall) Do(opts ...googleapi.CallOption) (*RealtimeData, error) {
  5324. gensupport.SetOptions(c.urlParams_, opts...)
  5325. res, err := c.doRequest("json")
  5326. if res != nil && res.StatusCode == http.StatusNotModified {
  5327. if res.Body != nil {
  5328. res.Body.Close()
  5329. }
  5330. return nil, &googleapi.Error{
  5331. Code: res.StatusCode,
  5332. Header: res.Header,
  5333. }
  5334. }
  5335. if err != nil {
  5336. return nil, err
  5337. }
  5338. defer googleapi.CloseBody(res)
  5339. if err := googleapi.CheckResponse(res); err != nil {
  5340. return nil, err
  5341. }
  5342. ret := &RealtimeData{
  5343. ServerResponse: googleapi.ServerResponse{
  5344. Header: res.Header,
  5345. HTTPStatusCode: res.StatusCode,
  5346. },
  5347. }
  5348. target := &ret
  5349. if err := gensupport.DecodeResponse(target, res); err != nil {
  5350. return nil, err
  5351. }
  5352. return ret, nil
  5353. // {
  5354. // "description": "Returns real time data for a view (profile).",
  5355. // "httpMethod": "GET",
  5356. // "id": "analytics.data.realtime.get",
  5357. // "parameterOrder": [
  5358. // "ids",
  5359. // "metrics"
  5360. // ],
  5361. // "parameters": {
  5362. // "dimensions": {
  5363. // "description": "A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'.",
  5364. // "location": "query",
  5365. // "pattern": "(ga:.+)|(rt:.+)",
  5366. // "type": "string"
  5367. // },
  5368. // "filters": {
  5369. // "description": "A comma-separated list of dimension or metric filters to be applied to real time data.",
  5370. // "location": "query",
  5371. // "pattern": "(ga:.+)|(rt:.+)",
  5372. // "type": "string"
  5373. // },
  5374. // "ids": {
  5375. // "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.",
  5376. // "location": "query",
  5377. // "pattern": "ga:[0-9]+",
  5378. // "required": true,
  5379. // "type": "string"
  5380. // },
  5381. // "max-results": {
  5382. // "description": "The maximum number of entries to include in this feed.",
  5383. // "format": "int32",
  5384. // "location": "query",
  5385. // "type": "integer"
  5386. // },
  5387. // "metrics": {
  5388. // "description": "A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified.",
  5389. // "location": "query",
  5390. // "pattern": "(ga:.+)|(rt:.+)",
  5391. // "required": true,
  5392. // "type": "string"
  5393. // },
  5394. // "sort": {
  5395. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for real time data.",
  5396. // "location": "query",
  5397. // "pattern": "(-)?((ga:.+)|(rt:.+))",
  5398. // "type": "string"
  5399. // }
  5400. // },
  5401. // "path": "data/realtime",
  5402. // "response": {
  5403. // "$ref": "RealtimeData"
  5404. // },
  5405. // "scopes": [
  5406. // "https://www.googleapis.com/auth/analytics",
  5407. // "https://www.googleapis.com/auth/analytics.readonly"
  5408. // ]
  5409. // }
  5410. }
  5411. // method id "analytics.management.accountSummaries.list":
  5412. type ManagementAccountSummariesListCall struct {
  5413. s *Service
  5414. urlParams_ gensupport.URLParams
  5415. ifNoneMatch_ string
  5416. ctx_ context.Context
  5417. header_ http.Header
  5418. }
  5419. // List: Lists account summaries (lightweight tree comprised of
  5420. // accounts/properties/profiles) to which the user has access.
  5421. func (r *ManagementAccountSummariesService) List() *ManagementAccountSummariesListCall {
  5422. c := &ManagementAccountSummariesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5423. return c
  5424. }
  5425. // MaxResults sets the optional parameter "max-results": The maximum
  5426. // number of account summaries to include in this response, where the
  5427. // largest acceptable value is 1000.
  5428. func (c *ManagementAccountSummariesListCall) MaxResults(maxResults int64) *ManagementAccountSummariesListCall {
  5429. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5430. return c
  5431. }
  5432. // StartIndex sets the optional parameter "start-index": An index of the
  5433. // first entity to retrieve. Use this parameter as a pagination
  5434. // mechanism along with the max-results parameter.
  5435. func (c *ManagementAccountSummariesListCall) StartIndex(startIndex int64) *ManagementAccountSummariesListCall {
  5436. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5437. return c
  5438. }
  5439. // Fields allows partial responses to be retrieved. See
  5440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5441. // for more information.
  5442. func (c *ManagementAccountSummariesListCall) Fields(s ...googleapi.Field) *ManagementAccountSummariesListCall {
  5443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5444. return c
  5445. }
  5446. // IfNoneMatch sets the optional parameter which makes the operation
  5447. // fail if the object's ETag matches the given value. This is useful for
  5448. // getting updates only after the object has changed since the last
  5449. // request. Use googleapi.IsNotModified to check whether the response
  5450. // error from Do is the result of In-None-Match.
  5451. func (c *ManagementAccountSummariesListCall) IfNoneMatch(entityTag string) *ManagementAccountSummariesListCall {
  5452. c.ifNoneMatch_ = entityTag
  5453. return c
  5454. }
  5455. // Context sets the context to be used in this call's Do method. Any
  5456. // pending HTTP request will be aborted if the provided context is
  5457. // canceled.
  5458. func (c *ManagementAccountSummariesListCall) Context(ctx context.Context) *ManagementAccountSummariesListCall {
  5459. c.ctx_ = ctx
  5460. return c
  5461. }
  5462. // Header returns an http.Header that can be modified by the caller to
  5463. // add HTTP headers to the request.
  5464. func (c *ManagementAccountSummariesListCall) Header() http.Header {
  5465. if c.header_ == nil {
  5466. c.header_ = make(http.Header)
  5467. }
  5468. return c.header_
  5469. }
  5470. func (c *ManagementAccountSummariesListCall) doRequest(alt string) (*http.Response, error) {
  5471. reqHeaders := make(http.Header)
  5472. for k, v := range c.header_ {
  5473. reqHeaders[k] = v
  5474. }
  5475. reqHeaders.Set("User-Agent", c.s.userAgent())
  5476. if c.ifNoneMatch_ != "" {
  5477. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5478. }
  5479. var body io.Reader = nil
  5480. c.urlParams_.Set("alt", alt)
  5481. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accountSummaries")
  5482. urls += "?" + c.urlParams_.Encode()
  5483. req, _ := http.NewRequest("GET", urls, body)
  5484. req.Header = reqHeaders
  5485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5486. }
  5487. // Do executes the "analytics.management.accountSummaries.list" call.
  5488. // Exactly one of *AccountSummaries or error will be non-nil. Any
  5489. // non-2xx status code is an error. Response headers are in either
  5490. // *AccountSummaries.ServerResponse.Header or (if a response was
  5491. // returned at all) in error.(*googleapi.Error).Header. Use
  5492. // googleapi.IsNotModified to check whether the returned error was
  5493. // because http.StatusNotModified was returned.
  5494. func (c *ManagementAccountSummariesListCall) Do(opts ...googleapi.CallOption) (*AccountSummaries, error) {
  5495. gensupport.SetOptions(c.urlParams_, opts...)
  5496. res, err := c.doRequest("json")
  5497. if res != nil && res.StatusCode == http.StatusNotModified {
  5498. if res.Body != nil {
  5499. res.Body.Close()
  5500. }
  5501. return nil, &googleapi.Error{
  5502. Code: res.StatusCode,
  5503. Header: res.Header,
  5504. }
  5505. }
  5506. if err != nil {
  5507. return nil, err
  5508. }
  5509. defer googleapi.CloseBody(res)
  5510. if err := googleapi.CheckResponse(res); err != nil {
  5511. return nil, err
  5512. }
  5513. ret := &AccountSummaries{
  5514. ServerResponse: googleapi.ServerResponse{
  5515. Header: res.Header,
  5516. HTTPStatusCode: res.StatusCode,
  5517. },
  5518. }
  5519. target := &ret
  5520. if err := gensupport.DecodeResponse(target, res); err != nil {
  5521. return nil, err
  5522. }
  5523. return ret, nil
  5524. // {
  5525. // "description": "Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.",
  5526. // "httpMethod": "GET",
  5527. // "id": "analytics.management.accountSummaries.list",
  5528. // "parameters": {
  5529. // "max-results": {
  5530. // "description": "The maximum number of account summaries to include in this response, where the largest acceptable value is 1000.",
  5531. // "format": "int32",
  5532. // "location": "query",
  5533. // "type": "integer"
  5534. // },
  5535. // "start-index": {
  5536. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5537. // "format": "int32",
  5538. // "location": "query",
  5539. // "minimum": "1",
  5540. // "type": "integer"
  5541. // }
  5542. // },
  5543. // "path": "management/accountSummaries",
  5544. // "response": {
  5545. // "$ref": "AccountSummaries"
  5546. // },
  5547. // "scopes": [
  5548. // "https://www.googleapis.com/auth/analytics.edit",
  5549. // "https://www.googleapis.com/auth/analytics.readonly"
  5550. // ]
  5551. // }
  5552. }
  5553. // method id "analytics.management.accountUserLinks.delete":
  5554. type ManagementAccountUserLinksDeleteCall struct {
  5555. s *Service
  5556. accountId string
  5557. linkId string
  5558. urlParams_ gensupport.URLParams
  5559. ctx_ context.Context
  5560. header_ http.Header
  5561. }
  5562. // Delete: Removes a user from the given account.
  5563. func (r *ManagementAccountUserLinksService) Delete(accountId string, linkId string) *ManagementAccountUserLinksDeleteCall {
  5564. c := &ManagementAccountUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5565. c.accountId = accountId
  5566. c.linkId = linkId
  5567. return c
  5568. }
  5569. // Fields allows partial responses to be retrieved. See
  5570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5571. // for more information.
  5572. func (c *ManagementAccountUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksDeleteCall {
  5573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5574. return c
  5575. }
  5576. // Context sets the context to be used in this call's Do method. Any
  5577. // pending HTTP request will be aborted if the provided context is
  5578. // canceled.
  5579. func (c *ManagementAccountUserLinksDeleteCall) Context(ctx context.Context) *ManagementAccountUserLinksDeleteCall {
  5580. c.ctx_ = ctx
  5581. return c
  5582. }
  5583. // Header returns an http.Header that can be modified by the caller to
  5584. // add HTTP headers to the request.
  5585. func (c *ManagementAccountUserLinksDeleteCall) Header() http.Header {
  5586. if c.header_ == nil {
  5587. c.header_ = make(http.Header)
  5588. }
  5589. return c.header_
  5590. }
  5591. func (c *ManagementAccountUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  5592. reqHeaders := make(http.Header)
  5593. for k, v := range c.header_ {
  5594. reqHeaders[k] = v
  5595. }
  5596. reqHeaders.Set("User-Agent", c.s.userAgent())
  5597. var body io.Reader = nil
  5598. c.urlParams_.Set("alt", alt)
  5599. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  5600. urls += "?" + c.urlParams_.Encode()
  5601. req, _ := http.NewRequest("DELETE", urls, body)
  5602. req.Header = reqHeaders
  5603. googleapi.Expand(req.URL, map[string]string{
  5604. "accountId": c.accountId,
  5605. "linkId": c.linkId,
  5606. })
  5607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5608. }
  5609. // Do executes the "analytics.management.accountUserLinks.delete" call.
  5610. func (c *ManagementAccountUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  5611. gensupport.SetOptions(c.urlParams_, opts...)
  5612. res, err := c.doRequest("json")
  5613. if err != nil {
  5614. return err
  5615. }
  5616. defer googleapi.CloseBody(res)
  5617. if err := googleapi.CheckResponse(res); err != nil {
  5618. return err
  5619. }
  5620. return nil
  5621. // {
  5622. // "description": "Removes a user from the given account.",
  5623. // "httpMethod": "DELETE",
  5624. // "id": "analytics.management.accountUserLinks.delete",
  5625. // "parameterOrder": [
  5626. // "accountId",
  5627. // "linkId"
  5628. // ],
  5629. // "parameters": {
  5630. // "accountId": {
  5631. // "description": "Account ID to delete the user link for.",
  5632. // "location": "path",
  5633. // "required": true,
  5634. // "type": "string"
  5635. // },
  5636. // "linkId": {
  5637. // "description": "Link ID to delete the user link for.",
  5638. // "location": "path",
  5639. // "required": true,
  5640. // "type": "string"
  5641. // }
  5642. // },
  5643. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  5644. // "scopes": [
  5645. // "https://www.googleapis.com/auth/analytics.manage.users"
  5646. // ]
  5647. // }
  5648. }
  5649. // method id "analytics.management.accountUserLinks.insert":
  5650. type ManagementAccountUserLinksInsertCall struct {
  5651. s *Service
  5652. accountId string
  5653. entityuserlink *EntityUserLink
  5654. urlParams_ gensupport.URLParams
  5655. ctx_ context.Context
  5656. header_ http.Header
  5657. }
  5658. // Insert: Adds a new user to the given account.
  5659. func (r *ManagementAccountUserLinksService) Insert(accountId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksInsertCall {
  5660. c := &ManagementAccountUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5661. c.accountId = accountId
  5662. c.entityuserlink = entityuserlink
  5663. return c
  5664. }
  5665. // Fields allows partial responses to be retrieved. See
  5666. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5667. // for more information.
  5668. func (c *ManagementAccountUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksInsertCall {
  5669. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5670. return c
  5671. }
  5672. // Context sets the context to be used in this call's Do method. Any
  5673. // pending HTTP request will be aborted if the provided context is
  5674. // canceled.
  5675. func (c *ManagementAccountUserLinksInsertCall) Context(ctx context.Context) *ManagementAccountUserLinksInsertCall {
  5676. c.ctx_ = ctx
  5677. return c
  5678. }
  5679. // Header returns an http.Header that can be modified by the caller to
  5680. // add HTTP headers to the request.
  5681. func (c *ManagementAccountUserLinksInsertCall) Header() http.Header {
  5682. if c.header_ == nil {
  5683. c.header_ = make(http.Header)
  5684. }
  5685. return c.header_
  5686. }
  5687. func (c *ManagementAccountUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  5688. reqHeaders := make(http.Header)
  5689. for k, v := range c.header_ {
  5690. reqHeaders[k] = v
  5691. }
  5692. reqHeaders.Set("User-Agent", c.s.userAgent())
  5693. var body io.Reader = nil
  5694. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  5695. if err != nil {
  5696. return nil, err
  5697. }
  5698. reqHeaders.Set("Content-Type", "application/json")
  5699. c.urlParams_.Set("alt", alt)
  5700. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  5701. urls += "?" + c.urlParams_.Encode()
  5702. req, _ := http.NewRequest("POST", urls, body)
  5703. req.Header = reqHeaders
  5704. googleapi.Expand(req.URL, map[string]string{
  5705. "accountId": c.accountId,
  5706. })
  5707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5708. }
  5709. // Do executes the "analytics.management.accountUserLinks.insert" call.
  5710. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  5711. // status code is an error. Response headers are in either
  5712. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  5713. // at all) in error.(*googleapi.Error).Header. Use
  5714. // googleapi.IsNotModified to check whether the returned error was
  5715. // because http.StatusNotModified was returned.
  5716. func (c *ManagementAccountUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  5717. gensupport.SetOptions(c.urlParams_, opts...)
  5718. res, err := c.doRequest("json")
  5719. if res != nil && res.StatusCode == http.StatusNotModified {
  5720. if res.Body != nil {
  5721. res.Body.Close()
  5722. }
  5723. return nil, &googleapi.Error{
  5724. Code: res.StatusCode,
  5725. Header: res.Header,
  5726. }
  5727. }
  5728. if err != nil {
  5729. return nil, err
  5730. }
  5731. defer googleapi.CloseBody(res)
  5732. if err := googleapi.CheckResponse(res); err != nil {
  5733. return nil, err
  5734. }
  5735. ret := &EntityUserLink{
  5736. ServerResponse: googleapi.ServerResponse{
  5737. Header: res.Header,
  5738. HTTPStatusCode: res.StatusCode,
  5739. },
  5740. }
  5741. target := &ret
  5742. if err := gensupport.DecodeResponse(target, res); err != nil {
  5743. return nil, err
  5744. }
  5745. return ret, nil
  5746. // {
  5747. // "description": "Adds a new user to the given account.",
  5748. // "httpMethod": "POST",
  5749. // "id": "analytics.management.accountUserLinks.insert",
  5750. // "parameterOrder": [
  5751. // "accountId"
  5752. // ],
  5753. // "parameters": {
  5754. // "accountId": {
  5755. // "description": "Account ID to create the user link for.",
  5756. // "location": "path",
  5757. // "required": true,
  5758. // "type": "string"
  5759. // }
  5760. // },
  5761. // "path": "management/accounts/{accountId}/entityUserLinks",
  5762. // "request": {
  5763. // "$ref": "EntityUserLink"
  5764. // },
  5765. // "response": {
  5766. // "$ref": "EntityUserLink"
  5767. // },
  5768. // "scopes": [
  5769. // "https://www.googleapis.com/auth/analytics.manage.users"
  5770. // ]
  5771. // }
  5772. }
  5773. // method id "analytics.management.accountUserLinks.list":
  5774. type ManagementAccountUserLinksListCall struct {
  5775. s *Service
  5776. accountId string
  5777. urlParams_ gensupport.URLParams
  5778. ifNoneMatch_ string
  5779. ctx_ context.Context
  5780. header_ http.Header
  5781. }
  5782. // List: Lists account-user links for a given account.
  5783. func (r *ManagementAccountUserLinksService) List(accountId string) *ManagementAccountUserLinksListCall {
  5784. c := &ManagementAccountUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5785. c.accountId = accountId
  5786. return c
  5787. }
  5788. // MaxResults sets the optional parameter "max-results": The maximum
  5789. // number of account-user links to include in this response.
  5790. func (c *ManagementAccountUserLinksListCall) MaxResults(maxResults int64) *ManagementAccountUserLinksListCall {
  5791. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  5792. return c
  5793. }
  5794. // StartIndex sets the optional parameter "start-index": An index of the
  5795. // first account-user link to retrieve. Use this parameter as a
  5796. // pagination mechanism along with the max-results parameter.
  5797. func (c *ManagementAccountUserLinksListCall) StartIndex(startIndex int64) *ManagementAccountUserLinksListCall {
  5798. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  5799. return c
  5800. }
  5801. // Fields allows partial responses to be retrieved. See
  5802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5803. // for more information.
  5804. func (c *ManagementAccountUserLinksListCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksListCall {
  5805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5806. return c
  5807. }
  5808. // IfNoneMatch sets the optional parameter which makes the operation
  5809. // fail if the object's ETag matches the given value. This is useful for
  5810. // getting updates only after the object has changed since the last
  5811. // request. Use googleapi.IsNotModified to check whether the response
  5812. // error from Do is the result of In-None-Match.
  5813. func (c *ManagementAccountUserLinksListCall) IfNoneMatch(entityTag string) *ManagementAccountUserLinksListCall {
  5814. c.ifNoneMatch_ = entityTag
  5815. return c
  5816. }
  5817. // Context sets the context to be used in this call's Do method. Any
  5818. // pending HTTP request will be aborted if the provided context is
  5819. // canceled.
  5820. func (c *ManagementAccountUserLinksListCall) Context(ctx context.Context) *ManagementAccountUserLinksListCall {
  5821. c.ctx_ = ctx
  5822. return c
  5823. }
  5824. // Header returns an http.Header that can be modified by the caller to
  5825. // add HTTP headers to the request.
  5826. func (c *ManagementAccountUserLinksListCall) Header() http.Header {
  5827. if c.header_ == nil {
  5828. c.header_ = make(http.Header)
  5829. }
  5830. return c.header_
  5831. }
  5832. func (c *ManagementAccountUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  5833. reqHeaders := make(http.Header)
  5834. for k, v := range c.header_ {
  5835. reqHeaders[k] = v
  5836. }
  5837. reqHeaders.Set("User-Agent", c.s.userAgent())
  5838. if c.ifNoneMatch_ != "" {
  5839. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5840. }
  5841. var body io.Reader = nil
  5842. c.urlParams_.Set("alt", alt)
  5843. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks")
  5844. urls += "?" + c.urlParams_.Encode()
  5845. req, _ := http.NewRequest("GET", urls, body)
  5846. req.Header = reqHeaders
  5847. googleapi.Expand(req.URL, map[string]string{
  5848. "accountId": c.accountId,
  5849. })
  5850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5851. }
  5852. // Do executes the "analytics.management.accountUserLinks.list" call.
  5853. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  5854. // status code is an error. Response headers are in either
  5855. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  5856. // at all) in error.(*googleapi.Error).Header. Use
  5857. // googleapi.IsNotModified to check whether the returned error was
  5858. // because http.StatusNotModified was returned.
  5859. func (c *ManagementAccountUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  5860. gensupport.SetOptions(c.urlParams_, opts...)
  5861. res, err := c.doRequest("json")
  5862. if res != nil && res.StatusCode == http.StatusNotModified {
  5863. if res.Body != nil {
  5864. res.Body.Close()
  5865. }
  5866. return nil, &googleapi.Error{
  5867. Code: res.StatusCode,
  5868. Header: res.Header,
  5869. }
  5870. }
  5871. if err != nil {
  5872. return nil, err
  5873. }
  5874. defer googleapi.CloseBody(res)
  5875. if err := googleapi.CheckResponse(res); err != nil {
  5876. return nil, err
  5877. }
  5878. ret := &EntityUserLinks{
  5879. ServerResponse: googleapi.ServerResponse{
  5880. Header: res.Header,
  5881. HTTPStatusCode: res.StatusCode,
  5882. },
  5883. }
  5884. target := &ret
  5885. if err := gensupport.DecodeResponse(target, res); err != nil {
  5886. return nil, err
  5887. }
  5888. return ret, nil
  5889. // {
  5890. // "description": "Lists account-user links for a given account.",
  5891. // "httpMethod": "GET",
  5892. // "id": "analytics.management.accountUserLinks.list",
  5893. // "parameterOrder": [
  5894. // "accountId"
  5895. // ],
  5896. // "parameters": {
  5897. // "accountId": {
  5898. // "description": "Account ID to retrieve the user links for.",
  5899. // "location": "path",
  5900. // "required": true,
  5901. // "type": "string"
  5902. // },
  5903. // "max-results": {
  5904. // "description": "The maximum number of account-user links to include in this response.",
  5905. // "format": "int32",
  5906. // "location": "query",
  5907. // "type": "integer"
  5908. // },
  5909. // "start-index": {
  5910. // "description": "An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  5911. // "format": "int32",
  5912. // "location": "query",
  5913. // "minimum": "1",
  5914. // "type": "integer"
  5915. // }
  5916. // },
  5917. // "path": "management/accounts/{accountId}/entityUserLinks",
  5918. // "response": {
  5919. // "$ref": "EntityUserLinks"
  5920. // },
  5921. // "scopes": [
  5922. // "https://www.googleapis.com/auth/analytics.manage.users",
  5923. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  5924. // ]
  5925. // }
  5926. }
  5927. // method id "analytics.management.accountUserLinks.update":
  5928. type ManagementAccountUserLinksUpdateCall struct {
  5929. s *Service
  5930. accountId string
  5931. linkId string
  5932. entityuserlink *EntityUserLink
  5933. urlParams_ gensupport.URLParams
  5934. ctx_ context.Context
  5935. header_ http.Header
  5936. }
  5937. // Update: Updates permissions for an existing user on the given
  5938. // account.
  5939. func (r *ManagementAccountUserLinksService) Update(accountId string, linkId string, entityuserlink *EntityUserLink) *ManagementAccountUserLinksUpdateCall {
  5940. c := &ManagementAccountUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5941. c.accountId = accountId
  5942. c.linkId = linkId
  5943. c.entityuserlink = entityuserlink
  5944. return c
  5945. }
  5946. // Fields allows partial responses to be retrieved. See
  5947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5948. // for more information.
  5949. func (c *ManagementAccountUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementAccountUserLinksUpdateCall {
  5950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5951. return c
  5952. }
  5953. // Context sets the context to be used in this call's Do method. Any
  5954. // pending HTTP request will be aborted if the provided context is
  5955. // canceled.
  5956. func (c *ManagementAccountUserLinksUpdateCall) Context(ctx context.Context) *ManagementAccountUserLinksUpdateCall {
  5957. c.ctx_ = ctx
  5958. return c
  5959. }
  5960. // Header returns an http.Header that can be modified by the caller to
  5961. // add HTTP headers to the request.
  5962. func (c *ManagementAccountUserLinksUpdateCall) Header() http.Header {
  5963. if c.header_ == nil {
  5964. c.header_ = make(http.Header)
  5965. }
  5966. return c.header_
  5967. }
  5968. func (c *ManagementAccountUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  5969. reqHeaders := make(http.Header)
  5970. for k, v := range c.header_ {
  5971. reqHeaders[k] = v
  5972. }
  5973. reqHeaders.Set("User-Agent", c.s.userAgent())
  5974. var body io.Reader = nil
  5975. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  5976. if err != nil {
  5977. return nil, err
  5978. }
  5979. reqHeaders.Set("Content-Type", "application/json")
  5980. c.urlParams_.Set("alt", alt)
  5981. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/entityUserLinks/{linkId}")
  5982. urls += "?" + c.urlParams_.Encode()
  5983. req, _ := http.NewRequest("PUT", urls, body)
  5984. req.Header = reqHeaders
  5985. googleapi.Expand(req.URL, map[string]string{
  5986. "accountId": c.accountId,
  5987. "linkId": c.linkId,
  5988. })
  5989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5990. }
  5991. // Do executes the "analytics.management.accountUserLinks.update" call.
  5992. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  5993. // status code is an error. Response headers are in either
  5994. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  5995. // at all) in error.(*googleapi.Error).Header. Use
  5996. // googleapi.IsNotModified to check whether the returned error was
  5997. // because http.StatusNotModified was returned.
  5998. func (c *ManagementAccountUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  5999. gensupport.SetOptions(c.urlParams_, opts...)
  6000. res, err := c.doRequest("json")
  6001. if res != nil && res.StatusCode == http.StatusNotModified {
  6002. if res.Body != nil {
  6003. res.Body.Close()
  6004. }
  6005. return nil, &googleapi.Error{
  6006. Code: res.StatusCode,
  6007. Header: res.Header,
  6008. }
  6009. }
  6010. if err != nil {
  6011. return nil, err
  6012. }
  6013. defer googleapi.CloseBody(res)
  6014. if err := googleapi.CheckResponse(res); err != nil {
  6015. return nil, err
  6016. }
  6017. ret := &EntityUserLink{
  6018. ServerResponse: googleapi.ServerResponse{
  6019. Header: res.Header,
  6020. HTTPStatusCode: res.StatusCode,
  6021. },
  6022. }
  6023. target := &ret
  6024. if err := gensupport.DecodeResponse(target, res); err != nil {
  6025. return nil, err
  6026. }
  6027. return ret, nil
  6028. // {
  6029. // "description": "Updates permissions for an existing user on the given account.",
  6030. // "httpMethod": "PUT",
  6031. // "id": "analytics.management.accountUserLinks.update",
  6032. // "parameterOrder": [
  6033. // "accountId",
  6034. // "linkId"
  6035. // ],
  6036. // "parameters": {
  6037. // "accountId": {
  6038. // "description": "Account ID to update the account-user link for.",
  6039. // "location": "path",
  6040. // "required": true,
  6041. // "type": "string"
  6042. // },
  6043. // "linkId": {
  6044. // "description": "Link ID to update the account-user link for.",
  6045. // "location": "path",
  6046. // "required": true,
  6047. // "type": "string"
  6048. // }
  6049. // },
  6050. // "path": "management/accounts/{accountId}/entityUserLinks/{linkId}",
  6051. // "request": {
  6052. // "$ref": "EntityUserLink"
  6053. // },
  6054. // "response": {
  6055. // "$ref": "EntityUserLink"
  6056. // },
  6057. // "scopes": [
  6058. // "https://www.googleapis.com/auth/analytics.manage.users"
  6059. // ]
  6060. // }
  6061. }
  6062. // method id "analytics.management.accounts.list":
  6063. type ManagementAccountsListCall struct {
  6064. s *Service
  6065. urlParams_ gensupport.URLParams
  6066. ifNoneMatch_ string
  6067. ctx_ context.Context
  6068. header_ http.Header
  6069. }
  6070. // List: Lists all accounts to which the user has access.
  6071. func (r *ManagementAccountsService) List() *ManagementAccountsListCall {
  6072. c := &ManagementAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6073. return c
  6074. }
  6075. // MaxResults sets the optional parameter "max-results": The maximum
  6076. // number of accounts to include in this response.
  6077. func (c *ManagementAccountsListCall) MaxResults(maxResults int64) *ManagementAccountsListCall {
  6078. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6079. return c
  6080. }
  6081. // StartIndex sets the optional parameter "start-index": An index of the
  6082. // first account to retrieve. Use this parameter as a pagination
  6083. // mechanism along with the max-results parameter.
  6084. func (c *ManagementAccountsListCall) StartIndex(startIndex int64) *ManagementAccountsListCall {
  6085. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6086. return c
  6087. }
  6088. // Fields allows partial responses to be retrieved. See
  6089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6090. // for more information.
  6091. func (c *ManagementAccountsListCall) Fields(s ...googleapi.Field) *ManagementAccountsListCall {
  6092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6093. return c
  6094. }
  6095. // IfNoneMatch sets the optional parameter which makes the operation
  6096. // fail if the object's ETag matches the given value. This is useful for
  6097. // getting updates only after the object has changed since the last
  6098. // request. Use googleapi.IsNotModified to check whether the response
  6099. // error from Do is the result of In-None-Match.
  6100. func (c *ManagementAccountsListCall) IfNoneMatch(entityTag string) *ManagementAccountsListCall {
  6101. c.ifNoneMatch_ = entityTag
  6102. return c
  6103. }
  6104. // Context sets the context to be used in this call's Do method. Any
  6105. // pending HTTP request will be aborted if the provided context is
  6106. // canceled.
  6107. func (c *ManagementAccountsListCall) Context(ctx context.Context) *ManagementAccountsListCall {
  6108. c.ctx_ = ctx
  6109. return c
  6110. }
  6111. // Header returns an http.Header that can be modified by the caller to
  6112. // add HTTP headers to the request.
  6113. func (c *ManagementAccountsListCall) Header() http.Header {
  6114. if c.header_ == nil {
  6115. c.header_ = make(http.Header)
  6116. }
  6117. return c.header_
  6118. }
  6119. func (c *ManagementAccountsListCall) doRequest(alt string) (*http.Response, error) {
  6120. reqHeaders := make(http.Header)
  6121. for k, v := range c.header_ {
  6122. reqHeaders[k] = v
  6123. }
  6124. reqHeaders.Set("User-Agent", c.s.userAgent())
  6125. if c.ifNoneMatch_ != "" {
  6126. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6127. }
  6128. var body io.Reader = nil
  6129. c.urlParams_.Set("alt", alt)
  6130. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts")
  6131. urls += "?" + c.urlParams_.Encode()
  6132. req, _ := http.NewRequest("GET", urls, body)
  6133. req.Header = reqHeaders
  6134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6135. }
  6136. // Do executes the "analytics.management.accounts.list" call.
  6137. // Exactly one of *Accounts or error will be non-nil. Any non-2xx status
  6138. // code is an error. Response headers are in either
  6139. // *Accounts.ServerResponse.Header or (if a response was returned at
  6140. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6141. // to check whether the returned error was because
  6142. // http.StatusNotModified was returned.
  6143. func (c *ManagementAccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
  6144. gensupport.SetOptions(c.urlParams_, opts...)
  6145. res, err := c.doRequest("json")
  6146. if res != nil && res.StatusCode == http.StatusNotModified {
  6147. if res.Body != nil {
  6148. res.Body.Close()
  6149. }
  6150. return nil, &googleapi.Error{
  6151. Code: res.StatusCode,
  6152. Header: res.Header,
  6153. }
  6154. }
  6155. if err != nil {
  6156. return nil, err
  6157. }
  6158. defer googleapi.CloseBody(res)
  6159. if err := googleapi.CheckResponse(res); err != nil {
  6160. return nil, err
  6161. }
  6162. ret := &Accounts{
  6163. ServerResponse: googleapi.ServerResponse{
  6164. Header: res.Header,
  6165. HTTPStatusCode: res.StatusCode,
  6166. },
  6167. }
  6168. target := &ret
  6169. if err := gensupport.DecodeResponse(target, res); err != nil {
  6170. return nil, err
  6171. }
  6172. return ret, nil
  6173. // {
  6174. // "description": "Lists all accounts to which the user has access.",
  6175. // "httpMethod": "GET",
  6176. // "id": "analytics.management.accounts.list",
  6177. // "parameters": {
  6178. // "max-results": {
  6179. // "description": "The maximum number of accounts to include in this response.",
  6180. // "format": "int32",
  6181. // "location": "query",
  6182. // "type": "integer"
  6183. // },
  6184. // "start-index": {
  6185. // "description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6186. // "format": "int32",
  6187. // "location": "query",
  6188. // "minimum": "1",
  6189. // "type": "integer"
  6190. // }
  6191. // },
  6192. // "path": "management/accounts",
  6193. // "response": {
  6194. // "$ref": "Accounts"
  6195. // },
  6196. // "scopes": [
  6197. // "https://www.googleapis.com/auth/analytics",
  6198. // "https://www.googleapis.com/auth/analytics.edit",
  6199. // "https://www.googleapis.com/auth/analytics.readonly"
  6200. // ]
  6201. // }
  6202. }
  6203. // method id "analytics.management.customDataSources.list":
  6204. type ManagementCustomDataSourcesListCall struct {
  6205. s *Service
  6206. accountId string
  6207. webPropertyId string
  6208. urlParams_ gensupport.URLParams
  6209. ifNoneMatch_ string
  6210. ctx_ context.Context
  6211. header_ http.Header
  6212. }
  6213. // List: List custom data sources to which the user has access.
  6214. func (r *ManagementCustomDataSourcesService) List(accountId string, webPropertyId string) *ManagementCustomDataSourcesListCall {
  6215. c := &ManagementCustomDataSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6216. c.accountId = accountId
  6217. c.webPropertyId = webPropertyId
  6218. return c
  6219. }
  6220. // MaxResults sets the optional parameter "max-results": The maximum
  6221. // number of custom data sources to include in this response.
  6222. func (c *ManagementCustomDataSourcesListCall) MaxResults(maxResults int64) *ManagementCustomDataSourcesListCall {
  6223. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6224. return c
  6225. }
  6226. // StartIndex sets the optional parameter "start-index": A 1-based index
  6227. // of the first custom data source to retrieve. Use this parameter as a
  6228. // pagination mechanism along with the max-results parameter.
  6229. func (c *ManagementCustomDataSourcesListCall) StartIndex(startIndex int64) *ManagementCustomDataSourcesListCall {
  6230. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6231. return c
  6232. }
  6233. // Fields allows partial responses to be retrieved. See
  6234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6235. // for more information.
  6236. func (c *ManagementCustomDataSourcesListCall) Fields(s ...googleapi.Field) *ManagementCustomDataSourcesListCall {
  6237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6238. return c
  6239. }
  6240. // IfNoneMatch sets the optional parameter which makes the operation
  6241. // fail if the object's ETag matches the given value. This is useful for
  6242. // getting updates only after the object has changed since the last
  6243. // request. Use googleapi.IsNotModified to check whether the response
  6244. // error from Do is the result of In-None-Match.
  6245. func (c *ManagementCustomDataSourcesListCall) IfNoneMatch(entityTag string) *ManagementCustomDataSourcesListCall {
  6246. c.ifNoneMatch_ = entityTag
  6247. return c
  6248. }
  6249. // Context sets the context to be used in this call's Do method. Any
  6250. // pending HTTP request will be aborted if the provided context is
  6251. // canceled.
  6252. func (c *ManagementCustomDataSourcesListCall) Context(ctx context.Context) *ManagementCustomDataSourcesListCall {
  6253. c.ctx_ = ctx
  6254. return c
  6255. }
  6256. // Header returns an http.Header that can be modified by the caller to
  6257. // add HTTP headers to the request.
  6258. func (c *ManagementCustomDataSourcesListCall) Header() http.Header {
  6259. if c.header_ == nil {
  6260. c.header_ = make(http.Header)
  6261. }
  6262. return c.header_
  6263. }
  6264. func (c *ManagementCustomDataSourcesListCall) doRequest(alt string) (*http.Response, error) {
  6265. reqHeaders := make(http.Header)
  6266. for k, v := range c.header_ {
  6267. reqHeaders[k] = v
  6268. }
  6269. reqHeaders.Set("User-Agent", c.s.userAgent())
  6270. if c.ifNoneMatch_ != "" {
  6271. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6272. }
  6273. var body io.Reader = nil
  6274. c.urlParams_.Set("alt", alt)
  6275. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources")
  6276. urls += "?" + c.urlParams_.Encode()
  6277. req, _ := http.NewRequest("GET", urls, body)
  6278. req.Header = reqHeaders
  6279. googleapi.Expand(req.URL, map[string]string{
  6280. "accountId": c.accountId,
  6281. "webPropertyId": c.webPropertyId,
  6282. })
  6283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6284. }
  6285. // Do executes the "analytics.management.customDataSources.list" call.
  6286. // Exactly one of *CustomDataSources or error will be non-nil. Any
  6287. // non-2xx status code is an error. Response headers are in either
  6288. // *CustomDataSources.ServerResponse.Header or (if a response was
  6289. // returned at all) in error.(*googleapi.Error).Header. Use
  6290. // googleapi.IsNotModified to check whether the returned error was
  6291. // because http.StatusNotModified was returned.
  6292. func (c *ManagementCustomDataSourcesListCall) Do(opts ...googleapi.CallOption) (*CustomDataSources, error) {
  6293. gensupport.SetOptions(c.urlParams_, opts...)
  6294. res, err := c.doRequest("json")
  6295. if res != nil && res.StatusCode == http.StatusNotModified {
  6296. if res.Body != nil {
  6297. res.Body.Close()
  6298. }
  6299. return nil, &googleapi.Error{
  6300. Code: res.StatusCode,
  6301. Header: res.Header,
  6302. }
  6303. }
  6304. if err != nil {
  6305. return nil, err
  6306. }
  6307. defer googleapi.CloseBody(res)
  6308. if err := googleapi.CheckResponse(res); err != nil {
  6309. return nil, err
  6310. }
  6311. ret := &CustomDataSources{
  6312. ServerResponse: googleapi.ServerResponse{
  6313. Header: res.Header,
  6314. HTTPStatusCode: res.StatusCode,
  6315. },
  6316. }
  6317. target := &ret
  6318. if err := gensupport.DecodeResponse(target, res); err != nil {
  6319. return nil, err
  6320. }
  6321. return ret, nil
  6322. // {
  6323. // "description": "List custom data sources to which the user has access.",
  6324. // "httpMethod": "GET",
  6325. // "id": "analytics.management.customDataSources.list",
  6326. // "parameterOrder": [
  6327. // "accountId",
  6328. // "webPropertyId"
  6329. // ],
  6330. // "parameters": {
  6331. // "accountId": {
  6332. // "description": "Account Id for the custom data sources to retrieve.",
  6333. // "location": "path",
  6334. // "pattern": "\\d+",
  6335. // "required": true,
  6336. // "type": "string"
  6337. // },
  6338. // "max-results": {
  6339. // "description": "The maximum number of custom data sources to include in this response.",
  6340. // "format": "int32",
  6341. // "location": "query",
  6342. // "minimum": "1",
  6343. // "type": "integer"
  6344. // },
  6345. // "start-index": {
  6346. // "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.",
  6347. // "format": "int32",
  6348. // "location": "query",
  6349. // "minimum": "1",
  6350. // "type": "integer"
  6351. // },
  6352. // "webPropertyId": {
  6353. // "description": "Web property Id for the custom data sources to retrieve.",
  6354. // "location": "path",
  6355. // "pattern": "UA-(\\d+)-(\\d+)",
  6356. // "required": true,
  6357. // "type": "string"
  6358. // }
  6359. // },
  6360. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources",
  6361. // "response": {
  6362. // "$ref": "CustomDataSources"
  6363. // },
  6364. // "scopes": [
  6365. // "https://www.googleapis.com/auth/analytics",
  6366. // "https://www.googleapis.com/auth/analytics.edit",
  6367. // "https://www.googleapis.com/auth/analytics.readonly"
  6368. // ]
  6369. // }
  6370. }
  6371. // method id "analytics.management.customDimensions.get":
  6372. type ManagementCustomDimensionsGetCall struct {
  6373. s *Service
  6374. accountId string
  6375. webPropertyId string
  6376. customDimensionId string
  6377. urlParams_ gensupport.URLParams
  6378. ifNoneMatch_ string
  6379. ctx_ context.Context
  6380. header_ http.Header
  6381. }
  6382. // Get: Get a custom dimension to which the user has access.
  6383. func (r *ManagementCustomDimensionsService) Get(accountId string, webPropertyId string, customDimensionId string) *ManagementCustomDimensionsGetCall {
  6384. c := &ManagementCustomDimensionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6385. c.accountId = accountId
  6386. c.webPropertyId = webPropertyId
  6387. c.customDimensionId = customDimensionId
  6388. return c
  6389. }
  6390. // Fields allows partial responses to be retrieved. See
  6391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6392. // for more information.
  6393. func (c *ManagementCustomDimensionsGetCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsGetCall {
  6394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6395. return c
  6396. }
  6397. // IfNoneMatch sets the optional parameter which makes the operation
  6398. // fail if the object's ETag matches the given value. This is useful for
  6399. // getting updates only after the object has changed since the last
  6400. // request. Use googleapi.IsNotModified to check whether the response
  6401. // error from Do is the result of In-None-Match.
  6402. func (c *ManagementCustomDimensionsGetCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsGetCall {
  6403. c.ifNoneMatch_ = entityTag
  6404. return c
  6405. }
  6406. // Context sets the context to be used in this call's Do method. Any
  6407. // pending HTTP request will be aborted if the provided context is
  6408. // canceled.
  6409. func (c *ManagementCustomDimensionsGetCall) Context(ctx context.Context) *ManagementCustomDimensionsGetCall {
  6410. c.ctx_ = ctx
  6411. return c
  6412. }
  6413. // Header returns an http.Header that can be modified by the caller to
  6414. // add HTTP headers to the request.
  6415. func (c *ManagementCustomDimensionsGetCall) Header() http.Header {
  6416. if c.header_ == nil {
  6417. c.header_ = make(http.Header)
  6418. }
  6419. return c.header_
  6420. }
  6421. func (c *ManagementCustomDimensionsGetCall) doRequest(alt string) (*http.Response, error) {
  6422. reqHeaders := make(http.Header)
  6423. for k, v := range c.header_ {
  6424. reqHeaders[k] = v
  6425. }
  6426. reqHeaders.Set("User-Agent", c.s.userAgent())
  6427. if c.ifNoneMatch_ != "" {
  6428. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6429. }
  6430. var body io.Reader = nil
  6431. c.urlParams_.Set("alt", alt)
  6432. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  6433. urls += "?" + c.urlParams_.Encode()
  6434. req, _ := http.NewRequest("GET", urls, body)
  6435. req.Header = reqHeaders
  6436. googleapi.Expand(req.URL, map[string]string{
  6437. "accountId": c.accountId,
  6438. "webPropertyId": c.webPropertyId,
  6439. "customDimensionId": c.customDimensionId,
  6440. })
  6441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6442. }
  6443. // Do executes the "analytics.management.customDimensions.get" call.
  6444. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  6445. // status code is an error. Response headers are in either
  6446. // *CustomDimension.ServerResponse.Header or (if a response was returned
  6447. // at all) in error.(*googleapi.Error).Header. Use
  6448. // googleapi.IsNotModified to check whether the returned error was
  6449. // because http.StatusNotModified was returned.
  6450. func (c *ManagementCustomDimensionsGetCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  6451. gensupport.SetOptions(c.urlParams_, opts...)
  6452. res, err := c.doRequest("json")
  6453. if res != nil && res.StatusCode == http.StatusNotModified {
  6454. if res.Body != nil {
  6455. res.Body.Close()
  6456. }
  6457. return nil, &googleapi.Error{
  6458. Code: res.StatusCode,
  6459. Header: res.Header,
  6460. }
  6461. }
  6462. if err != nil {
  6463. return nil, err
  6464. }
  6465. defer googleapi.CloseBody(res)
  6466. if err := googleapi.CheckResponse(res); err != nil {
  6467. return nil, err
  6468. }
  6469. ret := &CustomDimension{
  6470. ServerResponse: googleapi.ServerResponse{
  6471. Header: res.Header,
  6472. HTTPStatusCode: res.StatusCode,
  6473. },
  6474. }
  6475. target := &ret
  6476. if err := gensupport.DecodeResponse(target, res); err != nil {
  6477. return nil, err
  6478. }
  6479. return ret, nil
  6480. // {
  6481. // "description": "Get a custom dimension to which the user has access.",
  6482. // "httpMethod": "GET",
  6483. // "id": "analytics.management.customDimensions.get",
  6484. // "parameterOrder": [
  6485. // "accountId",
  6486. // "webPropertyId",
  6487. // "customDimensionId"
  6488. // ],
  6489. // "parameters": {
  6490. // "accountId": {
  6491. // "description": "Account ID for the custom dimension to retrieve.",
  6492. // "location": "path",
  6493. // "required": true,
  6494. // "type": "string"
  6495. // },
  6496. // "customDimensionId": {
  6497. // "description": "The ID of the custom dimension to retrieve.",
  6498. // "location": "path",
  6499. // "required": true,
  6500. // "type": "string"
  6501. // },
  6502. // "webPropertyId": {
  6503. // "description": "Web property ID for the custom dimension to retrieve.",
  6504. // "location": "path",
  6505. // "required": true,
  6506. // "type": "string"
  6507. // }
  6508. // },
  6509. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  6510. // "response": {
  6511. // "$ref": "CustomDimension"
  6512. // },
  6513. // "scopes": [
  6514. // "https://www.googleapis.com/auth/analytics.edit",
  6515. // "https://www.googleapis.com/auth/analytics.readonly"
  6516. // ]
  6517. // }
  6518. }
  6519. // method id "analytics.management.customDimensions.insert":
  6520. type ManagementCustomDimensionsInsertCall struct {
  6521. s *Service
  6522. accountId string
  6523. webPropertyId string
  6524. customdimension *CustomDimension
  6525. urlParams_ gensupport.URLParams
  6526. ctx_ context.Context
  6527. header_ http.Header
  6528. }
  6529. // Insert: Create a new custom dimension.
  6530. func (r *ManagementCustomDimensionsService) Insert(accountId string, webPropertyId string, customdimension *CustomDimension) *ManagementCustomDimensionsInsertCall {
  6531. c := &ManagementCustomDimensionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6532. c.accountId = accountId
  6533. c.webPropertyId = webPropertyId
  6534. c.customdimension = customdimension
  6535. return c
  6536. }
  6537. // Fields allows partial responses to be retrieved. See
  6538. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6539. // for more information.
  6540. func (c *ManagementCustomDimensionsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsInsertCall {
  6541. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6542. return c
  6543. }
  6544. // Context sets the context to be used in this call's Do method. Any
  6545. // pending HTTP request will be aborted if the provided context is
  6546. // canceled.
  6547. func (c *ManagementCustomDimensionsInsertCall) Context(ctx context.Context) *ManagementCustomDimensionsInsertCall {
  6548. c.ctx_ = ctx
  6549. return c
  6550. }
  6551. // Header returns an http.Header that can be modified by the caller to
  6552. // add HTTP headers to the request.
  6553. func (c *ManagementCustomDimensionsInsertCall) Header() http.Header {
  6554. if c.header_ == nil {
  6555. c.header_ = make(http.Header)
  6556. }
  6557. return c.header_
  6558. }
  6559. func (c *ManagementCustomDimensionsInsertCall) doRequest(alt string) (*http.Response, error) {
  6560. reqHeaders := make(http.Header)
  6561. for k, v := range c.header_ {
  6562. reqHeaders[k] = v
  6563. }
  6564. reqHeaders.Set("User-Agent", c.s.userAgent())
  6565. var body io.Reader = nil
  6566. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  6567. if err != nil {
  6568. return nil, err
  6569. }
  6570. reqHeaders.Set("Content-Type", "application/json")
  6571. c.urlParams_.Set("alt", alt)
  6572. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  6573. urls += "?" + c.urlParams_.Encode()
  6574. req, _ := http.NewRequest("POST", urls, body)
  6575. req.Header = reqHeaders
  6576. googleapi.Expand(req.URL, map[string]string{
  6577. "accountId": c.accountId,
  6578. "webPropertyId": c.webPropertyId,
  6579. })
  6580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6581. }
  6582. // Do executes the "analytics.management.customDimensions.insert" call.
  6583. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  6584. // status code is an error. Response headers are in either
  6585. // *CustomDimension.ServerResponse.Header or (if a response was returned
  6586. // at all) in error.(*googleapi.Error).Header. Use
  6587. // googleapi.IsNotModified to check whether the returned error was
  6588. // because http.StatusNotModified was returned.
  6589. func (c *ManagementCustomDimensionsInsertCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  6590. gensupport.SetOptions(c.urlParams_, opts...)
  6591. res, err := c.doRequest("json")
  6592. if res != nil && res.StatusCode == http.StatusNotModified {
  6593. if res.Body != nil {
  6594. res.Body.Close()
  6595. }
  6596. return nil, &googleapi.Error{
  6597. Code: res.StatusCode,
  6598. Header: res.Header,
  6599. }
  6600. }
  6601. if err != nil {
  6602. return nil, err
  6603. }
  6604. defer googleapi.CloseBody(res)
  6605. if err := googleapi.CheckResponse(res); err != nil {
  6606. return nil, err
  6607. }
  6608. ret := &CustomDimension{
  6609. ServerResponse: googleapi.ServerResponse{
  6610. Header: res.Header,
  6611. HTTPStatusCode: res.StatusCode,
  6612. },
  6613. }
  6614. target := &ret
  6615. if err := gensupport.DecodeResponse(target, res); err != nil {
  6616. return nil, err
  6617. }
  6618. return ret, nil
  6619. // {
  6620. // "description": "Create a new custom dimension.",
  6621. // "httpMethod": "POST",
  6622. // "id": "analytics.management.customDimensions.insert",
  6623. // "parameterOrder": [
  6624. // "accountId",
  6625. // "webPropertyId"
  6626. // ],
  6627. // "parameters": {
  6628. // "accountId": {
  6629. // "description": "Account ID for the custom dimension to create.",
  6630. // "location": "path",
  6631. // "required": true,
  6632. // "type": "string"
  6633. // },
  6634. // "webPropertyId": {
  6635. // "description": "Web property ID for the custom dimension to create.",
  6636. // "location": "path",
  6637. // "required": true,
  6638. // "type": "string"
  6639. // }
  6640. // },
  6641. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  6642. // "request": {
  6643. // "$ref": "CustomDimension"
  6644. // },
  6645. // "response": {
  6646. // "$ref": "CustomDimension"
  6647. // },
  6648. // "scopes": [
  6649. // "https://www.googleapis.com/auth/analytics.edit"
  6650. // ]
  6651. // }
  6652. }
  6653. // method id "analytics.management.customDimensions.list":
  6654. type ManagementCustomDimensionsListCall struct {
  6655. s *Service
  6656. accountId string
  6657. webPropertyId string
  6658. urlParams_ gensupport.URLParams
  6659. ifNoneMatch_ string
  6660. ctx_ context.Context
  6661. header_ http.Header
  6662. }
  6663. // List: Lists custom dimensions to which the user has access.
  6664. func (r *ManagementCustomDimensionsService) List(accountId string, webPropertyId string) *ManagementCustomDimensionsListCall {
  6665. c := &ManagementCustomDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6666. c.accountId = accountId
  6667. c.webPropertyId = webPropertyId
  6668. return c
  6669. }
  6670. // MaxResults sets the optional parameter "max-results": The maximum
  6671. // number of custom dimensions to include in this response.
  6672. func (c *ManagementCustomDimensionsListCall) MaxResults(maxResults int64) *ManagementCustomDimensionsListCall {
  6673. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  6674. return c
  6675. }
  6676. // StartIndex sets the optional parameter "start-index": An index of the
  6677. // first entity to retrieve. Use this parameter as a pagination
  6678. // mechanism along with the max-results parameter.
  6679. func (c *ManagementCustomDimensionsListCall) StartIndex(startIndex int64) *ManagementCustomDimensionsListCall {
  6680. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  6681. return c
  6682. }
  6683. // Fields allows partial responses to be retrieved. See
  6684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6685. // for more information.
  6686. func (c *ManagementCustomDimensionsListCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsListCall {
  6687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6688. return c
  6689. }
  6690. // IfNoneMatch sets the optional parameter which makes the operation
  6691. // fail if the object's ETag matches the given value. This is useful for
  6692. // getting updates only after the object has changed since the last
  6693. // request. Use googleapi.IsNotModified to check whether the response
  6694. // error from Do is the result of In-None-Match.
  6695. func (c *ManagementCustomDimensionsListCall) IfNoneMatch(entityTag string) *ManagementCustomDimensionsListCall {
  6696. c.ifNoneMatch_ = entityTag
  6697. return c
  6698. }
  6699. // Context sets the context to be used in this call's Do method. Any
  6700. // pending HTTP request will be aborted if the provided context is
  6701. // canceled.
  6702. func (c *ManagementCustomDimensionsListCall) Context(ctx context.Context) *ManagementCustomDimensionsListCall {
  6703. c.ctx_ = ctx
  6704. return c
  6705. }
  6706. // Header returns an http.Header that can be modified by the caller to
  6707. // add HTTP headers to the request.
  6708. func (c *ManagementCustomDimensionsListCall) Header() http.Header {
  6709. if c.header_ == nil {
  6710. c.header_ = make(http.Header)
  6711. }
  6712. return c.header_
  6713. }
  6714. func (c *ManagementCustomDimensionsListCall) doRequest(alt string) (*http.Response, error) {
  6715. reqHeaders := make(http.Header)
  6716. for k, v := range c.header_ {
  6717. reqHeaders[k] = v
  6718. }
  6719. reqHeaders.Set("User-Agent", c.s.userAgent())
  6720. if c.ifNoneMatch_ != "" {
  6721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6722. }
  6723. var body io.Reader = nil
  6724. c.urlParams_.Set("alt", alt)
  6725. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions")
  6726. urls += "?" + c.urlParams_.Encode()
  6727. req, _ := http.NewRequest("GET", urls, body)
  6728. req.Header = reqHeaders
  6729. googleapi.Expand(req.URL, map[string]string{
  6730. "accountId": c.accountId,
  6731. "webPropertyId": c.webPropertyId,
  6732. })
  6733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6734. }
  6735. // Do executes the "analytics.management.customDimensions.list" call.
  6736. // Exactly one of *CustomDimensions or error will be non-nil. Any
  6737. // non-2xx status code is an error. Response headers are in either
  6738. // *CustomDimensions.ServerResponse.Header or (if a response was
  6739. // returned at all) in error.(*googleapi.Error).Header. Use
  6740. // googleapi.IsNotModified to check whether the returned error was
  6741. // because http.StatusNotModified was returned.
  6742. func (c *ManagementCustomDimensionsListCall) Do(opts ...googleapi.CallOption) (*CustomDimensions, error) {
  6743. gensupport.SetOptions(c.urlParams_, opts...)
  6744. res, err := c.doRequest("json")
  6745. if res != nil && res.StatusCode == http.StatusNotModified {
  6746. if res.Body != nil {
  6747. res.Body.Close()
  6748. }
  6749. return nil, &googleapi.Error{
  6750. Code: res.StatusCode,
  6751. Header: res.Header,
  6752. }
  6753. }
  6754. if err != nil {
  6755. return nil, err
  6756. }
  6757. defer googleapi.CloseBody(res)
  6758. if err := googleapi.CheckResponse(res); err != nil {
  6759. return nil, err
  6760. }
  6761. ret := &CustomDimensions{
  6762. ServerResponse: googleapi.ServerResponse{
  6763. Header: res.Header,
  6764. HTTPStatusCode: res.StatusCode,
  6765. },
  6766. }
  6767. target := &ret
  6768. if err := gensupport.DecodeResponse(target, res); err != nil {
  6769. return nil, err
  6770. }
  6771. return ret, nil
  6772. // {
  6773. // "description": "Lists custom dimensions to which the user has access.",
  6774. // "httpMethod": "GET",
  6775. // "id": "analytics.management.customDimensions.list",
  6776. // "parameterOrder": [
  6777. // "accountId",
  6778. // "webPropertyId"
  6779. // ],
  6780. // "parameters": {
  6781. // "accountId": {
  6782. // "description": "Account ID for the custom dimensions to retrieve.",
  6783. // "location": "path",
  6784. // "required": true,
  6785. // "type": "string"
  6786. // },
  6787. // "max-results": {
  6788. // "description": "The maximum number of custom dimensions to include in this response.",
  6789. // "format": "int32",
  6790. // "location": "query",
  6791. // "type": "integer"
  6792. // },
  6793. // "start-index": {
  6794. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  6795. // "format": "int32",
  6796. // "location": "query",
  6797. // "minimum": "1",
  6798. // "type": "integer"
  6799. // },
  6800. // "webPropertyId": {
  6801. // "description": "Web property ID for the custom dimensions to retrieve.",
  6802. // "location": "path",
  6803. // "required": true,
  6804. // "type": "string"
  6805. // }
  6806. // },
  6807. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions",
  6808. // "response": {
  6809. // "$ref": "CustomDimensions"
  6810. // },
  6811. // "scopes": [
  6812. // "https://www.googleapis.com/auth/analytics",
  6813. // "https://www.googleapis.com/auth/analytics.readonly"
  6814. // ]
  6815. // }
  6816. }
  6817. // method id "analytics.management.customDimensions.patch":
  6818. type ManagementCustomDimensionsPatchCall struct {
  6819. s *Service
  6820. accountId string
  6821. webPropertyId string
  6822. customDimensionId string
  6823. customdimension *CustomDimension
  6824. urlParams_ gensupport.URLParams
  6825. ctx_ context.Context
  6826. header_ http.Header
  6827. }
  6828. // Patch: Updates an existing custom dimension. This method supports
  6829. // patch semantics.
  6830. func (r *ManagementCustomDimensionsService) Patch(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsPatchCall {
  6831. c := &ManagementCustomDimensionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6832. c.accountId = accountId
  6833. c.webPropertyId = webPropertyId
  6834. c.customDimensionId = customDimensionId
  6835. c.customdimension = customdimension
  6836. return c
  6837. }
  6838. // IgnoreCustomDataSourceLinks sets the optional parameter
  6839. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  6840. // warnings related to the custom dimension being linked to a custom
  6841. // data source / data set.
  6842. func (c *ManagementCustomDimensionsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsPatchCall {
  6843. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  6844. return c
  6845. }
  6846. // Fields allows partial responses to be retrieved. See
  6847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6848. // for more information.
  6849. func (c *ManagementCustomDimensionsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsPatchCall {
  6850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6851. return c
  6852. }
  6853. // Context sets the context to be used in this call's Do method. Any
  6854. // pending HTTP request will be aborted if the provided context is
  6855. // canceled.
  6856. func (c *ManagementCustomDimensionsPatchCall) Context(ctx context.Context) *ManagementCustomDimensionsPatchCall {
  6857. c.ctx_ = ctx
  6858. return c
  6859. }
  6860. // Header returns an http.Header that can be modified by the caller to
  6861. // add HTTP headers to the request.
  6862. func (c *ManagementCustomDimensionsPatchCall) Header() http.Header {
  6863. if c.header_ == nil {
  6864. c.header_ = make(http.Header)
  6865. }
  6866. return c.header_
  6867. }
  6868. func (c *ManagementCustomDimensionsPatchCall) doRequest(alt string) (*http.Response, error) {
  6869. reqHeaders := make(http.Header)
  6870. for k, v := range c.header_ {
  6871. reqHeaders[k] = v
  6872. }
  6873. reqHeaders.Set("User-Agent", c.s.userAgent())
  6874. var body io.Reader = nil
  6875. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  6876. if err != nil {
  6877. return nil, err
  6878. }
  6879. reqHeaders.Set("Content-Type", "application/json")
  6880. c.urlParams_.Set("alt", alt)
  6881. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  6882. urls += "?" + c.urlParams_.Encode()
  6883. req, _ := http.NewRequest("PATCH", urls, body)
  6884. req.Header = reqHeaders
  6885. googleapi.Expand(req.URL, map[string]string{
  6886. "accountId": c.accountId,
  6887. "webPropertyId": c.webPropertyId,
  6888. "customDimensionId": c.customDimensionId,
  6889. })
  6890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6891. }
  6892. // Do executes the "analytics.management.customDimensions.patch" call.
  6893. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  6894. // status code is an error. Response headers are in either
  6895. // *CustomDimension.ServerResponse.Header or (if a response was returned
  6896. // at all) in error.(*googleapi.Error).Header. Use
  6897. // googleapi.IsNotModified to check whether the returned error was
  6898. // because http.StatusNotModified was returned.
  6899. func (c *ManagementCustomDimensionsPatchCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  6900. gensupport.SetOptions(c.urlParams_, opts...)
  6901. res, err := c.doRequest("json")
  6902. if res != nil && res.StatusCode == http.StatusNotModified {
  6903. if res.Body != nil {
  6904. res.Body.Close()
  6905. }
  6906. return nil, &googleapi.Error{
  6907. Code: res.StatusCode,
  6908. Header: res.Header,
  6909. }
  6910. }
  6911. if err != nil {
  6912. return nil, err
  6913. }
  6914. defer googleapi.CloseBody(res)
  6915. if err := googleapi.CheckResponse(res); err != nil {
  6916. return nil, err
  6917. }
  6918. ret := &CustomDimension{
  6919. ServerResponse: googleapi.ServerResponse{
  6920. Header: res.Header,
  6921. HTTPStatusCode: res.StatusCode,
  6922. },
  6923. }
  6924. target := &ret
  6925. if err := gensupport.DecodeResponse(target, res); err != nil {
  6926. return nil, err
  6927. }
  6928. return ret, nil
  6929. // {
  6930. // "description": "Updates an existing custom dimension. This method supports patch semantics.",
  6931. // "httpMethod": "PATCH",
  6932. // "id": "analytics.management.customDimensions.patch",
  6933. // "parameterOrder": [
  6934. // "accountId",
  6935. // "webPropertyId",
  6936. // "customDimensionId"
  6937. // ],
  6938. // "parameters": {
  6939. // "accountId": {
  6940. // "description": "Account ID for the custom dimension to update.",
  6941. // "location": "path",
  6942. // "required": true,
  6943. // "type": "string"
  6944. // },
  6945. // "customDimensionId": {
  6946. // "description": "Custom dimension ID for the custom dimension to update.",
  6947. // "location": "path",
  6948. // "required": true,
  6949. // "type": "string"
  6950. // },
  6951. // "ignoreCustomDataSourceLinks": {
  6952. // "default": "false",
  6953. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  6954. // "location": "query",
  6955. // "type": "boolean"
  6956. // },
  6957. // "webPropertyId": {
  6958. // "description": "Web property ID for the custom dimension to update.",
  6959. // "location": "path",
  6960. // "required": true,
  6961. // "type": "string"
  6962. // }
  6963. // },
  6964. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  6965. // "request": {
  6966. // "$ref": "CustomDimension"
  6967. // },
  6968. // "response": {
  6969. // "$ref": "CustomDimension"
  6970. // },
  6971. // "scopes": [
  6972. // "https://www.googleapis.com/auth/analytics.edit"
  6973. // ]
  6974. // }
  6975. }
  6976. // method id "analytics.management.customDimensions.update":
  6977. type ManagementCustomDimensionsUpdateCall struct {
  6978. s *Service
  6979. accountId string
  6980. webPropertyId string
  6981. customDimensionId string
  6982. customdimension *CustomDimension
  6983. urlParams_ gensupport.URLParams
  6984. ctx_ context.Context
  6985. header_ http.Header
  6986. }
  6987. // Update: Updates an existing custom dimension.
  6988. func (r *ManagementCustomDimensionsService) Update(accountId string, webPropertyId string, customDimensionId string, customdimension *CustomDimension) *ManagementCustomDimensionsUpdateCall {
  6989. c := &ManagementCustomDimensionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6990. c.accountId = accountId
  6991. c.webPropertyId = webPropertyId
  6992. c.customDimensionId = customDimensionId
  6993. c.customdimension = customdimension
  6994. return c
  6995. }
  6996. // IgnoreCustomDataSourceLinks sets the optional parameter
  6997. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  6998. // warnings related to the custom dimension being linked to a custom
  6999. // data source / data set.
  7000. func (c *ManagementCustomDimensionsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomDimensionsUpdateCall {
  7001. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7002. return c
  7003. }
  7004. // Fields allows partial responses to be retrieved. See
  7005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7006. // for more information.
  7007. func (c *ManagementCustomDimensionsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomDimensionsUpdateCall {
  7008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7009. return c
  7010. }
  7011. // Context sets the context to be used in this call's Do method. Any
  7012. // pending HTTP request will be aborted if the provided context is
  7013. // canceled.
  7014. func (c *ManagementCustomDimensionsUpdateCall) Context(ctx context.Context) *ManagementCustomDimensionsUpdateCall {
  7015. c.ctx_ = ctx
  7016. return c
  7017. }
  7018. // Header returns an http.Header that can be modified by the caller to
  7019. // add HTTP headers to the request.
  7020. func (c *ManagementCustomDimensionsUpdateCall) Header() http.Header {
  7021. if c.header_ == nil {
  7022. c.header_ = make(http.Header)
  7023. }
  7024. return c.header_
  7025. }
  7026. func (c *ManagementCustomDimensionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7027. reqHeaders := make(http.Header)
  7028. for k, v := range c.header_ {
  7029. reqHeaders[k] = v
  7030. }
  7031. reqHeaders.Set("User-Agent", c.s.userAgent())
  7032. var body io.Reader = nil
  7033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customdimension)
  7034. if err != nil {
  7035. return nil, err
  7036. }
  7037. reqHeaders.Set("Content-Type", "application/json")
  7038. c.urlParams_.Set("alt", alt)
  7039. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}")
  7040. urls += "?" + c.urlParams_.Encode()
  7041. req, _ := http.NewRequest("PUT", urls, body)
  7042. req.Header = reqHeaders
  7043. googleapi.Expand(req.URL, map[string]string{
  7044. "accountId": c.accountId,
  7045. "webPropertyId": c.webPropertyId,
  7046. "customDimensionId": c.customDimensionId,
  7047. })
  7048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7049. }
  7050. // Do executes the "analytics.management.customDimensions.update" call.
  7051. // Exactly one of *CustomDimension or error will be non-nil. Any non-2xx
  7052. // status code is an error. Response headers are in either
  7053. // *CustomDimension.ServerResponse.Header or (if a response was returned
  7054. // at all) in error.(*googleapi.Error).Header. Use
  7055. // googleapi.IsNotModified to check whether the returned error was
  7056. // because http.StatusNotModified was returned.
  7057. func (c *ManagementCustomDimensionsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomDimension, error) {
  7058. gensupport.SetOptions(c.urlParams_, opts...)
  7059. res, err := c.doRequest("json")
  7060. if res != nil && res.StatusCode == http.StatusNotModified {
  7061. if res.Body != nil {
  7062. res.Body.Close()
  7063. }
  7064. return nil, &googleapi.Error{
  7065. Code: res.StatusCode,
  7066. Header: res.Header,
  7067. }
  7068. }
  7069. if err != nil {
  7070. return nil, err
  7071. }
  7072. defer googleapi.CloseBody(res)
  7073. if err := googleapi.CheckResponse(res); err != nil {
  7074. return nil, err
  7075. }
  7076. ret := &CustomDimension{
  7077. ServerResponse: googleapi.ServerResponse{
  7078. Header: res.Header,
  7079. HTTPStatusCode: res.StatusCode,
  7080. },
  7081. }
  7082. target := &ret
  7083. if err := gensupport.DecodeResponse(target, res); err != nil {
  7084. return nil, err
  7085. }
  7086. return ret, nil
  7087. // {
  7088. // "description": "Updates an existing custom dimension.",
  7089. // "httpMethod": "PUT",
  7090. // "id": "analytics.management.customDimensions.update",
  7091. // "parameterOrder": [
  7092. // "accountId",
  7093. // "webPropertyId",
  7094. // "customDimensionId"
  7095. // ],
  7096. // "parameters": {
  7097. // "accountId": {
  7098. // "description": "Account ID for the custom dimension to update.",
  7099. // "location": "path",
  7100. // "required": true,
  7101. // "type": "string"
  7102. // },
  7103. // "customDimensionId": {
  7104. // "description": "Custom dimension ID for the custom dimension to update.",
  7105. // "location": "path",
  7106. // "required": true,
  7107. // "type": "string"
  7108. // },
  7109. // "ignoreCustomDataSourceLinks": {
  7110. // "default": "false",
  7111. // "description": "Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set.",
  7112. // "location": "query",
  7113. // "type": "boolean"
  7114. // },
  7115. // "webPropertyId": {
  7116. // "description": "Web property ID for the custom dimension to update.",
  7117. // "location": "path",
  7118. // "required": true,
  7119. // "type": "string"
  7120. // }
  7121. // },
  7122. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}",
  7123. // "request": {
  7124. // "$ref": "CustomDimension"
  7125. // },
  7126. // "response": {
  7127. // "$ref": "CustomDimension"
  7128. // },
  7129. // "scopes": [
  7130. // "https://www.googleapis.com/auth/analytics.edit"
  7131. // ]
  7132. // }
  7133. }
  7134. // method id "analytics.management.customMetrics.get":
  7135. type ManagementCustomMetricsGetCall struct {
  7136. s *Service
  7137. accountId string
  7138. webPropertyId string
  7139. customMetricId string
  7140. urlParams_ gensupport.URLParams
  7141. ifNoneMatch_ string
  7142. ctx_ context.Context
  7143. header_ http.Header
  7144. }
  7145. // Get: Get a custom metric to which the user has access.
  7146. func (r *ManagementCustomMetricsService) Get(accountId string, webPropertyId string, customMetricId string) *ManagementCustomMetricsGetCall {
  7147. c := &ManagementCustomMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7148. c.accountId = accountId
  7149. c.webPropertyId = webPropertyId
  7150. c.customMetricId = customMetricId
  7151. return c
  7152. }
  7153. // Fields allows partial responses to be retrieved. See
  7154. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7155. // for more information.
  7156. func (c *ManagementCustomMetricsGetCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsGetCall {
  7157. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7158. return c
  7159. }
  7160. // IfNoneMatch sets the optional parameter which makes the operation
  7161. // fail if the object's ETag matches the given value. This is useful for
  7162. // getting updates only after the object has changed since the last
  7163. // request. Use googleapi.IsNotModified to check whether the response
  7164. // error from Do is the result of In-None-Match.
  7165. func (c *ManagementCustomMetricsGetCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsGetCall {
  7166. c.ifNoneMatch_ = entityTag
  7167. return c
  7168. }
  7169. // Context sets the context to be used in this call's Do method. Any
  7170. // pending HTTP request will be aborted if the provided context is
  7171. // canceled.
  7172. func (c *ManagementCustomMetricsGetCall) Context(ctx context.Context) *ManagementCustomMetricsGetCall {
  7173. c.ctx_ = ctx
  7174. return c
  7175. }
  7176. // Header returns an http.Header that can be modified by the caller to
  7177. // add HTTP headers to the request.
  7178. func (c *ManagementCustomMetricsGetCall) Header() http.Header {
  7179. if c.header_ == nil {
  7180. c.header_ = make(http.Header)
  7181. }
  7182. return c.header_
  7183. }
  7184. func (c *ManagementCustomMetricsGetCall) doRequest(alt string) (*http.Response, error) {
  7185. reqHeaders := make(http.Header)
  7186. for k, v := range c.header_ {
  7187. reqHeaders[k] = v
  7188. }
  7189. reqHeaders.Set("User-Agent", c.s.userAgent())
  7190. if c.ifNoneMatch_ != "" {
  7191. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7192. }
  7193. var body io.Reader = nil
  7194. c.urlParams_.Set("alt", alt)
  7195. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  7196. urls += "?" + c.urlParams_.Encode()
  7197. req, _ := http.NewRequest("GET", urls, body)
  7198. req.Header = reqHeaders
  7199. googleapi.Expand(req.URL, map[string]string{
  7200. "accountId": c.accountId,
  7201. "webPropertyId": c.webPropertyId,
  7202. "customMetricId": c.customMetricId,
  7203. })
  7204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7205. }
  7206. // Do executes the "analytics.management.customMetrics.get" call.
  7207. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7208. // status code is an error. Response headers are in either
  7209. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7210. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7211. // to check whether the returned error was because
  7212. // http.StatusNotModified was returned.
  7213. func (c *ManagementCustomMetricsGetCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7214. gensupport.SetOptions(c.urlParams_, opts...)
  7215. res, err := c.doRequest("json")
  7216. if res != nil && res.StatusCode == http.StatusNotModified {
  7217. if res.Body != nil {
  7218. res.Body.Close()
  7219. }
  7220. return nil, &googleapi.Error{
  7221. Code: res.StatusCode,
  7222. Header: res.Header,
  7223. }
  7224. }
  7225. if err != nil {
  7226. return nil, err
  7227. }
  7228. defer googleapi.CloseBody(res)
  7229. if err := googleapi.CheckResponse(res); err != nil {
  7230. return nil, err
  7231. }
  7232. ret := &CustomMetric{
  7233. ServerResponse: googleapi.ServerResponse{
  7234. Header: res.Header,
  7235. HTTPStatusCode: res.StatusCode,
  7236. },
  7237. }
  7238. target := &ret
  7239. if err := gensupport.DecodeResponse(target, res); err != nil {
  7240. return nil, err
  7241. }
  7242. return ret, nil
  7243. // {
  7244. // "description": "Get a custom metric to which the user has access.",
  7245. // "httpMethod": "GET",
  7246. // "id": "analytics.management.customMetrics.get",
  7247. // "parameterOrder": [
  7248. // "accountId",
  7249. // "webPropertyId",
  7250. // "customMetricId"
  7251. // ],
  7252. // "parameters": {
  7253. // "accountId": {
  7254. // "description": "Account ID for the custom metric to retrieve.",
  7255. // "location": "path",
  7256. // "required": true,
  7257. // "type": "string"
  7258. // },
  7259. // "customMetricId": {
  7260. // "description": "The ID of the custom metric to retrieve.",
  7261. // "location": "path",
  7262. // "required": true,
  7263. // "type": "string"
  7264. // },
  7265. // "webPropertyId": {
  7266. // "description": "Web property ID for the custom metric to retrieve.",
  7267. // "location": "path",
  7268. // "required": true,
  7269. // "type": "string"
  7270. // }
  7271. // },
  7272. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  7273. // "response": {
  7274. // "$ref": "CustomMetric"
  7275. // },
  7276. // "scopes": [
  7277. // "https://www.googleapis.com/auth/analytics.edit",
  7278. // "https://www.googleapis.com/auth/analytics.readonly"
  7279. // ]
  7280. // }
  7281. }
  7282. // method id "analytics.management.customMetrics.insert":
  7283. type ManagementCustomMetricsInsertCall struct {
  7284. s *Service
  7285. accountId string
  7286. webPropertyId string
  7287. custommetric *CustomMetric
  7288. urlParams_ gensupport.URLParams
  7289. ctx_ context.Context
  7290. header_ http.Header
  7291. }
  7292. // Insert: Create a new custom metric.
  7293. func (r *ManagementCustomMetricsService) Insert(accountId string, webPropertyId string, custommetric *CustomMetric) *ManagementCustomMetricsInsertCall {
  7294. c := &ManagementCustomMetricsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7295. c.accountId = accountId
  7296. c.webPropertyId = webPropertyId
  7297. c.custommetric = custommetric
  7298. return c
  7299. }
  7300. // Fields allows partial responses to be retrieved. See
  7301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7302. // for more information.
  7303. func (c *ManagementCustomMetricsInsertCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsInsertCall {
  7304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7305. return c
  7306. }
  7307. // Context sets the context to be used in this call's Do method. Any
  7308. // pending HTTP request will be aborted if the provided context is
  7309. // canceled.
  7310. func (c *ManagementCustomMetricsInsertCall) Context(ctx context.Context) *ManagementCustomMetricsInsertCall {
  7311. c.ctx_ = ctx
  7312. return c
  7313. }
  7314. // Header returns an http.Header that can be modified by the caller to
  7315. // add HTTP headers to the request.
  7316. func (c *ManagementCustomMetricsInsertCall) Header() http.Header {
  7317. if c.header_ == nil {
  7318. c.header_ = make(http.Header)
  7319. }
  7320. return c.header_
  7321. }
  7322. func (c *ManagementCustomMetricsInsertCall) doRequest(alt string) (*http.Response, error) {
  7323. reqHeaders := make(http.Header)
  7324. for k, v := range c.header_ {
  7325. reqHeaders[k] = v
  7326. }
  7327. reqHeaders.Set("User-Agent", c.s.userAgent())
  7328. var body io.Reader = nil
  7329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  7330. if err != nil {
  7331. return nil, err
  7332. }
  7333. reqHeaders.Set("Content-Type", "application/json")
  7334. c.urlParams_.Set("alt", alt)
  7335. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  7336. urls += "?" + c.urlParams_.Encode()
  7337. req, _ := http.NewRequest("POST", urls, body)
  7338. req.Header = reqHeaders
  7339. googleapi.Expand(req.URL, map[string]string{
  7340. "accountId": c.accountId,
  7341. "webPropertyId": c.webPropertyId,
  7342. })
  7343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7344. }
  7345. // Do executes the "analytics.management.customMetrics.insert" call.
  7346. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7347. // status code is an error. Response headers are in either
  7348. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7349. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7350. // to check whether the returned error was because
  7351. // http.StatusNotModified was returned.
  7352. func (c *ManagementCustomMetricsInsertCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7353. gensupport.SetOptions(c.urlParams_, opts...)
  7354. res, err := c.doRequest("json")
  7355. if res != nil && res.StatusCode == http.StatusNotModified {
  7356. if res.Body != nil {
  7357. res.Body.Close()
  7358. }
  7359. return nil, &googleapi.Error{
  7360. Code: res.StatusCode,
  7361. Header: res.Header,
  7362. }
  7363. }
  7364. if err != nil {
  7365. return nil, err
  7366. }
  7367. defer googleapi.CloseBody(res)
  7368. if err := googleapi.CheckResponse(res); err != nil {
  7369. return nil, err
  7370. }
  7371. ret := &CustomMetric{
  7372. ServerResponse: googleapi.ServerResponse{
  7373. Header: res.Header,
  7374. HTTPStatusCode: res.StatusCode,
  7375. },
  7376. }
  7377. target := &ret
  7378. if err := gensupport.DecodeResponse(target, res); err != nil {
  7379. return nil, err
  7380. }
  7381. return ret, nil
  7382. // {
  7383. // "description": "Create a new custom metric.",
  7384. // "httpMethod": "POST",
  7385. // "id": "analytics.management.customMetrics.insert",
  7386. // "parameterOrder": [
  7387. // "accountId",
  7388. // "webPropertyId"
  7389. // ],
  7390. // "parameters": {
  7391. // "accountId": {
  7392. // "description": "Account ID for the custom metric to create.",
  7393. // "location": "path",
  7394. // "required": true,
  7395. // "type": "string"
  7396. // },
  7397. // "webPropertyId": {
  7398. // "description": "Web property ID for the custom dimension to create.",
  7399. // "location": "path",
  7400. // "required": true,
  7401. // "type": "string"
  7402. // }
  7403. // },
  7404. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  7405. // "request": {
  7406. // "$ref": "CustomMetric"
  7407. // },
  7408. // "response": {
  7409. // "$ref": "CustomMetric"
  7410. // },
  7411. // "scopes": [
  7412. // "https://www.googleapis.com/auth/analytics.edit"
  7413. // ]
  7414. // }
  7415. }
  7416. // method id "analytics.management.customMetrics.list":
  7417. type ManagementCustomMetricsListCall struct {
  7418. s *Service
  7419. accountId string
  7420. webPropertyId string
  7421. urlParams_ gensupport.URLParams
  7422. ifNoneMatch_ string
  7423. ctx_ context.Context
  7424. header_ http.Header
  7425. }
  7426. // List: Lists custom metrics to which the user has access.
  7427. func (r *ManagementCustomMetricsService) List(accountId string, webPropertyId string) *ManagementCustomMetricsListCall {
  7428. c := &ManagementCustomMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7429. c.accountId = accountId
  7430. c.webPropertyId = webPropertyId
  7431. return c
  7432. }
  7433. // MaxResults sets the optional parameter "max-results": The maximum
  7434. // number of custom metrics to include in this response.
  7435. func (c *ManagementCustomMetricsListCall) MaxResults(maxResults int64) *ManagementCustomMetricsListCall {
  7436. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  7437. return c
  7438. }
  7439. // StartIndex sets the optional parameter "start-index": An index of the
  7440. // first entity to retrieve. Use this parameter as a pagination
  7441. // mechanism along with the max-results parameter.
  7442. func (c *ManagementCustomMetricsListCall) StartIndex(startIndex int64) *ManagementCustomMetricsListCall {
  7443. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  7444. return c
  7445. }
  7446. // Fields allows partial responses to be retrieved. See
  7447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7448. // for more information.
  7449. func (c *ManagementCustomMetricsListCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsListCall {
  7450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7451. return c
  7452. }
  7453. // IfNoneMatch sets the optional parameter which makes the operation
  7454. // fail if the object's ETag matches the given value. This is useful for
  7455. // getting updates only after the object has changed since the last
  7456. // request. Use googleapi.IsNotModified to check whether the response
  7457. // error from Do is the result of In-None-Match.
  7458. func (c *ManagementCustomMetricsListCall) IfNoneMatch(entityTag string) *ManagementCustomMetricsListCall {
  7459. c.ifNoneMatch_ = entityTag
  7460. return c
  7461. }
  7462. // Context sets the context to be used in this call's Do method. Any
  7463. // pending HTTP request will be aborted if the provided context is
  7464. // canceled.
  7465. func (c *ManagementCustomMetricsListCall) Context(ctx context.Context) *ManagementCustomMetricsListCall {
  7466. c.ctx_ = ctx
  7467. return c
  7468. }
  7469. // Header returns an http.Header that can be modified by the caller to
  7470. // add HTTP headers to the request.
  7471. func (c *ManagementCustomMetricsListCall) Header() http.Header {
  7472. if c.header_ == nil {
  7473. c.header_ = make(http.Header)
  7474. }
  7475. return c.header_
  7476. }
  7477. func (c *ManagementCustomMetricsListCall) doRequest(alt string) (*http.Response, error) {
  7478. reqHeaders := make(http.Header)
  7479. for k, v := range c.header_ {
  7480. reqHeaders[k] = v
  7481. }
  7482. reqHeaders.Set("User-Agent", c.s.userAgent())
  7483. if c.ifNoneMatch_ != "" {
  7484. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7485. }
  7486. var body io.Reader = nil
  7487. c.urlParams_.Set("alt", alt)
  7488. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics")
  7489. urls += "?" + c.urlParams_.Encode()
  7490. req, _ := http.NewRequest("GET", urls, body)
  7491. req.Header = reqHeaders
  7492. googleapi.Expand(req.URL, map[string]string{
  7493. "accountId": c.accountId,
  7494. "webPropertyId": c.webPropertyId,
  7495. })
  7496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7497. }
  7498. // Do executes the "analytics.management.customMetrics.list" call.
  7499. // Exactly one of *CustomMetrics or error will be non-nil. Any non-2xx
  7500. // status code is an error. Response headers are in either
  7501. // *CustomMetrics.ServerResponse.Header or (if a response was returned
  7502. // at all) in error.(*googleapi.Error).Header. Use
  7503. // googleapi.IsNotModified to check whether the returned error was
  7504. // because http.StatusNotModified was returned.
  7505. func (c *ManagementCustomMetricsListCall) Do(opts ...googleapi.CallOption) (*CustomMetrics, error) {
  7506. gensupport.SetOptions(c.urlParams_, opts...)
  7507. res, err := c.doRequest("json")
  7508. if res != nil && res.StatusCode == http.StatusNotModified {
  7509. if res.Body != nil {
  7510. res.Body.Close()
  7511. }
  7512. return nil, &googleapi.Error{
  7513. Code: res.StatusCode,
  7514. Header: res.Header,
  7515. }
  7516. }
  7517. if err != nil {
  7518. return nil, err
  7519. }
  7520. defer googleapi.CloseBody(res)
  7521. if err := googleapi.CheckResponse(res); err != nil {
  7522. return nil, err
  7523. }
  7524. ret := &CustomMetrics{
  7525. ServerResponse: googleapi.ServerResponse{
  7526. Header: res.Header,
  7527. HTTPStatusCode: res.StatusCode,
  7528. },
  7529. }
  7530. target := &ret
  7531. if err := gensupport.DecodeResponse(target, res); err != nil {
  7532. return nil, err
  7533. }
  7534. return ret, nil
  7535. // {
  7536. // "description": "Lists custom metrics to which the user has access.",
  7537. // "httpMethod": "GET",
  7538. // "id": "analytics.management.customMetrics.list",
  7539. // "parameterOrder": [
  7540. // "accountId",
  7541. // "webPropertyId"
  7542. // ],
  7543. // "parameters": {
  7544. // "accountId": {
  7545. // "description": "Account ID for the custom metrics to retrieve.",
  7546. // "location": "path",
  7547. // "required": true,
  7548. // "type": "string"
  7549. // },
  7550. // "max-results": {
  7551. // "description": "The maximum number of custom metrics to include in this response.",
  7552. // "format": "int32",
  7553. // "location": "query",
  7554. // "type": "integer"
  7555. // },
  7556. // "start-index": {
  7557. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  7558. // "format": "int32",
  7559. // "location": "query",
  7560. // "minimum": "1",
  7561. // "type": "integer"
  7562. // },
  7563. // "webPropertyId": {
  7564. // "description": "Web property ID for the custom metrics to retrieve.",
  7565. // "location": "path",
  7566. // "required": true,
  7567. // "type": "string"
  7568. // }
  7569. // },
  7570. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics",
  7571. // "response": {
  7572. // "$ref": "CustomMetrics"
  7573. // },
  7574. // "scopes": [
  7575. // "https://www.googleapis.com/auth/analytics",
  7576. // "https://www.googleapis.com/auth/analytics.readonly"
  7577. // ]
  7578. // }
  7579. }
  7580. // method id "analytics.management.customMetrics.patch":
  7581. type ManagementCustomMetricsPatchCall struct {
  7582. s *Service
  7583. accountId string
  7584. webPropertyId string
  7585. customMetricId string
  7586. custommetric *CustomMetric
  7587. urlParams_ gensupport.URLParams
  7588. ctx_ context.Context
  7589. header_ http.Header
  7590. }
  7591. // Patch: Updates an existing custom metric. This method supports patch
  7592. // semantics.
  7593. func (r *ManagementCustomMetricsService) Patch(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsPatchCall {
  7594. c := &ManagementCustomMetricsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7595. c.accountId = accountId
  7596. c.webPropertyId = webPropertyId
  7597. c.customMetricId = customMetricId
  7598. c.custommetric = custommetric
  7599. return c
  7600. }
  7601. // IgnoreCustomDataSourceLinks sets the optional parameter
  7602. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7603. // warnings related to the custom metric being linked to a custom data
  7604. // source / data set.
  7605. func (c *ManagementCustomMetricsPatchCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsPatchCall {
  7606. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7607. return c
  7608. }
  7609. // Fields allows partial responses to be retrieved. See
  7610. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7611. // for more information.
  7612. func (c *ManagementCustomMetricsPatchCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsPatchCall {
  7613. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7614. return c
  7615. }
  7616. // Context sets the context to be used in this call's Do method. Any
  7617. // pending HTTP request will be aborted if the provided context is
  7618. // canceled.
  7619. func (c *ManagementCustomMetricsPatchCall) Context(ctx context.Context) *ManagementCustomMetricsPatchCall {
  7620. c.ctx_ = ctx
  7621. return c
  7622. }
  7623. // Header returns an http.Header that can be modified by the caller to
  7624. // add HTTP headers to the request.
  7625. func (c *ManagementCustomMetricsPatchCall) Header() http.Header {
  7626. if c.header_ == nil {
  7627. c.header_ = make(http.Header)
  7628. }
  7629. return c.header_
  7630. }
  7631. func (c *ManagementCustomMetricsPatchCall) doRequest(alt string) (*http.Response, error) {
  7632. reqHeaders := make(http.Header)
  7633. for k, v := range c.header_ {
  7634. reqHeaders[k] = v
  7635. }
  7636. reqHeaders.Set("User-Agent", c.s.userAgent())
  7637. var body io.Reader = nil
  7638. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  7639. if err != nil {
  7640. return nil, err
  7641. }
  7642. reqHeaders.Set("Content-Type", "application/json")
  7643. c.urlParams_.Set("alt", alt)
  7644. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  7645. urls += "?" + c.urlParams_.Encode()
  7646. req, _ := http.NewRequest("PATCH", urls, body)
  7647. req.Header = reqHeaders
  7648. googleapi.Expand(req.URL, map[string]string{
  7649. "accountId": c.accountId,
  7650. "webPropertyId": c.webPropertyId,
  7651. "customMetricId": c.customMetricId,
  7652. })
  7653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7654. }
  7655. // Do executes the "analytics.management.customMetrics.patch" call.
  7656. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7657. // status code is an error. Response headers are in either
  7658. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7659. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7660. // to check whether the returned error was because
  7661. // http.StatusNotModified was returned.
  7662. func (c *ManagementCustomMetricsPatchCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7663. gensupport.SetOptions(c.urlParams_, opts...)
  7664. res, err := c.doRequest("json")
  7665. if res != nil && res.StatusCode == http.StatusNotModified {
  7666. if res.Body != nil {
  7667. res.Body.Close()
  7668. }
  7669. return nil, &googleapi.Error{
  7670. Code: res.StatusCode,
  7671. Header: res.Header,
  7672. }
  7673. }
  7674. if err != nil {
  7675. return nil, err
  7676. }
  7677. defer googleapi.CloseBody(res)
  7678. if err := googleapi.CheckResponse(res); err != nil {
  7679. return nil, err
  7680. }
  7681. ret := &CustomMetric{
  7682. ServerResponse: googleapi.ServerResponse{
  7683. Header: res.Header,
  7684. HTTPStatusCode: res.StatusCode,
  7685. },
  7686. }
  7687. target := &ret
  7688. if err := gensupport.DecodeResponse(target, res); err != nil {
  7689. return nil, err
  7690. }
  7691. return ret, nil
  7692. // {
  7693. // "description": "Updates an existing custom metric. This method supports patch semantics.",
  7694. // "httpMethod": "PATCH",
  7695. // "id": "analytics.management.customMetrics.patch",
  7696. // "parameterOrder": [
  7697. // "accountId",
  7698. // "webPropertyId",
  7699. // "customMetricId"
  7700. // ],
  7701. // "parameters": {
  7702. // "accountId": {
  7703. // "description": "Account ID for the custom metric to update.",
  7704. // "location": "path",
  7705. // "required": true,
  7706. // "type": "string"
  7707. // },
  7708. // "customMetricId": {
  7709. // "description": "Custom metric ID for the custom metric to update.",
  7710. // "location": "path",
  7711. // "required": true,
  7712. // "type": "string"
  7713. // },
  7714. // "ignoreCustomDataSourceLinks": {
  7715. // "default": "false",
  7716. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  7717. // "location": "query",
  7718. // "type": "boolean"
  7719. // },
  7720. // "webPropertyId": {
  7721. // "description": "Web property ID for the custom metric to update.",
  7722. // "location": "path",
  7723. // "required": true,
  7724. // "type": "string"
  7725. // }
  7726. // },
  7727. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  7728. // "request": {
  7729. // "$ref": "CustomMetric"
  7730. // },
  7731. // "response": {
  7732. // "$ref": "CustomMetric"
  7733. // },
  7734. // "scopes": [
  7735. // "https://www.googleapis.com/auth/analytics.edit"
  7736. // ]
  7737. // }
  7738. }
  7739. // method id "analytics.management.customMetrics.update":
  7740. type ManagementCustomMetricsUpdateCall struct {
  7741. s *Service
  7742. accountId string
  7743. webPropertyId string
  7744. customMetricId string
  7745. custommetric *CustomMetric
  7746. urlParams_ gensupport.URLParams
  7747. ctx_ context.Context
  7748. header_ http.Header
  7749. }
  7750. // Update: Updates an existing custom metric.
  7751. func (r *ManagementCustomMetricsService) Update(accountId string, webPropertyId string, customMetricId string, custommetric *CustomMetric) *ManagementCustomMetricsUpdateCall {
  7752. c := &ManagementCustomMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7753. c.accountId = accountId
  7754. c.webPropertyId = webPropertyId
  7755. c.customMetricId = customMetricId
  7756. c.custommetric = custommetric
  7757. return c
  7758. }
  7759. // IgnoreCustomDataSourceLinks sets the optional parameter
  7760. // "ignoreCustomDataSourceLinks": Force the update and ignore any
  7761. // warnings related to the custom metric being linked to a custom data
  7762. // source / data set.
  7763. func (c *ManagementCustomMetricsUpdateCall) IgnoreCustomDataSourceLinks(ignoreCustomDataSourceLinks bool) *ManagementCustomMetricsUpdateCall {
  7764. c.urlParams_.Set("ignoreCustomDataSourceLinks", fmt.Sprint(ignoreCustomDataSourceLinks))
  7765. return c
  7766. }
  7767. // Fields allows partial responses to be retrieved. See
  7768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7769. // for more information.
  7770. func (c *ManagementCustomMetricsUpdateCall) Fields(s ...googleapi.Field) *ManagementCustomMetricsUpdateCall {
  7771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7772. return c
  7773. }
  7774. // Context sets the context to be used in this call's Do method. Any
  7775. // pending HTTP request will be aborted if the provided context is
  7776. // canceled.
  7777. func (c *ManagementCustomMetricsUpdateCall) Context(ctx context.Context) *ManagementCustomMetricsUpdateCall {
  7778. c.ctx_ = ctx
  7779. return c
  7780. }
  7781. // Header returns an http.Header that can be modified by the caller to
  7782. // add HTTP headers to the request.
  7783. func (c *ManagementCustomMetricsUpdateCall) Header() http.Header {
  7784. if c.header_ == nil {
  7785. c.header_ = make(http.Header)
  7786. }
  7787. return c.header_
  7788. }
  7789. func (c *ManagementCustomMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7790. reqHeaders := make(http.Header)
  7791. for k, v := range c.header_ {
  7792. reqHeaders[k] = v
  7793. }
  7794. reqHeaders.Set("User-Agent", c.s.userAgent())
  7795. var body io.Reader = nil
  7796. body, err := googleapi.WithoutDataWrapper.JSONReader(c.custommetric)
  7797. if err != nil {
  7798. return nil, err
  7799. }
  7800. reqHeaders.Set("Content-Type", "application/json")
  7801. c.urlParams_.Set("alt", alt)
  7802. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}")
  7803. urls += "?" + c.urlParams_.Encode()
  7804. req, _ := http.NewRequest("PUT", urls, body)
  7805. req.Header = reqHeaders
  7806. googleapi.Expand(req.URL, map[string]string{
  7807. "accountId": c.accountId,
  7808. "webPropertyId": c.webPropertyId,
  7809. "customMetricId": c.customMetricId,
  7810. })
  7811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7812. }
  7813. // Do executes the "analytics.management.customMetrics.update" call.
  7814. // Exactly one of *CustomMetric or error will be non-nil. Any non-2xx
  7815. // status code is an error. Response headers are in either
  7816. // *CustomMetric.ServerResponse.Header or (if a response was returned at
  7817. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7818. // to check whether the returned error was because
  7819. // http.StatusNotModified was returned.
  7820. func (c *ManagementCustomMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*CustomMetric, error) {
  7821. gensupport.SetOptions(c.urlParams_, opts...)
  7822. res, err := c.doRequest("json")
  7823. if res != nil && res.StatusCode == http.StatusNotModified {
  7824. if res.Body != nil {
  7825. res.Body.Close()
  7826. }
  7827. return nil, &googleapi.Error{
  7828. Code: res.StatusCode,
  7829. Header: res.Header,
  7830. }
  7831. }
  7832. if err != nil {
  7833. return nil, err
  7834. }
  7835. defer googleapi.CloseBody(res)
  7836. if err := googleapi.CheckResponse(res); err != nil {
  7837. return nil, err
  7838. }
  7839. ret := &CustomMetric{
  7840. ServerResponse: googleapi.ServerResponse{
  7841. Header: res.Header,
  7842. HTTPStatusCode: res.StatusCode,
  7843. },
  7844. }
  7845. target := &ret
  7846. if err := gensupport.DecodeResponse(target, res); err != nil {
  7847. return nil, err
  7848. }
  7849. return ret, nil
  7850. // {
  7851. // "description": "Updates an existing custom metric.",
  7852. // "httpMethod": "PUT",
  7853. // "id": "analytics.management.customMetrics.update",
  7854. // "parameterOrder": [
  7855. // "accountId",
  7856. // "webPropertyId",
  7857. // "customMetricId"
  7858. // ],
  7859. // "parameters": {
  7860. // "accountId": {
  7861. // "description": "Account ID for the custom metric to update.",
  7862. // "location": "path",
  7863. // "required": true,
  7864. // "type": "string"
  7865. // },
  7866. // "customMetricId": {
  7867. // "description": "Custom metric ID for the custom metric to update.",
  7868. // "location": "path",
  7869. // "required": true,
  7870. // "type": "string"
  7871. // },
  7872. // "ignoreCustomDataSourceLinks": {
  7873. // "default": "false",
  7874. // "description": "Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set.",
  7875. // "location": "query",
  7876. // "type": "boolean"
  7877. // },
  7878. // "webPropertyId": {
  7879. // "description": "Web property ID for the custom metric to update.",
  7880. // "location": "path",
  7881. // "required": true,
  7882. // "type": "string"
  7883. // }
  7884. // },
  7885. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}",
  7886. // "request": {
  7887. // "$ref": "CustomMetric"
  7888. // },
  7889. // "response": {
  7890. // "$ref": "CustomMetric"
  7891. // },
  7892. // "scopes": [
  7893. // "https://www.googleapis.com/auth/analytics.edit"
  7894. // ]
  7895. // }
  7896. }
  7897. // method id "analytics.management.experiments.delete":
  7898. type ManagementExperimentsDeleteCall struct {
  7899. s *Service
  7900. accountId string
  7901. webPropertyId string
  7902. profileId string
  7903. experimentId string
  7904. urlParams_ gensupport.URLParams
  7905. ctx_ context.Context
  7906. header_ http.Header
  7907. }
  7908. // Delete: Delete an experiment.
  7909. func (r *ManagementExperimentsService) Delete(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsDeleteCall {
  7910. c := &ManagementExperimentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7911. c.accountId = accountId
  7912. c.webPropertyId = webPropertyId
  7913. c.profileId = profileId
  7914. c.experimentId = experimentId
  7915. return c
  7916. }
  7917. // Fields allows partial responses to be retrieved. See
  7918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7919. // for more information.
  7920. func (c *ManagementExperimentsDeleteCall) Fields(s ...googleapi.Field) *ManagementExperimentsDeleteCall {
  7921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7922. return c
  7923. }
  7924. // Context sets the context to be used in this call's Do method. Any
  7925. // pending HTTP request will be aborted if the provided context is
  7926. // canceled.
  7927. func (c *ManagementExperimentsDeleteCall) Context(ctx context.Context) *ManagementExperimentsDeleteCall {
  7928. c.ctx_ = ctx
  7929. return c
  7930. }
  7931. // Header returns an http.Header that can be modified by the caller to
  7932. // add HTTP headers to the request.
  7933. func (c *ManagementExperimentsDeleteCall) Header() http.Header {
  7934. if c.header_ == nil {
  7935. c.header_ = make(http.Header)
  7936. }
  7937. return c.header_
  7938. }
  7939. func (c *ManagementExperimentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7940. reqHeaders := make(http.Header)
  7941. for k, v := range c.header_ {
  7942. reqHeaders[k] = v
  7943. }
  7944. reqHeaders.Set("User-Agent", c.s.userAgent())
  7945. var body io.Reader = nil
  7946. c.urlParams_.Set("alt", alt)
  7947. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  7948. urls += "?" + c.urlParams_.Encode()
  7949. req, _ := http.NewRequest("DELETE", urls, body)
  7950. req.Header = reqHeaders
  7951. googleapi.Expand(req.URL, map[string]string{
  7952. "accountId": c.accountId,
  7953. "webPropertyId": c.webPropertyId,
  7954. "profileId": c.profileId,
  7955. "experimentId": c.experimentId,
  7956. })
  7957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7958. }
  7959. // Do executes the "analytics.management.experiments.delete" call.
  7960. func (c *ManagementExperimentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7961. gensupport.SetOptions(c.urlParams_, opts...)
  7962. res, err := c.doRequest("json")
  7963. if err != nil {
  7964. return err
  7965. }
  7966. defer googleapi.CloseBody(res)
  7967. if err := googleapi.CheckResponse(res); err != nil {
  7968. return err
  7969. }
  7970. return nil
  7971. // {
  7972. // "description": "Delete an experiment.",
  7973. // "httpMethod": "DELETE",
  7974. // "id": "analytics.management.experiments.delete",
  7975. // "parameterOrder": [
  7976. // "accountId",
  7977. // "webPropertyId",
  7978. // "profileId",
  7979. // "experimentId"
  7980. // ],
  7981. // "parameters": {
  7982. // "accountId": {
  7983. // "description": "Account ID to which the experiment belongs",
  7984. // "location": "path",
  7985. // "required": true,
  7986. // "type": "string"
  7987. // },
  7988. // "experimentId": {
  7989. // "description": "ID of the experiment to delete",
  7990. // "location": "path",
  7991. // "required": true,
  7992. // "type": "string"
  7993. // },
  7994. // "profileId": {
  7995. // "description": "View (Profile) ID to which the experiment belongs",
  7996. // "location": "path",
  7997. // "required": true,
  7998. // "type": "string"
  7999. // },
  8000. // "webPropertyId": {
  8001. // "description": "Web property ID to which the experiment belongs",
  8002. // "location": "path",
  8003. // "required": true,
  8004. // "type": "string"
  8005. // }
  8006. // },
  8007. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8008. // "scopes": [
  8009. // "https://www.googleapis.com/auth/analytics",
  8010. // "https://www.googleapis.com/auth/analytics.edit"
  8011. // ]
  8012. // }
  8013. }
  8014. // method id "analytics.management.experiments.get":
  8015. type ManagementExperimentsGetCall struct {
  8016. s *Service
  8017. accountId string
  8018. webPropertyId string
  8019. profileId string
  8020. experimentId string
  8021. urlParams_ gensupport.URLParams
  8022. ifNoneMatch_ string
  8023. ctx_ context.Context
  8024. header_ http.Header
  8025. }
  8026. // Get: Returns an experiment to which the user has access.
  8027. func (r *ManagementExperimentsService) Get(accountId string, webPropertyId string, profileId string, experimentId string) *ManagementExperimentsGetCall {
  8028. c := &ManagementExperimentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8029. c.accountId = accountId
  8030. c.webPropertyId = webPropertyId
  8031. c.profileId = profileId
  8032. c.experimentId = experimentId
  8033. return c
  8034. }
  8035. // Fields allows partial responses to be retrieved. See
  8036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8037. // for more information.
  8038. func (c *ManagementExperimentsGetCall) Fields(s ...googleapi.Field) *ManagementExperimentsGetCall {
  8039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8040. return c
  8041. }
  8042. // IfNoneMatch sets the optional parameter which makes the operation
  8043. // fail if the object's ETag matches the given value. This is useful for
  8044. // getting updates only after the object has changed since the last
  8045. // request. Use googleapi.IsNotModified to check whether the response
  8046. // error from Do is the result of In-None-Match.
  8047. func (c *ManagementExperimentsGetCall) IfNoneMatch(entityTag string) *ManagementExperimentsGetCall {
  8048. c.ifNoneMatch_ = entityTag
  8049. return c
  8050. }
  8051. // Context sets the context to be used in this call's Do method. Any
  8052. // pending HTTP request will be aborted if the provided context is
  8053. // canceled.
  8054. func (c *ManagementExperimentsGetCall) Context(ctx context.Context) *ManagementExperimentsGetCall {
  8055. c.ctx_ = ctx
  8056. return c
  8057. }
  8058. // Header returns an http.Header that can be modified by the caller to
  8059. // add HTTP headers to the request.
  8060. func (c *ManagementExperimentsGetCall) Header() http.Header {
  8061. if c.header_ == nil {
  8062. c.header_ = make(http.Header)
  8063. }
  8064. return c.header_
  8065. }
  8066. func (c *ManagementExperimentsGetCall) doRequest(alt string) (*http.Response, error) {
  8067. reqHeaders := make(http.Header)
  8068. for k, v := range c.header_ {
  8069. reqHeaders[k] = v
  8070. }
  8071. reqHeaders.Set("User-Agent", c.s.userAgent())
  8072. if c.ifNoneMatch_ != "" {
  8073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8074. }
  8075. var body io.Reader = nil
  8076. c.urlParams_.Set("alt", alt)
  8077. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8078. urls += "?" + c.urlParams_.Encode()
  8079. req, _ := http.NewRequest("GET", urls, body)
  8080. req.Header = reqHeaders
  8081. googleapi.Expand(req.URL, map[string]string{
  8082. "accountId": c.accountId,
  8083. "webPropertyId": c.webPropertyId,
  8084. "profileId": c.profileId,
  8085. "experimentId": c.experimentId,
  8086. })
  8087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8088. }
  8089. // Do executes the "analytics.management.experiments.get" call.
  8090. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8091. // status code is an error. Response headers are in either
  8092. // *Experiment.ServerResponse.Header or (if a response was returned at
  8093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8094. // to check whether the returned error was because
  8095. // http.StatusNotModified was returned.
  8096. func (c *ManagementExperimentsGetCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8097. gensupport.SetOptions(c.urlParams_, opts...)
  8098. res, err := c.doRequest("json")
  8099. if res != nil && res.StatusCode == http.StatusNotModified {
  8100. if res.Body != nil {
  8101. res.Body.Close()
  8102. }
  8103. return nil, &googleapi.Error{
  8104. Code: res.StatusCode,
  8105. Header: res.Header,
  8106. }
  8107. }
  8108. if err != nil {
  8109. return nil, err
  8110. }
  8111. defer googleapi.CloseBody(res)
  8112. if err := googleapi.CheckResponse(res); err != nil {
  8113. return nil, err
  8114. }
  8115. ret := &Experiment{
  8116. ServerResponse: googleapi.ServerResponse{
  8117. Header: res.Header,
  8118. HTTPStatusCode: res.StatusCode,
  8119. },
  8120. }
  8121. target := &ret
  8122. if err := gensupport.DecodeResponse(target, res); err != nil {
  8123. return nil, err
  8124. }
  8125. return ret, nil
  8126. // {
  8127. // "description": "Returns an experiment to which the user has access.",
  8128. // "httpMethod": "GET",
  8129. // "id": "analytics.management.experiments.get",
  8130. // "parameterOrder": [
  8131. // "accountId",
  8132. // "webPropertyId",
  8133. // "profileId",
  8134. // "experimentId"
  8135. // ],
  8136. // "parameters": {
  8137. // "accountId": {
  8138. // "description": "Account ID to retrieve the experiment for.",
  8139. // "location": "path",
  8140. // "required": true,
  8141. // "type": "string"
  8142. // },
  8143. // "experimentId": {
  8144. // "description": "Experiment ID to retrieve the experiment for.",
  8145. // "location": "path",
  8146. // "required": true,
  8147. // "type": "string"
  8148. // },
  8149. // "profileId": {
  8150. // "description": "View (Profile) ID to retrieve the experiment for.",
  8151. // "location": "path",
  8152. // "required": true,
  8153. // "type": "string"
  8154. // },
  8155. // "webPropertyId": {
  8156. // "description": "Web property ID to retrieve the experiment for.",
  8157. // "location": "path",
  8158. // "required": true,
  8159. // "type": "string"
  8160. // }
  8161. // },
  8162. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8163. // "response": {
  8164. // "$ref": "Experiment"
  8165. // },
  8166. // "scopes": [
  8167. // "https://www.googleapis.com/auth/analytics",
  8168. // "https://www.googleapis.com/auth/analytics.edit",
  8169. // "https://www.googleapis.com/auth/analytics.readonly"
  8170. // ]
  8171. // }
  8172. }
  8173. // method id "analytics.management.experiments.insert":
  8174. type ManagementExperimentsInsertCall struct {
  8175. s *Service
  8176. accountId string
  8177. webPropertyId string
  8178. profileId string
  8179. experiment *Experiment
  8180. urlParams_ gensupport.URLParams
  8181. ctx_ context.Context
  8182. header_ http.Header
  8183. }
  8184. // Insert: Create a new experiment.
  8185. func (r *ManagementExperimentsService) Insert(accountId string, webPropertyId string, profileId string, experiment *Experiment) *ManagementExperimentsInsertCall {
  8186. c := &ManagementExperimentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8187. c.accountId = accountId
  8188. c.webPropertyId = webPropertyId
  8189. c.profileId = profileId
  8190. c.experiment = experiment
  8191. return c
  8192. }
  8193. // Fields allows partial responses to be retrieved. See
  8194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8195. // for more information.
  8196. func (c *ManagementExperimentsInsertCall) Fields(s ...googleapi.Field) *ManagementExperimentsInsertCall {
  8197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8198. return c
  8199. }
  8200. // Context sets the context to be used in this call's Do method. Any
  8201. // pending HTTP request will be aborted if the provided context is
  8202. // canceled.
  8203. func (c *ManagementExperimentsInsertCall) Context(ctx context.Context) *ManagementExperimentsInsertCall {
  8204. c.ctx_ = ctx
  8205. return c
  8206. }
  8207. // Header returns an http.Header that can be modified by the caller to
  8208. // add HTTP headers to the request.
  8209. func (c *ManagementExperimentsInsertCall) Header() http.Header {
  8210. if c.header_ == nil {
  8211. c.header_ = make(http.Header)
  8212. }
  8213. return c.header_
  8214. }
  8215. func (c *ManagementExperimentsInsertCall) doRequest(alt string) (*http.Response, error) {
  8216. reqHeaders := make(http.Header)
  8217. for k, v := range c.header_ {
  8218. reqHeaders[k] = v
  8219. }
  8220. reqHeaders.Set("User-Agent", c.s.userAgent())
  8221. var body io.Reader = nil
  8222. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8223. if err != nil {
  8224. return nil, err
  8225. }
  8226. reqHeaders.Set("Content-Type", "application/json")
  8227. c.urlParams_.Set("alt", alt)
  8228. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  8229. urls += "?" + c.urlParams_.Encode()
  8230. req, _ := http.NewRequest("POST", urls, body)
  8231. req.Header = reqHeaders
  8232. googleapi.Expand(req.URL, map[string]string{
  8233. "accountId": c.accountId,
  8234. "webPropertyId": c.webPropertyId,
  8235. "profileId": c.profileId,
  8236. })
  8237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8238. }
  8239. // Do executes the "analytics.management.experiments.insert" call.
  8240. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8241. // status code is an error. Response headers are in either
  8242. // *Experiment.ServerResponse.Header or (if a response was returned at
  8243. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8244. // to check whether the returned error was because
  8245. // http.StatusNotModified was returned.
  8246. func (c *ManagementExperimentsInsertCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8247. gensupport.SetOptions(c.urlParams_, opts...)
  8248. res, err := c.doRequest("json")
  8249. if res != nil && res.StatusCode == http.StatusNotModified {
  8250. if res.Body != nil {
  8251. res.Body.Close()
  8252. }
  8253. return nil, &googleapi.Error{
  8254. Code: res.StatusCode,
  8255. Header: res.Header,
  8256. }
  8257. }
  8258. if err != nil {
  8259. return nil, err
  8260. }
  8261. defer googleapi.CloseBody(res)
  8262. if err := googleapi.CheckResponse(res); err != nil {
  8263. return nil, err
  8264. }
  8265. ret := &Experiment{
  8266. ServerResponse: googleapi.ServerResponse{
  8267. Header: res.Header,
  8268. HTTPStatusCode: res.StatusCode,
  8269. },
  8270. }
  8271. target := &ret
  8272. if err := gensupport.DecodeResponse(target, res); err != nil {
  8273. return nil, err
  8274. }
  8275. return ret, nil
  8276. // {
  8277. // "description": "Create a new experiment.",
  8278. // "httpMethod": "POST",
  8279. // "id": "analytics.management.experiments.insert",
  8280. // "parameterOrder": [
  8281. // "accountId",
  8282. // "webPropertyId",
  8283. // "profileId"
  8284. // ],
  8285. // "parameters": {
  8286. // "accountId": {
  8287. // "description": "Account ID to create the experiment for.",
  8288. // "location": "path",
  8289. // "required": true,
  8290. // "type": "string"
  8291. // },
  8292. // "profileId": {
  8293. // "description": "View (Profile) ID to create the experiment for.",
  8294. // "location": "path",
  8295. // "required": true,
  8296. // "type": "string"
  8297. // },
  8298. // "webPropertyId": {
  8299. // "description": "Web property ID to create the experiment for.",
  8300. // "location": "path",
  8301. // "required": true,
  8302. // "type": "string"
  8303. // }
  8304. // },
  8305. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  8306. // "request": {
  8307. // "$ref": "Experiment"
  8308. // },
  8309. // "response": {
  8310. // "$ref": "Experiment"
  8311. // },
  8312. // "scopes": [
  8313. // "https://www.googleapis.com/auth/analytics",
  8314. // "https://www.googleapis.com/auth/analytics.edit"
  8315. // ]
  8316. // }
  8317. }
  8318. // method id "analytics.management.experiments.list":
  8319. type ManagementExperimentsListCall struct {
  8320. s *Service
  8321. accountId string
  8322. webPropertyId string
  8323. profileId string
  8324. urlParams_ gensupport.URLParams
  8325. ifNoneMatch_ string
  8326. ctx_ context.Context
  8327. header_ http.Header
  8328. }
  8329. // List: Lists experiments to which the user has access.
  8330. func (r *ManagementExperimentsService) List(accountId string, webPropertyId string, profileId string) *ManagementExperimentsListCall {
  8331. c := &ManagementExperimentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8332. c.accountId = accountId
  8333. c.webPropertyId = webPropertyId
  8334. c.profileId = profileId
  8335. return c
  8336. }
  8337. // MaxResults sets the optional parameter "max-results": The maximum
  8338. // number of experiments to include in this response.
  8339. func (c *ManagementExperimentsListCall) MaxResults(maxResults int64) *ManagementExperimentsListCall {
  8340. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  8341. return c
  8342. }
  8343. // StartIndex sets the optional parameter "start-index": An index of the
  8344. // first experiment to retrieve. Use this parameter as a pagination
  8345. // mechanism along with the max-results parameter.
  8346. func (c *ManagementExperimentsListCall) StartIndex(startIndex int64) *ManagementExperimentsListCall {
  8347. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  8348. return c
  8349. }
  8350. // Fields allows partial responses to be retrieved. See
  8351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8352. // for more information.
  8353. func (c *ManagementExperimentsListCall) Fields(s ...googleapi.Field) *ManagementExperimentsListCall {
  8354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8355. return c
  8356. }
  8357. // IfNoneMatch sets the optional parameter which makes the operation
  8358. // fail if the object's ETag matches the given value. This is useful for
  8359. // getting updates only after the object has changed since the last
  8360. // request. Use googleapi.IsNotModified to check whether the response
  8361. // error from Do is the result of In-None-Match.
  8362. func (c *ManagementExperimentsListCall) IfNoneMatch(entityTag string) *ManagementExperimentsListCall {
  8363. c.ifNoneMatch_ = entityTag
  8364. return c
  8365. }
  8366. // Context sets the context to be used in this call's Do method. Any
  8367. // pending HTTP request will be aborted if the provided context is
  8368. // canceled.
  8369. func (c *ManagementExperimentsListCall) Context(ctx context.Context) *ManagementExperimentsListCall {
  8370. c.ctx_ = ctx
  8371. return c
  8372. }
  8373. // Header returns an http.Header that can be modified by the caller to
  8374. // add HTTP headers to the request.
  8375. func (c *ManagementExperimentsListCall) Header() http.Header {
  8376. if c.header_ == nil {
  8377. c.header_ = make(http.Header)
  8378. }
  8379. return c.header_
  8380. }
  8381. func (c *ManagementExperimentsListCall) doRequest(alt string) (*http.Response, error) {
  8382. reqHeaders := make(http.Header)
  8383. for k, v := range c.header_ {
  8384. reqHeaders[k] = v
  8385. }
  8386. reqHeaders.Set("User-Agent", c.s.userAgent())
  8387. if c.ifNoneMatch_ != "" {
  8388. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8389. }
  8390. var body io.Reader = nil
  8391. c.urlParams_.Set("alt", alt)
  8392. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments")
  8393. urls += "?" + c.urlParams_.Encode()
  8394. req, _ := http.NewRequest("GET", urls, body)
  8395. req.Header = reqHeaders
  8396. googleapi.Expand(req.URL, map[string]string{
  8397. "accountId": c.accountId,
  8398. "webPropertyId": c.webPropertyId,
  8399. "profileId": c.profileId,
  8400. })
  8401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8402. }
  8403. // Do executes the "analytics.management.experiments.list" call.
  8404. // Exactly one of *Experiments or error will be non-nil. Any non-2xx
  8405. // status code is an error. Response headers are in either
  8406. // *Experiments.ServerResponse.Header or (if a response was returned at
  8407. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8408. // to check whether the returned error was because
  8409. // http.StatusNotModified was returned.
  8410. func (c *ManagementExperimentsListCall) Do(opts ...googleapi.CallOption) (*Experiments, error) {
  8411. gensupport.SetOptions(c.urlParams_, opts...)
  8412. res, err := c.doRequest("json")
  8413. if res != nil && res.StatusCode == http.StatusNotModified {
  8414. if res.Body != nil {
  8415. res.Body.Close()
  8416. }
  8417. return nil, &googleapi.Error{
  8418. Code: res.StatusCode,
  8419. Header: res.Header,
  8420. }
  8421. }
  8422. if err != nil {
  8423. return nil, err
  8424. }
  8425. defer googleapi.CloseBody(res)
  8426. if err := googleapi.CheckResponse(res); err != nil {
  8427. return nil, err
  8428. }
  8429. ret := &Experiments{
  8430. ServerResponse: googleapi.ServerResponse{
  8431. Header: res.Header,
  8432. HTTPStatusCode: res.StatusCode,
  8433. },
  8434. }
  8435. target := &ret
  8436. if err := gensupport.DecodeResponse(target, res); err != nil {
  8437. return nil, err
  8438. }
  8439. return ret, nil
  8440. // {
  8441. // "description": "Lists experiments to which the user has access.",
  8442. // "httpMethod": "GET",
  8443. // "id": "analytics.management.experiments.list",
  8444. // "parameterOrder": [
  8445. // "accountId",
  8446. // "webPropertyId",
  8447. // "profileId"
  8448. // ],
  8449. // "parameters": {
  8450. // "accountId": {
  8451. // "description": "Account ID to retrieve experiments for.",
  8452. // "location": "path",
  8453. // "pattern": "\\d+",
  8454. // "required": true,
  8455. // "type": "string"
  8456. // },
  8457. // "max-results": {
  8458. // "description": "The maximum number of experiments to include in this response.",
  8459. // "format": "int32",
  8460. // "location": "query",
  8461. // "type": "integer"
  8462. // },
  8463. // "profileId": {
  8464. // "description": "View (Profile) ID to retrieve experiments for.",
  8465. // "location": "path",
  8466. // "pattern": "\\d+",
  8467. // "required": true,
  8468. // "type": "string"
  8469. // },
  8470. // "start-index": {
  8471. // "description": "An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  8472. // "format": "int32",
  8473. // "location": "query",
  8474. // "minimum": "1",
  8475. // "type": "integer"
  8476. // },
  8477. // "webPropertyId": {
  8478. // "description": "Web property ID to retrieve experiments for.",
  8479. // "location": "path",
  8480. // "pattern": "UA-(\\d+)-(\\d+)",
  8481. // "required": true,
  8482. // "type": "string"
  8483. // }
  8484. // },
  8485. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments",
  8486. // "response": {
  8487. // "$ref": "Experiments"
  8488. // },
  8489. // "scopes": [
  8490. // "https://www.googleapis.com/auth/analytics",
  8491. // "https://www.googleapis.com/auth/analytics.edit",
  8492. // "https://www.googleapis.com/auth/analytics.readonly"
  8493. // ]
  8494. // }
  8495. }
  8496. // method id "analytics.management.experiments.patch":
  8497. type ManagementExperimentsPatchCall struct {
  8498. s *Service
  8499. accountId string
  8500. webPropertyId string
  8501. profileId string
  8502. experimentId string
  8503. experiment *Experiment
  8504. urlParams_ gensupport.URLParams
  8505. ctx_ context.Context
  8506. header_ http.Header
  8507. }
  8508. // Patch: Update an existing experiment. This method supports patch
  8509. // semantics.
  8510. func (r *ManagementExperimentsService) Patch(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsPatchCall {
  8511. c := &ManagementExperimentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8512. c.accountId = accountId
  8513. c.webPropertyId = webPropertyId
  8514. c.profileId = profileId
  8515. c.experimentId = experimentId
  8516. c.experiment = experiment
  8517. return c
  8518. }
  8519. // Fields allows partial responses to be retrieved. See
  8520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8521. // for more information.
  8522. func (c *ManagementExperimentsPatchCall) Fields(s ...googleapi.Field) *ManagementExperimentsPatchCall {
  8523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8524. return c
  8525. }
  8526. // Context sets the context to be used in this call's Do method. Any
  8527. // pending HTTP request will be aborted if the provided context is
  8528. // canceled.
  8529. func (c *ManagementExperimentsPatchCall) Context(ctx context.Context) *ManagementExperimentsPatchCall {
  8530. c.ctx_ = ctx
  8531. return c
  8532. }
  8533. // Header returns an http.Header that can be modified by the caller to
  8534. // add HTTP headers to the request.
  8535. func (c *ManagementExperimentsPatchCall) Header() http.Header {
  8536. if c.header_ == nil {
  8537. c.header_ = make(http.Header)
  8538. }
  8539. return c.header_
  8540. }
  8541. func (c *ManagementExperimentsPatchCall) doRequest(alt string) (*http.Response, error) {
  8542. reqHeaders := make(http.Header)
  8543. for k, v := range c.header_ {
  8544. reqHeaders[k] = v
  8545. }
  8546. reqHeaders.Set("User-Agent", c.s.userAgent())
  8547. var body io.Reader = nil
  8548. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8549. if err != nil {
  8550. return nil, err
  8551. }
  8552. reqHeaders.Set("Content-Type", "application/json")
  8553. c.urlParams_.Set("alt", alt)
  8554. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8555. urls += "?" + c.urlParams_.Encode()
  8556. req, _ := http.NewRequest("PATCH", urls, body)
  8557. req.Header = reqHeaders
  8558. googleapi.Expand(req.URL, map[string]string{
  8559. "accountId": c.accountId,
  8560. "webPropertyId": c.webPropertyId,
  8561. "profileId": c.profileId,
  8562. "experimentId": c.experimentId,
  8563. })
  8564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8565. }
  8566. // Do executes the "analytics.management.experiments.patch" call.
  8567. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8568. // status code is an error. Response headers are in either
  8569. // *Experiment.ServerResponse.Header or (if a response was returned at
  8570. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8571. // to check whether the returned error was because
  8572. // http.StatusNotModified was returned.
  8573. func (c *ManagementExperimentsPatchCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8574. gensupport.SetOptions(c.urlParams_, opts...)
  8575. res, err := c.doRequest("json")
  8576. if res != nil && res.StatusCode == http.StatusNotModified {
  8577. if res.Body != nil {
  8578. res.Body.Close()
  8579. }
  8580. return nil, &googleapi.Error{
  8581. Code: res.StatusCode,
  8582. Header: res.Header,
  8583. }
  8584. }
  8585. if err != nil {
  8586. return nil, err
  8587. }
  8588. defer googleapi.CloseBody(res)
  8589. if err := googleapi.CheckResponse(res); err != nil {
  8590. return nil, err
  8591. }
  8592. ret := &Experiment{
  8593. ServerResponse: googleapi.ServerResponse{
  8594. Header: res.Header,
  8595. HTTPStatusCode: res.StatusCode,
  8596. },
  8597. }
  8598. target := &ret
  8599. if err := gensupport.DecodeResponse(target, res); err != nil {
  8600. return nil, err
  8601. }
  8602. return ret, nil
  8603. // {
  8604. // "description": "Update an existing experiment. This method supports patch semantics.",
  8605. // "httpMethod": "PATCH",
  8606. // "id": "analytics.management.experiments.patch",
  8607. // "parameterOrder": [
  8608. // "accountId",
  8609. // "webPropertyId",
  8610. // "profileId",
  8611. // "experimentId"
  8612. // ],
  8613. // "parameters": {
  8614. // "accountId": {
  8615. // "description": "Account ID of the experiment to update.",
  8616. // "location": "path",
  8617. // "required": true,
  8618. // "type": "string"
  8619. // },
  8620. // "experimentId": {
  8621. // "description": "Experiment ID of the experiment to update.",
  8622. // "location": "path",
  8623. // "required": true,
  8624. // "type": "string"
  8625. // },
  8626. // "profileId": {
  8627. // "description": "View (Profile) ID of the experiment to update.",
  8628. // "location": "path",
  8629. // "required": true,
  8630. // "type": "string"
  8631. // },
  8632. // "webPropertyId": {
  8633. // "description": "Web property ID of the experiment to update.",
  8634. // "location": "path",
  8635. // "required": true,
  8636. // "type": "string"
  8637. // }
  8638. // },
  8639. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8640. // "request": {
  8641. // "$ref": "Experiment"
  8642. // },
  8643. // "response": {
  8644. // "$ref": "Experiment"
  8645. // },
  8646. // "scopes": [
  8647. // "https://www.googleapis.com/auth/analytics",
  8648. // "https://www.googleapis.com/auth/analytics.edit"
  8649. // ]
  8650. // }
  8651. }
  8652. // method id "analytics.management.experiments.update":
  8653. type ManagementExperimentsUpdateCall struct {
  8654. s *Service
  8655. accountId string
  8656. webPropertyId string
  8657. profileId string
  8658. experimentId string
  8659. experiment *Experiment
  8660. urlParams_ gensupport.URLParams
  8661. ctx_ context.Context
  8662. header_ http.Header
  8663. }
  8664. // Update: Update an existing experiment.
  8665. func (r *ManagementExperimentsService) Update(accountId string, webPropertyId string, profileId string, experimentId string, experiment *Experiment) *ManagementExperimentsUpdateCall {
  8666. c := &ManagementExperimentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8667. c.accountId = accountId
  8668. c.webPropertyId = webPropertyId
  8669. c.profileId = profileId
  8670. c.experimentId = experimentId
  8671. c.experiment = experiment
  8672. return c
  8673. }
  8674. // Fields allows partial responses to be retrieved. See
  8675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8676. // for more information.
  8677. func (c *ManagementExperimentsUpdateCall) Fields(s ...googleapi.Field) *ManagementExperimentsUpdateCall {
  8678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8679. return c
  8680. }
  8681. // Context sets the context to be used in this call's Do method. Any
  8682. // pending HTTP request will be aborted if the provided context is
  8683. // canceled.
  8684. func (c *ManagementExperimentsUpdateCall) Context(ctx context.Context) *ManagementExperimentsUpdateCall {
  8685. c.ctx_ = ctx
  8686. return c
  8687. }
  8688. // Header returns an http.Header that can be modified by the caller to
  8689. // add HTTP headers to the request.
  8690. func (c *ManagementExperimentsUpdateCall) Header() http.Header {
  8691. if c.header_ == nil {
  8692. c.header_ = make(http.Header)
  8693. }
  8694. return c.header_
  8695. }
  8696. func (c *ManagementExperimentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8697. reqHeaders := make(http.Header)
  8698. for k, v := range c.header_ {
  8699. reqHeaders[k] = v
  8700. }
  8701. reqHeaders.Set("User-Agent", c.s.userAgent())
  8702. var body io.Reader = nil
  8703. body, err := googleapi.WithoutDataWrapper.JSONReader(c.experiment)
  8704. if err != nil {
  8705. return nil, err
  8706. }
  8707. reqHeaders.Set("Content-Type", "application/json")
  8708. c.urlParams_.Set("alt", alt)
  8709. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}")
  8710. urls += "?" + c.urlParams_.Encode()
  8711. req, _ := http.NewRequest("PUT", urls, body)
  8712. req.Header = reqHeaders
  8713. googleapi.Expand(req.URL, map[string]string{
  8714. "accountId": c.accountId,
  8715. "webPropertyId": c.webPropertyId,
  8716. "profileId": c.profileId,
  8717. "experimentId": c.experimentId,
  8718. })
  8719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8720. }
  8721. // Do executes the "analytics.management.experiments.update" call.
  8722. // Exactly one of *Experiment or error will be non-nil. Any non-2xx
  8723. // status code is an error. Response headers are in either
  8724. // *Experiment.ServerResponse.Header or (if a response was returned at
  8725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8726. // to check whether the returned error was because
  8727. // http.StatusNotModified was returned.
  8728. func (c *ManagementExperimentsUpdateCall) Do(opts ...googleapi.CallOption) (*Experiment, error) {
  8729. gensupport.SetOptions(c.urlParams_, opts...)
  8730. res, err := c.doRequest("json")
  8731. if res != nil && res.StatusCode == http.StatusNotModified {
  8732. if res.Body != nil {
  8733. res.Body.Close()
  8734. }
  8735. return nil, &googleapi.Error{
  8736. Code: res.StatusCode,
  8737. Header: res.Header,
  8738. }
  8739. }
  8740. if err != nil {
  8741. return nil, err
  8742. }
  8743. defer googleapi.CloseBody(res)
  8744. if err := googleapi.CheckResponse(res); err != nil {
  8745. return nil, err
  8746. }
  8747. ret := &Experiment{
  8748. ServerResponse: googleapi.ServerResponse{
  8749. Header: res.Header,
  8750. HTTPStatusCode: res.StatusCode,
  8751. },
  8752. }
  8753. target := &ret
  8754. if err := gensupport.DecodeResponse(target, res); err != nil {
  8755. return nil, err
  8756. }
  8757. return ret, nil
  8758. // {
  8759. // "description": "Update an existing experiment.",
  8760. // "httpMethod": "PUT",
  8761. // "id": "analytics.management.experiments.update",
  8762. // "parameterOrder": [
  8763. // "accountId",
  8764. // "webPropertyId",
  8765. // "profileId",
  8766. // "experimentId"
  8767. // ],
  8768. // "parameters": {
  8769. // "accountId": {
  8770. // "description": "Account ID of the experiment to update.",
  8771. // "location": "path",
  8772. // "required": true,
  8773. // "type": "string"
  8774. // },
  8775. // "experimentId": {
  8776. // "description": "Experiment ID of the experiment to update.",
  8777. // "location": "path",
  8778. // "required": true,
  8779. // "type": "string"
  8780. // },
  8781. // "profileId": {
  8782. // "description": "View (Profile) ID of the experiment to update.",
  8783. // "location": "path",
  8784. // "required": true,
  8785. // "type": "string"
  8786. // },
  8787. // "webPropertyId": {
  8788. // "description": "Web property ID of the experiment to update.",
  8789. // "location": "path",
  8790. // "required": true,
  8791. // "type": "string"
  8792. // }
  8793. // },
  8794. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}",
  8795. // "request": {
  8796. // "$ref": "Experiment"
  8797. // },
  8798. // "response": {
  8799. // "$ref": "Experiment"
  8800. // },
  8801. // "scopes": [
  8802. // "https://www.googleapis.com/auth/analytics",
  8803. // "https://www.googleapis.com/auth/analytics.edit"
  8804. // ]
  8805. // }
  8806. }
  8807. // method id "analytics.management.filters.delete":
  8808. type ManagementFiltersDeleteCall struct {
  8809. s *Service
  8810. accountId string
  8811. filterId string
  8812. urlParams_ gensupport.URLParams
  8813. ctx_ context.Context
  8814. header_ http.Header
  8815. }
  8816. // Delete: Delete a filter.
  8817. func (r *ManagementFiltersService) Delete(accountId string, filterId string) *ManagementFiltersDeleteCall {
  8818. c := &ManagementFiltersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8819. c.accountId = accountId
  8820. c.filterId = filterId
  8821. return c
  8822. }
  8823. // Fields allows partial responses to be retrieved. See
  8824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8825. // for more information.
  8826. func (c *ManagementFiltersDeleteCall) Fields(s ...googleapi.Field) *ManagementFiltersDeleteCall {
  8827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8828. return c
  8829. }
  8830. // Context sets the context to be used in this call's Do method. Any
  8831. // pending HTTP request will be aborted if the provided context is
  8832. // canceled.
  8833. func (c *ManagementFiltersDeleteCall) Context(ctx context.Context) *ManagementFiltersDeleteCall {
  8834. c.ctx_ = ctx
  8835. return c
  8836. }
  8837. // Header returns an http.Header that can be modified by the caller to
  8838. // add HTTP headers to the request.
  8839. func (c *ManagementFiltersDeleteCall) Header() http.Header {
  8840. if c.header_ == nil {
  8841. c.header_ = make(http.Header)
  8842. }
  8843. return c.header_
  8844. }
  8845. func (c *ManagementFiltersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8846. reqHeaders := make(http.Header)
  8847. for k, v := range c.header_ {
  8848. reqHeaders[k] = v
  8849. }
  8850. reqHeaders.Set("User-Agent", c.s.userAgent())
  8851. var body io.Reader = nil
  8852. c.urlParams_.Set("alt", alt)
  8853. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  8854. urls += "?" + c.urlParams_.Encode()
  8855. req, _ := http.NewRequest("DELETE", urls, body)
  8856. req.Header = reqHeaders
  8857. googleapi.Expand(req.URL, map[string]string{
  8858. "accountId": c.accountId,
  8859. "filterId": c.filterId,
  8860. })
  8861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8862. }
  8863. // Do executes the "analytics.management.filters.delete" call.
  8864. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  8865. // code is an error. Response headers are in either
  8866. // *Filter.ServerResponse.Header or (if a response was returned at all)
  8867. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8868. // check whether the returned error was because http.StatusNotModified
  8869. // was returned.
  8870. func (c *ManagementFiltersDeleteCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  8871. gensupport.SetOptions(c.urlParams_, opts...)
  8872. res, err := c.doRequest("json")
  8873. if res != nil && res.StatusCode == http.StatusNotModified {
  8874. if res.Body != nil {
  8875. res.Body.Close()
  8876. }
  8877. return nil, &googleapi.Error{
  8878. Code: res.StatusCode,
  8879. Header: res.Header,
  8880. }
  8881. }
  8882. if err != nil {
  8883. return nil, err
  8884. }
  8885. defer googleapi.CloseBody(res)
  8886. if err := googleapi.CheckResponse(res); err != nil {
  8887. return nil, err
  8888. }
  8889. ret := &Filter{
  8890. ServerResponse: googleapi.ServerResponse{
  8891. Header: res.Header,
  8892. HTTPStatusCode: res.StatusCode,
  8893. },
  8894. }
  8895. target := &ret
  8896. if err := gensupport.DecodeResponse(target, res); err != nil {
  8897. return nil, err
  8898. }
  8899. return ret, nil
  8900. // {
  8901. // "description": "Delete a filter.",
  8902. // "httpMethod": "DELETE",
  8903. // "id": "analytics.management.filters.delete",
  8904. // "parameterOrder": [
  8905. // "accountId",
  8906. // "filterId"
  8907. // ],
  8908. // "parameters": {
  8909. // "accountId": {
  8910. // "description": "Account ID to delete the filter for.",
  8911. // "location": "path",
  8912. // "required": true,
  8913. // "type": "string"
  8914. // },
  8915. // "filterId": {
  8916. // "description": "ID of the filter to be deleted.",
  8917. // "location": "path",
  8918. // "required": true,
  8919. // "type": "string"
  8920. // }
  8921. // },
  8922. // "path": "management/accounts/{accountId}/filters/{filterId}",
  8923. // "response": {
  8924. // "$ref": "Filter"
  8925. // },
  8926. // "scopes": [
  8927. // "https://www.googleapis.com/auth/analytics.edit"
  8928. // ]
  8929. // }
  8930. }
  8931. // method id "analytics.management.filters.get":
  8932. type ManagementFiltersGetCall struct {
  8933. s *Service
  8934. accountId string
  8935. filterId string
  8936. urlParams_ gensupport.URLParams
  8937. ifNoneMatch_ string
  8938. ctx_ context.Context
  8939. header_ http.Header
  8940. }
  8941. // Get: Returns a filters to which the user has access.
  8942. func (r *ManagementFiltersService) Get(accountId string, filterId string) *ManagementFiltersGetCall {
  8943. c := &ManagementFiltersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8944. c.accountId = accountId
  8945. c.filterId = filterId
  8946. return c
  8947. }
  8948. // Fields allows partial responses to be retrieved. See
  8949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8950. // for more information.
  8951. func (c *ManagementFiltersGetCall) Fields(s ...googleapi.Field) *ManagementFiltersGetCall {
  8952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8953. return c
  8954. }
  8955. // IfNoneMatch sets the optional parameter which makes the operation
  8956. // fail if the object's ETag matches the given value. This is useful for
  8957. // getting updates only after the object has changed since the last
  8958. // request. Use googleapi.IsNotModified to check whether the response
  8959. // error from Do is the result of In-None-Match.
  8960. func (c *ManagementFiltersGetCall) IfNoneMatch(entityTag string) *ManagementFiltersGetCall {
  8961. c.ifNoneMatch_ = entityTag
  8962. return c
  8963. }
  8964. // Context sets the context to be used in this call's Do method. Any
  8965. // pending HTTP request will be aborted if the provided context is
  8966. // canceled.
  8967. func (c *ManagementFiltersGetCall) Context(ctx context.Context) *ManagementFiltersGetCall {
  8968. c.ctx_ = ctx
  8969. return c
  8970. }
  8971. // Header returns an http.Header that can be modified by the caller to
  8972. // add HTTP headers to the request.
  8973. func (c *ManagementFiltersGetCall) Header() http.Header {
  8974. if c.header_ == nil {
  8975. c.header_ = make(http.Header)
  8976. }
  8977. return c.header_
  8978. }
  8979. func (c *ManagementFiltersGetCall) doRequest(alt string) (*http.Response, error) {
  8980. reqHeaders := make(http.Header)
  8981. for k, v := range c.header_ {
  8982. reqHeaders[k] = v
  8983. }
  8984. reqHeaders.Set("User-Agent", c.s.userAgent())
  8985. if c.ifNoneMatch_ != "" {
  8986. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8987. }
  8988. var body io.Reader = nil
  8989. c.urlParams_.Set("alt", alt)
  8990. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  8991. urls += "?" + c.urlParams_.Encode()
  8992. req, _ := http.NewRequest("GET", urls, body)
  8993. req.Header = reqHeaders
  8994. googleapi.Expand(req.URL, map[string]string{
  8995. "accountId": c.accountId,
  8996. "filterId": c.filterId,
  8997. })
  8998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8999. }
  9000. // Do executes the "analytics.management.filters.get" call.
  9001. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9002. // code is an error. Response headers are in either
  9003. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9004. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9005. // check whether the returned error was because http.StatusNotModified
  9006. // was returned.
  9007. func (c *ManagementFiltersGetCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9008. gensupport.SetOptions(c.urlParams_, opts...)
  9009. res, err := c.doRequest("json")
  9010. if res != nil && res.StatusCode == http.StatusNotModified {
  9011. if res.Body != nil {
  9012. res.Body.Close()
  9013. }
  9014. return nil, &googleapi.Error{
  9015. Code: res.StatusCode,
  9016. Header: res.Header,
  9017. }
  9018. }
  9019. if err != nil {
  9020. return nil, err
  9021. }
  9022. defer googleapi.CloseBody(res)
  9023. if err := googleapi.CheckResponse(res); err != nil {
  9024. return nil, err
  9025. }
  9026. ret := &Filter{
  9027. ServerResponse: googleapi.ServerResponse{
  9028. Header: res.Header,
  9029. HTTPStatusCode: res.StatusCode,
  9030. },
  9031. }
  9032. target := &ret
  9033. if err := gensupport.DecodeResponse(target, res); err != nil {
  9034. return nil, err
  9035. }
  9036. return ret, nil
  9037. // {
  9038. // "description": "Returns a filters to which the user has access.",
  9039. // "httpMethod": "GET",
  9040. // "id": "analytics.management.filters.get",
  9041. // "parameterOrder": [
  9042. // "accountId",
  9043. // "filterId"
  9044. // ],
  9045. // "parameters": {
  9046. // "accountId": {
  9047. // "description": "Account ID to retrieve filters for.",
  9048. // "location": "path",
  9049. // "required": true,
  9050. // "type": "string"
  9051. // },
  9052. // "filterId": {
  9053. // "description": "Filter ID to retrieve filters for.",
  9054. // "location": "path",
  9055. // "required": true,
  9056. // "type": "string"
  9057. // }
  9058. // },
  9059. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9060. // "response": {
  9061. // "$ref": "Filter"
  9062. // },
  9063. // "scopes": [
  9064. // "https://www.googleapis.com/auth/analytics.edit",
  9065. // "https://www.googleapis.com/auth/analytics.readonly"
  9066. // ]
  9067. // }
  9068. }
  9069. // method id "analytics.management.filters.insert":
  9070. type ManagementFiltersInsertCall struct {
  9071. s *Service
  9072. accountId string
  9073. filter *Filter
  9074. urlParams_ gensupport.URLParams
  9075. ctx_ context.Context
  9076. header_ http.Header
  9077. }
  9078. // Insert: Create a new filter.
  9079. func (r *ManagementFiltersService) Insert(accountId string, filter *Filter) *ManagementFiltersInsertCall {
  9080. c := &ManagementFiltersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9081. c.accountId = accountId
  9082. c.filter = filter
  9083. return c
  9084. }
  9085. // Fields allows partial responses to be retrieved. See
  9086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9087. // for more information.
  9088. func (c *ManagementFiltersInsertCall) Fields(s ...googleapi.Field) *ManagementFiltersInsertCall {
  9089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9090. return c
  9091. }
  9092. // Context sets the context to be used in this call's Do method. Any
  9093. // pending HTTP request will be aborted if the provided context is
  9094. // canceled.
  9095. func (c *ManagementFiltersInsertCall) Context(ctx context.Context) *ManagementFiltersInsertCall {
  9096. c.ctx_ = ctx
  9097. return c
  9098. }
  9099. // Header returns an http.Header that can be modified by the caller to
  9100. // add HTTP headers to the request.
  9101. func (c *ManagementFiltersInsertCall) Header() http.Header {
  9102. if c.header_ == nil {
  9103. c.header_ = make(http.Header)
  9104. }
  9105. return c.header_
  9106. }
  9107. func (c *ManagementFiltersInsertCall) doRequest(alt string) (*http.Response, error) {
  9108. reqHeaders := make(http.Header)
  9109. for k, v := range c.header_ {
  9110. reqHeaders[k] = v
  9111. }
  9112. reqHeaders.Set("User-Agent", c.s.userAgent())
  9113. var body io.Reader = nil
  9114. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9115. if err != nil {
  9116. return nil, err
  9117. }
  9118. reqHeaders.Set("Content-Type", "application/json")
  9119. c.urlParams_.Set("alt", alt)
  9120. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  9121. urls += "?" + c.urlParams_.Encode()
  9122. req, _ := http.NewRequest("POST", urls, body)
  9123. req.Header = reqHeaders
  9124. googleapi.Expand(req.URL, map[string]string{
  9125. "accountId": c.accountId,
  9126. })
  9127. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9128. }
  9129. // Do executes the "analytics.management.filters.insert" call.
  9130. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9131. // code is an error. Response headers are in either
  9132. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9133. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9134. // check whether the returned error was because http.StatusNotModified
  9135. // was returned.
  9136. func (c *ManagementFiltersInsertCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9137. gensupport.SetOptions(c.urlParams_, opts...)
  9138. res, err := c.doRequest("json")
  9139. if res != nil && res.StatusCode == http.StatusNotModified {
  9140. if res.Body != nil {
  9141. res.Body.Close()
  9142. }
  9143. return nil, &googleapi.Error{
  9144. Code: res.StatusCode,
  9145. Header: res.Header,
  9146. }
  9147. }
  9148. if err != nil {
  9149. return nil, err
  9150. }
  9151. defer googleapi.CloseBody(res)
  9152. if err := googleapi.CheckResponse(res); err != nil {
  9153. return nil, err
  9154. }
  9155. ret := &Filter{
  9156. ServerResponse: googleapi.ServerResponse{
  9157. Header: res.Header,
  9158. HTTPStatusCode: res.StatusCode,
  9159. },
  9160. }
  9161. target := &ret
  9162. if err := gensupport.DecodeResponse(target, res); err != nil {
  9163. return nil, err
  9164. }
  9165. return ret, nil
  9166. // {
  9167. // "description": "Create a new filter.",
  9168. // "httpMethod": "POST",
  9169. // "id": "analytics.management.filters.insert",
  9170. // "parameterOrder": [
  9171. // "accountId"
  9172. // ],
  9173. // "parameters": {
  9174. // "accountId": {
  9175. // "description": "Account ID to create filter for.",
  9176. // "location": "path",
  9177. // "required": true,
  9178. // "type": "string"
  9179. // }
  9180. // },
  9181. // "path": "management/accounts/{accountId}/filters",
  9182. // "request": {
  9183. // "$ref": "Filter"
  9184. // },
  9185. // "response": {
  9186. // "$ref": "Filter"
  9187. // },
  9188. // "scopes": [
  9189. // "https://www.googleapis.com/auth/analytics.edit"
  9190. // ]
  9191. // }
  9192. }
  9193. // method id "analytics.management.filters.list":
  9194. type ManagementFiltersListCall struct {
  9195. s *Service
  9196. accountId string
  9197. urlParams_ gensupport.URLParams
  9198. ifNoneMatch_ string
  9199. ctx_ context.Context
  9200. header_ http.Header
  9201. }
  9202. // List: Lists all filters for an account
  9203. func (r *ManagementFiltersService) List(accountId string) *ManagementFiltersListCall {
  9204. c := &ManagementFiltersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9205. c.accountId = accountId
  9206. return c
  9207. }
  9208. // MaxResults sets the optional parameter "max-results": The maximum
  9209. // number of filters to include in this response.
  9210. func (c *ManagementFiltersListCall) MaxResults(maxResults int64) *ManagementFiltersListCall {
  9211. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  9212. return c
  9213. }
  9214. // StartIndex sets the optional parameter "start-index": An index of the
  9215. // first entity to retrieve. Use this parameter as a pagination
  9216. // mechanism along with the max-results parameter.
  9217. func (c *ManagementFiltersListCall) StartIndex(startIndex int64) *ManagementFiltersListCall {
  9218. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  9219. return c
  9220. }
  9221. // Fields allows partial responses to be retrieved. See
  9222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9223. // for more information.
  9224. func (c *ManagementFiltersListCall) Fields(s ...googleapi.Field) *ManagementFiltersListCall {
  9225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9226. return c
  9227. }
  9228. // IfNoneMatch sets the optional parameter which makes the operation
  9229. // fail if the object's ETag matches the given value. This is useful for
  9230. // getting updates only after the object has changed since the last
  9231. // request. Use googleapi.IsNotModified to check whether the response
  9232. // error from Do is the result of In-None-Match.
  9233. func (c *ManagementFiltersListCall) IfNoneMatch(entityTag string) *ManagementFiltersListCall {
  9234. c.ifNoneMatch_ = entityTag
  9235. return c
  9236. }
  9237. // Context sets the context to be used in this call's Do method. Any
  9238. // pending HTTP request will be aborted if the provided context is
  9239. // canceled.
  9240. func (c *ManagementFiltersListCall) Context(ctx context.Context) *ManagementFiltersListCall {
  9241. c.ctx_ = ctx
  9242. return c
  9243. }
  9244. // Header returns an http.Header that can be modified by the caller to
  9245. // add HTTP headers to the request.
  9246. func (c *ManagementFiltersListCall) Header() http.Header {
  9247. if c.header_ == nil {
  9248. c.header_ = make(http.Header)
  9249. }
  9250. return c.header_
  9251. }
  9252. func (c *ManagementFiltersListCall) doRequest(alt string) (*http.Response, error) {
  9253. reqHeaders := make(http.Header)
  9254. for k, v := range c.header_ {
  9255. reqHeaders[k] = v
  9256. }
  9257. reqHeaders.Set("User-Agent", c.s.userAgent())
  9258. if c.ifNoneMatch_ != "" {
  9259. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9260. }
  9261. var body io.Reader = nil
  9262. c.urlParams_.Set("alt", alt)
  9263. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters")
  9264. urls += "?" + c.urlParams_.Encode()
  9265. req, _ := http.NewRequest("GET", urls, body)
  9266. req.Header = reqHeaders
  9267. googleapi.Expand(req.URL, map[string]string{
  9268. "accountId": c.accountId,
  9269. })
  9270. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9271. }
  9272. // Do executes the "analytics.management.filters.list" call.
  9273. // Exactly one of *Filters or error will be non-nil. Any non-2xx status
  9274. // code is an error. Response headers are in either
  9275. // *Filters.ServerResponse.Header or (if a response was returned at all)
  9276. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9277. // check whether the returned error was because http.StatusNotModified
  9278. // was returned.
  9279. func (c *ManagementFiltersListCall) Do(opts ...googleapi.CallOption) (*Filters, error) {
  9280. gensupport.SetOptions(c.urlParams_, opts...)
  9281. res, err := c.doRequest("json")
  9282. if res != nil && res.StatusCode == http.StatusNotModified {
  9283. if res.Body != nil {
  9284. res.Body.Close()
  9285. }
  9286. return nil, &googleapi.Error{
  9287. Code: res.StatusCode,
  9288. Header: res.Header,
  9289. }
  9290. }
  9291. if err != nil {
  9292. return nil, err
  9293. }
  9294. defer googleapi.CloseBody(res)
  9295. if err := googleapi.CheckResponse(res); err != nil {
  9296. return nil, err
  9297. }
  9298. ret := &Filters{
  9299. ServerResponse: googleapi.ServerResponse{
  9300. Header: res.Header,
  9301. HTTPStatusCode: res.StatusCode,
  9302. },
  9303. }
  9304. target := &ret
  9305. if err := gensupport.DecodeResponse(target, res); err != nil {
  9306. return nil, err
  9307. }
  9308. return ret, nil
  9309. // {
  9310. // "description": "Lists all filters for an account",
  9311. // "httpMethod": "GET",
  9312. // "id": "analytics.management.filters.list",
  9313. // "parameterOrder": [
  9314. // "accountId"
  9315. // ],
  9316. // "parameters": {
  9317. // "accountId": {
  9318. // "description": "Account ID to retrieve filters for.",
  9319. // "location": "path",
  9320. // "pattern": "\\d+",
  9321. // "required": true,
  9322. // "type": "string"
  9323. // },
  9324. // "max-results": {
  9325. // "description": "The maximum number of filters to include in this response.",
  9326. // "format": "int32",
  9327. // "location": "query",
  9328. // "type": "integer"
  9329. // },
  9330. // "start-index": {
  9331. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  9332. // "format": "int32",
  9333. // "location": "query",
  9334. // "minimum": "1",
  9335. // "type": "integer"
  9336. // }
  9337. // },
  9338. // "path": "management/accounts/{accountId}/filters",
  9339. // "response": {
  9340. // "$ref": "Filters"
  9341. // },
  9342. // "scopes": [
  9343. // "https://www.googleapis.com/auth/analytics.edit",
  9344. // "https://www.googleapis.com/auth/analytics.readonly"
  9345. // ]
  9346. // }
  9347. }
  9348. // method id "analytics.management.filters.patch":
  9349. type ManagementFiltersPatchCall struct {
  9350. s *Service
  9351. accountId string
  9352. filterId string
  9353. filter *Filter
  9354. urlParams_ gensupport.URLParams
  9355. ctx_ context.Context
  9356. header_ http.Header
  9357. }
  9358. // Patch: Updates an existing filter. This method supports patch
  9359. // semantics.
  9360. func (r *ManagementFiltersService) Patch(accountId string, filterId string, filter *Filter) *ManagementFiltersPatchCall {
  9361. c := &ManagementFiltersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9362. c.accountId = accountId
  9363. c.filterId = filterId
  9364. c.filter = filter
  9365. return c
  9366. }
  9367. // Fields allows partial responses to be retrieved. See
  9368. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9369. // for more information.
  9370. func (c *ManagementFiltersPatchCall) Fields(s ...googleapi.Field) *ManagementFiltersPatchCall {
  9371. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9372. return c
  9373. }
  9374. // Context sets the context to be used in this call's Do method. Any
  9375. // pending HTTP request will be aborted if the provided context is
  9376. // canceled.
  9377. func (c *ManagementFiltersPatchCall) Context(ctx context.Context) *ManagementFiltersPatchCall {
  9378. c.ctx_ = ctx
  9379. return c
  9380. }
  9381. // Header returns an http.Header that can be modified by the caller to
  9382. // add HTTP headers to the request.
  9383. func (c *ManagementFiltersPatchCall) Header() http.Header {
  9384. if c.header_ == nil {
  9385. c.header_ = make(http.Header)
  9386. }
  9387. return c.header_
  9388. }
  9389. func (c *ManagementFiltersPatchCall) doRequest(alt string) (*http.Response, error) {
  9390. reqHeaders := make(http.Header)
  9391. for k, v := range c.header_ {
  9392. reqHeaders[k] = v
  9393. }
  9394. reqHeaders.Set("User-Agent", c.s.userAgent())
  9395. var body io.Reader = nil
  9396. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9397. if err != nil {
  9398. return nil, err
  9399. }
  9400. reqHeaders.Set("Content-Type", "application/json")
  9401. c.urlParams_.Set("alt", alt)
  9402. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9403. urls += "?" + c.urlParams_.Encode()
  9404. req, _ := http.NewRequest("PATCH", urls, body)
  9405. req.Header = reqHeaders
  9406. googleapi.Expand(req.URL, map[string]string{
  9407. "accountId": c.accountId,
  9408. "filterId": c.filterId,
  9409. })
  9410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9411. }
  9412. // Do executes the "analytics.management.filters.patch" call.
  9413. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9414. // code is an error. Response headers are in either
  9415. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9416. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9417. // check whether the returned error was because http.StatusNotModified
  9418. // was returned.
  9419. func (c *ManagementFiltersPatchCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9420. gensupport.SetOptions(c.urlParams_, opts...)
  9421. res, err := c.doRequest("json")
  9422. if res != nil && res.StatusCode == http.StatusNotModified {
  9423. if res.Body != nil {
  9424. res.Body.Close()
  9425. }
  9426. return nil, &googleapi.Error{
  9427. Code: res.StatusCode,
  9428. Header: res.Header,
  9429. }
  9430. }
  9431. if err != nil {
  9432. return nil, err
  9433. }
  9434. defer googleapi.CloseBody(res)
  9435. if err := googleapi.CheckResponse(res); err != nil {
  9436. return nil, err
  9437. }
  9438. ret := &Filter{
  9439. ServerResponse: googleapi.ServerResponse{
  9440. Header: res.Header,
  9441. HTTPStatusCode: res.StatusCode,
  9442. },
  9443. }
  9444. target := &ret
  9445. if err := gensupport.DecodeResponse(target, res); err != nil {
  9446. return nil, err
  9447. }
  9448. return ret, nil
  9449. // {
  9450. // "description": "Updates an existing filter. This method supports patch semantics.",
  9451. // "httpMethod": "PATCH",
  9452. // "id": "analytics.management.filters.patch",
  9453. // "parameterOrder": [
  9454. // "accountId",
  9455. // "filterId"
  9456. // ],
  9457. // "parameters": {
  9458. // "accountId": {
  9459. // "description": "Account ID to which the filter belongs.",
  9460. // "location": "path",
  9461. // "required": true,
  9462. // "type": "string"
  9463. // },
  9464. // "filterId": {
  9465. // "description": "ID of the filter to be updated.",
  9466. // "location": "path",
  9467. // "required": true,
  9468. // "type": "string"
  9469. // }
  9470. // },
  9471. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9472. // "request": {
  9473. // "$ref": "Filter"
  9474. // },
  9475. // "response": {
  9476. // "$ref": "Filter"
  9477. // },
  9478. // "scopes": [
  9479. // "https://www.googleapis.com/auth/analytics.edit"
  9480. // ]
  9481. // }
  9482. }
  9483. // method id "analytics.management.filters.update":
  9484. type ManagementFiltersUpdateCall struct {
  9485. s *Service
  9486. accountId string
  9487. filterId string
  9488. filter *Filter
  9489. urlParams_ gensupport.URLParams
  9490. ctx_ context.Context
  9491. header_ http.Header
  9492. }
  9493. // Update: Updates an existing filter.
  9494. func (r *ManagementFiltersService) Update(accountId string, filterId string, filter *Filter) *ManagementFiltersUpdateCall {
  9495. c := &ManagementFiltersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9496. c.accountId = accountId
  9497. c.filterId = filterId
  9498. c.filter = filter
  9499. return c
  9500. }
  9501. // Fields allows partial responses to be retrieved. See
  9502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9503. // for more information.
  9504. func (c *ManagementFiltersUpdateCall) Fields(s ...googleapi.Field) *ManagementFiltersUpdateCall {
  9505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9506. return c
  9507. }
  9508. // Context sets the context to be used in this call's Do method. Any
  9509. // pending HTTP request will be aborted if the provided context is
  9510. // canceled.
  9511. func (c *ManagementFiltersUpdateCall) Context(ctx context.Context) *ManagementFiltersUpdateCall {
  9512. c.ctx_ = ctx
  9513. return c
  9514. }
  9515. // Header returns an http.Header that can be modified by the caller to
  9516. // add HTTP headers to the request.
  9517. func (c *ManagementFiltersUpdateCall) Header() http.Header {
  9518. if c.header_ == nil {
  9519. c.header_ = make(http.Header)
  9520. }
  9521. return c.header_
  9522. }
  9523. func (c *ManagementFiltersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9524. reqHeaders := make(http.Header)
  9525. for k, v := range c.header_ {
  9526. reqHeaders[k] = v
  9527. }
  9528. reqHeaders.Set("User-Agent", c.s.userAgent())
  9529. var body io.Reader = nil
  9530. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
  9531. if err != nil {
  9532. return nil, err
  9533. }
  9534. reqHeaders.Set("Content-Type", "application/json")
  9535. c.urlParams_.Set("alt", alt)
  9536. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/filters/{filterId}")
  9537. urls += "?" + c.urlParams_.Encode()
  9538. req, _ := http.NewRequest("PUT", urls, body)
  9539. req.Header = reqHeaders
  9540. googleapi.Expand(req.URL, map[string]string{
  9541. "accountId": c.accountId,
  9542. "filterId": c.filterId,
  9543. })
  9544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9545. }
  9546. // Do executes the "analytics.management.filters.update" call.
  9547. // Exactly one of *Filter or error will be non-nil. Any non-2xx status
  9548. // code is an error. Response headers are in either
  9549. // *Filter.ServerResponse.Header or (if a response was returned at all)
  9550. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9551. // check whether the returned error was because http.StatusNotModified
  9552. // was returned.
  9553. func (c *ManagementFiltersUpdateCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
  9554. gensupport.SetOptions(c.urlParams_, opts...)
  9555. res, err := c.doRequest("json")
  9556. if res != nil && res.StatusCode == http.StatusNotModified {
  9557. if res.Body != nil {
  9558. res.Body.Close()
  9559. }
  9560. return nil, &googleapi.Error{
  9561. Code: res.StatusCode,
  9562. Header: res.Header,
  9563. }
  9564. }
  9565. if err != nil {
  9566. return nil, err
  9567. }
  9568. defer googleapi.CloseBody(res)
  9569. if err := googleapi.CheckResponse(res); err != nil {
  9570. return nil, err
  9571. }
  9572. ret := &Filter{
  9573. ServerResponse: googleapi.ServerResponse{
  9574. Header: res.Header,
  9575. HTTPStatusCode: res.StatusCode,
  9576. },
  9577. }
  9578. target := &ret
  9579. if err := gensupport.DecodeResponse(target, res); err != nil {
  9580. return nil, err
  9581. }
  9582. return ret, nil
  9583. // {
  9584. // "description": "Updates an existing filter.",
  9585. // "httpMethod": "PUT",
  9586. // "id": "analytics.management.filters.update",
  9587. // "parameterOrder": [
  9588. // "accountId",
  9589. // "filterId"
  9590. // ],
  9591. // "parameters": {
  9592. // "accountId": {
  9593. // "description": "Account ID to which the filter belongs.",
  9594. // "location": "path",
  9595. // "required": true,
  9596. // "type": "string"
  9597. // },
  9598. // "filterId": {
  9599. // "description": "ID of the filter to be updated.",
  9600. // "location": "path",
  9601. // "required": true,
  9602. // "type": "string"
  9603. // }
  9604. // },
  9605. // "path": "management/accounts/{accountId}/filters/{filterId}",
  9606. // "request": {
  9607. // "$ref": "Filter"
  9608. // },
  9609. // "response": {
  9610. // "$ref": "Filter"
  9611. // },
  9612. // "scopes": [
  9613. // "https://www.googleapis.com/auth/analytics.edit"
  9614. // ]
  9615. // }
  9616. }
  9617. // method id "analytics.management.goals.get":
  9618. type ManagementGoalsGetCall struct {
  9619. s *Service
  9620. accountId string
  9621. webPropertyId string
  9622. profileId string
  9623. goalId string
  9624. urlParams_ gensupport.URLParams
  9625. ifNoneMatch_ string
  9626. ctx_ context.Context
  9627. header_ http.Header
  9628. }
  9629. // Get: Gets a goal to which the user has access.
  9630. func (r *ManagementGoalsService) Get(accountId string, webPropertyId string, profileId string, goalId string) *ManagementGoalsGetCall {
  9631. c := &ManagementGoalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9632. c.accountId = accountId
  9633. c.webPropertyId = webPropertyId
  9634. c.profileId = profileId
  9635. c.goalId = goalId
  9636. return c
  9637. }
  9638. // Fields allows partial responses to be retrieved. See
  9639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9640. // for more information.
  9641. func (c *ManagementGoalsGetCall) Fields(s ...googleapi.Field) *ManagementGoalsGetCall {
  9642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9643. return c
  9644. }
  9645. // IfNoneMatch sets the optional parameter which makes the operation
  9646. // fail if the object's ETag matches the given value. This is useful for
  9647. // getting updates only after the object has changed since the last
  9648. // request. Use googleapi.IsNotModified to check whether the response
  9649. // error from Do is the result of In-None-Match.
  9650. func (c *ManagementGoalsGetCall) IfNoneMatch(entityTag string) *ManagementGoalsGetCall {
  9651. c.ifNoneMatch_ = entityTag
  9652. return c
  9653. }
  9654. // Context sets the context to be used in this call's Do method. Any
  9655. // pending HTTP request will be aborted if the provided context is
  9656. // canceled.
  9657. func (c *ManagementGoalsGetCall) Context(ctx context.Context) *ManagementGoalsGetCall {
  9658. c.ctx_ = ctx
  9659. return c
  9660. }
  9661. // Header returns an http.Header that can be modified by the caller to
  9662. // add HTTP headers to the request.
  9663. func (c *ManagementGoalsGetCall) Header() http.Header {
  9664. if c.header_ == nil {
  9665. c.header_ = make(http.Header)
  9666. }
  9667. return c.header_
  9668. }
  9669. func (c *ManagementGoalsGetCall) doRequest(alt string) (*http.Response, error) {
  9670. reqHeaders := make(http.Header)
  9671. for k, v := range c.header_ {
  9672. reqHeaders[k] = v
  9673. }
  9674. reqHeaders.Set("User-Agent", c.s.userAgent())
  9675. if c.ifNoneMatch_ != "" {
  9676. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9677. }
  9678. var body io.Reader = nil
  9679. c.urlParams_.Set("alt", alt)
  9680. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  9681. urls += "?" + c.urlParams_.Encode()
  9682. req, _ := http.NewRequest("GET", urls, body)
  9683. req.Header = reqHeaders
  9684. googleapi.Expand(req.URL, map[string]string{
  9685. "accountId": c.accountId,
  9686. "webPropertyId": c.webPropertyId,
  9687. "profileId": c.profileId,
  9688. "goalId": c.goalId,
  9689. })
  9690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9691. }
  9692. // Do executes the "analytics.management.goals.get" call.
  9693. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  9694. // code is an error. Response headers are in either
  9695. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  9696. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9697. // whether the returned error was because http.StatusNotModified was
  9698. // returned.
  9699. func (c *ManagementGoalsGetCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  9700. gensupport.SetOptions(c.urlParams_, opts...)
  9701. res, err := c.doRequest("json")
  9702. if res != nil && res.StatusCode == http.StatusNotModified {
  9703. if res.Body != nil {
  9704. res.Body.Close()
  9705. }
  9706. return nil, &googleapi.Error{
  9707. Code: res.StatusCode,
  9708. Header: res.Header,
  9709. }
  9710. }
  9711. if err != nil {
  9712. return nil, err
  9713. }
  9714. defer googleapi.CloseBody(res)
  9715. if err := googleapi.CheckResponse(res); err != nil {
  9716. return nil, err
  9717. }
  9718. ret := &Goal{
  9719. ServerResponse: googleapi.ServerResponse{
  9720. Header: res.Header,
  9721. HTTPStatusCode: res.StatusCode,
  9722. },
  9723. }
  9724. target := &ret
  9725. if err := gensupport.DecodeResponse(target, res); err != nil {
  9726. return nil, err
  9727. }
  9728. return ret, nil
  9729. // {
  9730. // "description": "Gets a goal to which the user has access.",
  9731. // "httpMethod": "GET",
  9732. // "id": "analytics.management.goals.get",
  9733. // "parameterOrder": [
  9734. // "accountId",
  9735. // "webPropertyId",
  9736. // "profileId",
  9737. // "goalId"
  9738. // ],
  9739. // "parameters": {
  9740. // "accountId": {
  9741. // "description": "Account ID to retrieve the goal for.",
  9742. // "location": "path",
  9743. // "required": true,
  9744. // "type": "string"
  9745. // },
  9746. // "goalId": {
  9747. // "description": "Goal ID to retrieve the goal for.",
  9748. // "location": "path",
  9749. // "required": true,
  9750. // "type": "string"
  9751. // },
  9752. // "profileId": {
  9753. // "description": "View (Profile) ID to retrieve the goal for.",
  9754. // "location": "path",
  9755. // "required": true,
  9756. // "type": "string"
  9757. // },
  9758. // "webPropertyId": {
  9759. // "description": "Web property ID to retrieve the goal for.",
  9760. // "location": "path",
  9761. // "required": true,
  9762. // "type": "string"
  9763. // }
  9764. // },
  9765. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  9766. // "response": {
  9767. // "$ref": "Goal"
  9768. // },
  9769. // "scopes": [
  9770. // "https://www.googleapis.com/auth/analytics.edit",
  9771. // "https://www.googleapis.com/auth/analytics.readonly"
  9772. // ]
  9773. // }
  9774. }
  9775. // method id "analytics.management.goals.insert":
  9776. type ManagementGoalsInsertCall struct {
  9777. s *Service
  9778. accountId string
  9779. webPropertyId string
  9780. profileId string
  9781. goal *Goal
  9782. urlParams_ gensupport.URLParams
  9783. ctx_ context.Context
  9784. header_ http.Header
  9785. }
  9786. // Insert: Create a new goal.
  9787. func (r *ManagementGoalsService) Insert(accountId string, webPropertyId string, profileId string, goal *Goal) *ManagementGoalsInsertCall {
  9788. c := &ManagementGoalsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9789. c.accountId = accountId
  9790. c.webPropertyId = webPropertyId
  9791. c.profileId = profileId
  9792. c.goal = goal
  9793. return c
  9794. }
  9795. // Fields allows partial responses to be retrieved. See
  9796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9797. // for more information.
  9798. func (c *ManagementGoalsInsertCall) Fields(s ...googleapi.Field) *ManagementGoalsInsertCall {
  9799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9800. return c
  9801. }
  9802. // Context sets the context to be used in this call's Do method. Any
  9803. // pending HTTP request will be aborted if the provided context is
  9804. // canceled.
  9805. func (c *ManagementGoalsInsertCall) Context(ctx context.Context) *ManagementGoalsInsertCall {
  9806. c.ctx_ = ctx
  9807. return c
  9808. }
  9809. // Header returns an http.Header that can be modified by the caller to
  9810. // add HTTP headers to the request.
  9811. func (c *ManagementGoalsInsertCall) Header() http.Header {
  9812. if c.header_ == nil {
  9813. c.header_ = make(http.Header)
  9814. }
  9815. return c.header_
  9816. }
  9817. func (c *ManagementGoalsInsertCall) doRequest(alt string) (*http.Response, error) {
  9818. reqHeaders := make(http.Header)
  9819. for k, v := range c.header_ {
  9820. reqHeaders[k] = v
  9821. }
  9822. reqHeaders.Set("User-Agent", c.s.userAgent())
  9823. var body io.Reader = nil
  9824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  9825. if err != nil {
  9826. return nil, err
  9827. }
  9828. reqHeaders.Set("Content-Type", "application/json")
  9829. c.urlParams_.Set("alt", alt)
  9830. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  9831. urls += "?" + c.urlParams_.Encode()
  9832. req, _ := http.NewRequest("POST", urls, body)
  9833. req.Header = reqHeaders
  9834. googleapi.Expand(req.URL, map[string]string{
  9835. "accountId": c.accountId,
  9836. "webPropertyId": c.webPropertyId,
  9837. "profileId": c.profileId,
  9838. })
  9839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9840. }
  9841. // Do executes the "analytics.management.goals.insert" call.
  9842. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  9843. // code is an error. Response headers are in either
  9844. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  9845. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9846. // whether the returned error was because http.StatusNotModified was
  9847. // returned.
  9848. func (c *ManagementGoalsInsertCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  9849. gensupport.SetOptions(c.urlParams_, opts...)
  9850. res, err := c.doRequest("json")
  9851. if res != nil && res.StatusCode == http.StatusNotModified {
  9852. if res.Body != nil {
  9853. res.Body.Close()
  9854. }
  9855. return nil, &googleapi.Error{
  9856. Code: res.StatusCode,
  9857. Header: res.Header,
  9858. }
  9859. }
  9860. if err != nil {
  9861. return nil, err
  9862. }
  9863. defer googleapi.CloseBody(res)
  9864. if err := googleapi.CheckResponse(res); err != nil {
  9865. return nil, err
  9866. }
  9867. ret := &Goal{
  9868. ServerResponse: googleapi.ServerResponse{
  9869. Header: res.Header,
  9870. HTTPStatusCode: res.StatusCode,
  9871. },
  9872. }
  9873. target := &ret
  9874. if err := gensupport.DecodeResponse(target, res); err != nil {
  9875. return nil, err
  9876. }
  9877. return ret, nil
  9878. // {
  9879. // "description": "Create a new goal.",
  9880. // "httpMethod": "POST",
  9881. // "id": "analytics.management.goals.insert",
  9882. // "parameterOrder": [
  9883. // "accountId",
  9884. // "webPropertyId",
  9885. // "profileId"
  9886. // ],
  9887. // "parameters": {
  9888. // "accountId": {
  9889. // "description": "Account ID to create the goal for.",
  9890. // "location": "path",
  9891. // "required": true,
  9892. // "type": "string"
  9893. // },
  9894. // "profileId": {
  9895. // "description": "View (Profile) ID to create the goal for.",
  9896. // "location": "path",
  9897. // "required": true,
  9898. // "type": "string"
  9899. // },
  9900. // "webPropertyId": {
  9901. // "description": "Web property ID to create the goal for.",
  9902. // "location": "path",
  9903. // "required": true,
  9904. // "type": "string"
  9905. // }
  9906. // },
  9907. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  9908. // "request": {
  9909. // "$ref": "Goal"
  9910. // },
  9911. // "response": {
  9912. // "$ref": "Goal"
  9913. // },
  9914. // "scopes": [
  9915. // "https://www.googleapis.com/auth/analytics.edit"
  9916. // ]
  9917. // }
  9918. }
  9919. // method id "analytics.management.goals.list":
  9920. type ManagementGoalsListCall struct {
  9921. s *Service
  9922. accountId string
  9923. webPropertyId string
  9924. profileId string
  9925. urlParams_ gensupport.URLParams
  9926. ifNoneMatch_ string
  9927. ctx_ context.Context
  9928. header_ http.Header
  9929. }
  9930. // List: Lists goals to which the user has access.
  9931. func (r *ManagementGoalsService) List(accountId string, webPropertyId string, profileId string) *ManagementGoalsListCall {
  9932. c := &ManagementGoalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9933. c.accountId = accountId
  9934. c.webPropertyId = webPropertyId
  9935. c.profileId = profileId
  9936. return c
  9937. }
  9938. // MaxResults sets the optional parameter "max-results": The maximum
  9939. // number of goals to include in this response.
  9940. func (c *ManagementGoalsListCall) MaxResults(maxResults int64) *ManagementGoalsListCall {
  9941. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  9942. return c
  9943. }
  9944. // StartIndex sets the optional parameter "start-index": An index of the
  9945. // first goal to retrieve. Use this parameter as a pagination mechanism
  9946. // along with the max-results parameter.
  9947. func (c *ManagementGoalsListCall) StartIndex(startIndex int64) *ManagementGoalsListCall {
  9948. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  9949. return c
  9950. }
  9951. // Fields allows partial responses to be retrieved. See
  9952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9953. // for more information.
  9954. func (c *ManagementGoalsListCall) Fields(s ...googleapi.Field) *ManagementGoalsListCall {
  9955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9956. return c
  9957. }
  9958. // IfNoneMatch sets the optional parameter which makes the operation
  9959. // fail if the object's ETag matches the given value. This is useful for
  9960. // getting updates only after the object has changed since the last
  9961. // request. Use googleapi.IsNotModified to check whether the response
  9962. // error from Do is the result of In-None-Match.
  9963. func (c *ManagementGoalsListCall) IfNoneMatch(entityTag string) *ManagementGoalsListCall {
  9964. c.ifNoneMatch_ = entityTag
  9965. return c
  9966. }
  9967. // Context sets the context to be used in this call's Do method. Any
  9968. // pending HTTP request will be aborted if the provided context is
  9969. // canceled.
  9970. func (c *ManagementGoalsListCall) Context(ctx context.Context) *ManagementGoalsListCall {
  9971. c.ctx_ = ctx
  9972. return c
  9973. }
  9974. // Header returns an http.Header that can be modified by the caller to
  9975. // add HTTP headers to the request.
  9976. func (c *ManagementGoalsListCall) Header() http.Header {
  9977. if c.header_ == nil {
  9978. c.header_ = make(http.Header)
  9979. }
  9980. return c.header_
  9981. }
  9982. func (c *ManagementGoalsListCall) doRequest(alt string) (*http.Response, error) {
  9983. reqHeaders := make(http.Header)
  9984. for k, v := range c.header_ {
  9985. reqHeaders[k] = v
  9986. }
  9987. reqHeaders.Set("User-Agent", c.s.userAgent())
  9988. if c.ifNoneMatch_ != "" {
  9989. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9990. }
  9991. var body io.Reader = nil
  9992. c.urlParams_.Set("alt", alt)
  9993. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals")
  9994. urls += "?" + c.urlParams_.Encode()
  9995. req, _ := http.NewRequest("GET", urls, body)
  9996. req.Header = reqHeaders
  9997. googleapi.Expand(req.URL, map[string]string{
  9998. "accountId": c.accountId,
  9999. "webPropertyId": c.webPropertyId,
  10000. "profileId": c.profileId,
  10001. })
  10002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10003. }
  10004. // Do executes the "analytics.management.goals.list" call.
  10005. // Exactly one of *Goals or error will be non-nil. Any non-2xx status
  10006. // code is an error. Response headers are in either
  10007. // *Goals.ServerResponse.Header or (if a response was returned at all)
  10008. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10009. // check whether the returned error was because http.StatusNotModified
  10010. // was returned.
  10011. func (c *ManagementGoalsListCall) Do(opts ...googleapi.CallOption) (*Goals, error) {
  10012. gensupport.SetOptions(c.urlParams_, opts...)
  10013. res, err := c.doRequest("json")
  10014. if res != nil && res.StatusCode == http.StatusNotModified {
  10015. if res.Body != nil {
  10016. res.Body.Close()
  10017. }
  10018. return nil, &googleapi.Error{
  10019. Code: res.StatusCode,
  10020. Header: res.Header,
  10021. }
  10022. }
  10023. if err != nil {
  10024. return nil, err
  10025. }
  10026. defer googleapi.CloseBody(res)
  10027. if err := googleapi.CheckResponse(res); err != nil {
  10028. return nil, err
  10029. }
  10030. ret := &Goals{
  10031. ServerResponse: googleapi.ServerResponse{
  10032. Header: res.Header,
  10033. HTTPStatusCode: res.StatusCode,
  10034. },
  10035. }
  10036. target := &ret
  10037. if err := gensupport.DecodeResponse(target, res); err != nil {
  10038. return nil, err
  10039. }
  10040. return ret, nil
  10041. // {
  10042. // "description": "Lists goals to which the user has access.",
  10043. // "httpMethod": "GET",
  10044. // "id": "analytics.management.goals.list",
  10045. // "parameterOrder": [
  10046. // "accountId",
  10047. // "webPropertyId",
  10048. // "profileId"
  10049. // ],
  10050. // "parameters": {
  10051. // "accountId": {
  10052. // "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.",
  10053. // "location": "path",
  10054. // "required": true,
  10055. // "type": "string"
  10056. // },
  10057. // "max-results": {
  10058. // "description": "The maximum number of goals to include in this response.",
  10059. // "format": "int32",
  10060. // "location": "query",
  10061. // "type": "integer"
  10062. // },
  10063. // "profileId": {
  10064. // "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.",
  10065. // "location": "path",
  10066. // "required": true,
  10067. // "type": "string"
  10068. // },
  10069. // "start-index": {
  10070. // "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  10071. // "format": "int32",
  10072. // "location": "query",
  10073. // "minimum": "1",
  10074. // "type": "integer"
  10075. // },
  10076. // "webPropertyId": {
  10077. // "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.",
  10078. // "location": "path",
  10079. // "required": true,
  10080. // "type": "string"
  10081. // }
  10082. // },
  10083. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
  10084. // "response": {
  10085. // "$ref": "Goals"
  10086. // },
  10087. // "scopes": [
  10088. // "https://www.googleapis.com/auth/analytics",
  10089. // "https://www.googleapis.com/auth/analytics.edit",
  10090. // "https://www.googleapis.com/auth/analytics.readonly"
  10091. // ]
  10092. // }
  10093. }
  10094. // method id "analytics.management.goals.patch":
  10095. type ManagementGoalsPatchCall struct {
  10096. s *Service
  10097. accountId string
  10098. webPropertyId string
  10099. profileId string
  10100. goalId string
  10101. goal *Goal
  10102. urlParams_ gensupport.URLParams
  10103. ctx_ context.Context
  10104. header_ http.Header
  10105. }
  10106. // Patch: Updates an existing goal. This method supports patch
  10107. // semantics.
  10108. func (r *ManagementGoalsService) Patch(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsPatchCall {
  10109. c := &ManagementGoalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10110. c.accountId = accountId
  10111. c.webPropertyId = webPropertyId
  10112. c.profileId = profileId
  10113. c.goalId = goalId
  10114. c.goal = goal
  10115. return c
  10116. }
  10117. // Fields allows partial responses to be retrieved. See
  10118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10119. // for more information.
  10120. func (c *ManagementGoalsPatchCall) Fields(s ...googleapi.Field) *ManagementGoalsPatchCall {
  10121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10122. return c
  10123. }
  10124. // Context sets the context to be used in this call's Do method. Any
  10125. // pending HTTP request will be aborted if the provided context is
  10126. // canceled.
  10127. func (c *ManagementGoalsPatchCall) Context(ctx context.Context) *ManagementGoalsPatchCall {
  10128. c.ctx_ = ctx
  10129. return c
  10130. }
  10131. // Header returns an http.Header that can be modified by the caller to
  10132. // add HTTP headers to the request.
  10133. func (c *ManagementGoalsPatchCall) Header() http.Header {
  10134. if c.header_ == nil {
  10135. c.header_ = make(http.Header)
  10136. }
  10137. return c.header_
  10138. }
  10139. func (c *ManagementGoalsPatchCall) doRequest(alt string) (*http.Response, error) {
  10140. reqHeaders := make(http.Header)
  10141. for k, v := range c.header_ {
  10142. reqHeaders[k] = v
  10143. }
  10144. reqHeaders.Set("User-Agent", c.s.userAgent())
  10145. var body io.Reader = nil
  10146. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10147. if err != nil {
  10148. return nil, err
  10149. }
  10150. reqHeaders.Set("Content-Type", "application/json")
  10151. c.urlParams_.Set("alt", alt)
  10152. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  10153. urls += "?" + c.urlParams_.Encode()
  10154. req, _ := http.NewRequest("PATCH", urls, body)
  10155. req.Header = reqHeaders
  10156. googleapi.Expand(req.URL, map[string]string{
  10157. "accountId": c.accountId,
  10158. "webPropertyId": c.webPropertyId,
  10159. "profileId": c.profileId,
  10160. "goalId": c.goalId,
  10161. })
  10162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10163. }
  10164. // Do executes the "analytics.management.goals.patch" call.
  10165. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10166. // code is an error. Response headers are in either
  10167. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10168. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10169. // whether the returned error was because http.StatusNotModified was
  10170. // returned.
  10171. func (c *ManagementGoalsPatchCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10172. gensupport.SetOptions(c.urlParams_, opts...)
  10173. res, err := c.doRequest("json")
  10174. if res != nil && res.StatusCode == http.StatusNotModified {
  10175. if res.Body != nil {
  10176. res.Body.Close()
  10177. }
  10178. return nil, &googleapi.Error{
  10179. Code: res.StatusCode,
  10180. Header: res.Header,
  10181. }
  10182. }
  10183. if err != nil {
  10184. return nil, err
  10185. }
  10186. defer googleapi.CloseBody(res)
  10187. if err := googleapi.CheckResponse(res); err != nil {
  10188. return nil, err
  10189. }
  10190. ret := &Goal{
  10191. ServerResponse: googleapi.ServerResponse{
  10192. Header: res.Header,
  10193. HTTPStatusCode: res.StatusCode,
  10194. },
  10195. }
  10196. target := &ret
  10197. if err := gensupport.DecodeResponse(target, res); err != nil {
  10198. return nil, err
  10199. }
  10200. return ret, nil
  10201. // {
  10202. // "description": "Updates an existing goal. This method supports patch semantics.",
  10203. // "httpMethod": "PATCH",
  10204. // "id": "analytics.management.goals.patch",
  10205. // "parameterOrder": [
  10206. // "accountId",
  10207. // "webPropertyId",
  10208. // "profileId",
  10209. // "goalId"
  10210. // ],
  10211. // "parameters": {
  10212. // "accountId": {
  10213. // "description": "Account ID to update the goal.",
  10214. // "location": "path",
  10215. // "required": true,
  10216. // "type": "string"
  10217. // },
  10218. // "goalId": {
  10219. // "description": "Index of the goal to be updated.",
  10220. // "location": "path",
  10221. // "required": true,
  10222. // "type": "string"
  10223. // },
  10224. // "profileId": {
  10225. // "description": "View (Profile) ID to update the goal.",
  10226. // "location": "path",
  10227. // "required": true,
  10228. // "type": "string"
  10229. // },
  10230. // "webPropertyId": {
  10231. // "description": "Web property ID to update the goal.",
  10232. // "location": "path",
  10233. // "required": true,
  10234. // "type": "string"
  10235. // }
  10236. // },
  10237. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10238. // "request": {
  10239. // "$ref": "Goal"
  10240. // },
  10241. // "response": {
  10242. // "$ref": "Goal"
  10243. // },
  10244. // "scopes": [
  10245. // "https://www.googleapis.com/auth/analytics.edit"
  10246. // ]
  10247. // }
  10248. }
  10249. // method id "analytics.management.goals.update":
  10250. type ManagementGoalsUpdateCall struct {
  10251. s *Service
  10252. accountId string
  10253. webPropertyId string
  10254. profileId string
  10255. goalId string
  10256. goal *Goal
  10257. urlParams_ gensupport.URLParams
  10258. ctx_ context.Context
  10259. header_ http.Header
  10260. }
  10261. // Update: Updates an existing goal.
  10262. func (r *ManagementGoalsService) Update(accountId string, webPropertyId string, profileId string, goalId string, goal *Goal) *ManagementGoalsUpdateCall {
  10263. c := &ManagementGoalsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10264. c.accountId = accountId
  10265. c.webPropertyId = webPropertyId
  10266. c.profileId = profileId
  10267. c.goalId = goalId
  10268. c.goal = goal
  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 *ManagementGoalsUpdateCall) Fields(s ...googleapi.Field) *ManagementGoalsUpdateCall {
  10275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10276. return c
  10277. }
  10278. // Context sets the context to be used in this call's Do method. Any
  10279. // pending HTTP request will be aborted if the provided context is
  10280. // canceled.
  10281. func (c *ManagementGoalsUpdateCall) Context(ctx context.Context) *ManagementGoalsUpdateCall {
  10282. c.ctx_ = ctx
  10283. return c
  10284. }
  10285. // Header returns an http.Header that can be modified by the caller to
  10286. // add HTTP headers to the request.
  10287. func (c *ManagementGoalsUpdateCall) Header() http.Header {
  10288. if c.header_ == nil {
  10289. c.header_ = make(http.Header)
  10290. }
  10291. return c.header_
  10292. }
  10293. func (c *ManagementGoalsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10294. reqHeaders := make(http.Header)
  10295. for k, v := range c.header_ {
  10296. reqHeaders[k] = v
  10297. }
  10298. reqHeaders.Set("User-Agent", c.s.userAgent())
  10299. var body io.Reader = nil
  10300. body, err := googleapi.WithoutDataWrapper.JSONReader(c.goal)
  10301. if err != nil {
  10302. return nil, err
  10303. }
  10304. reqHeaders.Set("Content-Type", "application/json")
  10305. c.urlParams_.Set("alt", alt)
  10306. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}")
  10307. urls += "?" + c.urlParams_.Encode()
  10308. req, _ := http.NewRequest("PUT", urls, body)
  10309. req.Header = reqHeaders
  10310. googleapi.Expand(req.URL, map[string]string{
  10311. "accountId": c.accountId,
  10312. "webPropertyId": c.webPropertyId,
  10313. "profileId": c.profileId,
  10314. "goalId": c.goalId,
  10315. })
  10316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10317. }
  10318. // Do executes the "analytics.management.goals.update" call.
  10319. // Exactly one of *Goal or error will be non-nil. Any non-2xx status
  10320. // code is an error. Response headers are in either
  10321. // *Goal.ServerResponse.Header or (if a response was returned at all) in
  10322. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10323. // whether the returned error was because http.StatusNotModified was
  10324. // returned.
  10325. func (c *ManagementGoalsUpdateCall) Do(opts ...googleapi.CallOption) (*Goal, error) {
  10326. gensupport.SetOptions(c.urlParams_, opts...)
  10327. res, err := c.doRequest("json")
  10328. if res != nil && res.StatusCode == http.StatusNotModified {
  10329. if res.Body != nil {
  10330. res.Body.Close()
  10331. }
  10332. return nil, &googleapi.Error{
  10333. Code: res.StatusCode,
  10334. Header: res.Header,
  10335. }
  10336. }
  10337. if err != nil {
  10338. return nil, err
  10339. }
  10340. defer googleapi.CloseBody(res)
  10341. if err := googleapi.CheckResponse(res); err != nil {
  10342. return nil, err
  10343. }
  10344. ret := &Goal{
  10345. ServerResponse: googleapi.ServerResponse{
  10346. Header: res.Header,
  10347. HTTPStatusCode: res.StatusCode,
  10348. },
  10349. }
  10350. target := &ret
  10351. if err := gensupport.DecodeResponse(target, res); err != nil {
  10352. return nil, err
  10353. }
  10354. return ret, nil
  10355. // {
  10356. // "description": "Updates an existing goal.",
  10357. // "httpMethod": "PUT",
  10358. // "id": "analytics.management.goals.update",
  10359. // "parameterOrder": [
  10360. // "accountId",
  10361. // "webPropertyId",
  10362. // "profileId",
  10363. // "goalId"
  10364. // ],
  10365. // "parameters": {
  10366. // "accountId": {
  10367. // "description": "Account ID to update the goal.",
  10368. // "location": "path",
  10369. // "required": true,
  10370. // "type": "string"
  10371. // },
  10372. // "goalId": {
  10373. // "description": "Index of the goal to be updated.",
  10374. // "location": "path",
  10375. // "required": true,
  10376. // "type": "string"
  10377. // },
  10378. // "profileId": {
  10379. // "description": "View (Profile) ID to update the goal.",
  10380. // "location": "path",
  10381. // "required": true,
  10382. // "type": "string"
  10383. // },
  10384. // "webPropertyId": {
  10385. // "description": "Web property ID to update the goal.",
  10386. // "location": "path",
  10387. // "required": true,
  10388. // "type": "string"
  10389. // }
  10390. // },
  10391. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}",
  10392. // "request": {
  10393. // "$ref": "Goal"
  10394. // },
  10395. // "response": {
  10396. // "$ref": "Goal"
  10397. // },
  10398. // "scopes": [
  10399. // "https://www.googleapis.com/auth/analytics.edit"
  10400. // ]
  10401. // }
  10402. }
  10403. // method id "analytics.management.profileFilterLinks.delete":
  10404. type ManagementProfileFilterLinksDeleteCall struct {
  10405. s *Service
  10406. accountId string
  10407. webPropertyId string
  10408. profileId string
  10409. linkId string
  10410. urlParams_ gensupport.URLParams
  10411. ctx_ context.Context
  10412. header_ http.Header
  10413. }
  10414. // Delete: Delete a profile filter link.
  10415. func (r *ManagementProfileFilterLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksDeleteCall {
  10416. c := &ManagementProfileFilterLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10417. c.accountId = accountId
  10418. c.webPropertyId = webPropertyId
  10419. c.profileId = profileId
  10420. c.linkId = linkId
  10421. return c
  10422. }
  10423. // Fields allows partial responses to be retrieved. See
  10424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10425. // for more information.
  10426. func (c *ManagementProfileFilterLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksDeleteCall {
  10427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10428. return c
  10429. }
  10430. // Context sets the context to be used in this call's Do method. Any
  10431. // pending HTTP request will be aborted if the provided context is
  10432. // canceled.
  10433. func (c *ManagementProfileFilterLinksDeleteCall) Context(ctx context.Context) *ManagementProfileFilterLinksDeleteCall {
  10434. c.ctx_ = ctx
  10435. return c
  10436. }
  10437. // Header returns an http.Header that can be modified by the caller to
  10438. // add HTTP headers to the request.
  10439. func (c *ManagementProfileFilterLinksDeleteCall) Header() http.Header {
  10440. if c.header_ == nil {
  10441. c.header_ = make(http.Header)
  10442. }
  10443. return c.header_
  10444. }
  10445. func (c *ManagementProfileFilterLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  10446. reqHeaders := make(http.Header)
  10447. for k, v := range c.header_ {
  10448. reqHeaders[k] = v
  10449. }
  10450. reqHeaders.Set("User-Agent", c.s.userAgent())
  10451. var body io.Reader = nil
  10452. c.urlParams_.Set("alt", alt)
  10453. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  10454. urls += "?" + c.urlParams_.Encode()
  10455. req, _ := http.NewRequest("DELETE", urls, body)
  10456. req.Header = reqHeaders
  10457. googleapi.Expand(req.URL, map[string]string{
  10458. "accountId": c.accountId,
  10459. "webPropertyId": c.webPropertyId,
  10460. "profileId": c.profileId,
  10461. "linkId": c.linkId,
  10462. })
  10463. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10464. }
  10465. // Do executes the "analytics.management.profileFilterLinks.delete" call.
  10466. func (c *ManagementProfileFilterLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  10467. gensupport.SetOptions(c.urlParams_, opts...)
  10468. res, err := c.doRequest("json")
  10469. if err != nil {
  10470. return err
  10471. }
  10472. defer googleapi.CloseBody(res)
  10473. if err := googleapi.CheckResponse(res); err != nil {
  10474. return err
  10475. }
  10476. return nil
  10477. // {
  10478. // "description": "Delete a profile filter link.",
  10479. // "httpMethod": "DELETE",
  10480. // "id": "analytics.management.profileFilterLinks.delete",
  10481. // "parameterOrder": [
  10482. // "accountId",
  10483. // "webPropertyId",
  10484. // "profileId",
  10485. // "linkId"
  10486. // ],
  10487. // "parameters": {
  10488. // "accountId": {
  10489. // "description": "Account ID to which the profile filter link belongs.",
  10490. // "location": "path",
  10491. // "pattern": "\\d+",
  10492. // "required": true,
  10493. // "type": "string"
  10494. // },
  10495. // "linkId": {
  10496. // "description": "ID of the profile filter link to delete.",
  10497. // "location": "path",
  10498. // "pattern": "\\d+:\\d+",
  10499. // "required": true,
  10500. // "type": "string"
  10501. // },
  10502. // "profileId": {
  10503. // "description": "Profile ID to which the filter link belongs.",
  10504. // "location": "path",
  10505. // "pattern": "\\d+",
  10506. // "required": true,
  10507. // "type": "string"
  10508. // },
  10509. // "webPropertyId": {
  10510. // "description": "Web property Id to which the profile filter link belongs.",
  10511. // "location": "path",
  10512. // "pattern": "UA-(\\d+)-(\\d+)",
  10513. // "required": true,
  10514. // "type": "string"
  10515. // }
  10516. // },
  10517. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  10518. // "scopes": [
  10519. // "https://www.googleapis.com/auth/analytics.edit"
  10520. // ]
  10521. // }
  10522. }
  10523. // method id "analytics.management.profileFilterLinks.get":
  10524. type ManagementProfileFilterLinksGetCall struct {
  10525. s *Service
  10526. accountId string
  10527. webPropertyId string
  10528. profileId string
  10529. linkId string
  10530. urlParams_ gensupport.URLParams
  10531. ifNoneMatch_ string
  10532. ctx_ context.Context
  10533. header_ http.Header
  10534. }
  10535. // Get: Returns a single profile filter link.
  10536. func (r *ManagementProfileFilterLinksService) Get(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileFilterLinksGetCall {
  10537. c := &ManagementProfileFilterLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10538. c.accountId = accountId
  10539. c.webPropertyId = webPropertyId
  10540. c.profileId = profileId
  10541. c.linkId = linkId
  10542. return c
  10543. }
  10544. // Fields allows partial responses to be retrieved. See
  10545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10546. // for more information.
  10547. func (c *ManagementProfileFilterLinksGetCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksGetCall {
  10548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10549. return c
  10550. }
  10551. // IfNoneMatch sets the optional parameter which makes the operation
  10552. // fail if the object's ETag matches the given value. This is useful for
  10553. // getting updates only after the object has changed since the last
  10554. // request. Use googleapi.IsNotModified to check whether the response
  10555. // error from Do is the result of In-None-Match.
  10556. func (c *ManagementProfileFilterLinksGetCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksGetCall {
  10557. c.ifNoneMatch_ = entityTag
  10558. return c
  10559. }
  10560. // Context sets the context to be used in this call's Do method. Any
  10561. // pending HTTP request will be aborted if the provided context is
  10562. // canceled.
  10563. func (c *ManagementProfileFilterLinksGetCall) Context(ctx context.Context) *ManagementProfileFilterLinksGetCall {
  10564. c.ctx_ = ctx
  10565. return c
  10566. }
  10567. // Header returns an http.Header that can be modified by the caller to
  10568. // add HTTP headers to the request.
  10569. func (c *ManagementProfileFilterLinksGetCall) Header() http.Header {
  10570. if c.header_ == nil {
  10571. c.header_ = make(http.Header)
  10572. }
  10573. return c.header_
  10574. }
  10575. func (c *ManagementProfileFilterLinksGetCall) doRequest(alt string) (*http.Response, error) {
  10576. reqHeaders := make(http.Header)
  10577. for k, v := range c.header_ {
  10578. reqHeaders[k] = v
  10579. }
  10580. reqHeaders.Set("User-Agent", c.s.userAgent())
  10581. if c.ifNoneMatch_ != "" {
  10582. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10583. }
  10584. var body io.Reader = nil
  10585. c.urlParams_.Set("alt", alt)
  10586. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  10587. urls += "?" + c.urlParams_.Encode()
  10588. req, _ := http.NewRequest("GET", urls, body)
  10589. req.Header = reqHeaders
  10590. googleapi.Expand(req.URL, map[string]string{
  10591. "accountId": c.accountId,
  10592. "webPropertyId": c.webPropertyId,
  10593. "profileId": c.profileId,
  10594. "linkId": c.linkId,
  10595. })
  10596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10597. }
  10598. // Do executes the "analytics.management.profileFilterLinks.get" call.
  10599. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  10600. // non-2xx status code is an error. Response headers are in either
  10601. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  10602. // returned at all) in error.(*googleapi.Error).Header. Use
  10603. // googleapi.IsNotModified to check whether the returned error was
  10604. // because http.StatusNotModified was returned.
  10605. func (c *ManagementProfileFilterLinksGetCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  10606. gensupport.SetOptions(c.urlParams_, opts...)
  10607. res, err := c.doRequest("json")
  10608. if res != nil && res.StatusCode == http.StatusNotModified {
  10609. if res.Body != nil {
  10610. res.Body.Close()
  10611. }
  10612. return nil, &googleapi.Error{
  10613. Code: res.StatusCode,
  10614. Header: res.Header,
  10615. }
  10616. }
  10617. if err != nil {
  10618. return nil, err
  10619. }
  10620. defer googleapi.CloseBody(res)
  10621. if err := googleapi.CheckResponse(res); err != nil {
  10622. return nil, err
  10623. }
  10624. ret := &ProfileFilterLink{
  10625. ServerResponse: googleapi.ServerResponse{
  10626. Header: res.Header,
  10627. HTTPStatusCode: res.StatusCode,
  10628. },
  10629. }
  10630. target := &ret
  10631. if err := gensupport.DecodeResponse(target, res); err != nil {
  10632. return nil, err
  10633. }
  10634. return ret, nil
  10635. // {
  10636. // "description": "Returns a single profile filter link.",
  10637. // "httpMethod": "GET",
  10638. // "id": "analytics.management.profileFilterLinks.get",
  10639. // "parameterOrder": [
  10640. // "accountId",
  10641. // "webPropertyId",
  10642. // "profileId",
  10643. // "linkId"
  10644. // ],
  10645. // "parameters": {
  10646. // "accountId": {
  10647. // "description": "Account ID to retrieve profile filter link for.",
  10648. // "location": "path",
  10649. // "pattern": "\\d+",
  10650. // "required": true,
  10651. // "type": "string"
  10652. // },
  10653. // "linkId": {
  10654. // "description": "ID of the profile filter link.",
  10655. // "location": "path",
  10656. // "pattern": "\\d+:\\d+",
  10657. // "required": true,
  10658. // "type": "string"
  10659. // },
  10660. // "profileId": {
  10661. // "description": "Profile ID to retrieve filter link for.",
  10662. // "location": "path",
  10663. // "pattern": "\\d+",
  10664. // "required": true,
  10665. // "type": "string"
  10666. // },
  10667. // "webPropertyId": {
  10668. // "description": "Web property Id to retrieve profile filter link for.",
  10669. // "location": "path",
  10670. // "pattern": "UA-(\\d+)-(\\d+)",
  10671. // "required": true,
  10672. // "type": "string"
  10673. // }
  10674. // },
  10675. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  10676. // "response": {
  10677. // "$ref": "ProfileFilterLink"
  10678. // },
  10679. // "scopes": [
  10680. // "https://www.googleapis.com/auth/analytics.edit",
  10681. // "https://www.googleapis.com/auth/analytics.readonly"
  10682. // ]
  10683. // }
  10684. }
  10685. // method id "analytics.management.profileFilterLinks.insert":
  10686. type ManagementProfileFilterLinksInsertCall struct {
  10687. s *Service
  10688. accountId string
  10689. webPropertyId string
  10690. profileId string
  10691. profilefilterlink *ProfileFilterLink
  10692. urlParams_ gensupport.URLParams
  10693. ctx_ context.Context
  10694. header_ http.Header
  10695. }
  10696. // Insert: Create a new profile filter link.
  10697. func (r *ManagementProfileFilterLinksService) Insert(accountId string, webPropertyId string, profileId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksInsertCall {
  10698. c := &ManagementProfileFilterLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10699. c.accountId = accountId
  10700. c.webPropertyId = webPropertyId
  10701. c.profileId = profileId
  10702. c.profilefilterlink = profilefilterlink
  10703. return c
  10704. }
  10705. // Fields allows partial responses to be retrieved. See
  10706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10707. // for more information.
  10708. func (c *ManagementProfileFilterLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksInsertCall {
  10709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10710. return c
  10711. }
  10712. // Context sets the context to be used in this call's Do method. Any
  10713. // pending HTTP request will be aborted if the provided context is
  10714. // canceled.
  10715. func (c *ManagementProfileFilterLinksInsertCall) Context(ctx context.Context) *ManagementProfileFilterLinksInsertCall {
  10716. c.ctx_ = ctx
  10717. return c
  10718. }
  10719. // Header returns an http.Header that can be modified by the caller to
  10720. // add HTTP headers to the request.
  10721. func (c *ManagementProfileFilterLinksInsertCall) Header() http.Header {
  10722. if c.header_ == nil {
  10723. c.header_ = make(http.Header)
  10724. }
  10725. return c.header_
  10726. }
  10727. func (c *ManagementProfileFilterLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  10728. reqHeaders := make(http.Header)
  10729. for k, v := range c.header_ {
  10730. reqHeaders[k] = v
  10731. }
  10732. reqHeaders.Set("User-Agent", c.s.userAgent())
  10733. var body io.Reader = nil
  10734. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  10735. if err != nil {
  10736. return nil, err
  10737. }
  10738. reqHeaders.Set("Content-Type", "application/json")
  10739. c.urlParams_.Set("alt", alt)
  10740. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  10741. urls += "?" + c.urlParams_.Encode()
  10742. req, _ := http.NewRequest("POST", urls, body)
  10743. req.Header = reqHeaders
  10744. googleapi.Expand(req.URL, map[string]string{
  10745. "accountId": c.accountId,
  10746. "webPropertyId": c.webPropertyId,
  10747. "profileId": c.profileId,
  10748. })
  10749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10750. }
  10751. // Do executes the "analytics.management.profileFilterLinks.insert" call.
  10752. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  10753. // non-2xx status code is an error. Response headers are in either
  10754. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  10755. // returned at all) in error.(*googleapi.Error).Header. Use
  10756. // googleapi.IsNotModified to check whether the returned error was
  10757. // because http.StatusNotModified was returned.
  10758. func (c *ManagementProfileFilterLinksInsertCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  10759. gensupport.SetOptions(c.urlParams_, opts...)
  10760. res, err := c.doRequest("json")
  10761. if res != nil && res.StatusCode == http.StatusNotModified {
  10762. if res.Body != nil {
  10763. res.Body.Close()
  10764. }
  10765. return nil, &googleapi.Error{
  10766. Code: res.StatusCode,
  10767. Header: res.Header,
  10768. }
  10769. }
  10770. if err != nil {
  10771. return nil, err
  10772. }
  10773. defer googleapi.CloseBody(res)
  10774. if err := googleapi.CheckResponse(res); err != nil {
  10775. return nil, err
  10776. }
  10777. ret := &ProfileFilterLink{
  10778. ServerResponse: googleapi.ServerResponse{
  10779. Header: res.Header,
  10780. HTTPStatusCode: res.StatusCode,
  10781. },
  10782. }
  10783. target := &ret
  10784. if err := gensupport.DecodeResponse(target, res); err != nil {
  10785. return nil, err
  10786. }
  10787. return ret, nil
  10788. // {
  10789. // "description": "Create a new profile filter link.",
  10790. // "httpMethod": "POST",
  10791. // "id": "analytics.management.profileFilterLinks.insert",
  10792. // "parameterOrder": [
  10793. // "accountId",
  10794. // "webPropertyId",
  10795. // "profileId"
  10796. // ],
  10797. // "parameters": {
  10798. // "accountId": {
  10799. // "description": "Account ID to create profile filter link for.",
  10800. // "location": "path",
  10801. // "pattern": "\\d+",
  10802. // "required": true,
  10803. // "type": "string"
  10804. // },
  10805. // "profileId": {
  10806. // "description": "Profile ID to create filter link for.",
  10807. // "location": "path",
  10808. // "pattern": "\\d+",
  10809. // "required": true,
  10810. // "type": "string"
  10811. // },
  10812. // "webPropertyId": {
  10813. // "description": "Web property Id to create profile filter link for.",
  10814. // "location": "path",
  10815. // "pattern": "UA-(\\d+)-(\\d+)",
  10816. // "required": true,
  10817. // "type": "string"
  10818. // }
  10819. // },
  10820. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  10821. // "request": {
  10822. // "$ref": "ProfileFilterLink"
  10823. // },
  10824. // "response": {
  10825. // "$ref": "ProfileFilterLink"
  10826. // },
  10827. // "scopes": [
  10828. // "https://www.googleapis.com/auth/analytics.edit"
  10829. // ]
  10830. // }
  10831. }
  10832. // method id "analytics.management.profileFilterLinks.list":
  10833. type ManagementProfileFilterLinksListCall struct {
  10834. s *Service
  10835. accountId string
  10836. webPropertyId string
  10837. profileId string
  10838. urlParams_ gensupport.URLParams
  10839. ifNoneMatch_ string
  10840. ctx_ context.Context
  10841. header_ http.Header
  10842. }
  10843. // List: Lists all profile filter links for a profile.
  10844. func (r *ManagementProfileFilterLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileFilterLinksListCall {
  10845. c := &ManagementProfileFilterLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10846. c.accountId = accountId
  10847. c.webPropertyId = webPropertyId
  10848. c.profileId = profileId
  10849. return c
  10850. }
  10851. // MaxResults sets the optional parameter "max-results": The maximum
  10852. // number of profile filter links to include in this response.
  10853. func (c *ManagementProfileFilterLinksListCall) MaxResults(maxResults int64) *ManagementProfileFilterLinksListCall {
  10854. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  10855. return c
  10856. }
  10857. // StartIndex sets the optional parameter "start-index": An index of the
  10858. // first entity to retrieve. Use this parameter as a pagination
  10859. // mechanism along with the max-results parameter.
  10860. func (c *ManagementProfileFilterLinksListCall) StartIndex(startIndex int64) *ManagementProfileFilterLinksListCall {
  10861. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  10862. return c
  10863. }
  10864. // Fields allows partial responses to be retrieved. See
  10865. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10866. // for more information.
  10867. func (c *ManagementProfileFilterLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksListCall {
  10868. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10869. return c
  10870. }
  10871. // IfNoneMatch sets the optional parameter which makes the operation
  10872. // fail if the object's ETag matches the given value. This is useful for
  10873. // getting updates only after the object has changed since the last
  10874. // request. Use googleapi.IsNotModified to check whether the response
  10875. // error from Do is the result of In-None-Match.
  10876. func (c *ManagementProfileFilterLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileFilterLinksListCall {
  10877. c.ifNoneMatch_ = entityTag
  10878. return c
  10879. }
  10880. // Context sets the context to be used in this call's Do method. Any
  10881. // pending HTTP request will be aborted if the provided context is
  10882. // canceled.
  10883. func (c *ManagementProfileFilterLinksListCall) Context(ctx context.Context) *ManagementProfileFilterLinksListCall {
  10884. c.ctx_ = ctx
  10885. return c
  10886. }
  10887. // Header returns an http.Header that can be modified by the caller to
  10888. // add HTTP headers to the request.
  10889. func (c *ManagementProfileFilterLinksListCall) Header() http.Header {
  10890. if c.header_ == nil {
  10891. c.header_ = make(http.Header)
  10892. }
  10893. return c.header_
  10894. }
  10895. func (c *ManagementProfileFilterLinksListCall) doRequest(alt string) (*http.Response, error) {
  10896. reqHeaders := make(http.Header)
  10897. for k, v := range c.header_ {
  10898. reqHeaders[k] = v
  10899. }
  10900. reqHeaders.Set("User-Agent", c.s.userAgent())
  10901. if c.ifNoneMatch_ != "" {
  10902. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10903. }
  10904. var body io.Reader = nil
  10905. c.urlParams_.Set("alt", alt)
  10906. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks")
  10907. urls += "?" + c.urlParams_.Encode()
  10908. req, _ := http.NewRequest("GET", urls, body)
  10909. req.Header = reqHeaders
  10910. googleapi.Expand(req.URL, map[string]string{
  10911. "accountId": c.accountId,
  10912. "webPropertyId": c.webPropertyId,
  10913. "profileId": c.profileId,
  10914. })
  10915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10916. }
  10917. // Do executes the "analytics.management.profileFilterLinks.list" call.
  10918. // Exactly one of *ProfileFilterLinks or error will be non-nil. Any
  10919. // non-2xx status code is an error. Response headers are in either
  10920. // *ProfileFilterLinks.ServerResponse.Header or (if a response was
  10921. // returned at all) in error.(*googleapi.Error).Header. Use
  10922. // googleapi.IsNotModified to check whether the returned error was
  10923. // because http.StatusNotModified was returned.
  10924. func (c *ManagementProfileFilterLinksListCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLinks, error) {
  10925. gensupport.SetOptions(c.urlParams_, opts...)
  10926. res, err := c.doRequest("json")
  10927. if res != nil && res.StatusCode == http.StatusNotModified {
  10928. if res.Body != nil {
  10929. res.Body.Close()
  10930. }
  10931. return nil, &googleapi.Error{
  10932. Code: res.StatusCode,
  10933. Header: res.Header,
  10934. }
  10935. }
  10936. if err != nil {
  10937. return nil, err
  10938. }
  10939. defer googleapi.CloseBody(res)
  10940. if err := googleapi.CheckResponse(res); err != nil {
  10941. return nil, err
  10942. }
  10943. ret := &ProfileFilterLinks{
  10944. ServerResponse: googleapi.ServerResponse{
  10945. Header: res.Header,
  10946. HTTPStatusCode: res.StatusCode,
  10947. },
  10948. }
  10949. target := &ret
  10950. if err := gensupport.DecodeResponse(target, res); err != nil {
  10951. return nil, err
  10952. }
  10953. return ret, nil
  10954. // {
  10955. // "description": "Lists all profile filter links for a profile.",
  10956. // "httpMethod": "GET",
  10957. // "id": "analytics.management.profileFilterLinks.list",
  10958. // "parameterOrder": [
  10959. // "accountId",
  10960. // "webPropertyId",
  10961. // "profileId"
  10962. // ],
  10963. // "parameters": {
  10964. // "accountId": {
  10965. // "description": "Account ID to retrieve profile filter links for.",
  10966. // "location": "path",
  10967. // "pattern": "\\d+",
  10968. // "required": true,
  10969. // "type": "string"
  10970. // },
  10971. // "max-results": {
  10972. // "description": "The maximum number of profile filter links to include in this response.",
  10973. // "format": "int32",
  10974. // "location": "query",
  10975. // "type": "integer"
  10976. // },
  10977. // "profileId": {
  10978. // "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.",
  10979. // "location": "path",
  10980. // "required": true,
  10981. // "type": "string"
  10982. // },
  10983. // "start-index": {
  10984. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  10985. // "format": "int32",
  10986. // "location": "query",
  10987. // "minimum": "1",
  10988. // "type": "integer"
  10989. // },
  10990. // "webPropertyId": {
  10991. // "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.",
  10992. // "location": "path",
  10993. // "required": true,
  10994. // "type": "string"
  10995. // }
  10996. // },
  10997. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks",
  10998. // "response": {
  10999. // "$ref": "ProfileFilterLinks"
  11000. // },
  11001. // "scopes": [
  11002. // "https://www.googleapis.com/auth/analytics.edit",
  11003. // "https://www.googleapis.com/auth/analytics.readonly"
  11004. // ]
  11005. // }
  11006. }
  11007. // method id "analytics.management.profileFilterLinks.patch":
  11008. type ManagementProfileFilterLinksPatchCall struct {
  11009. s *Service
  11010. accountId string
  11011. webPropertyId string
  11012. profileId string
  11013. linkId string
  11014. profilefilterlink *ProfileFilterLink
  11015. urlParams_ gensupport.URLParams
  11016. ctx_ context.Context
  11017. header_ http.Header
  11018. }
  11019. // Patch: Update an existing profile filter link. This method supports
  11020. // patch semantics.
  11021. func (r *ManagementProfileFilterLinksService) Patch(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksPatchCall {
  11022. c := &ManagementProfileFilterLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11023. c.accountId = accountId
  11024. c.webPropertyId = webPropertyId
  11025. c.profileId = profileId
  11026. c.linkId = linkId
  11027. c.profilefilterlink = profilefilterlink
  11028. return c
  11029. }
  11030. // Fields allows partial responses to be retrieved. See
  11031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11032. // for more information.
  11033. func (c *ManagementProfileFilterLinksPatchCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksPatchCall {
  11034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11035. return c
  11036. }
  11037. // Context sets the context to be used in this call's Do method. Any
  11038. // pending HTTP request will be aborted if the provided context is
  11039. // canceled.
  11040. func (c *ManagementProfileFilterLinksPatchCall) Context(ctx context.Context) *ManagementProfileFilterLinksPatchCall {
  11041. c.ctx_ = ctx
  11042. return c
  11043. }
  11044. // Header returns an http.Header that can be modified by the caller to
  11045. // add HTTP headers to the request.
  11046. func (c *ManagementProfileFilterLinksPatchCall) Header() http.Header {
  11047. if c.header_ == nil {
  11048. c.header_ = make(http.Header)
  11049. }
  11050. return c.header_
  11051. }
  11052. func (c *ManagementProfileFilterLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  11053. reqHeaders := make(http.Header)
  11054. for k, v := range c.header_ {
  11055. reqHeaders[k] = v
  11056. }
  11057. reqHeaders.Set("User-Agent", c.s.userAgent())
  11058. var body io.Reader = nil
  11059. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11060. if err != nil {
  11061. return nil, err
  11062. }
  11063. reqHeaders.Set("Content-Type", "application/json")
  11064. c.urlParams_.Set("alt", alt)
  11065. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  11066. urls += "?" + c.urlParams_.Encode()
  11067. req, _ := http.NewRequest("PATCH", urls, body)
  11068. req.Header = reqHeaders
  11069. googleapi.Expand(req.URL, map[string]string{
  11070. "accountId": c.accountId,
  11071. "webPropertyId": c.webPropertyId,
  11072. "profileId": c.profileId,
  11073. "linkId": c.linkId,
  11074. })
  11075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11076. }
  11077. // Do executes the "analytics.management.profileFilterLinks.patch" call.
  11078. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11079. // non-2xx status code is an error. Response headers are in either
  11080. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11081. // returned at all) in error.(*googleapi.Error).Header. Use
  11082. // googleapi.IsNotModified to check whether the returned error was
  11083. // because http.StatusNotModified was returned.
  11084. func (c *ManagementProfileFilterLinksPatchCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11085. gensupport.SetOptions(c.urlParams_, opts...)
  11086. res, err := c.doRequest("json")
  11087. if res != nil && res.StatusCode == http.StatusNotModified {
  11088. if res.Body != nil {
  11089. res.Body.Close()
  11090. }
  11091. return nil, &googleapi.Error{
  11092. Code: res.StatusCode,
  11093. Header: res.Header,
  11094. }
  11095. }
  11096. if err != nil {
  11097. return nil, err
  11098. }
  11099. defer googleapi.CloseBody(res)
  11100. if err := googleapi.CheckResponse(res); err != nil {
  11101. return nil, err
  11102. }
  11103. ret := &ProfileFilterLink{
  11104. ServerResponse: googleapi.ServerResponse{
  11105. Header: res.Header,
  11106. HTTPStatusCode: res.StatusCode,
  11107. },
  11108. }
  11109. target := &ret
  11110. if err := gensupport.DecodeResponse(target, res); err != nil {
  11111. return nil, err
  11112. }
  11113. return ret, nil
  11114. // {
  11115. // "description": "Update an existing profile filter link. This method supports patch semantics.",
  11116. // "httpMethod": "PATCH",
  11117. // "id": "analytics.management.profileFilterLinks.patch",
  11118. // "parameterOrder": [
  11119. // "accountId",
  11120. // "webPropertyId",
  11121. // "profileId",
  11122. // "linkId"
  11123. // ],
  11124. // "parameters": {
  11125. // "accountId": {
  11126. // "description": "Account ID to which profile filter link belongs.",
  11127. // "location": "path",
  11128. // "pattern": "\\d+",
  11129. // "required": true,
  11130. // "type": "string"
  11131. // },
  11132. // "linkId": {
  11133. // "description": "ID of the profile filter link to be updated.",
  11134. // "location": "path",
  11135. // "pattern": "\\d+:\\d+",
  11136. // "required": true,
  11137. // "type": "string"
  11138. // },
  11139. // "profileId": {
  11140. // "description": "Profile ID to which filter link belongs",
  11141. // "location": "path",
  11142. // "pattern": "\\d+",
  11143. // "required": true,
  11144. // "type": "string"
  11145. // },
  11146. // "webPropertyId": {
  11147. // "description": "Web property Id to which profile filter link belongs",
  11148. // "location": "path",
  11149. // "pattern": "UA-(\\d+)-(\\d+)",
  11150. // "required": true,
  11151. // "type": "string"
  11152. // }
  11153. // },
  11154. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11155. // "request": {
  11156. // "$ref": "ProfileFilterLink"
  11157. // },
  11158. // "response": {
  11159. // "$ref": "ProfileFilterLink"
  11160. // },
  11161. // "scopes": [
  11162. // "https://www.googleapis.com/auth/analytics.edit"
  11163. // ]
  11164. // }
  11165. }
  11166. // method id "analytics.management.profileFilterLinks.update":
  11167. type ManagementProfileFilterLinksUpdateCall struct {
  11168. s *Service
  11169. accountId string
  11170. webPropertyId string
  11171. profileId string
  11172. linkId string
  11173. profilefilterlink *ProfileFilterLink
  11174. urlParams_ gensupport.URLParams
  11175. ctx_ context.Context
  11176. header_ http.Header
  11177. }
  11178. // Update: Update an existing profile filter link.
  11179. func (r *ManagementProfileFilterLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, profilefilterlink *ProfileFilterLink) *ManagementProfileFilterLinksUpdateCall {
  11180. c := &ManagementProfileFilterLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11181. c.accountId = accountId
  11182. c.webPropertyId = webPropertyId
  11183. c.profileId = profileId
  11184. c.linkId = linkId
  11185. c.profilefilterlink = profilefilterlink
  11186. return c
  11187. }
  11188. // Fields allows partial responses to be retrieved. See
  11189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11190. // for more information.
  11191. func (c *ManagementProfileFilterLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileFilterLinksUpdateCall {
  11192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11193. return c
  11194. }
  11195. // Context sets the context to be used in this call's Do method. Any
  11196. // pending HTTP request will be aborted if the provided context is
  11197. // canceled.
  11198. func (c *ManagementProfileFilterLinksUpdateCall) Context(ctx context.Context) *ManagementProfileFilterLinksUpdateCall {
  11199. c.ctx_ = ctx
  11200. return c
  11201. }
  11202. // Header returns an http.Header that can be modified by the caller to
  11203. // add HTTP headers to the request.
  11204. func (c *ManagementProfileFilterLinksUpdateCall) Header() http.Header {
  11205. if c.header_ == nil {
  11206. c.header_ = make(http.Header)
  11207. }
  11208. return c.header_
  11209. }
  11210. func (c *ManagementProfileFilterLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  11211. reqHeaders := make(http.Header)
  11212. for k, v := range c.header_ {
  11213. reqHeaders[k] = v
  11214. }
  11215. reqHeaders.Set("User-Agent", c.s.userAgent())
  11216. var body io.Reader = nil
  11217. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profilefilterlink)
  11218. if err != nil {
  11219. return nil, err
  11220. }
  11221. reqHeaders.Set("Content-Type", "application/json")
  11222. c.urlParams_.Set("alt", alt)
  11223. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}")
  11224. urls += "?" + c.urlParams_.Encode()
  11225. req, _ := http.NewRequest("PUT", urls, body)
  11226. req.Header = reqHeaders
  11227. googleapi.Expand(req.URL, map[string]string{
  11228. "accountId": c.accountId,
  11229. "webPropertyId": c.webPropertyId,
  11230. "profileId": c.profileId,
  11231. "linkId": c.linkId,
  11232. })
  11233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11234. }
  11235. // Do executes the "analytics.management.profileFilterLinks.update" call.
  11236. // Exactly one of *ProfileFilterLink or error will be non-nil. Any
  11237. // non-2xx status code is an error. Response headers are in either
  11238. // *ProfileFilterLink.ServerResponse.Header or (if a response was
  11239. // returned at all) in error.(*googleapi.Error).Header. Use
  11240. // googleapi.IsNotModified to check whether the returned error was
  11241. // because http.StatusNotModified was returned.
  11242. func (c *ManagementProfileFilterLinksUpdateCall) Do(opts ...googleapi.CallOption) (*ProfileFilterLink, error) {
  11243. gensupport.SetOptions(c.urlParams_, opts...)
  11244. res, err := c.doRequest("json")
  11245. if res != nil && res.StatusCode == http.StatusNotModified {
  11246. if res.Body != nil {
  11247. res.Body.Close()
  11248. }
  11249. return nil, &googleapi.Error{
  11250. Code: res.StatusCode,
  11251. Header: res.Header,
  11252. }
  11253. }
  11254. if err != nil {
  11255. return nil, err
  11256. }
  11257. defer googleapi.CloseBody(res)
  11258. if err := googleapi.CheckResponse(res); err != nil {
  11259. return nil, err
  11260. }
  11261. ret := &ProfileFilterLink{
  11262. ServerResponse: googleapi.ServerResponse{
  11263. Header: res.Header,
  11264. HTTPStatusCode: res.StatusCode,
  11265. },
  11266. }
  11267. target := &ret
  11268. if err := gensupport.DecodeResponse(target, res); err != nil {
  11269. return nil, err
  11270. }
  11271. return ret, nil
  11272. // {
  11273. // "description": "Update an existing profile filter link.",
  11274. // "httpMethod": "PUT",
  11275. // "id": "analytics.management.profileFilterLinks.update",
  11276. // "parameterOrder": [
  11277. // "accountId",
  11278. // "webPropertyId",
  11279. // "profileId",
  11280. // "linkId"
  11281. // ],
  11282. // "parameters": {
  11283. // "accountId": {
  11284. // "description": "Account ID to which profile filter link belongs.",
  11285. // "location": "path",
  11286. // "pattern": "\\d+",
  11287. // "required": true,
  11288. // "type": "string"
  11289. // },
  11290. // "linkId": {
  11291. // "description": "ID of the profile filter link to be updated.",
  11292. // "location": "path",
  11293. // "pattern": "\\d+:\\d+",
  11294. // "required": true,
  11295. // "type": "string"
  11296. // },
  11297. // "profileId": {
  11298. // "description": "Profile ID to which filter link belongs",
  11299. // "location": "path",
  11300. // "pattern": "\\d+",
  11301. // "required": true,
  11302. // "type": "string"
  11303. // },
  11304. // "webPropertyId": {
  11305. // "description": "Web property Id to which profile filter link belongs",
  11306. // "location": "path",
  11307. // "pattern": "UA-(\\d+)-(\\d+)",
  11308. // "required": true,
  11309. // "type": "string"
  11310. // }
  11311. // },
  11312. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}",
  11313. // "request": {
  11314. // "$ref": "ProfileFilterLink"
  11315. // },
  11316. // "response": {
  11317. // "$ref": "ProfileFilterLink"
  11318. // },
  11319. // "scopes": [
  11320. // "https://www.googleapis.com/auth/analytics.edit"
  11321. // ]
  11322. // }
  11323. }
  11324. // method id "analytics.management.profileUserLinks.delete":
  11325. type ManagementProfileUserLinksDeleteCall struct {
  11326. s *Service
  11327. accountId string
  11328. webPropertyId string
  11329. profileId string
  11330. linkId string
  11331. urlParams_ gensupport.URLParams
  11332. ctx_ context.Context
  11333. header_ http.Header
  11334. }
  11335. // Delete: Removes a user from the given view (profile).
  11336. func (r *ManagementProfileUserLinksService) Delete(accountId string, webPropertyId string, profileId string, linkId string) *ManagementProfileUserLinksDeleteCall {
  11337. c := &ManagementProfileUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11338. c.accountId = accountId
  11339. c.webPropertyId = webPropertyId
  11340. c.profileId = profileId
  11341. c.linkId = linkId
  11342. return c
  11343. }
  11344. // Fields allows partial responses to be retrieved. See
  11345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11346. // for more information.
  11347. func (c *ManagementProfileUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksDeleteCall {
  11348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11349. return c
  11350. }
  11351. // Context sets the context to be used in this call's Do method. Any
  11352. // pending HTTP request will be aborted if the provided context is
  11353. // canceled.
  11354. func (c *ManagementProfileUserLinksDeleteCall) Context(ctx context.Context) *ManagementProfileUserLinksDeleteCall {
  11355. c.ctx_ = ctx
  11356. return c
  11357. }
  11358. // Header returns an http.Header that can be modified by the caller to
  11359. // add HTTP headers to the request.
  11360. func (c *ManagementProfileUserLinksDeleteCall) Header() http.Header {
  11361. if c.header_ == nil {
  11362. c.header_ = make(http.Header)
  11363. }
  11364. return c.header_
  11365. }
  11366. func (c *ManagementProfileUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  11367. reqHeaders := make(http.Header)
  11368. for k, v := range c.header_ {
  11369. reqHeaders[k] = v
  11370. }
  11371. reqHeaders.Set("User-Agent", c.s.userAgent())
  11372. var body io.Reader = nil
  11373. c.urlParams_.Set("alt", alt)
  11374. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  11375. urls += "?" + c.urlParams_.Encode()
  11376. req, _ := http.NewRequest("DELETE", urls, body)
  11377. req.Header = reqHeaders
  11378. googleapi.Expand(req.URL, map[string]string{
  11379. "accountId": c.accountId,
  11380. "webPropertyId": c.webPropertyId,
  11381. "profileId": c.profileId,
  11382. "linkId": c.linkId,
  11383. })
  11384. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11385. }
  11386. // Do executes the "analytics.management.profileUserLinks.delete" call.
  11387. func (c *ManagementProfileUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  11388. gensupport.SetOptions(c.urlParams_, opts...)
  11389. res, err := c.doRequest("json")
  11390. if err != nil {
  11391. return err
  11392. }
  11393. defer googleapi.CloseBody(res)
  11394. if err := googleapi.CheckResponse(res); err != nil {
  11395. return err
  11396. }
  11397. return nil
  11398. // {
  11399. // "description": "Removes a user from the given view (profile).",
  11400. // "httpMethod": "DELETE",
  11401. // "id": "analytics.management.profileUserLinks.delete",
  11402. // "parameterOrder": [
  11403. // "accountId",
  11404. // "webPropertyId",
  11405. // "profileId",
  11406. // "linkId"
  11407. // ],
  11408. // "parameters": {
  11409. // "accountId": {
  11410. // "description": "Account ID to delete the user link for.",
  11411. // "location": "path",
  11412. // "required": true,
  11413. // "type": "string"
  11414. // },
  11415. // "linkId": {
  11416. // "description": "Link ID to delete the user link for.",
  11417. // "location": "path",
  11418. // "required": true,
  11419. // "type": "string"
  11420. // },
  11421. // "profileId": {
  11422. // "description": "View (Profile) ID to delete the user link for.",
  11423. // "location": "path",
  11424. // "required": true,
  11425. // "type": "string"
  11426. // },
  11427. // "webPropertyId": {
  11428. // "description": "Web Property ID to delete the user link for.",
  11429. // "location": "path",
  11430. // "required": true,
  11431. // "type": "string"
  11432. // }
  11433. // },
  11434. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  11435. // "scopes": [
  11436. // "https://www.googleapis.com/auth/analytics.manage.users"
  11437. // ]
  11438. // }
  11439. }
  11440. // method id "analytics.management.profileUserLinks.insert":
  11441. type ManagementProfileUserLinksInsertCall struct {
  11442. s *Service
  11443. accountId string
  11444. webPropertyId string
  11445. profileId string
  11446. entityuserlink *EntityUserLink
  11447. urlParams_ gensupport.URLParams
  11448. ctx_ context.Context
  11449. header_ http.Header
  11450. }
  11451. // Insert: Adds a new user to the given view (profile).
  11452. func (r *ManagementProfileUserLinksService) Insert(accountId string, webPropertyId string, profileId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksInsertCall {
  11453. c := &ManagementProfileUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11454. c.accountId = accountId
  11455. c.webPropertyId = webPropertyId
  11456. c.profileId = profileId
  11457. c.entityuserlink = entityuserlink
  11458. return c
  11459. }
  11460. // Fields allows partial responses to be retrieved. See
  11461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11462. // for more information.
  11463. func (c *ManagementProfileUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksInsertCall {
  11464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11465. return c
  11466. }
  11467. // Context sets the context to be used in this call's Do method. Any
  11468. // pending HTTP request will be aborted if the provided context is
  11469. // canceled.
  11470. func (c *ManagementProfileUserLinksInsertCall) Context(ctx context.Context) *ManagementProfileUserLinksInsertCall {
  11471. c.ctx_ = ctx
  11472. return c
  11473. }
  11474. // Header returns an http.Header that can be modified by the caller to
  11475. // add HTTP headers to the request.
  11476. func (c *ManagementProfileUserLinksInsertCall) Header() http.Header {
  11477. if c.header_ == nil {
  11478. c.header_ = make(http.Header)
  11479. }
  11480. return c.header_
  11481. }
  11482. func (c *ManagementProfileUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  11483. reqHeaders := make(http.Header)
  11484. for k, v := range c.header_ {
  11485. reqHeaders[k] = v
  11486. }
  11487. reqHeaders.Set("User-Agent", c.s.userAgent())
  11488. var body io.Reader = nil
  11489. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  11490. if err != nil {
  11491. return nil, err
  11492. }
  11493. reqHeaders.Set("Content-Type", "application/json")
  11494. c.urlParams_.Set("alt", alt)
  11495. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  11496. urls += "?" + c.urlParams_.Encode()
  11497. req, _ := http.NewRequest("POST", urls, body)
  11498. req.Header = reqHeaders
  11499. googleapi.Expand(req.URL, map[string]string{
  11500. "accountId": c.accountId,
  11501. "webPropertyId": c.webPropertyId,
  11502. "profileId": c.profileId,
  11503. })
  11504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11505. }
  11506. // Do executes the "analytics.management.profileUserLinks.insert" call.
  11507. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  11508. // status code is an error. Response headers are in either
  11509. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  11510. // at all) in error.(*googleapi.Error).Header. Use
  11511. // googleapi.IsNotModified to check whether the returned error was
  11512. // because http.StatusNotModified was returned.
  11513. func (c *ManagementProfileUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  11514. gensupport.SetOptions(c.urlParams_, opts...)
  11515. res, err := c.doRequest("json")
  11516. if res != nil && res.StatusCode == http.StatusNotModified {
  11517. if res.Body != nil {
  11518. res.Body.Close()
  11519. }
  11520. return nil, &googleapi.Error{
  11521. Code: res.StatusCode,
  11522. Header: res.Header,
  11523. }
  11524. }
  11525. if err != nil {
  11526. return nil, err
  11527. }
  11528. defer googleapi.CloseBody(res)
  11529. if err := googleapi.CheckResponse(res); err != nil {
  11530. return nil, err
  11531. }
  11532. ret := &EntityUserLink{
  11533. ServerResponse: googleapi.ServerResponse{
  11534. Header: res.Header,
  11535. HTTPStatusCode: res.StatusCode,
  11536. },
  11537. }
  11538. target := &ret
  11539. if err := gensupport.DecodeResponse(target, res); err != nil {
  11540. return nil, err
  11541. }
  11542. return ret, nil
  11543. // {
  11544. // "description": "Adds a new user to the given view (profile).",
  11545. // "httpMethod": "POST",
  11546. // "id": "analytics.management.profileUserLinks.insert",
  11547. // "parameterOrder": [
  11548. // "accountId",
  11549. // "webPropertyId",
  11550. // "profileId"
  11551. // ],
  11552. // "parameters": {
  11553. // "accountId": {
  11554. // "description": "Account ID to create the user link for.",
  11555. // "location": "path",
  11556. // "required": true,
  11557. // "type": "string"
  11558. // },
  11559. // "profileId": {
  11560. // "description": "View (Profile) ID to create the user link for.",
  11561. // "location": "path",
  11562. // "required": true,
  11563. // "type": "string"
  11564. // },
  11565. // "webPropertyId": {
  11566. // "description": "Web Property ID to create the user link for.",
  11567. // "location": "path",
  11568. // "required": true,
  11569. // "type": "string"
  11570. // }
  11571. // },
  11572. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  11573. // "request": {
  11574. // "$ref": "EntityUserLink"
  11575. // },
  11576. // "response": {
  11577. // "$ref": "EntityUserLink"
  11578. // },
  11579. // "scopes": [
  11580. // "https://www.googleapis.com/auth/analytics.manage.users"
  11581. // ]
  11582. // }
  11583. }
  11584. // method id "analytics.management.profileUserLinks.list":
  11585. type ManagementProfileUserLinksListCall struct {
  11586. s *Service
  11587. accountId string
  11588. webPropertyId string
  11589. profileId string
  11590. urlParams_ gensupport.URLParams
  11591. ifNoneMatch_ string
  11592. ctx_ context.Context
  11593. header_ http.Header
  11594. }
  11595. // List: Lists profile-user links for a given view (profile).
  11596. func (r *ManagementProfileUserLinksService) List(accountId string, webPropertyId string, profileId string) *ManagementProfileUserLinksListCall {
  11597. c := &ManagementProfileUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11598. c.accountId = accountId
  11599. c.webPropertyId = webPropertyId
  11600. c.profileId = profileId
  11601. return c
  11602. }
  11603. // MaxResults sets the optional parameter "max-results": The maximum
  11604. // number of profile-user links to include in this response.
  11605. func (c *ManagementProfileUserLinksListCall) MaxResults(maxResults int64) *ManagementProfileUserLinksListCall {
  11606. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  11607. return c
  11608. }
  11609. // StartIndex sets the optional parameter "start-index": An index of the
  11610. // first profile-user link to retrieve. Use this parameter as a
  11611. // pagination mechanism along with the max-results parameter.
  11612. func (c *ManagementProfileUserLinksListCall) StartIndex(startIndex int64) *ManagementProfileUserLinksListCall {
  11613. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  11614. return c
  11615. }
  11616. // Fields allows partial responses to be retrieved. See
  11617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11618. // for more information.
  11619. func (c *ManagementProfileUserLinksListCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksListCall {
  11620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11621. return c
  11622. }
  11623. // IfNoneMatch sets the optional parameter which makes the operation
  11624. // fail if the object's ETag matches the given value. This is useful for
  11625. // getting updates only after the object has changed since the last
  11626. // request. Use googleapi.IsNotModified to check whether the response
  11627. // error from Do is the result of In-None-Match.
  11628. func (c *ManagementProfileUserLinksListCall) IfNoneMatch(entityTag string) *ManagementProfileUserLinksListCall {
  11629. c.ifNoneMatch_ = entityTag
  11630. return c
  11631. }
  11632. // Context sets the context to be used in this call's Do method. Any
  11633. // pending HTTP request will be aborted if the provided context is
  11634. // canceled.
  11635. func (c *ManagementProfileUserLinksListCall) Context(ctx context.Context) *ManagementProfileUserLinksListCall {
  11636. c.ctx_ = ctx
  11637. return c
  11638. }
  11639. // Header returns an http.Header that can be modified by the caller to
  11640. // add HTTP headers to the request.
  11641. func (c *ManagementProfileUserLinksListCall) Header() http.Header {
  11642. if c.header_ == nil {
  11643. c.header_ = make(http.Header)
  11644. }
  11645. return c.header_
  11646. }
  11647. func (c *ManagementProfileUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  11648. reqHeaders := make(http.Header)
  11649. for k, v := range c.header_ {
  11650. reqHeaders[k] = v
  11651. }
  11652. reqHeaders.Set("User-Agent", c.s.userAgent())
  11653. if c.ifNoneMatch_ != "" {
  11654. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11655. }
  11656. var body io.Reader = nil
  11657. c.urlParams_.Set("alt", alt)
  11658. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks")
  11659. urls += "?" + c.urlParams_.Encode()
  11660. req, _ := http.NewRequest("GET", urls, body)
  11661. req.Header = reqHeaders
  11662. googleapi.Expand(req.URL, map[string]string{
  11663. "accountId": c.accountId,
  11664. "webPropertyId": c.webPropertyId,
  11665. "profileId": c.profileId,
  11666. })
  11667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11668. }
  11669. // Do executes the "analytics.management.profileUserLinks.list" call.
  11670. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  11671. // status code is an error. Response headers are in either
  11672. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  11673. // at all) in error.(*googleapi.Error).Header. Use
  11674. // googleapi.IsNotModified to check whether the returned error was
  11675. // because http.StatusNotModified was returned.
  11676. func (c *ManagementProfileUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  11677. gensupport.SetOptions(c.urlParams_, opts...)
  11678. res, err := c.doRequest("json")
  11679. if res != nil && res.StatusCode == http.StatusNotModified {
  11680. if res.Body != nil {
  11681. res.Body.Close()
  11682. }
  11683. return nil, &googleapi.Error{
  11684. Code: res.StatusCode,
  11685. Header: res.Header,
  11686. }
  11687. }
  11688. if err != nil {
  11689. return nil, err
  11690. }
  11691. defer googleapi.CloseBody(res)
  11692. if err := googleapi.CheckResponse(res); err != nil {
  11693. return nil, err
  11694. }
  11695. ret := &EntityUserLinks{
  11696. ServerResponse: googleapi.ServerResponse{
  11697. Header: res.Header,
  11698. HTTPStatusCode: res.StatusCode,
  11699. },
  11700. }
  11701. target := &ret
  11702. if err := gensupport.DecodeResponse(target, res); err != nil {
  11703. return nil, err
  11704. }
  11705. return ret, nil
  11706. // {
  11707. // "description": "Lists profile-user links for a given view (profile).",
  11708. // "httpMethod": "GET",
  11709. // "id": "analytics.management.profileUserLinks.list",
  11710. // "parameterOrder": [
  11711. // "accountId",
  11712. // "webPropertyId",
  11713. // "profileId"
  11714. // ],
  11715. // "parameters": {
  11716. // "accountId": {
  11717. // "description": "Account ID which the given view (profile) belongs to.",
  11718. // "location": "path",
  11719. // "required": true,
  11720. // "type": "string"
  11721. // },
  11722. // "max-results": {
  11723. // "description": "The maximum number of profile-user links to include in this response.",
  11724. // "format": "int32",
  11725. // "location": "query",
  11726. // "type": "integer"
  11727. // },
  11728. // "profileId": {
  11729. // "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.",
  11730. // "location": "path",
  11731. // "required": true,
  11732. // "type": "string"
  11733. // },
  11734. // "start-index": {
  11735. // "description": "An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  11736. // "format": "int32",
  11737. // "location": "query",
  11738. // "minimum": "1",
  11739. // "type": "integer"
  11740. // },
  11741. // "webPropertyId": {
  11742. // "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.",
  11743. // "location": "path",
  11744. // "required": true,
  11745. // "type": "string"
  11746. // }
  11747. // },
  11748. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks",
  11749. // "response": {
  11750. // "$ref": "EntityUserLinks"
  11751. // },
  11752. // "scopes": [
  11753. // "https://www.googleapis.com/auth/analytics.manage.users",
  11754. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  11755. // ]
  11756. // }
  11757. }
  11758. // method id "analytics.management.profileUserLinks.update":
  11759. type ManagementProfileUserLinksUpdateCall struct {
  11760. s *Service
  11761. accountId string
  11762. webPropertyId string
  11763. profileId string
  11764. linkId string
  11765. entityuserlink *EntityUserLink
  11766. urlParams_ gensupport.URLParams
  11767. ctx_ context.Context
  11768. header_ http.Header
  11769. }
  11770. // Update: Updates permissions for an existing user on the given view
  11771. // (profile).
  11772. func (r *ManagementProfileUserLinksService) Update(accountId string, webPropertyId string, profileId string, linkId string, entityuserlink *EntityUserLink) *ManagementProfileUserLinksUpdateCall {
  11773. c := &ManagementProfileUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11774. c.accountId = accountId
  11775. c.webPropertyId = webPropertyId
  11776. c.profileId = profileId
  11777. c.linkId = linkId
  11778. c.entityuserlink = entityuserlink
  11779. return c
  11780. }
  11781. // Fields allows partial responses to be retrieved. See
  11782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11783. // for more information.
  11784. func (c *ManagementProfileUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementProfileUserLinksUpdateCall {
  11785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11786. return c
  11787. }
  11788. // Context sets the context to be used in this call's Do method. Any
  11789. // pending HTTP request will be aborted if the provided context is
  11790. // canceled.
  11791. func (c *ManagementProfileUserLinksUpdateCall) Context(ctx context.Context) *ManagementProfileUserLinksUpdateCall {
  11792. c.ctx_ = ctx
  11793. return c
  11794. }
  11795. // Header returns an http.Header that can be modified by the caller to
  11796. // add HTTP headers to the request.
  11797. func (c *ManagementProfileUserLinksUpdateCall) Header() http.Header {
  11798. if c.header_ == nil {
  11799. c.header_ = make(http.Header)
  11800. }
  11801. return c.header_
  11802. }
  11803. func (c *ManagementProfileUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  11804. reqHeaders := make(http.Header)
  11805. for k, v := range c.header_ {
  11806. reqHeaders[k] = v
  11807. }
  11808. reqHeaders.Set("User-Agent", c.s.userAgent())
  11809. var body io.Reader = nil
  11810. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  11811. if err != nil {
  11812. return nil, err
  11813. }
  11814. reqHeaders.Set("Content-Type", "application/json")
  11815. c.urlParams_.Set("alt", alt)
  11816. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}")
  11817. urls += "?" + c.urlParams_.Encode()
  11818. req, _ := http.NewRequest("PUT", urls, body)
  11819. req.Header = reqHeaders
  11820. googleapi.Expand(req.URL, map[string]string{
  11821. "accountId": c.accountId,
  11822. "webPropertyId": c.webPropertyId,
  11823. "profileId": c.profileId,
  11824. "linkId": c.linkId,
  11825. })
  11826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11827. }
  11828. // Do executes the "analytics.management.profileUserLinks.update" call.
  11829. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  11830. // status code is an error. Response headers are in either
  11831. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  11832. // at all) in error.(*googleapi.Error).Header. Use
  11833. // googleapi.IsNotModified to check whether the returned error was
  11834. // because http.StatusNotModified was returned.
  11835. func (c *ManagementProfileUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  11836. gensupport.SetOptions(c.urlParams_, opts...)
  11837. res, err := c.doRequest("json")
  11838. if res != nil && res.StatusCode == http.StatusNotModified {
  11839. if res.Body != nil {
  11840. res.Body.Close()
  11841. }
  11842. return nil, &googleapi.Error{
  11843. Code: res.StatusCode,
  11844. Header: res.Header,
  11845. }
  11846. }
  11847. if err != nil {
  11848. return nil, err
  11849. }
  11850. defer googleapi.CloseBody(res)
  11851. if err := googleapi.CheckResponse(res); err != nil {
  11852. return nil, err
  11853. }
  11854. ret := &EntityUserLink{
  11855. ServerResponse: googleapi.ServerResponse{
  11856. Header: res.Header,
  11857. HTTPStatusCode: res.StatusCode,
  11858. },
  11859. }
  11860. target := &ret
  11861. if err := gensupport.DecodeResponse(target, res); err != nil {
  11862. return nil, err
  11863. }
  11864. return ret, nil
  11865. // {
  11866. // "description": "Updates permissions for an existing user on the given view (profile).",
  11867. // "httpMethod": "PUT",
  11868. // "id": "analytics.management.profileUserLinks.update",
  11869. // "parameterOrder": [
  11870. // "accountId",
  11871. // "webPropertyId",
  11872. // "profileId",
  11873. // "linkId"
  11874. // ],
  11875. // "parameters": {
  11876. // "accountId": {
  11877. // "description": "Account ID to update the user link for.",
  11878. // "location": "path",
  11879. // "required": true,
  11880. // "type": "string"
  11881. // },
  11882. // "linkId": {
  11883. // "description": "Link ID to update the user link for.",
  11884. // "location": "path",
  11885. // "required": true,
  11886. // "type": "string"
  11887. // },
  11888. // "profileId": {
  11889. // "description": "View (Profile ID) to update the user link for.",
  11890. // "location": "path",
  11891. // "required": true,
  11892. // "type": "string"
  11893. // },
  11894. // "webPropertyId": {
  11895. // "description": "Web Property ID to update the user link for.",
  11896. // "location": "path",
  11897. // "required": true,
  11898. // "type": "string"
  11899. // }
  11900. // },
  11901. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}",
  11902. // "request": {
  11903. // "$ref": "EntityUserLink"
  11904. // },
  11905. // "response": {
  11906. // "$ref": "EntityUserLink"
  11907. // },
  11908. // "scopes": [
  11909. // "https://www.googleapis.com/auth/analytics.manage.users"
  11910. // ]
  11911. // }
  11912. }
  11913. // method id "analytics.management.profiles.delete":
  11914. type ManagementProfilesDeleteCall struct {
  11915. s *Service
  11916. accountId string
  11917. webPropertyId string
  11918. profileId string
  11919. urlParams_ gensupport.URLParams
  11920. ctx_ context.Context
  11921. header_ http.Header
  11922. }
  11923. // Delete: Deletes a view (profile).
  11924. func (r *ManagementProfilesService) Delete(accountId string, webPropertyId string, profileId string) *ManagementProfilesDeleteCall {
  11925. c := &ManagementProfilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11926. c.accountId = accountId
  11927. c.webPropertyId = webPropertyId
  11928. c.profileId = profileId
  11929. return c
  11930. }
  11931. // Fields allows partial responses to be retrieved. See
  11932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11933. // for more information.
  11934. func (c *ManagementProfilesDeleteCall) Fields(s ...googleapi.Field) *ManagementProfilesDeleteCall {
  11935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11936. return c
  11937. }
  11938. // Context sets the context to be used in this call's Do method. Any
  11939. // pending HTTP request will be aborted if the provided context is
  11940. // canceled.
  11941. func (c *ManagementProfilesDeleteCall) Context(ctx context.Context) *ManagementProfilesDeleteCall {
  11942. c.ctx_ = ctx
  11943. return c
  11944. }
  11945. // Header returns an http.Header that can be modified by the caller to
  11946. // add HTTP headers to the request.
  11947. func (c *ManagementProfilesDeleteCall) Header() http.Header {
  11948. if c.header_ == nil {
  11949. c.header_ = make(http.Header)
  11950. }
  11951. return c.header_
  11952. }
  11953. func (c *ManagementProfilesDeleteCall) doRequest(alt string) (*http.Response, error) {
  11954. reqHeaders := make(http.Header)
  11955. for k, v := range c.header_ {
  11956. reqHeaders[k] = v
  11957. }
  11958. reqHeaders.Set("User-Agent", c.s.userAgent())
  11959. var body io.Reader = nil
  11960. c.urlParams_.Set("alt", alt)
  11961. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  11962. urls += "?" + c.urlParams_.Encode()
  11963. req, _ := http.NewRequest("DELETE", urls, body)
  11964. req.Header = reqHeaders
  11965. googleapi.Expand(req.URL, map[string]string{
  11966. "accountId": c.accountId,
  11967. "webPropertyId": c.webPropertyId,
  11968. "profileId": c.profileId,
  11969. })
  11970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11971. }
  11972. // Do executes the "analytics.management.profiles.delete" call.
  11973. func (c *ManagementProfilesDeleteCall) Do(opts ...googleapi.CallOption) error {
  11974. gensupport.SetOptions(c.urlParams_, opts...)
  11975. res, err := c.doRequest("json")
  11976. if err != nil {
  11977. return err
  11978. }
  11979. defer googleapi.CloseBody(res)
  11980. if err := googleapi.CheckResponse(res); err != nil {
  11981. return err
  11982. }
  11983. return nil
  11984. // {
  11985. // "description": "Deletes a view (profile).",
  11986. // "httpMethod": "DELETE",
  11987. // "id": "analytics.management.profiles.delete",
  11988. // "parameterOrder": [
  11989. // "accountId",
  11990. // "webPropertyId",
  11991. // "profileId"
  11992. // ],
  11993. // "parameters": {
  11994. // "accountId": {
  11995. // "description": "Account ID to delete the view (profile) for.",
  11996. // "location": "path",
  11997. // "required": true,
  11998. // "type": "string"
  11999. // },
  12000. // "profileId": {
  12001. // "description": "ID of the view (profile) to be deleted.",
  12002. // "location": "path",
  12003. // "required": true,
  12004. // "type": "string"
  12005. // },
  12006. // "webPropertyId": {
  12007. // "description": "Web property ID to delete the view (profile) for.",
  12008. // "location": "path",
  12009. // "required": true,
  12010. // "type": "string"
  12011. // }
  12012. // },
  12013. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12014. // "scopes": [
  12015. // "https://www.googleapis.com/auth/analytics.edit"
  12016. // ]
  12017. // }
  12018. }
  12019. // method id "analytics.management.profiles.get":
  12020. type ManagementProfilesGetCall struct {
  12021. s *Service
  12022. accountId string
  12023. webPropertyId string
  12024. profileId string
  12025. urlParams_ gensupport.URLParams
  12026. ifNoneMatch_ string
  12027. ctx_ context.Context
  12028. header_ http.Header
  12029. }
  12030. // Get: Gets a view (profile) to which the user has access.
  12031. func (r *ManagementProfilesService) Get(accountId string, webPropertyId string, profileId string) *ManagementProfilesGetCall {
  12032. c := &ManagementProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12033. c.accountId = accountId
  12034. c.webPropertyId = webPropertyId
  12035. c.profileId = profileId
  12036. return c
  12037. }
  12038. // Fields allows partial responses to be retrieved. See
  12039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12040. // for more information.
  12041. func (c *ManagementProfilesGetCall) Fields(s ...googleapi.Field) *ManagementProfilesGetCall {
  12042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12043. return c
  12044. }
  12045. // IfNoneMatch sets the optional parameter which makes the operation
  12046. // fail if the object's ETag matches the given value. This is useful for
  12047. // getting updates only after the object has changed since the last
  12048. // request. Use googleapi.IsNotModified to check whether the response
  12049. // error from Do is the result of In-None-Match.
  12050. func (c *ManagementProfilesGetCall) IfNoneMatch(entityTag string) *ManagementProfilesGetCall {
  12051. c.ifNoneMatch_ = entityTag
  12052. return c
  12053. }
  12054. // Context sets the context to be used in this call's Do method. Any
  12055. // pending HTTP request will be aborted if the provided context is
  12056. // canceled.
  12057. func (c *ManagementProfilesGetCall) Context(ctx context.Context) *ManagementProfilesGetCall {
  12058. c.ctx_ = ctx
  12059. return c
  12060. }
  12061. // Header returns an http.Header that can be modified by the caller to
  12062. // add HTTP headers to the request.
  12063. func (c *ManagementProfilesGetCall) Header() http.Header {
  12064. if c.header_ == nil {
  12065. c.header_ = make(http.Header)
  12066. }
  12067. return c.header_
  12068. }
  12069. func (c *ManagementProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12070. reqHeaders := make(http.Header)
  12071. for k, v := range c.header_ {
  12072. reqHeaders[k] = v
  12073. }
  12074. reqHeaders.Set("User-Agent", c.s.userAgent())
  12075. if c.ifNoneMatch_ != "" {
  12076. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12077. }
  12078. var body io.Reader = nil
  12079. c.urlParams_.Set("alt", alt)
  12080. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12081. urls += "?" + c.urlParams_.Encode()
  12082. req, _ := http.NewRequest("GET", urls, body)
  12083. req.Header = reqHeaders
  12084. googleapi.Expand(req.URL, map[string]string{
  12085. "accountId": c.accountId,
  12086. "webPropertyId": c.webPropertyId,
  12087. "profileId": c.profileId,
  12088. })
  12089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12090. }
  12091. // Do executes the "analytics.management.profiles.get" call.
  12092. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12093. // code is an error. Response headers are in either
  12094. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12095. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12096. // check whether the returned error was because http.StatusNotModified
  12097. // was returned.
  12098. func (c *ManagementProfilesGetCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12099. gensupport.SetOptions(c.urlParams_, opts...)
  12100. res, err := c.doRequest("json")
  12101. if res != nil && res.StatusCode == http.StatusNotModified {
  12102. if res.Body != nil {
  12103. res.Body.Close()
  12104. }
  12105. return nil, &googleapi.Error{
  12106. Code: res.StatusCode,
  12107. Header: res.Header,
  12108. }
  12109. }
  12110. if err != nil {
  12111. return nil, err
  12112. }
  12113. defer googleapi.CloseBody(res)
  12114. if err := googleapi.CheckResponse(res); err != nil {
  12115. return nil, err
  12116. }
  12117. ret := &Profile{
  12118. ServerResponse: googleapi.ServerResponse{
  12119. Header: res.Header,
  12120. HTTPStatusCode: res.StatusCode,
  12121. },
  12122. }
  12123. target := &ret
  12124. if err := gensupport.DecodeResponse(target, res); err != nil {
  12125. return nil, err
  12126. }
  12127. return ret, nil
  12128. // {
  12129. // "description": "Gets a view (profile) to which the user has access.",
  12130. // "httpMethod": "GET",
  12131. // "id": "analytics.management.profiles.get",
  12132. // "parameterOrder": [
  12133. // "accountId",
  12134. // "webPropertyId",
  12135. // "profileId"
  12136. // ],
  12137. // "parameters": {
  12138. // "accountId": {
  12139. // "description": "Account ID to retrieve the view (profile) for.",
  12140. // "location": "path",
  12141. // "pattern": "[0-9]+",
  12142. // "required": true,
  12143. // "type": "string"
  12144. // },
  12145. // "profileId": {
  12146. // "description": "View (Profile) ID to retrieve the view (profile) for.",
  12147. // "location": "path",
  12148. // "pattern": "[0-9]+",
  12149. // "required": true,
  12150. // "type": "string"
  12151. // },
  12152. // "webPropertyId": {
  12153. // "description": "Web property ID to retrieve the view (profile) for.",
  12154. // "location": "path",
  12155. // "pattern": "UA-[0-9]+-[0-9]+",
  12156. // "required": true,
  12157. // "type": "string"
  12158. // }
  12159. // },
  12160. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12161. // "response": {
  12162. // "$ref": "Profile"
  12163. // },
  12164. // "scopes": [
  12165. // "https://www.googleapis.com/auth/analytics.edit",
  12166. // "https://www.googleapis.com/auth/analytics.readonly"
  12167. // ]
  12168. // }
  12169. }
  12170. // method id "analytics.management.profiles.insert":
  12171. type ManagementProfilesInsertCall struct {
  12172. s *Service
  12173. accountId string
  12174. webPropertyId string
  12175. profile *Profile
  12176. urlParams_ gensupport.URLParams
  12177. ctx_ context.Context
  12178. header_ http.Header
  12179. }
  12180. // Insert: Create a new view (profile).
  12181. func (r *ManagementProfilesService) Insert(accountId string, webPropertyId string, profile *Profile) *ManagementProfilesInsertCall {
  12182. c := &ManagementProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12183. c.accountId = accountId
  12184. c.webPropertyId = webPropertyId
  12185. c.profile = profile
  12186. return c
  12187. }
  12188. // Fields allows partial responses to be retrieved. See
  12189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12190. // for more information.
  12191. func (c *ManagementProfilesInsertCall) Fields(s ...googleapi.Field) *ManagementProfilesInsertCall {
  12192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12193. return c
  12194. }
  12195. // Context sets the context to be used in this call's Do method. Any
  12196. // pending HTTP request will be aborted if the provided context is
  12197. // canceled.
  12198. func (c *ManagementProfilesInsertCall) Context(ctx context.Context) *ManagementProfilesInsertCall {
  12199. c.ctx_ = ctx
  12200. return c
  12201. }
  12202. // Header returns an http.Header that can be modified by the caller to
  12203. // add HTTP headers to the request.
  12204. func (c *ManagementProfilesInsertCall) Header() http.Header {
  12205. if c.header_ == nil {
  12206. c.header_ = make(http.Header)
  12207. }
  12208. return c.header_
  12209. }
  12210. func (c *ManagementProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12211. reqHeaders := make(http.Header)
  12212. for k, v := range c.header_ {
  12213. reqHeaders[k] = v
  12214. }
  12215. reqHeaders.Set("User-Agent", c.s.userAgent())
  12216. var body io.Reader = nil
  12217. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  12218. if err != nil {
  12219. return nil, err
  12220. }
  12221. reqHeaders.Set("Content-Type", "application/json")
  12222. c.urlParams_.Set("alt", alt)
  12223. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  12224. urls += "?" + c.urlParams_.Encode()
  12225. req, _ := http.NewRequest("POST", urls, body)
  12226. req.Header = reqHeaders
  12227. googleapi.Expand(req.URL, map[string]string{
  12228. "accountId": c.accountId,
  12229. "webPropertyId": c.webPropertyId,
  12230. })
  12231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12232. }
  12233. // Do executes the "analytics.management.profiles.insert" call.
  12234. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12235. // code is an error. Response headers are in either
  12236. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12237. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12238. // check whether the returned error was because http.StatusNotModified
  12239. // was returned.
  12240. func (c *ManagementProfilesInsertCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12241. gensupport.SetOptions(c.urlParams_, opts...)
  12242. res, err := c.doRequest("json")
  12243. if res != nil && res.StatusCode == http.StatusNotModified {
  12244. if res.Body != nil {
  12245. res.Body.Close()
  12246. }
  12247. return nil, &googleapi.Error{
  12248. Code: res.StatusCode,
  12249. Header: res.Header,
  12250. }
  12251. }
  12252. if err != nil {
  12253. return nil, err
  12254. }
  12255. defer googleapi.CloseBody(res)
  12256. if err := googleapi.CheckResponse(res); err != nil {
  12257. return nil, err
  12258. }
  12259. ret := &Profile{
  12260. ServerResponse: googleapi.ServerResponse{
  12261. Header: res.Header,
  12262. HTTPStatusCode: res.StatusCode,
  12263. },
  12264. }
  12265. target := &ret
  12266. if err := gensupport.DecodeResponse(target, res); err != nil {
  12267. return nil, err
  12268. }
  12269. return ret, nil
  12270. // {
  12271. // "description": "Create a new view (profile).",
  12272. // "httpMethod": "POST",
  12273. // "id": "analytics.management.profiles.insert",
  12274. // "parameterOrder": [
  12275. // "accountId",
  12276. // "webPropertyId"
  12277. // ],
  12278. // "parameters": {
  12279. // "accountId": {
  12280. // "description": "Account ID to create the view (profile) for.",
  12281. // "location": "path",
  12282. // "required": true,
  12283. // "type": "string"
  12284. // },
  12285. // "webPropertyId": {
  12286. // "description": "Web property ID to create the view (profile) for.",
  12287. // "location": "path",
  12288. // "required": true,
  12289. // "type": "string"
  12290. // }
  12291. // },
  12292. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  12293. // "request": {
  12294. // "$ref": "Profile"
  12295. // },
  12296. // "response": {
  12297. // "$ref": "Profile"
  12298. // },
  12299. // "scopes": [
  12300. // "https://www.googleapis.com/auth/analytics.edit"
  12301. // ]
  12302. // }
  12303. }
  12304. // method id "analytics.management.profiles.list":
  12305. type ManagementProfilesListCall struct {
  12306. s *Service
  12307. accountId string
  12308. webPropertyId string
  12309. urlParams_ gensupport.URLParams
  12310. ifNoneMatch_ string
  12311. ctx_ context.Context
  12312. header_ http.Header
  12313. }
  12314. // List: Lists views (profiles) to which the user has access.
  12315. func (r *ManagementProfilesService) List(accountId string, webPropertyId string) *ManagementProfilesListCall {
  12316. c := &ManagementProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12317. c.accountId = accountId
  12318. c.webPropertyId = webPropertyId
  12319. return c
  12320. }
  12321. // MaxResults sets the optional parameter "max-results": The maximum
  12322. // number of views (profiles) to include in this response.
  12323. func (c *ManagementProfilesListCall) MaxResults(maxResults int64) *ManagementProfilesListCall {
  12324. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  12325. return c
  12326. }
  12327. // StartIndex sets the optional parameter "start-index": An index of the
  12328. // first entity to retrieve. Use this parameter as a pagination
  12329. // mechanism along with the max-results parameter.
  12330. func (c *ManagementProfilesListCall) StartIndex(startIndex int64) *ManagementProfilesListCall {
  12331. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  12332. return c
  12333. }
  12334. // Fields allows partial responses to be retrieved. See
  12335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12336. // for more information.
  12337. func (c *ManagementProfilesListCall) Fields(s ...googleapi.Field) *ManagementProfilesListCall {
  12338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12339. return c
  12340. }
  12341. // IfNoneMatch sets the optional parameter which makes the operation
  12342. // fail if the object's ETag matches the given value. This is useful for
  12343. // getting updates only after the object has changed since the last
  12344. // request. Use googleapi.IsNotModified to check whether the response
  12345. // error from Do is the result of In-None-Match.
  12346. func (c *ManagementProfilesListCall) IfNoneMatch(entityTag string) *ManagementProfilesListCall {
  12347. c.ifNoneMatch_ = entityTag
  12348. return c
  12349. }
  12350. // Context sets the context to be used in this call's Do method. Any
  12351. // pending HTTP request will be aborted if the provided context is
  12352. // canceled.
  12353. func (c *ManagementProfilesListCall) Context(ctx context.Context) *ManagementProfilesListCall {
  12354. c.ctx_ = ctx
  12355. return c
  12356. }
  12357. // Header returns an http.Header that can be modified by the caller to
  12358. // add HTTP headers to the request.
  12359. func (c *ManagementProfilesListCall) Header() http.Header {
  12360. if c.header_ == nil {
  12361. c.header_ = make(http.Header)
  12362. }
  12363. return c.header_
  12364. }
  12365. func (c *ManagementProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12366. reqHeaders := make(http.Header)
  12367. for k, v := range c.header_ {
  12368. reqHeaders[k] = v
  12369. }
  12370. reqHeaders.Set("User-Agent", c.s.userAgent())
  12371. if c.ifNoneMatch_ != "" {
  12372. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12373. }
  12374. var body io.Reader = nil
  12375. c.urlParams_.Set("alt", alt)
  12376. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles")
  12377. urls += "?" + c.urlParams_.Encode()
  12378. req, _ := http.NewRequest("GET", urls, body)
  12379. req.Header = reqHeaders
  12380. googleapi.Expand(req.URL, map[string]string{
  12381. "accountId": c.accountId,
  12382. "webPropertyId": c.webPropertyId,
  12383. })
  12384. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12385. }
  12386. // Do executes the "analytics.management.profiles.list" call.
  12387. // Exactly one of *Profiles or error will be non-nil. Any non-2xx status
  12388. // code is an error. Response headers are in either
  12389. // *Profiles.ServerResponse.Header or (if a response was returned at
  12390. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12391. // to check whether the returned error was because
  12392. // http.StatusNotModified was returned.
  12393. func (c *ManagementProfilesListCall) Do(opts ...googleapi.CallOption) (*Profiles, error) {
  12394. gensupport.SetOptions(c.urlParams_, opts...)
  12395. res, err := c.doRequest("json")
  12396. if res != nil && res.StatusCode == http.StatusNotModified {
  12397. if res.Body != nil {
  12398. res.Body.Close()
  12399. }
  12400. return nil, &googleapi.Error{
  12401. Code: res.StatusCode,
  12402. Header: res.Header,
  12403. }
  12404. }
  12405. if err != nil {
  12406. return nil, err
  12407. }
  12408. defer googleapi.CloseBody(res)
  12409. if err := googleapi.CheckResponse(res); err != nil {
  12410. return nil, err
  12411. }
  12412. ret := &Profiles{
  12413. ServerResponse: googleapi.ServerResponse{
  12414. Header: res.Header,
  12415. HTTPStatusCode: res.StatusCode,
  12416. },
  12417. }
  12418. target := &ret
  12419. if err := gensupport.DecodeResponse(target, res); err != nil {
  12420. return nil, err
  12421. }
  12422. return ret, nil
  12423. // {
  12424. // "description": "Lists views (profiles) to which the user has access.",
  12425. // "httpMethod": "GET",
  12426. // "id": "analytics.management.profiles.list",
  12427. // "parameterOrder": [
  12428. // "accountId",
  12429. // "webPropertyId"
  12430. // ],
  12431. // "parameters": {
  12432. // "accountId": {
  12433. // "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.",
  12434. // "location": "path",
  12435. // "required": true,
  12436. // "type": "string"
  12437. // },
  12438. // "max-results": {
  12439. // "description": "The maximum number of views (profiles) to include in this response.",
  12440. // "format": "int32",
  12441. // "location": "query",
  12442. // "type": "integer"
  12443. // },
  12444. // "start-index": {
  12445. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  12446. // "format": "int32",
  12447. // "location": "query",
  12448. // "minimum": "1",
  12449. // "type": "integer"
  12450. // },
  12451. // "webPropertyId": {
  12452. // "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.",
  12453. // "location": "path",
  12454. // "required": true,
  12455. // "type": "string"
  12456. // }
  12457. // },
  12458. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
  12459. // "response": {
  12460. // "$ref": "Profiles"
  12461. // },
  12462. // "scopes": [
  12463. // "https://www.googleapis.com/auth/analytics",
  12464. // "https://www.googleapis.com/auth/analytics.edit",
  12465. // "https://www.googleapis.com/auth/analytics.readonly"
  12466. // ]
  12467. // }
  12468. }
  12469. // method id "analytics.management.profiles.patch":
  12470. type ManagementProfilesPatchCall struct {
  12471. s *Service
  12472. accountId string
  12473. webPropertyId string
  12474. profileId string
  12475. profile *Profile
  12476. urlParams_ gensupport.URLParams
  12477. ctx_ context.Context
  12478. header_ http.Header
  12479. }
  12480. // Patch: Updates an existing view (profile). This method supports patch
  12481. // semantics.
  12482. func (r *ManagementProfilesService) Patch(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesPatchCall {
  12483. c := &ManagementProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12484. c.accountId = accountId
  12485. c.webPropertyId = webPropertyId
  12486. c.profileId = profileId
  12487. c.profile = profile
  12488. return c
  12489. }
  12490. // Fields allows partial responses to be retrieved. See
  12491. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12492. // for more information.
  12493. func (c *ManagementProfilesPatchCall) Fields(s ...googleapi.Field) *ManagementProfilesPatchCall {
  12494. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12495. return c
  12496. }
  12497. // Context sets the context to be used in this call's Do method. Any
  12498. // pending HTTP request will be aborted if the provided context is
  12499. // canceled.
  12500. func (c *ManagementProfilesPatchCall) Context(ctx context.Context) *ManagementProfilesPatchCall {
  12501. c.ctx_ = ctx
  12502. return c
  12503. }
  12504. // Header returns an http.Header that can be modified by the caller to
  12505. // add HTTP headers to the request.
  12506. func (c *ManagementProfilesPatchCall) Header() http.Header {
  12507. if c.header_ == nil {
  12508. c.header_ = make(http.Header)
  12509. }
  12510. return c.header_
  12511. }
  12512. func (c *ManagementProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  12513. reqHeaders := make(http.Header)
  12514. for k, v := range c.header_ {
  12515. reqHeaders[k] = v
  12516. }
  12517. reqHeaders.Set("User-Agent", c.s.userAgent())
  12518. var body io.Reader = nil
  12519. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  12520. if err != nil {
  12521. return nil, err
  12522. }
  12523. reqHeaders.Set("Content-Type", "application/json")
  12524. c.urlParams_.Set("alt", alt)
  12525. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12526. urls += "?" + c.urlParams_.Encode()
  12527. req, _ := http.NewRequest("PATCH", urls, body)
  12528. req.Header = reqHeaders
  12529. googleapi.Expand(req.URL, map[string]string{
  12530. "accountId": c.accountId,
  12531. "webPropertyId": c.webPropertyId,
  12532. "profileId": c.profileId,
  12533. })
  12534. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12535. }
  12536. // Do executes the "analytics.management.profiles.patch" call.
  12537. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12538. // code is an error. Response headers are in either
  12539. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12540. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12541. // check whether the returned error was because http.StatusNotModified
  12542. // was returned.
  12543. func (c *ManagementProfilesPatchCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12544. gensupport.SetOptions(c.urlParams_, opts...)
  12545. res, err := c.doRequest("json")
  12546. if res != nil && res.StatusCode == http.StatusNotModified {
  12547. if res.Body != nil {
  12548. res.Body.Close()
  12549. }
  12550. return nil, &googleapi.Error{
  12551. Code: res.StatusCode,
  12552. Header: res.Header,
  12553. }
  12554. }
  12555. if err != nil {
  12556. return nil, err
  12557. }
  12558. defer googleapi.CloseBody(res)
  12559. if err := googleapi.CheckResponse(res); err != nil {
  12560. return nil, err
  12561. }
  12562. ret := &Profile{
  12563. ServerResponse: googleapi.ServerResponse{
  12564. Header: res.Header,
  12565. HTTPStatusCode: res.StatusCode,
  12566. },
  12567. }
  12568. target := &ret
  12569. if err := gensupport.DecodeResponse(target, res); err != nil {
  12570. return nil, err
  12571. }
  12572. return ret, nil
  12573. // {
  12574. // "description": "Updates an existing view (profile). This method supports patch semantics.",
  12575. // "httpMethod": "PATCH",
  12576. // "id": "analytics.management.profiles.patch",
  12577. // "parameterOrder": [
  12578. // "accountId",
  12579. // "webPropertyId",
  12580. // "profileId"
  12581. // ],
  12582. // "parameters": {
  12583. // "accountId": {
  12584. // "description": "Account ID to which the view (profile) belongs",
  12585. // "location": "path",
  12586. // "required": true,
  12587. // "type": "string"
  12588. // },
  12589. // "profileId": {
  12590. // "description": "ID of the view (profile) to be updated.",
  12591. // "location": "path",
  12592. // "required": true,
  12593. // "type": "string"
  12594. // },
  12595. // "webPropertyId": {
  12596. // "description": "Web property ID to which the view (profile) belongs",
  12597. // "location": "path",
  12598. // "required": true,
  12599. // "type": "string"
  12600. // }
  12601. // },
  12602. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12603. // "request": {
  12604. // "$ref": "Profile"
  12605. // },
  12606. // "response": {
  12607. // "$ref": "Profile"
  12608. // },
  12609. // "scopes": [
  12610. // "https://www.googleapis.com/auth/analytics.edit"
  12611. // ]
  12612. // }
  12613. }
  12614. // method id "analytics.management.profiles.update":
  12615. type ManagementProfilesUpdateCall struct {
  12616. s *Service
  12617. accountId string
  12618. webPropertyId string
  12619. profileId string
  12620. profile *Profile
  12621. urlParams_ gensupport.URLParams
  12622. ctx_ context.Context
  12623. header_ http.Header
  12624. }
  12625. // Update: Updates an existing view (profile).
  12626. func (r *ManagementProfilesService) Update(accountId string, webPropertyId string, profileId string, profile *Profile) *ManagementProfilesUpdateCall {
  12627. c := &ManagementProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12628. c.accountId = accountId
  12629. c.webPropertyId = webPropertyId
  12630. c.profileId = profileId
  12631. c.profile = profile
  12632. return c
  12633. }
  12634. // Fields allows partial responses to be retrieved. See
  12635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12636. // for more information.
  12637. func (c *ManagementProfilesUpdateCall) Fields(s ...googleapi.Field) *ManagementProfilesUpdateCall {
  12638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12639. return c
  12640. }
  12641. // Context sets the context to be used in this call's Do method. Any
  12642. // pending HTTP request will be aborted if the provided context is
  12643. // canceled.
  12644. func (c *ManagementProfilesUpdateCall) Context(ctx context.Context) *ManagementProfilesUpdateCall {
  12645. c.ctx_ = ctx
  12646. return c
  12647. }
  12648. // Header returns an http.Header that can be modified by the caller to
  12649. // add HTTP headers to the request.
  12650. func (c *ManagementProfilesUpdateCall) Header() http.Header {
  12651. if c.header_ == nil {
  12652. c.header_ = make(http.Header)
  12653. }
  12654. return c.header_
  12655. }
  12656. func (c *ManagementProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12657. reqHeaders := make(http.Header)
  12658. for k, v := range c.header_ {
  12659. reqHeaders[k] = v
  12660. }
  12661. reqHeaders.Set("User-Agent", c.s.userAgent())
  12662. var body io.Reader = nil
  12663. body, err := googleapi.WithoutDataWrapper.JSONReader(c.profile)
  12664. if err != nil {
  12665. return nil, err
  12666. }
  12667. reqHeaders.Set("Content-Type", "application/json")
  12668. c.urlParams_.Set("alt", alt)
  12669. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}")
  12670. urls += "?" + c.urlParams_.Encode()
  12671. req, _ := http.NewRequest("PUT", urls, body)
  12672. req.Header = reqHeaders
  12673. googleapi.Expand(req.URL, map[string]string{
  12674. "accountId": c.accountId,
  12675. "webPropertyId": c.webPropertyId,
  12676. "profileId": c.profileId,
  12677. })
  12678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12679. }
  12680. // Do executes the "analytics.management.profiles.update" call.
  12681. // Exactly one of *Profile or error will be non-nil. Any non-2xx status
  12682. // code is an error. Response headers are in either
  12683. // *Profile.ServerResponse.Header or (if a response was returned at all)
  12684. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12685. // check whether the returned error was because http.StatusNotModified
  12686. // was returned.
  12687. func (c *ManagementProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
  12688. gensupport.SetOptions(c.urlParams_, opts...)
  12689. res, err := c.doRequest("json")
  12690. if res != nil && res.StatusCode == http.StatusNotModified {
  12691. if res.Body != nil {
  12692. res.Body.Close()
  12693. }
  12694. return nil, &googleapi.Error{
  12695. Code: res.StatusCode,
  12696. Header: res.Header,
  12697. }
  12698. }
  12699. if err != nil {
  12700. return nil, err
  12701. }
  12702. defer googleapi.CloseBody(res)
  12703. if err := googleapi.CheckResponse(res); err != nil {
  12704. return nil, err
  12705. }
  12706. ret := &Profile{
  12707. ServerResponse: googleapi.ServerResponse{
  12708. Header: res.Header,
  12709. HTTPStatusCode: res.StatusCode,
  12710. },
  12711. }
  12712. target := &ret
  12713. if err := gensupport.DecodeResponse(target, res); err != nil {
  12714. return nil, err
  12715. }
  12716. return ret, nil
  12717. // {
  12718. // "description": "Updates an existing view (profile).",
  12719. // "httpMethod": "PUT",
  12720. // "id": "analytics.management.profiles.update",
  12721. // "parameterOrder": [
  12722. // "accountId",
  12723. // "webPropertyId",
  12724. // "profileId"
  12725. // ],
  12726. // "parameters": {
  12727. // "accountId": {
  12728. // "description": "Account ID to which the view (profile) belongs",
  12729. // "location": "path",
  12730. // "required": true,
  12731. // "type": "string"
  12732. // },
  12733. // "profileId": {
  12734. // "description": "ID of the view (profile) to be updated.",
  12735. // "location": "path",
  12736. // "required": true,
  12737. // "type": "string"
  12738. // },
  12739. // "webPropertyId": {
  12740. // "description": "Web property ID to which the view (profile) belongs",
  12741. // "location": "path",
  12742. // "required": true,
  12743. // "type": "string"
  12744. // }
  12745. // },
  12746. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}",
  12747. // "request": {
  12748. // "$ref": "Profile"
  12749. // },
  12750. // "response": {
  12751. // "$ref": "Profile"
  12752. // },
  12753. // "scopes": [
  12754. // "https://www.googleapis.com/auth/analytics.edit"
  12755. // ]
  12756. // }
  12757. }
  12758. // method id "analytics.management.remarketingAudience.delete":
  12759. type ManagementRemarketingAudienceDeleteCall struct {
  12760. s *Service
  12761. accountId string
  12762. webPropertyId string
  12763. remarketingAudienceId string
  12764. urlParams_ gensupport.URLParams
  12765. ctx_ context.Context
  12766. header_ http.Header
  12767. }
  12768. // Delete: Delete a remarketing audience.
  12769. func (r *ManagementRemarketingAudienceService) Delete(accountId string, webPropertyId string, remarketingAudienceId string) *ManagementRemarketingAudienceDeleteCall {
  12770. c := &ManagementRemarketingAudienceDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12771. c.accountId = accountId
  12772. c.webPropertyId = webPropertyId
  12773. c.remarketingAudienceId = remarketingAudienceId
  12774. return c
  12775. }
  12776. // Fields allows partial responses to be retrieved. See
  12777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12778. // for more information.
  12779. func (c *ManagementRemarketingAudienceDeleteCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceDeleteCall {
  12780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12781. return c
  12782. }
  12783. // Context sets the context to be used in this call's Do method. Any
  12784. // pending HTTP request will be aborted if the provided context is
  12785. // canceled.
  12786. func (c *ManagementRemarketingAudienceDeleteCall) Context(ctx context.Context) *ManagementRemarketingAudienceDeleteCall {
  12787. c.ctx_ = ctx
  12788. return c
  12789. }
  12790. // Header returns an http.Header that can be modified by the caller to
  12791. // add HTTP headers to the request.
  12792. func (c *ManagementRemarketingAudienceDeleteCall) Header() http.Header {
  12793. if c.header_ == nil {
  12794. c.header_ = make(http.Header)
  12795. }
  12796. return c.header_
  12797. }
  12798. func (c *ManagementRemarketingAudienceDeleteCall) doRequest(alt string) (*http.Response, error) {
  12799. reqHeaders := make(http.Header)
  12800. for k, v := range c.header_ {
  12801. reqHeaders[k] = v
  12802. }
  12803. reqHeaders.Set("User-Agent", c.s.userAgent())
  12804. var body io.Reader = nil
  12805. c.urlParams_.Set("alt", alt)
  12806. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  12807. urls += "?" + c.urlParams_.Encode()
  12808. req, _ := http.NewRequest("DELETE", urls, body)
  12809. req.Header = reqHeaders
  12810. googleapi.Expand(req.URL, map[string]string{
  12811. "accountId": c.accountId,
  12812. "webPropertyId": c.webPropertyId,
  12813. "remarketingAudienceId": c.remarketingAudienceId,
  12814. })
  12815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12816. }
  12817. // Do executes the "analytics.management.remarketingAudience.delete" call.
  12818. func (c *ManagementRemarketingAudienceDeleteCall) Do(opts ...googleapi.CallOption) error {
  12819. gensupport.SetOptions(c.urlParams_, opts...)
  12820. res, err := c.doRequest("json")
  12821. if err != nil {
  12822. return err
  12823. }
  12824. defer googleapi.CloseBody(res)
  12825. if err := googleapi.CheckResponse(res); err != nil {
  12826. return err
  12827. }
  12828. return nil
  12829. // {
  12830. // "description": "Delete a remarketing audience.",
  12831. // "httpMethod": "DELETE",
  12832. // "id": "analytics.management.remarketingAudience.delete",
  12833. // "parameterOrder": [
  12834. // "accountId",
  12835. // "webPropertyId",
  12836. // "remarketingAudienceId"
  12837. // ],
  12838. // "parameters": {
  12839. // "accountId": {
  12840. // "description": "Account ID to which the remarketing audience belongs.",
  12841. // "location": "path",
  12842. // "required": true,
  12843. // "type": "string"
  12844. // },
  12845. // "remarketingAudienceId": {
  12846. // "description": "The ID of the remarketing audience to delete.",
  12847. // "location": "path",
  12848. // "required": true,
  12849. // "type": "string"
  12850. // },
  12851. // "webPropertyId": {
  12852. // "description": "Web property ID to which the remarketing audience belongs.",
  12853. // "location": "path",
  12854. // "required": true,
  12855. // "type": "string"
  12856. // }
  12857. // },
  12858. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  12859. // "scopes": [
  12860. // "https://www.googleapis.com/auth/analytics.edit"
  12861. // ]
  12862. // }
  12863. }
  12864. // method id "analytics.management.remarketingAudience.get":
  12865. type ManagementRemarketingAudienceGetCall struct {
  12866. s *Service
  12867. accountId string
  12868. webPropertyId string
  12869. remarketingAudienceId string
  12870. urlParams_ gensupport.URLParams
  12871. ifNoneMatch_ string
  12872. ctx_ context.Context
  12873. header_ http.Header
  12874. }
  12875. // Get: Gets a remarketing audience to which the user has access.
  12876. func (r *ManagementRemarketingAudienceService) Get(accountId string, webPropertyId string, remarketingAudienceId string) *ManagementRemarketingAudienceGetCall {
  12877. c := &ManagementRemarketingAudienceGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12878. c.accountId = accountId
  12879. c.webPropertyId = webPropertyId
  12880. c.remarketingAudienceId = remarketingAudienceId
  12881. return c
  12882. }
  12883. // Fields allows partial responses to be retrieved. See
  12884. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12885. // for more information.
  12886. func (c *ManagementRemarketingAudienceGetCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceGetCall {
  12887. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12888. return c
  12889. }
  12890. // IfNoneMatch sets the optional parameter which makes the operation
  12891. // fail if the object's ETag matches the given value. This is useful for
  12892. // getting updates only after the object has changed since the last
  12893. // request. Use googleapi.IsNotModified to check whether the response
  12894. // error from Do is the result of In-None-Match.
  12895. func (c *ManagementRemarketingAudienceGetCall) IfNoneMatch(entityTag string) *ManagementRemarketingAudienceGetCall {
  12896. c.ifNoneMatch_ = entityTag
  12897. return c
  12898. }
  12899. // Context sets the context to be used in this call's Do method. Any
  12900. // pending HTTP request will be aborted if the provided context is
  12901. // canceled.
  12902. func (c *ManagementRemarketingAudienceGetCall) Context(ctx context.Context) *ManagementRemarketingAudienceGetCall {
  12903. c.ctx_ = ctx
  12904. return c
  12905. }
  12906. // Header returns an http.Header that can be modified by the caller to
  12907. // add HTTP headers to the request.
  12908. func (c *ManagementRemarketingAudienceGetCall) Header() http.Header {
  12909. if c.header_ == nil {
  12910. c.header_ = make(http.Header)
  12911. }
  12912. return c.header_
  12913. }
  12914. func (c *ManagementRemarketingAudienceGetCall) doRequest(alt string) (*http.Response, error) {
  12915. reqHeaders := make(http.Header)
  12916. for k, v := range c.header_ {
  12917. reqHeaders[k] = v
  12918. }
  12919. reqHeaders.Set("User-Agent", c.s.userAgent())
  12920. if c.ifNoneMatch_ != "" {
  12921. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12922. }
  12923. var body io.Reader = nil
  12924. c.urlParams_.Set("alt", alt)
  12925. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  12926. urls += "?" + c.urlParams_.Encode()
  12927. req, _ := http.NewRequest("GET", urls, body)
  12928. req.Header = reqHeaders
  12929. googleapi.Expand(req.URL, map[string]string{
  12930. "accountId": c.accountId,
  12931. "webPropertyId": c.webPropertyId,
  12932. "remarketingAudienceId": c.remarketingAudienceId,
  12933. })
  12934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12935. }
  12936. // Do executes the "analytics.management.remarketingAudience.get" call.
  12937. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  12938. // non-2xx status code is an error. Response headers are in either
  12939. // *RemarketingAudience.ServerResponse.Header or (if a response was
  12940. // returned at all) in error.(*googleapi.Error).Header. Use
  12941. // googleapi.IsNotModified to check whether the returned error was
  12942. // because http.StatusNotModified was returned.
  12943. func (c *ManagementRemarketingAudienceGetCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  12944. gensupport.SetOptions(c.urlParams_, opts...)
  12945. res, err := c.doRequest("json")
  12946. if res != nil && res.StatusCode == http.StatusNotModified {
  12947. if res.Body != nil {
  12948. res.Body.Close()
  12949. }
  12950. return nil, &googleapi.Error{
  12951. Code: res.StatusCode,
  12952. Header: res.Header,
  12953. }
  12954. }
  12955. if err != nil {
  12956. return nil, err
  12957. }
  12958. defer googleapi.CloseBody(res)
  12959. if err := googleapi.CheckResponse(res); err != nil {
  12960. return nil, err
  12961. }
  12962. ret := &RemarketingAudience{
  12963. ServerResponse: googleapi.ServerResponse{
  12964. Header: res.Header,
  12965. HTTPStatusCode: res.StatusCode,
  12966. },
  12967. }
  12968. target := &ret
  12969. if err := gensupport.DecodeResponse(target, res); err != nil {
  12970. return nil, err
  12971. }
  12972. return ret, nil
  12973. // {
  12974. // "description": "Gets a remarketing audience to which the user has access.",
  12975. // "httpMethod": "GET",
  12976. // "id": "analytics.management.remarketingAudience.get",
  12977. // "parameterOrder": [
  12978. // "accountId",
  12979. // "webPropertyId",
  12980. // "remarketingAudienceId"
  12981. // ],
  12982. // "parameters": {
  12983. // "accountId": {
  12984. // "description": "The account ID of the remarketing audience to retrieve.",
  12985. // "location": "path",
  12986. // "required": true,
  12987. // "type": "string"
  12988. // },
  12989. // "remarketingAudienceId": {
  12990. // "description": "The ID of the remarketing audience to retrieve.",
  12991. // "location": "path",
  12992. // "required": true,
  12993. // "type": "string"
  12994. // },
  12995. // "webPropertyId": {
  12996. // "description": "The web property ID of the remarketing audience to retrieve.",
  12997. // "location": "path",
  12998. // "required": true,
  12999. // "type": "string"
  13000. // }
  13001. // },
  13002. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13003. // "response": {
  13004. // "$ref": "RemarketingAudience"
  13005. // },
  13006. // "scopes": [
  13007. // "https://www.googleapis.com/auth/analytics.edit",
  13008. // "https://www.googleapis.com/auth/analytics.readonly"
  13009. // ]
  13010. // }
  13011. }
  13012. // method id "analytics.management.remarketingAudience.insert":
  13013. type ManagementRemarketingAudienceInsertCall struct {
  13014. s *Service
  13015. accountId string
  13016. webPropertyId string
  13017. remarketingaudience *RemarketingAudience
  13018. urlParams_ gensupport.URLParams
  13019. ctx_ context.Context
  13020. header_ http.Header
  13021. }
  13022. // Insert: Creates a new remarketing audience.
  13023. func (r *ManagementRemarketingAudienceService) Insert(accountId string, webPropertyId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudienceInsertCall {
  13024. c := &ManagementRemarketingAudienceInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13025. c.accountId = accountId
  13026. c.webPropertyId = webPropertyId
  13027. c.remarketingaudience = remarketingaudience
  13028. return c
  13029. }
  13030. // Fields allows partial responses to be retrieved. See
  13031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13032. // for more information.
  13033. func (c *ManagementRemarketingAudienceInsertCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceInsertCall {
  13034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13035. return c
  13036. }
  13037. // Context sets the context to be used in this call's Do method. Any
  13038. // pending HTTP request will be aborted if the provided context is
  13039. // canceled.
  13040. func (c *ManagementRemarketingAudienceInsertCall) Context(ctx context.Context) *ManagementRemarketingAudienceInsertCall {
  13041. c.ctx_ = ctx
  13042. return c
  13043. }
  13044. // Header returns an http.Header that can be modified by the caller to
  13045. // add HTTP headers to the request.
  13046. func (c *ManagementRemarketingAudienceInsertCall) Header() http.Header {
  13047. if c.header_ == nil {
  13048. c.header_ = make(http.Header)
  13049. }
  13050. return c.header_
  13051. }
  13052. func (c *ManagementRemarketingAudienceInsertCall) doRequest(alt string) (*http.Response, error) {
  13053. reqHeaders := make(http.Header)
  13054. for k, v := range c.header_ {
  13055. reqHeaders[k] = v
  13056. }
  13057. reqHeaders.Set("User-Agent", c.s.userAgent())
  13058. var body io.Reader = nil
  13059. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13060. if err != nil {
  13061. return nil, err
  13062. }
  13063. reqHeaders.Set("Content-Type", "application/json")
  13064. c.urlParams_.Set("alt", alt)
  13065. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences")
  13066. urls += "?" + c.urlParams_.Encode()
  13067. req, _ := http.NewRequest("POST", urls, body)
  13068. req.Header = reqHeaders
  13069. googleapi.Expand(req.URL, map[string]string{
  13070. "accountId": c.accountId,
  13071. "webPropertyId": c.webPropertyId,
  13072. })
  13073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13074. }
  13075. // Do executes the "analytics.management.remarketingAudience.insert" call.
  13076. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13077. // non-2xx status code is an error. Response headers are in either
  13078. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13079. // returned at all) in error.(*googleapi.Error).Header. Use
  13080. // googleapi.IsNotModified to check whether the returned error was
  13081. // because http.StatusNotModified was returned.
  13082. func (c *ManagementRemarketingAudienceInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13083. gensupport.SetOptions(c.urlParams_, opts...)
  13084. res, err := c.doRequest("json")
  13085. if res != nil && res.StatusCode == http.StatusNotModified {
  13086. if res.Body != nil {
  13087. res.Body.Close()
  13088. }
  13089. return nil, &googleapi.Error{
  13090. Code: res.StatusCode,
  13091. Header: res.Header,
  13092. }
  13093. }
  13094. if err != nil {
  13095. return nil, err
  13096. }
  13097. defer googleapi.CloseBody(res)
  13098. if err := googleapi.CheckResponse(res); err != nil {
  13099. return nil, err
  13100. }
  13101. ret := &RemarketingAudience{
  13102. ServerResponse: googleapi.ServerResponse{
  13103. Header: res.Header,
  13104. HTTPStatusCode: res.StatusCode,
  13105. },
  13106. }
  13107. target := &ret
  13108. if err := gensupport.DecodeResponse(target, res); err != nil {
  13109. return nil, err
  13110. }
  13111. return ret, nil
  13112. // {
  13113. // "description": "Creates a new remarketing audience.",
  13114. // "httpMethod": "POST",
  13115. // "id": "analytics.management.remarketingAudience.insert",
  13116. // "parameterOrder": [
  13117. // "accountId",
  13118. // "webPropertyId"
  13119. // ],
  13120. // "parameters": {
  13121. // "accountId": {
  13122. // "description": "The account ID for which to create the remarketing audience.",
  13123. // "location": "path",
  13124. // "required": true,
  13125. // "type": "string"
  13126. // },
  13127. // "webPropertyId": {
  13128. // "description": "Web property ID for which to create the remarketing audience.",
  13129. // "location": "path",
  13130. // "required": true,
  13131. // "type": "string"
  13132. // }
  13133. // },
  13134. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences",
  13135. // "request": {
  13136. // "$ref": "RemarketingAudience"
  13137. // },
  13138. // "response": {
  13139. // "$ref": "RemarketingAudience"
  13140. // },
  13141. // "scopes": [
  13142. // "https://www.googleapis.com/auth/analytics.edit"
  13143. // ]
  13144. // }
  13145. }
  13146. // method id "analytics.management.remarketingAudience.list":
  13147. type ManagementRemarketingAudienceListCall struct {
  13148. s *Service
  13149. accountId string
  13150. webPropertyId string
  13151. urlParams_ gensupport.URLParams
  13152. ifNoneMatch_ string
  13153. ctx_ context.Context
  13154. header_ http.Header
  13155. }
  13156. // List: Lists remarketing audiences to which the user has access.
  13157. func (r *ManagementRemarketingAudienceService) List(accountId string, webPropertyId string) *ManagementRemarketingAudienceListCall {
  13158. c := &ManagementRemarketingAudienceListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13159. c.accountId = accountId
  13160. c.webPropertyId = webPropertyId
  13161. return c
  13162. }
  13163. // MaxResults sets the optional parameter "max-results": The maximum
  13164. // number of remarketing audiences to include in this response.
  13165. func (c *ManagementRemarketingAudienceListCall) MaxResults(maxResults int64) *ManagementRemarketingAudienceListCall {
  13166. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  13167. return c
  13168. }
  13169. // StartIndex sets the optional parameter "start-index": An index of the
  13170. // first entity to retrieve. Use this parameter as a pagination
  13171. // mechanism along with the max-results parameter.
  13172. func (c *ManagementRemarketingAudienceListCall) StartIndex(startIndex int64) *ManagementRemarketingAudienceListCall {
  13173. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  13174. return c
  13175. }
  13176. // Type sets the optional parameter "type":
  13177. func (c *ManagementRemarketingAudienceListCall) Type(type_ string) *ManagementRemarketingAudienceListCall {
  13178. c.urlParams_.Set("type", type_)
  13179. return c
  13180. }
  13181. // Fields allows partial responses to be retrieved. See
  13182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13183. // for more information.
  13184. func (c *ManagementRemarketingAudienceListCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceListCall {
  13185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13186. return c
  13187. }
  13188. // IfNoneMatch sets the optional parameter which makes the operation
  13189. // fail if the object's ETag matches the given value. This is useful for
  13190. // getting updates only after the object has changed since the last
  13191. // request. Use googleapi.IsNotModified to check whether the response
  13192. // error from Do is the result of In-None-Match.
  13193. func (c *ManagementRemarketingAudienceListCall) IfNoneMatch(entityTag string) *ManagementRemarketingAudienceListCall {
  13194. c.ifNoneMatch_ = entityTag
  13195. return c
  13196. }
  13197. // Context sets the context to be used in this call's Do method. Any
  13198. // pending HTTP request will be aborted if the provided context is
  13199. // canceled.
  13200. func (c *ManagementRemarketingAudienceListCall) Context(ctx context.Context) *ManagementRemarketingAudienceListCall {
  13201. c.ctx_ = ctx
  13202. return c
  13203. }
  13204. // Header returns an http.Header that can be modified by the caller to
  13205. // add HTTP headers to the request.
  13206. func (c *ManagementRemarketingAudienceListCall) Header() http.Header {
  13207. if c.header_ == nil {
  13208. c.header_ = make(http.Header)
  13209. }
  13210. return c.header_
  13211. }
  13212. func (c *ManagementRemarketingAudienceListCall) doRequest(alt string) (*http.Response, error) {
  13213. reqHeaders := make(http.Header)
  13214. for k, v := range c.header_ {
  13215. reqHeaders[k] = v
  13216. }
  13217. reqHeaders.Set("User-Agent", c.s.userAgent())
  13218. if c.ifNoneMatch_ != "" {
  13219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13220. }
  13221. var body io.Reader = nil
  13222. c.urlParams_.Set("alt", alt)
  13223. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences")
  13224. urls += "?" + c.urlParams_.Encode()
  13225. req, _ := http.NewRequest("GET", urls, body)
  13226. req.Header = reqHeaders
  13227. googleapi.Expand(req.URL, map[string]string{
  13228. "accountId": c.accountId,
  13229. "webPropertyId": c.webPropertyId,
  13230. })
  13231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13232. }
  13233. // Do executes the "analytics.management.remarketingAudience.list" call.
  13234. // Exactly one of *RemarketingAudiences or error will be non-nil. Any
  13235. // non-2xx status code is an error. Response headers are in either
  13236. // *RemarketingAudiences.ServerResponse.Header or (if a response was
  13237. // returned at all) in error.(*googleapi.Error).Header. Use
  13238. // googleapi.IsNotModified to check whether the returned error was
  13239. // because http.StatusNotModified was returned.
  13240. func (c *ManagementRemarketingAudienceListCall) Do(opts ...googleapi.CallOption) (*RemarketingAudiences, error) {
  13241. gensupport.SetOptions(c.urlParams_, opts...)
  13242. res, err := c.doRequest("json")
  13243. if res != nil && res.StatusCode == http.StatusNotModified {
  13244. if res.Body != nil {
  13245. res.Body.Close()
  13246. }
  13247. return nil, &googleapi.Error{
  13248. Code: res.StatusCode,
  13249. Header: res.Header,
  13250. }
  13251. }
  13252. if err != nil {
  13253. return nil, err
  13254. }
  13255. defer googleapi.CloseBody(res)
  13256. if err := googleapi.CheckResponse(res); err != nil {
  13257. return nil, err
  13258. }
  13259. ret := &RemarketingAudiences{
  13260. ServerResponse: googleapi.ServerResponse{
  13261. Header: res.Header,
  13262. HTTPStatusCode: res.StatusCode,
  13263. },
  13264. }
  13265. target := &ret
  13266. if err := gensupport.DecodeResponse(target, res); err != nil {
  13267. return nil, err
  13268. }
  13269. return ret, nil
  13270. // {
  13271. // "description": "Lists remarketing audiences to which the user has access.",
  13272. // "httpMethod": "GET",
  13273. // "id": "analytics.management.remarketingAudience.list",
  13274. // "parameterOrder": [
  13275. // "accountId",
  13276. // "webPropertyId"
  13277. // ],
  13278. // "parameters": {
  13279. // "accountId": {
  13280. // "description": "The account ID of the remarketing audiences to retrieve.",
  13281. // "location": "path",
  13282. // "required": true,
  13283. // "type": "string"
  13284. // },
  13285. // "max-results": {
  13286. // "description": "The maximum number of remarketing audiences to include in this response.",
  13287. // "format": "int32",
  13288. // "location": "query",
  13289. // "type": "integer"
  13290. // },
  13291. // "start-index": {
  13292. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  13293. // "format": "int32",
  13294. // "location": "query",
  13295. // "minimum": "1",
  13296. // "type": "integer"
  13297. // },
  13298. // "type": {
  13299. // "default": "all",
  13300. // "location": "query",
  13301. // "type": "string"
  13302. // },
  13303. // "webPropertyId": {
  13304. // "description": "The web property ID of the remarketing audiences to retrieve.",
  13305. // "location": "path",
  13306. // "required": true,
  13307. // "type": "string"
  13308. // }
  13309. // },
  13310. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences",
  13311. // "response": {
  13312. // "$ref": "RemarketingAudiences"
  13313. // },
  13314. // "scopes": [
  13315. // "https://www.googleapis.com/auth/analytics.edit",
  13316. // "https://www.googleapis.com/auth/analytics.readonly"
  13317. // ]
  13318. // }
  13319. }
  13320. // method id "analytics.management.remarketingAudience.patch":
  13321. type ManagementRemarketingAudiencePatchCall struct {
  13322. s *Service
  13323. accountId string
  13324. webPropertyId string
  13325. remarketingAudienceId string
  13326. remarketingaudience *RemarketingAudience
  13327. urlParams_ gensupport.URLParams
  13328. ctx_ context.Context
  13329. header_ http.Header
  13330. }
  13331. // Patch: Updates an existing remarketing audience. This method supports
  13332. // patch semantics.
  13333. func (r *ManagementRemarketingAudienceService) Patch(accountId string, webPropertyId string, remarketingAudienceId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudiencePatchCall {
  13334. c := &ManagementRemarketingAudiencePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13335. c.accountId = accountId
  13336. c.webPropertyId = webPropertyId
  13337. c.remarketingAudienceId = remarketingAudienceId
  13338. c.remarketingaudience = remarketingaudience
  13339. return c
  13340. }
  13341. // Fields allows partial responses to be retrieved. See
  13342. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13343. // for more information.
  13344. func (c *ManagementRemarketingAudiencePatchCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudiencePatchCall {
  13345. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13346. return c
  13347. }
  13348. // Context sets the context to be used in this call's Do method. Any
  13349. // pending HTTP request will be aborted if the provided context is
  13350. // canceled.
  13351. func (c *ManagementRemarketingAudiencePatchCall) Context(ctx context.Context) *ManagementRemarketingAudiencePatchCall {
  13352. c.ctx_ = ctx
  13353. return c
  13354. }
  13355. // Header returns an http.Header that can be modified by the caller to
  13356. // add HTTP headers to the request.
  13357. func (c *ManagementRemarketingAudiencePatchCall) Header() http.Header {
  13358. if c.header_ == nil {
  13359. c.header_ = make(http.Header)
  13360. }
  13361. return c.header_
  13362. }
  13363. func (c *ManagementRemarketingAudiencePatchCall) doRequest(alt string) (*http.Response, error) {
  13364. reqHeaders := make(http.Header)
  13365. for k, v := range c.header_ {
  13366. reqHeaders[k] = v
  13367. }
  13368. reqHeaders.Set("User-Agent", c.s.userAgent())
  13369. var body io.Reader = nil
  13370. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13371. if err != nil {
  13372. return nil, err
  13373. }
  13374. reqHeaders.Set("Content-Type", "application/json")
  13375. c.urlParams_.Set("alt", alt)
  13376. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13377. urls += "?" + c.urlParams_.Encode()
  13378. req, _ := http.NewRequest("PATCH", urls, body)
  13379. req.Header = reqHeaders
  13380. googleapi.Expand(req.URL, map[string]string{
  13381. "accountId": c.accountId,
  13382. "webPropertyId": c.webPropertyId,
  13383. "remarketingAudienceId": c.remarketingAudienceId,
  13384. })
  13385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13386. }
  13387. // Do executes the "analytics.management.remarketingAudience.patch" call.
  13388. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13389. // non-2xx status code is an error. Response headers are in either
  13390. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13391. // returned at all) in error.(*googleapi.Error).Header. Use
  13392. // googleapi.IsNotModified to check whether the returned error was
  13393. // because http.StatusNotModified was returned.
  13394. func (c *ManagementRemarketingAudiencePatchCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13395. gensupport.SetOptions(c.urlParams_, opts...)
  13396. res, err := c.doRequest("json")
  13397. if res != nil && res.StatusCode == http.StatusNotModified {
  13398. if res.Body != nil {
  13399. res.Body.Close()
  13400. }
  13401. return nil, &googleapi.Error{
  13402. Code: res.StatusCode,
  13403. Header: res.Header,
  13404. }
  13405. }
  13406. if err != nil {
  13407. return nil, err
  13408. }
  13409. defer googleapi.CloseBody(res)
  13410. if err := googleapi.CheckResponse(res); err != nil {
  13411. return nil, err
  13412. }
  13413. ret := &RemarketingAudience{
  13414. ServerResponse: googleapi.ServerResponse{
  13415. Header: res.Header,
  13416. HTTPStatusCode: res.StatusCode,
  13417. },
  13418. }
  13419. target := &ret
  13420. if err := gensupport.DecodeResponse(target, res); err != nil {
  13421. return nil, err
  13422. }
  13423. return ret, nil
  13424. // {
  13425. // "description": "Updates an existing remarketing audience. This method supports patch semantics.",
  13426. // "httpMethod": "PATCH",
  13427. // "id": "analytics.management.remarketingAudience.patch",
  13428. // "parameterOrder": [
  13429. // "accountId",
  13430. // "webPropertyId",
  13431. // "remarketingAudienceId"
  13432. // ],
  13433. // "parameters": {
  13434. // "accountId": {
  13435. // "description": "The account ID of the remarketing audience to update.",
  13436. // "location": "path",
  13437. // "required": true,
  13438. // "type": "string"
  13439. // },
  13440. // "remarketingAudienceId": {
  13441. // "description": "The ID of the remarketing audience to update.",
  13442. // "location": "path",
  13443. // "required": true,
  13444. // "type": "string"
  13445. // },
  13446. // "webPropertyId": {
  13447. // "description": "The web property ID of the remarketing audience to update.",
  13448. // "location": "path",
  13449. // "required": true,
  13450. // "type": "string"
  13451. // }
  13452. // },
  13453. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13454. // "request": {
  13455. // "$ref": "RemarketingAudience"
  13456. // },
  13457. // "response": {
  13458. // "$ref": "RemarketingAudience"
  13459. // },
  13460. // "scopes": [
  13461. // "https://www.googleapis.com/auth/analytics.edit"
  13462. // ]
  13463. // }
  13464. }
  13465. // method id "analytics.management.remarketingAudience.update":
  13466. type ManagementRemarketingAudienceUpdateCall struct {
  13467. s *Service
  13468. accountId string
  13469. webPropertyId string
  13470. remarketingAudienceId string
  13471. remarketingaudience *RemarketingAudience
  13472. urlParams_ gensupport.URLParams
  13473. ctx_ context.Context
  13474. header_ http.Header
  13475. }
  13476. // Update: Updates an existing remarketing audience.
  13477. func (r *ManagementRemarketingAudienceService) Update(accountId string, webPropertyId string, remarketingAudienceId string, remarketingaudience *RemarketingAudience) *ManagementRemarketingAudienceUpdateCall {
  13478. c := &ManagementRemarketingAudienceUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13479. c.accountId = accountId
  13480. c.webPropertyId = webPropertyId
  13481. c.remarketingAudienceId = remarketingAudienceId
  13482. c.remarketingaudience = remarketingaudience
  13483. return c
  13484. }
  13485. // Fields allows partial responses to be retrieved. See
  13486. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13487. // for more information.
  13488. func (c *ManagementRemarketingAudienceUpdateCall) Fields(s ...googleapi.Field) *ManagementRemarketingAudienceUpdateCall {
  13489. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13490. return c
  13491. }
  13492. // Context sets the context to be used in this call's Do method. Any
  13493. // pending HTTP request will be aborted if the provided context is
  13494. // canceled.
  13495. func (c *ManagementRemarketingAudienceUpdateCall) Context(ctx context.Context) *ManagementRemarketingAudienceUpdateCall {
  13496. c.ctx_ = ctx
  13497. return c
  13498. }
  13499. // Header returns an http.Header that can be modified by the caller to
  13500. // add HTTP headers to the request.
  13501. func (c *ManagementRemarketingAudienceUpdateCall) Header() http.Header {
  13502. if c.header_ == nil {
  13503. c.header_ = make(http.Header)
  13504. }
  13505. return c.header_
  13506. }
  13507. func (c *ManagementRemarketingAudienceUpdateCall) doRequest(alt string) (*http.Response, error) {
  13508. reqHeaders := make(http.Header)
  13509. for k, v := range c.header_ {
  13510. reqHeaders[k] = v
  13511. }
  13512. reqHeaders.Set("User-Agent", c.s.userAgent())
  13513. var body io.Reader = nil
  13514. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketingaudience)
  13515. if err != nil {
  13516. return nil, err
  13517. }
  13518. reqHeaders.Set("Content-Type", "application/json")
  13519. c.urlParams_.Set("alt", alt)
  13520. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}")
  13521. urls += "?" + c.urlParams_.Encode()
  13522. req, _ := http.NewRequest("PUT", urls, body)
  13523. req.Header = reqHeaders
  13524. googleapi.Expand(req.URL, map[string]string{
  13525. "accountId": c.accountId,
  13526. "webPropertyId": c.webPropertyId,
  13527. "remarketingAudienceId": c.remarketingAudienceId,
  13528. })
  13529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13530. }
  13531. // Do executes the "analytics.management.remarketingAudience.update" call.
  13532. // Exactly one of *RemarketingAudience or error will be non-nil. Any
  13533. // non-2xx status code is an error. Response headers are in either
  13534. // *RemarketingAudience.ServerResponse.Header or (if a response was
  13535. // returned at all) in error.(*googleapi.Error).Header. Use
  13536. // googleapi.IsNotModified to check whether the returned error was
  13537. // because http.StatusNotModified was returned.
  13538. func (c *ManagementRemarketingAudienceUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingAudience, error) {
  13539. gensupport.SetOptions(c.urlParams_, opts...)
  13540. res, err := c.doRequest("json")
  13541. if res != nil && res.StatusCode == http.StatusNotModified {
  13542. if res.Body != nil {
  13543. res.Body.Close()
  13544. }
  13545. return nil, &googleapi.Error{
  13546. Code: res.StatusCode,
  13547. Header: res.Header,
  13548. }
  13549. }
  13550. if err != nil {
  13551. return nil, err
  13552. }
  13553. defer googleapi.CloseBody(res)
  13554. if err := googleapi.CheckResponse(res); err != nil {
  13555. return nil, err
  13556. }
  13557. ret := &RemarketingAudience{
  13558. ServerResponse: googleapi.ServerResponse{
  13559. Header: res.Header,
  13560. HTTPStatusCode: res.StatusCode,
  13561. },
  13562. }
  13563. target := &ret
  13564. if err := gensupport.DecodeResponse(target, res); err != nil {
  13565. return nil, err
  13566. }
  13567. return ret, nil
  13568. // {
  13569. // "description": "Updates an existing remarketing audience.",
  13570. // "httpMethod": "PUT",
  13571. // "id": "analytics.management.remarketingAudience.update",
  13572. // "parameterOrder": [
  13573. // "accountId",
  13574. // "webPropertyId",
  13575. // "remarketingAudienceId"
  13576. // ],
  13577. // "parameters": {
  13578. // "accountId": {
  13579. // "description": "The account ID of the remarketing audience to update.",
  13580. // "location": "path",
  13581. // "required": true,
  13582. // "type": "string"
  13583. // },
  13584. // "remarketingAudienceId": {
  13585. // "description": "The ID of the remarketing audience to update.",
  13586. // "location": "path",
  13587. // "required": true,
  13588. // "type": "string"
  13589. // },
  13590. // "webPropertyId": {
  13591. // "description": "The web property ID of the remarketing audience to update.",
  13592. // "location": "path",
  13593. // "required": true,
  13594. // "type": "string"
  13595. // }
  13596. // },
  13597. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}",
  13598. // "request": {
  13599. // "$ref": "RemarketingAudience"
  13600. // },
  13601. // "response": {
  13602. // "$ref": "RemarketingAudience"
  13603. // },
  13604. // "scopes": [
  13605. // "https://www.googleapis.com/auth/analytics.edit"
  13606. // ]
  13607. // }
  13608. }
  13609. // method id "analytics.management.segments.list":
  13610. type ManagementSegmentsListCall struct {
  13611. s *Service
  13612. urlParams_ gensupport.URLParams
  13613. ifNoneMatch_ string
  13614. ctx_ context.Context
  13615. header_ http.Header
  13616. }
  13617. // List: Lists segments to which the user has access.
  13618. func (r *ManagementSegmentsService) List() *ManagementSegmentsListCall {
  13619. c := &ManagementSegmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13620. return c
  13621. }
  13622. // MaxResults sets the optional parameter "max-results": The maximum
  13623. // number of segments to include in this response.
  13624. func (c *ManagementSegmentsListCall) MaxResults(maxResults int64) *ManagementSegmentsListCall {
  13625. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  13626. return c
  13627. }
  13628. // StartIndex sets the optional parameter "start-index": An index of the
  13629. // first segment to retrieve. Use this parameter as a pagination
  13630. // mechanism along with the max-results parameter.
  13631. func (c *ManagementSegmentsListCall) StartIndex(startIndex int64) *ManagementSegmentsListCall {
  13632. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  13633. return c
  13634. }
  13635. // Fields allows partial responses to be retrieved. See
  13636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13637. // for more information.
  13638. func (c *ManagementSegmentsListCall) Fields(s ...googleapi.Field) *ManagementSegmentsListCall {
  13639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13640. return c
  13641. }
  13642. // IfNoneMatch sets the optional parameter which makes the operation
  13643. // fail if the object's ETag matches the given value. This is useful for
  13644. // getting updates only after the object has changed since the last
  13645. // request. Use googleapi.IsNotModified to check whether the response
  13646. // error from Do is the result of In-None-Match.
  13647. func (c *ManagementSegmentsListCall) IfNoneMatch(entityTag string) *ManagementSegmentsListCall {
  13648. c.ifNoneMatch_ = entityTag
  13649. return c
  13650. }
  13651. // Context sets the context to be used in this call's Do method. Any
  13652. // pending HTTP request will be aborted if the provided context is
  13653. // canceled.
  13654. func (c *ManagementSegmentsListCall) Context(ctx context.Context) *ManagementSegmentsListCall {
  13655. c.ctx_ = ctx
  13656. return c
  13657. }
  13658. // Header returns an http.Header that can be modified by the caller to
  13659. // add HTTP headers to the request.
  13660. func (c *ManagementSegmentsListCall) Header() http.Header {
  13661. if c.header_ == nil {
  13662. c.header_ = make(http.Header)
  13663. }
  13664. return c.header_
  13665. }
  13666. func (c *ManagementSegmentsListCall) doRequest(alt string) (*http.Response, error) {
  13667. reqHeaders := make(http.Header)
  13668. for k, v := range c.header_ {
  13669. reqHeaders[k] = v
  13670. }
  13671. reqHeaders.Set("User-Agent", c.s.userAgent())
  13672. if c.ifNoneMatch_ != "" {
  13673. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13674. }
  13675. var body io.Reader = nil
  13676. c.urlParams_.Set("alt", alt)
  13677. urls := googleapi.ResolveRelative(c.s.BasePath, "management/segments")
  13678. urls += "?" + c.urlParams_.Encode()
  13679. req, _ := http.NewRequest("GET", urls, body)
  13680. req.Header = reqHeaders
  13681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13682. }
  13683. // Do executes the "analytics.management.segments.list" call.
  13684. // Exactly one of *Segments or error will be non-nil. Any non-2xx status
  13685. // code is an error. Response headers are in either
  13686. // *Segments.ServerResponse.Header or (if a response was returned at
  13687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13688. // to check whether the returned error was because
  13689. // http.StatusNotModified was returned.
  13690. func (c *ManagementSegmentsListCall) Do(opts ...googleapi.CallOption) (*Segments, error) {
  13691. gensupport.SetOptions(c.urlParams_, opts...)
  13692. res, err := c.doRequest("json")
  13693. if res != nil && res.StatusCode == http.StatusNotModified {
  13694. if res.Body != nil {
  13695. res.Body.Close()
  13696. }
  13697. return nil, &googleapi.Error{
  13698. Code: res.StatusCode,
  13699. Header: res.Header,
  13700. }
  13701. }
  13702. if err != nil {
  13703. return nil, err
  13704. }
  13705. defer googleapi.CloseBody(res)
  13706. if err := googleapi.CheckResponse(res); err != nil {
  13707. return nil, err
  13708. }
  13709. ret := &Segments{
  13710. ServerResponse: googleapi.ServerResponse{
  13711. Header: res.Header,
  13712. HTTPStatusCode: res.StatusCode,
  13713. },
  13714. }
  13715. target := &ret
  13716. if err := gensupport.DecodeResponse(target, res); err != nil {
  13717. return nil, err
  13718. }
  13719. return ret, nil
  13720. // {
  13721. // "description": "Lists segments to which the user has access.",
  13722. // "httpMethod": "GET",
  13723. // "id": "analytics.management.segments.list",
  13724. // "parameters": {
  13725. // "max-results": {
  13726. // "description": "The maximum number of segments to include in this response.",
  13727. // "format": "int32",
  13728. // "location": "query",
  13729. // "type": "integer"
  13730. // },
  13731. // "start-index": {
  13732. // "description": "An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  13733. // "format": "int32",
  13734. // "location": "query",
  13735. // "minimum": "1",
  13736. // "type": "integer"
  13737. // }
  13738. // },
  13739. // "path": "management/segments",
  13740. // "response": {
  13741. // "$ref": "Segments"
  13742. // },
  13743. // "scopes": [
  13744. // "https://www.googleapis.com/auth/analytics",
  13745. // "https://www.googleapis.com/auth/analytics.edit",
  13746. // "https://www.googleapis.com/auth/analytics.readonly"
  13747. // ]
  13748. // }
  13749. }
  13750. // method id "analytics.management.unsampledReports.delete":
  13751. type ManagementUnsampledReportsDeleteCall struct {
  13752. s *Service
  13753. accountId string
  13754. webPropertyId string
  13755. profileId string
  13756. unsampledReportId string
  13757. urlParams_ gensupport.URLParams
  13758. ctx_ context.Context
  13759. header_ http.Header
  13760. }
  13761. // Delete: Deletes an unsampled report.
  13762. func (r *ManagementUnsampledReportsService) Delete(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsDeleteCall {
  13763. c := &ManagementUnsampledReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13764. c.accountId = accountId
  13765. c.webPropertyId = webPropertyId
  13766. c.profileId = profileId
  13767. c.unsampledReportId = unsampledReportId
  13768. return c
  13769. }
  13770. // Fields allows partial responses to be retrieved. See
  13771. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13772. // for more information.
  13773. func (c *ManagementUnsampledReportsDeleteCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsDeleteCall {
  13774. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13775. return c
  13776. }
  13777. // Context sets the context to be used in this call's Do method. Any
  13778. // pending HTTP request will be aborted if the provided context is
  13779. // canceled.
  13780. func (c *ManagementUnsampledReportsDeleteCall) Context(ctx context.Context) *ManagementUnsampledReportsDeleteCall {
  13781. c.ctx_ = ctx
  13782. return c
  13783. }
  13784. // Header returns an http.Header that can be modified by the caller to
  13785. // add HTTP headers to the request.
  13786. func (c *ManagementUnsampledReportsDeleteCall) Header() http.Header {
  13787. if c.header_ == nil {
  13788. c.header_ = make(http.Header)
  13789. }
  13790. return c.header_
  13791. }
  13792. func (c *ManagementUnsampledReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13793. reqHeaders := make(http.Header)
  13794. for k, v := range c.header_ {
  13795. reqHeaders[k] = v
  13796. }
  13797. reqHeaders.Set("User-Agent", c.s.userAgent())
  13798. var body io.Reader = nil
  13799. c.urlParams_.Set("alt", alt)
  13800. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  13801. urls += "?" + c.urlParams_.Encode()
  13802. req, _ := http.NewRequest("DELETE", urls, body)
  13803. req.Header = reqHeaders
  13804. googleapi.Expand(req.URL, map[string]string{
  13805. "accountId": c.accountId,
  13806. "webPropertyId": c.webPropertyId,
  13807. "profileId": c.profileId,
  13808. "unsampledReportId": c.unsampledReportId,
  13809. })
  13810. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13811. }
  13812. // Do executes the "analytics.management.unsampledReports.delete" call.
  13813. func (c *ManagementUnsampledReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  13814. gensupport.SetOptions(c.urlParams_, opts...)
  13815. res, err := c.doRequest("json")
  13816. if err != nil {
  13817. return err
  13818. }
  13819. defer googleapi.CloseBody(res)
  13820. if err := googleapi.CheckResponse(res); err != nil {
  13821. return err
  13822. }
  13823. return nil
  13824. // {
  13825. // "description": "Deletes an unsampled report.",
  13826. // "httpMethod": "DELETE",
  13827. // "id": "analytics.management.unsampledReports.delete",
  13828. // "parameterOrder": [
  13829. // "accountId",
  13830. // "webPropertyId",
  13831. // "profileId",
  13832. // "unsampledReportId"
  13833. // ],
  13834. // "parameters": {
  13835. // "accountId": {
  13836. // "description": "Account ID to delete the unsampled report for.",
  13837. // "location": "path",
  13838. // "required": true,
  13839. // "type": "string"
  13840. // },
  13841. // "profileId": {
  13842. // "description": "View (Profile) ID to delete the unsampled report for.",
  13843. // "location": "path",
  13844. // "required": true,
  13845. // "type": "string"
  13846. // },
  13847. // "unsampledReportId": {
  13848. // "description": "ID of the unsampled report to be deleted.",
  13849. // "location": "path",
  13850. // "required": true,
  13851. // "type": "string"
  13852. // },
  13853. // "webPropertyId": {
  13854. // "description": "Web property ID to delete the unsampled reports for.",
  13855. // "location": "path",
  13856. // "required": true,
  13857. // "type": "string"
  13858. // }
  13859. // },
  13860. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  13861. // "scopes": [
  13862. // "https://www.googleapis.com/auth/analytics.edit"
  13863. // ]
  13864. // }
  13865. }
  13866. // method id "analytics.management.unsampledReports.get":
  13867. type ManagementUnsampledReportsGetCall struct {
  13868. s *Service
  13869. accountId string
  13870. webPropertyId string
  13871. profileId string
  13872. unsampledReportId string
  13873. urlParams_ gensupport.URLParams
  13874. ifNoneMatch_ string
  13875. ctx_ context.Context
  13876. header_ http.Header
  13877. }
  13878. // Get: Returns a single unsampled report.
  13879. func (r *ManagementUnsampledReportsService) Get(accountId string, webPropertyId string, profileId string, unsampledReportId string) *ManagementUnsampledReportsGetCall {
  13880. c := &ManagementUnsampledReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13881. c.accountId = accountId
  13882. c.webPropertyId = webPropertyId
  13883. c.profileId = profileId
  13884. c.unsampledReportId = unsampledReportId
  13885. return c
  13886. }
  13887. // Fields allows partial responses to be retrieved. See
  13888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13889. // for more information.
  13890. func (c *ManagementUnsampledReportsGetCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsGetCall {
  13891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13892. return c
  13893. }
  13894. // IfNoneMatch sets the optional parameter which makes the operation
  13895. // fail if the object's ETag matches the given value. This is useful for
  13896. // getting updates only after the object has changed since the last
  13897. // request. Use googleapi.IsNotModified to check whether the response
  13898. // error from Do is the result of In-None-Match.
  13899. func (c *ManagementUnsampledReportsGetCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsGetCall {
  13900. c.ifNoneMatch_ = entityTag
  13901. return c
  13902. }
  13903. // Context sets the context to be used in this call's Do method. Any
  13904. // pending HTTP request will be aborted if the provided context is
  13905. // canceled.
  13906. func (c *ManagementUnsampledReportsGetCall) Context(ctx context.Context) *ManagementUnsampledReportsGetCall {
  13907. c.ctx_ = ctx
  13908. return c
  13909. }
  13910. // Header returns an http.Header that can be modified by the caller to
  13911. // add HTTP headers to the request.
  13912. func (c *ManagementUnsampledReportsGetCall) Header() http.Header {
  13913. if c.header_ == nil {
  13914. c.header_ = make(http.Header)
  13915. }
  13916. return c.header_
  13917. }
  13918. func (c *ManagementUnsampledReportsGetCall) doRequest(alt string) (*http.Response, error) {
  13919. reqHeaders := make(http.Header)
  13920. for k, v := range c.header_ {
  13921. reqHeaders[k] = v
  13922. }
  13923. reqHeaders.Set("User-Agent", c.s.userAgent())
  13924. if c.ifNoneMatch_ != "" {
  13925. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13926. }
  13927. var body io.Reader = nil
  13928. c.urlParams_.Set("alt", alt)
  13929. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}")
  13930. urls += "?" + c.urlParams_.Encode()
  13931. req, _ := http.NewRequest("GET", urls, body)
  13932. req.Header = reqHeaders
  13933. googleapi.Expand(req.URL, map[string]string{
  13934. "accountId": c.accountId,
  13935. "webPropertyId": c.webPropertyId,
  13936. "profileId": c.profileId,
  13937. "unsampledReportId": c.unsampledReportId,
  13938. })
  13939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13940. }
  13941. // Do executes the "analytics.management.unsampledReports.get" call.
  13942. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  13943. // status code is an error. Response headers are in either
  13944. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  13945. // at all) in error.(*googleapi.Error).Header. Use
  13946. // googleapi.IsNotModified to check whether the returned error was
  13947. // because http.StatusNotModified was returned.
  13948. func (c *ManagementUnsampledReportsGetCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  13949. gensupport.SetOptions(c.urlParams_, opts...)
  13950. res, err := c.doRequest("json")
  13951. if res != nil && res.StatusCode == http.StatusNotModified {
  13952. if res.Body != nil {
  13953. res.Body.Close()
  13954. }
  13955. return nil, &googleapi.Error{
  13956. Code: res.StatusCode,
  13957. Header: res.Header,
  13958. }
  13959. }
  13960. if err != nil {
  13961. return nil, err
  13962. }
  13963. defer googleapi.CloseBody(res)
  13964. if err := googleapi.CheckResponse(res); err != nil {
  13965. return nil, err
  13966. }
  13967. ret := &UnsampledReport{
  13968. ServerResponse: googleapi.ServerResponse{
  13969. Header: res.Header,
  13970. HTTPStatusCode: res.StatusCode,
  13971. },
  13972. }
  13973. target := &ret
  13974. if err := gensupport.DecodeResponse(target, res); err != nil {
  13975. return nil, err
  13976. }
  13977. return ret, nil
  13978. // {
  13979. // "description": "Returns a single unsampled report.",
  13980. // "httpMethod": "GET",
  13981. // "id": "analytics.management.unsampledReports.get",
  13982. // "parameterOrder": [
  13983. // "accountId",
  13984. // "webPropertyId",
  13985. // "profileId",
  13986. // "unsampledReportId"
  13987. // ],
  13988. // "parameters": {
  13989. // "accountId": {
  13990. // "description": "Account ID to retrieve unsampled report for.",
  13991. // "location": "path",
  13992. // "required": true,
  13993. // "type": "string"
  13994. // },
  13995. // "profileId": {
  13996. // "description": "View (Profile) ID to retrieve unsampled report for.",
  13997. // "location": "path",
  13998. // "required": true,
  13999. // "type": "string"
  14000. // },
  14001. // "unsampledReportId": {
  14002. // "description": "ID of the unsampled report to retrieve.",
  14003. // "location": "path",
  14004. // "required": true,
  14005. // "type": "string"
  14006. // },
  14007. // "webPropertyId": {
  14008. // "description": "Web property ID to retrieve unsampled reports for.",
  14009. // "location": "path",
  14010. // "required": true,
  14011. // "type": "string"
  14012. // }
  14013. // },
  14014. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}",
  14015. // "response": {
  14016. // "$ref": "UnsampledReport"
  14017. // },
  14018. // "scopes": [
  14019. // "https://www.googleapis.com/auth/analytics",
  14020. // "https://www.googleapis.com/auth/analytics.edit",
  14021. // "https://www.googleapis.com/auth/analytics.readonly"
  14022. // ]
  14023. // }
  14024. }
  14025. // method id "analytics.management.unsampledReports.insert":
  14026. type ManagementUnsampledReportsInsertCall struct {
  14027. s *Service
  14028. accountId string
  14029. webPropertyId string
  14030. profileId string
  14031. unsampledreport *UnsampledReport
  14032. urlParams_ gensupport.URLParams
  14033. ctx_ context.Context
  14034. header_ http.Header
  14035. }
  14036. // Insert: Create a new unsampled report.
  14037. func (r *ManagementUnsampledReportsService) Insert(accountId string, webPropertyId string, profileId string, unsampledreport *UnsampledReport) *ManagementUnsampledReportsInsertCall {
  14038. c := &ManagementUnsampledReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14039. c.accountId = accountId
  14040. c.webPropertyId = webPropertyId
  14041. c.profileId = profileId
  14042. c.unsampledreport = unsampledreport
  14043. return c
  14044. }
  14045. // Fields allows partial responses to be retrieved. See
  14046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14047. // for more information.
  14048. func (c *ManagementUnsampledReportsInsertCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsInsertCall {
  14049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14050. return c
  14051. }
  14052. // Context sets the context to be used in this call's Do method. Any
  14053. // pending HTTP request will be aborted if the provided context is
  14054. // canceled.
  14055. func (c *ManagementUnsampledReportsInsertCall) Context(ctx context.Context) *ManagementUnsampledReportsInsertCall {
  14056. c.ctx_ = ctx
  14057. return c
  14058. }
  14059. // Header returns an http.Header that can be modified by the caller to
  14060. // add HTTP headers to the request.
  14061. func (c *ManagementUnsampledReportsInsertCall) Header() http.Header {
  14062. if c.header_ == nil {
  14063. c.header_ = make(http.Header)
  14064. }
  14065. return c.header_
  14066. }
  14067. func (c *ManagementUnsampledReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  14068. reqHeaders := make(http.Header)
  14069. for k, v := range c.header_ {
  14070. reqHeaders[k] = v
  14071. }
  14072. reqHeaders.Set("User-Agent", c.s.userAgent())
  14073. var body io.Reader = nil
  14074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.unsampledreport)
  14075. if err != nil {
  14076. return nil, err
  14077. }
  14078. reqHeaders.Set("Content-Type", "application/json")
  14079. c.urlParams_.Set("alt", alt)
  14080. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  14081. urls += "?" + c.urlParams_.Encode()
  14082. req, _ := http.NewRequest("POST", urls, body)
  14083. req.Header = reqHeaders
  14084. googleapi.Expand(req.URL, map[string]string{
  14085. "accountId": c.accountId,
  14086. "webPropertyId": c.webPropertyId,
  14087. "profileId": c.profileId,
  14088. })
  14089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14090. }
  14091. // Do executes the "analytics.management.unsampledReports.insert" call.
  14092. // Exactly one of *UnsampledReport or error will be non-nil. Any non-2xx
  14093. // status code is an error. Response headers are in either
  14094. // *UnsampledReport.ServerResponse.Header or (if a response was returned
  14095. // at all) in error.(*googleapi.Error).Header. Use
  14096. // googleapi.IsNotModified to check whether the returned error was
  14097. // because http.StatusNotModified was returned.
  14098. func (c *ManagementUnsampledReportsInsertCall) Do(opts ...googleapi.CallOption) (*UnsampledReport, error) {
  14099. gensupport.SetOptions(c.urlParams_, opts...)
  14100. res, err := c.doRequest("json")
  14101. if res != nil && res.StatusCode == http.StatusNotModified {
  14102. if res.Body != nil {
  14103. res.Body.Close()
  14104. }
  14105. return nil, &googleapi.Error{
  14106. Code: res.StatusCode,
  14107. Header: res.Header,
  14108. }
  14109. }
  14110. if err != nil {
  14111. return nil, err
  14112. }
  14113. defer googleapi.CloseBody(res)
  14114. if err := googleapi.CheckResponse(res); err != nil {
  14115. return nil, err
  14116. }
  14117. ret := &UnsampledReport{
  14118. ServerResponse: googleapi.ServerResponse{
  14119. Header: res.Header,
  14120. HTTPStatusCode: res.StatusCode,
  14121. },
  14122. }
  14123. target := &ret
  14124. if err := gensupport.DecodeResponse(target, res); err != nil {
  14125. return nil, err
  14126. }
  14127. return ret, nil
  14128. // {
  14129. // "description": "Create a new unsampled report.",
  14130. // "httpMethod": "POST",
  14131. // "id": "analytics.management.unsampledReports.insert",
  14132. // "parameterOrder": [
  14133. // "accountId",
  14134. // "webPropertyId",
  14135. // "profileId"
  14136. // ],
  14137. // "parameters": {
  14138. // "accountId": {
  14139. // "description": "Account ID to create the unsampled report for.",
  14140. // "location": "path",
  14141. // "required": true,
  14142. // "type": "string"
  14143. // },
  14144. // "profileId": {
  14145. // "description": "View (Profile) ID to create the unsampled report for.",
  14146. // "location": "path",
  14147. // "required": true,
  14148. // "type": "string"
  14149. // },
  14150. // "webPropertyId": {
  14151. // "description": "Web property ID to create the unsampled report for.",
  14152. // "location": "path",
  14153. // "required": true,
  14154. // "type": "string"
  14155. // }
  14156. // },
  14157. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  14158. // "request": {
  14159. // "$ref": "UnsampledReport"
  14160. // },
  14161. // "response": {
  14162. // "$ref": "UnsampledReport"
  14163. // },
  14164. // "scopes": [
  14165. // "https://www.googleapis.com/auth/analytics",
  14166. // "https://www.googleapis.com/auth/analytics.edit"
  14167. // ]
  14168. // }
  14169. }
  14170. // method id "analytics.management.unsampledReports.list":
  14171. type ManagementUnsampledReportsListCall struct {
  14172. s *Service
  14173. accountId string
  14174. webPropertyId string
  14175. profileId string
  14176. urlParams_ gensupport.URLParams
  14177. ifNoneMatch_ string
  14178. ctx_ context.Context
  14179. header_ http.Header
  14180. }
  14181. // List: Lists unsampled reports to which the user has access.
  14182. func (r *ManagementUnsampledReportsService) List(accountId string, webPropertyId string, profileId string) *ManagementUnsampledReportsListCall {
  14183. c := &ManagementUnsampledReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14184. c.accountId = accountId
  14185. c.webPropertyId = webPropertyId
  14186. c.profileId = profileId
  14187. return c
  14188. }
  14189. // MaxResults sets the optional parameter "max-results": The maximum
  14190. // number of unsampled reports to include in this response.
  14191. func (c *ManagementUnsampledReportsListCall) MaxResults(maxResults int64) *ManagementUnsampledReportsListCall {
  14192. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  14193. return c
  14194. }
  14195. // StartIndex sets the optional parameter "start-index": An index of the
  14196. // first unsampled report to retrieve. Use this parameter as a
  14197. // pagination mechanism along with the max-results parameter.
  14198. func (c *ManagementUnsampledReportsListCall) StartIndex(startIndex int64) *ManagementUnsampledReportsListCall {
  14199. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  14200. return c
  14201. }
  14202. // Fields allows partial responses to be retrieved. See
  14203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14204. // for more information.
  14205. func (c *ManagementUnsampledReportsListCall) Fields(s ...googleapi.Field) *ManagementUnsampledReportsListCall {
  14206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14207. return c
  14208. }
  14209. // IfNoneMatch sets the optional parameter which makes the operation
  14210. // fail if the object's ETag matches the given value. This is useful for
  14211. // getting updates only after the object has changed since the last
  14212. // request. Use googleapi.IsNotModified to check whether the response
  14213. // error from Do is the result of In-None-Match.
  14214. func (c *ManagementUnsampledReportsListCall) IfNoneMatch(entityTag string) *ManagementUnsampledReportsListCall {
  14215. c.ifNoneMatch_ = entityTag
  14216. return c
  14217. }
  14218. // Context sets the context to be used in this call's Do method. Any
  14219. // pending HTTP request will be aborted if the provided context is
  14220. // canceled.
  14221. func (c *ManagementUnsampledReportsListCall) Context(ctx context.Context) *ManagementUnsampledReportsListCall {
  14222. c.ctx_ = ctx
  14223. return c
  14224. }
  14225. // Header returns an http.Header that can be modified by the caller to
  14226. // add HTTP headers to the request.
  14227. func (c *ManagementUnsampledReportsListCall) Header() http.Header {
  14228. if c.header_ == nil {
  14229. c.header_ = make(http.Header)
  14230. }
  14231. return c.header_
  14232. }
  14233. func (c *ManagementUnsampledReportsListCall) doRequest(alt string) (*http.Response, error) {
  14234. reqHeaders := make(http.Header)
  14235. for k, v := range c.header_ {
  14236. reqHeaders[k] = v
  14237. }
  14238. reqHeaders.Set("User-Agent", c.s.userAgent())
  14239. if c.ifNoneMatch_ != "" {
  14240. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14241. }
  14242. var body io.Reader = nil
  14243. c.urlParams_.Set("alt", alt)
  14244. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports")
  14245. urls += "?" + c.urlParams_.Encode()
  14246. req, _ := http.NewRequest("GET", urls, body)
  14247. req.Header = reqHeaders
  14248. googleapi.Expand(req.URL, map[string]string{
  14249. "accountId": c.accountId,
  14250. "webPropertyId": c.webPropertyId,
  14251. "profileId": c.profileId,
  14252. })
  14253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14254. }
  14255. // Do executes the "analytics.management.unsampledReports.list" call.
  14256. // Exactly one of *UnsampledReports or error will be non-nil. Any
  14257. // non-2xx status code is an error. Response headers are in either
  14258. // *UnsampledReports.ServerResponse.Header or (if a response was
  14259. // returned at all) in error.(*googleapi.Error).Header. Use
  14260. // googleapi.IsNotModified to check whether the returned error was
  14261. // because http.StatusNotModified was returned.
  14262. func (c *ManagementUnsampledReportsListCall) Do(opts ...googleapi.CallOption) (*UnsampledReports, error) {
  14263. gensupport.SetOptions(c.urlParams_, opts...)
  14264. res, err := c.doRequest("json")
  14265. if res != nil && res.StatusCode == http.StatusNotModified {
  14266. if res.Body != nil {
  14267. res.Body.Close()
  14268. }
  14269. return nil, &googleapi.Error{
  14270. Code: res.StatusCode,
  14271. Header: res.Header,
  14272. }
  14273. }
  14274. if err != nil {
  14275. return nil, err
  14276. }
  14277. defer googleapi.CloseBody(res)
  14278. if err := googleapi.CheckResponse(res); err != nil {
  14279. return nil, err
  14280. }
  14281. ret := &UnsampledReports{
  14282. ServerResponse: googleapi.ServerResponse{
  14283. Header: res.Header,
  14284. HTTPStatusCode: res.StatusCode,
  14285. },
  14286. }
  14287. target := &ret
  14288. if err := gensupport.DecodeResponse(target, res); err != nil {
  14289. return nil, err
  14290. }
  14291. return ret, nil
  14292. // {
  14293. // "description": "Lists unsampled reports to which the user has access.",
  14294. // "httpMethod": "GET",
  14295. // "id": "analytics.management.unsampledReports.list",
  14296. // "parameterOrder": [
  14297. // "accountId",
  14298. // "webPropertyId",
  14299. // "profileId"
  14300. // ],
  14301. // "parameters": {
  14302. // "accountId": {
  14303. // "description": "Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported.",
  14304. // "location": "path",
  14305. // "required": true,
  14306. // "type": "string"
  14307. // },
  14308. // "max-results": {
  14309. // "description": "The maximum number of unsampled reports to include in this response.",
  14310. // "format": "int32",
  14311. // "location": "query",
  14312. // "type": "integer"
  14313. // },
  14314. // "profileId": {
  14315. // "description": "View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported.",
  14316. // "location": "path",
  14317. // "required": true,
  14318. // "type": "string"
  14319. // },
  14320. // "start-index": {
  14321. // "description": "An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  14322. // "format": "int32",
  14323. // "location": "query",
  14324. // "minimum": "1",
  14325. // "type": "integer"
  14326. // },
  14327. // "webPropertyId": {
  14328. // "description": "Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported.",
  14329. // "location": "path",
  14330. // "required": true,
  14331. // "type": "string"
  14332. // }
  14333. // },
  14334. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports",
  14335. // "response": {
  14336. // "$ref": "UnsampledReports"
  14337. // },
  14338. // "scopes": [
  14339. // "https://www.googleapis.com/auth/analytics",
  14340. // "https://www.googleapis.com/auth/analytics.edit",
  14341. // "https://www.googleapis.com/auth/analytics.readonly"
  14342. // ]
  14343. // }
  14344. }
  14345. // method id "analytics.management.uploads.deleteUploadData":
  14346. type ManagementUploadsDeleteUploadDataCall struct {
  14347. s *Service
  14348. accountId string
  14349. webPropertyId string
  14350. customDataSourceId string
  14351. analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest
  14352. urlParams_ gensupport.URLParams
  14353. ctx_ context.Context
  14354. header_ http.Header
  14355. }
  14356. // DeleteUploadData: Delete data associated with a previous upload.
  14357. func (r *ManagementUploadsService) DeleteUploadData(accountId string, webPropertyId string, customDataSourceId string, analyticsdataimportdeleteuploaddatarequest *AnalyticsDataimportDeleteUploadDataRequest) *ManagementUploadsDeleteUploadDataCall {
  14358. c := &ManagementUploadsDeleteUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14359. c.accountId = accountId
  14360. c.webPropertyId = webPropertyId
  14361. c.customDataSourceId = customDataSourceId
  14362. c.analyticsdataimportdeleteuploaddatarequest = analyticsdataimportdeleteuploaddatarequest
  14363. return c
  14364. }
  14365. // Fields allows partial responses to be retrieved. See
  14366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14367. // for more information.
  14368. func (c *ManagementUploadsDeleteUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsDeleteUploadDataCall {
  14369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14370. return c
  14371. }
  14372. // Context sets the context to be used in this call's Do method. Any
  14373. // pending HTTP request will be aborted if the provided context is
  14374. // canceled.
  14375. func (c *ManagementUploadsDeleteUploadDataCall) Context(ctx context.Context) *ManagementUploadsDeleteUploadDataCall {
  14376. c.ctx_ = ctx
  14377. return c
  14378. }
  14379. // Header returns an http.Header that can be modified by the caller to
  14380. // add HTTP headers to the request.
  14381. func (c *ManagementUploadsDeleteUploadDataCall) Header() http.Header {
  14382. if c.header_ == nil {
  14383. c.header_ = make(http.Header)
  14384. }
  14385. return c.header_
  14386. }
  14387. func (c *ManagementUploadsDeleteUploadDataCall) doRequest(alt string) (*http.Response, error) {
  14388. reqHeaders := make(http.Header)
  14389. for k, v := range c.header_ {
  14390. reqHeaders[k] = v
  14391. }
  14392. reqHeaders.Set("User-Agent", c.s.userAgent())
  14393. var body io.Reader = nil
  14394. body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyticsdataimportdeleteuploaddatarequest)
  14395. if err != nil {
  14396. return nil, err
  14397. }
  14398. reqHeaders.Set("Content-Type", "application/json")
  14399. c.urlParams_.Set("alt", alt)
  14400. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData")
  14401. urls += "?" + c.urlParams_.Encode()
  14402. req, _ := http.NewRequest("POST", urls, body)
  14403. req.Header = reqHeaders
  14404. googleapi.Expand(req.URL, map[string]string{
  14405. "accountId": c.accountId,
  14406. "webPropertyId": c.webPropertyId,
  14407. "customDataSourceId": c.customDataSourceId,
  14408. })
  14409. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14410. }
  14411. // Do executes the "analytics.management.uploads.deleteUploadData" call.
  14412. func (c *ManagementUploadsDeleteUploadDataCall) Do(opts ...googleapi.CallOption) error {
  14413. gensupport.SetOptions(c.urlParams_, opts...)
  14414. res, err := c.doRequest("json")
  14415. if err != nil {
  14416. return err
  14417. }
  14418. defer googleapi.CloseBody(res)
  14419. if err := googleapi.CheckResponse(res); err != nil {
  14420. return err
  14421. }
  14422. return nil
  14423. // {
  14424. // "description": "Delete data associated with a previous upload.",
  14425. // "httpMethod": "POST",
  14426. // "id": "analytics.management.uploads.deleteUploadData",
  14427. // "parameterOrder": [
  14428. // "accountId",
  14429. // "webPropertyId",
  14430. // "customDataSourceId"
  14431. // ],
  14432. // "parameters": {
  14433. // "accountId": {
  14434. // "description": "Account Id for the uploads to be deleted.",
  14435. // "location": "path",
  14436. // "pattern": "\\d+",
  14437. // "required": true,
  14438. // "type": "string"
  14439. // },
  14440. // "customDataSourceId": {
  14441. // "description": "Custom data source Id for the uploads to be deleted.",
  14442. // "location": "path",
  14443. // "pattern": ".{22}",
  14444. // "required": true,
  14445. // "type": "string"
  14446. // },
  14447. // "webPropertyId": {
  14448. // "description": "Web property Id for the uploads to be deleted.",
  14449. // "location": "path",
  14450. // "pattern": "UA-(\\d+)-(\\d+)",
  14451. // "required": true,
  14452. // "type": "string"
  14453. // }
  14454. // },
  14455. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData",
  14456. // "request": {
  14457. // "$ref": "AnalyticsDataimportDeleteUploadDataRequest"
  14458. // },
  14459. // "scopes": [
  14460. // "https://www.googleapis.com/auth/analytics",
  14461. // "https://www.googleapis.com/auth/analytics.edit"
  14462. // ]
  14463. // }
  14464. }
  14465. // method id "analytics.management.uploads.get":
  14466. type ManagementUploadsGetCall struct {
  14467. s *Service
  14468. accountId string
  14469. webPropertyId string
  14470. customDataSourceId string
  14471. uploadId string
  14472. urlParams_ gensupport.URLParams
  14473. ifNoneMatch_ string
  14474. ctx_ context.Context
  14475. header_ http.Header
  14476. }
  14477. // Get: List uploads to which the user has access.
  14478. func (r *ManagementUploadsService) Get(accountId string, webPropertyId string, customDataSourceId string, uploadId string) *ManagementUploadsGetCall {
  14479. c := &ManagementUploadsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14480. c.accountId = accountId
  14481. c.webPropertyId = webPropertyId
  14482. c.customDataSourceId = customDataSourceId
  14483. c.uploadId = uploadId
  14484. return c
  14485. }
  14486. // Fields allows partial responses to be retrieved. See
  14487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14488. // for more information.
  14489. func (c *ManagementUploadsGetCall) Fields(s ...googleapi.Field) *ManagementUploadsGetCall {
  14490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14491. return c
  14492. }
  14493. // IfNoneMatch sets the optional parameter which makes the operation
  14494. // fail if the object's ETag matches the given value. This is useful for
  14495. // getting updates only after the object has changed since the last
  14496. // request. Use googleapi.IsNotModified to check whether the response
  14497. // error from Do is the result of In-None-Match.
  14498. func (c *ManagementUploadsGetCall) IfNoneMatch(entityTag string) *ManagementUploadsGetCall {
  14499. c.ifNoneMatch_ = entityTag
  14500. return c
  14501. }
  14502. // Context sets the context to be used in this call's Do method. Any
  14503. // pending HTTP request will be aborted if the provided context is
  14504. // canceled.
  14505. func (c *ManagementUploadsGetCall) Context(ctx context.Context) *ManagementUploadsGetCall {
  14506. c.ctx_ = ctx
  14507. return c
  14508. }
  14509. // Header returns an http.Header that can be modified by the caller to
  14510. // add HTTP headers to the request.
  14511. func (c *ManagementUploadsGetCall) Header() http.Header {
  14512. if c.header_ == nil {
  14513. c.header_ = make(http.Header)
  14514. }
  14515. return c.header_
  14516. }
  14517. func (c *ManagementUploadsGetCall) doRequest(alt string) (*http.Response, error) {
  14518. reqHeaders := make(http.Header)
  14519. for k, v := range c.header_ {
  14520. reqHeaders[k] = v
  14521. }
  14522. reqHeaders.Set("User-Agent", c.s.userAgent())
  14523. if c.ifNoneMatch_ != "" {
  14524. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14525. }
  14526. var body io.Reader = nil
  14527. c.urlParams_.Set("alt", alt)
  14528. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}")
  14529. urls += "?" + c.urlParams_.Encode()
  14530. req, _ := http.NewRequest("GET", urls, body)
  14531. req.Header = reqHeaders
  14532. googleapi.Expand(req.URL, map[string]string{
  14533. "accountId": c.accountId,
  14534. "webPropertyId": c.webPropertyId,
  14535. "customDataSourceId": c.customDataSourceId,
  14536. "uploadId": c.uploadId,
  14537. })
  14538. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14539. }
  14540. // Do executes the "analytics.management.uploads.get" call.
  14541. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  14542. // code is an error. Response headers are in either
  14543. // *Upload.ServerResponse.Header or (if a response was returned at all)
  14544. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14545. // check whether the returned error was because http.StatusNotModified
  14546. // was returned.
  14547. func (c *ManagementUploadsGetCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  14548. gensupport.SetOptions(c.urlParams_, opts...)
  14549. res, err := c.doRequest("json")
  14550. if res != nil && res.StatusCode == http.StatusNotModified {
  14551. if res.Body != nil {
  14552. res.Body.Close()
  14553. }
  14554. return nil, &googleapi.Error{
  14555. Code: res.StatusCode,
  14556. Header: res.Header,
  14557. }
  14558. }
  14559. if err != nil {
  14560. return nil, err
  14561. }
  14562. defer googleapi.CloseBody(res)
  14563. if err := googleapi.CheckResponse(res); err != nil {
  14564. return nil, err
  14565. }
  14566. ret := &Upload{
  14567. ServerResponse: googleapi.ServerResponse{
  14568. Header: res.Header,
  14569. HTTPStatusCode: res.StatusCode,
  14570. },
  14571. }
  14572. target := &ret
  14573. if err := gensupport.DecodeResponse(target, res); err != nil {
  14574. return nil, err
  14575. }
  14576. return ret, nil
  14577. // {
  14578. // "description": "List uploads to which the user has access.",
  14579. // "httpMethod": "GET",
  14580. // "id": "analytics.management.uploads.get",
  14581. // "parameterOrder": [
  14582. // "accountId",
  14583. // "webPropertyId",
  14584. // "customDataSourceId",
  14585. // "uploadId"
  14586. // ],
  14587. // "parameters": {
  14588. // "accountId": {
  14589. // "description": "Account Id for the upload to retrieve.",
  14590. // "location": "path",
  14591. // "pattern": "\\d+",
  14592. // "required": true,
  14593. // "type": "string"
  14594. // },
  14595. // "customDataSourceId": {
  14596. // "description": "Custom data source Id for upload to retrieve.",
  14597. // "location": "path",
  14598. // "pattern": ".{22}",
  14599. // "required": true,
  14600. // "type": "string"
  14601. // },
  14602. // "uploadId": {
  14603. // "description": "Upload Id to retrieve.",
  14604. // "location": "path",
  14605. // "pattern": ".{22}",
  14606. // "required": true,
  14607. // "type": "string"
  14608. // },
  14609. // "webPropertyId": {
  14610. // "description": "Web property Id for the upload to retrieve.",
  14611. // "location": "path",
  14612. // "pattern": "UA-(\\d+)-(\\d+)",
  14613. // "required": true,
  14614. // "type": "string"
  14615. // }
  14616. // },
  14617. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}",
  14618. // "response": {
  14619. // "$ref": "Upload"
  14620. // },
  14621. // "scopes": [
  14622. // "https://www.googleapis.com/auth/analytics",
  14623. // "https://www.googleapis.com/auth/analytics.edit",
  14624. // "https://www.googleapis.com/auth/analytics.readonly"
  14625. // ]
  14626. // }
  14627. }
  14628. // method id "analytics.management.uploads.list":
  14629. type ManagementUploadsListCall struct {
  14630. s *Service
  14631. accountId string
  14632. webPropertyId string
  14633. customDataSourceId string
  14634. urlParams_ gensupport.URLParams
  14635. ifNoneMatch_ string
  14636. ctx_ context.Context
  14637. header_ http.Header
  14638. }
  14639. // List: List uploads to which the user has access.
  14640. func (r *ManagementUploadsService) List(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsListCall {
  14641. c := &ManagementUploadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14642. c.accountId = accountId
  14643. c.webPropertyId = webPropertyId
  14644. c.customDataSourceId = customDataSourceId
  14645. return c
  14646. }
  14647. // MaxResults sets the optional parameter "max-results": The maximum
  14648. // number of uploads to include in this response.
  14649. func (c *ManagementUploadsListCall) MaxResults(maxResults int64) *ManagementUploadsListCall {
  14650. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  14651. return c
  14652. }
  14653. // StartIndex sets the optional parameter "start-index": A 1-based index
  14654. // of the first upload to retrieve. Use this parameter as a pagination
  14655. // mechanism along with the max-results parameter.
  14656. func (c *ManagementUploadsListCall) StartIndex(startIndex int64) *ManagementUploadsListCall {
  14657. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  14658. return c
  14659. }
  14660. // Fields allows partial responses to be retrieved. See
  14661. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14662. // for more information.
  14663. func (c *ManagementUploadsListCall) Fields(s ...googleapi.Field) *ManagementUploadsListCall {
  14664. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14665. return c
  14666. }
  14667. // IfNoneMatch sets the optional parameter which makes the operation
  14668. // fail if the object's ETag matches the given value. This is useful for
  14669. // getting updates only after the object has changed since the last
  14670. // request. Use googleapi.IsNotModified to check whether the response
  14671. // error from Do is the result of In-None-Match.
  14672. func (c *ManagementUploadsListCall) IfNoneMatch(entityTag string) *ManagementUploadsListCall {
  14673. c.ifNoneMatch_ = entityTag
  14674. return c
  14675. }
  14676. // Context sets the context to be used in this call's Do method. Any
  14677. // pending HTTP request will be aborted if the provided context is
  14678. // canceled.
  14679. func (c *ManagementUploadsListCall) Context(ctx context.Context) *ManagementUploadsListCall {
  14680. c.ctx_ = ctx
  14681. return c
  14682. }
  14683. // Header returns an http.Header that can be modified by the caller to
  14684. // add HTTP headers to the request.
  14685. func (c *ManagementUploadsListCall) Header() http.Header {
  14686. if c.header_ == nil {
  14687. c.header_ = make(http.Header)
  14688. }
  14689. return c.header_
  14690. }
  14691. func (c *ManagementUploadsListCall) doRequest(alt string) (*http.Response, error) {
  14692. reqHeaders := make(http.Header)
  14693. for k, v := range c.header_ {
  14694. reqHeaders[k] = v
  14695. }
  14696. reqHeaders.Set("User-Agent", c.s.userAgent())
  14697. if c.ifNoneMatch_ != "" {
  14698. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14699. }
  14700. var body io.Reader = nil
  14701. c.urlParams_.Set("alt", alt)
  14702. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  14703. urls += "?" + c.urlParams_.Encode()
  14704. req, _ := http.NewRequest("GET", urls, body)
  14705. req.Header = reqHeaders
  14706. googleapi.Expand(req.URL, map[string]string{
  14707. "accountId": c.accountId,
  14708. "webPropertyId": c.webPropertyId,
  14709. "customDataSourceId": c.customDataSourceId,
  14710. })
  14711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14712. }
  14713. // Do executes the "analytics.management.uploads.list" call.
  14714. // Exactly one of *Uploads or error will be non-nil. Any non-2xx status
  14715. // code is an error. Response headers are in either
  14716. // *Uploads.ServerResponse.Header or (if a response was returned at all)
  14717. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14718. // check whether the returned error was because http.StatusNotModified
  14719. // was returned.
  14720. func (c *ManagementUploadsListCall) Do(opts ...googleapi.CallOption) (*Uploads, error) {
  14721. gensupport.SetOptions(c.urlParams_, opts...)
  14722. res, err := c.doRequest("json")
  14723. if res != nil && res.StatusCode == http.StatusNotModified {
  14724. if res.Body != nil {
  14725. res.Body.Close()
  14726. }
  14727. return nil, &googleapi.Error{
  14728. Code: res.StatusCode,
  14729. Header: res.Header,
  14730. }
  14731. }
  14732. if err != nil {
  14733. return nil, err
  14734. }
  14735. defer googleapi.CloseBody(res)
  14736. if err := googleapi.CheckResponse(res); err != nil {
  14737. return nil, err
  14738. }
  14739. ret := &Uploads{
  14740. ServerResponse: googleapi.ServerResponse{
  14741. Header: res.Header,
  14742. HTTPStatusCode: res.StatusCode,
  14743. },
  14744. }
  14745. target := &ret
  14746. if err := gensupport.DecodeResponse(target, res); err != nil {
  14747. return nil, err
  14748. }
  14749. return ret, nil
  14750. // {
  14751. // "description": "List uploads to which the user has access.",
  14752. // "httpMethod": "GET",
  14753. // "id": "analytics.management.uploads.list",
  14754. // "parameterOrder": [
  14755. // "accountId",
  14756. // "webPropertyId",
  14757. // "customDataSourceId"
  14758. // ],
  14759. // "parameters": {
  14760. // "accountId": {
  14761. // "description": "Account Id for the uploads to retrieve.",
  14762. // "location": "path",
  14763. // "pattern": "\\d+",
  14764. // "required": true,
  14765. // "type": "string"
  14766. // },
  14767. // "customDataSourceId": {
  14768. // "description": "Custom data source Id for uploads to retrieve.",
  14769. // "location": "path",
  14770. // "pattern": ".{22}",
  14771. // "required": true,
  14772. // "type": "string"
  14773. // },
  14774. // "max-results": {
  14775. // "description": "The maximum number of uploads to include in this response.",
  14776. // "format": "int32",
  14777. // "location": "query",
  14778. // "minimum": "1",
  14779. // "type": "integer"
  14780. // },
  14781. // "start-index": {
  14782. // "description": "A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  14783. // "format": "int32",
  14784. // "location": "query",
  14785. // "minimum": "1",
  14786. // "type": "integer"
  14787. // },
  14788. // "webPropertyId": {
  14789. // "description": "Web property Id for the uploads to retrieve.",
  14790. // "location": "path",
  14791. // "pattern": "UA-(\\d+)-(\\d+)",
  14792. // "required": true,
  14793. // "type": "string"
  14794. // }
  14795. // },
  14796. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  14797. // "response": {
  14798. // "$ref": "Uploads"
  14799. // },
  14800. // "scopes": [
  14801. // "https://www.googleapis.com/auth/analytics",
  14802. // "https://www.googleapis.com/auth/analytics.edit",
  14803. // "https://www.googleapis.com/auth/analytics.readonly"
  14804. // ]
  14805. // }
  14806. }
  14807. // method id "analytics.management.uploads.uploadData":
  14808. type ManagementUploadsUploadDataCall struct {
  14809. s *Service
  14810. accountId string
  14811. webPropertyId string
  14812. customDataSourceId string
  14813. urlParams_ gensupport.URLParams
  14814. mediaInfo_ *gensupport.MediaInfo
  14815. ctx_ context.Context
  14816. header_ http.Header
  14817. }
  14818. // UploadData: Upload data for a custom data source.
  14819. func (r *ManagementUploadsService) UploadData(accountId string, webPropertyId string, customDataSourceId string) *ManagementUploadsUploadDataCall {
  14820. c := &ManagementUploadsUploadDataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14821. c.accountId = accountId
  14822. c.webPropertyId = webPropertyId
  14823. c.customDataSourceId = customDataSourceId
  14824. return c
  14825. }
  14826. // Media specifies the media to upload in one or more chunks. The chunk
  14827. // size may be controlled by supplying a MediaOption generated by
  14828. // googleapi.ChunkSize. The chunk size defaults to
  14829. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  14830. // upload request will be determined by sniffing the contents of r,
  14831. // unless a MediaOption generated by googleapi.ContentType is
  14832. // supplied.
  14833. // At most one of Media and ResumableMedia may be set.
  14834. func (c *ManagementUploadsUploadDataCall) Media(r io.Reader, options ...googleapi.MediaOption) *ManagementUploadsUploadDataCall {
  14835. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  14836. return c
  14837. }
  14838. // ResumableMedia specifies the media to upload in chunks and can be
  14839. // canceled with ctx.
  14840. //
  14841. // Deprecated: use Media instead.
  14842. //
  14843. // At most one of Media and ResumableMedia may be set. mediaType
  14844. // identifies the MIME media type of the upload, such as "image/png". If
  14845. // mediaType is "", it will be auto-detected. The provided ctx will
  14846. // supersede any context previously provided to the Context method.
  14847. func (c *ManagementUploadsUploadDataCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ManagementUploadsUploadDataCall {
  14848. c.ctx_ = ctx
  14849. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  14850. return c
  14851. }
  14852. // ProgressUpdater provides a callback function that will be called
  14853. // after every chunk. It should be a low-latency function in order to
  14854. // not slow down the upload operation. This should only be called when
  14855. // using ResumableMedia (as opposed to Media).
  14856. func (c *ManagementUploadsUploadDataCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ManagementUploadsUploadDataCall {
  14857. c.mediaInfo_.SetProgressUpdater(pu)
  14858. return c
  14859. }
  14860. // Fields allows partial responses to be retrieved. See
  14861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14862. // for more information.
  14863. func (c *ManagementUploadsUploadDataCall) Fields(s ...googleapi.Field) *ManagementUploadsUploadDataCall {
  14864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14865. return c
  14866. }
  14867. // Context sets the context to be used in this call's Do method. Any
  14868. // pending HTTP request will be aborted if the provided context is
  14869. // canceled.
  14870. // This context will supersede any context previously provided to the
  14871. // ResumableMedia method.
  14872. func (c *ManagementUploadsUploadDataCall) Context(ctx context.Context) *ManagementUploadsUploadDataCall {
  14873. c.ctx_ = ctx
  14874. return c
  14875. }
  14876. // Header returns an http.Header that can be modified by the caller to
  14877. // add HTTP headers to the request.
  14878. func (c *ManagementUploadsUploadDataCall) Header() http.Header {
  14879. if c.header_ == nil {
  14880. c.header_ = make(http.Header)
  14881. }
  14882. return c.header_
  14883. }
  14884. func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response, error) {
  14885. reqHeaders := make(http.Header)
  14886. for k, v := range c.header_ {
  14887. reqHeaders[k] = v
  14888. }
  14889. reqHeaders.Set("User-Agent", c.s.userAgent())
  14890. var body io.Reader = nil
  14891. c.urlParams_.Set("alt", alt)
  14892. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads")
  14893. if c.mediaInfo_ != nil {
  14894. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  14895. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  14896. }
  14897. if body == nil {
  14898. body = new(bytes.Buffer)
  14899. reqHeaders.Set("Content-Type", "application/json")
  14900. }
  14901. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  14902. defer cleanup()
  14903. urls += "?" + c.urlParams_.Encode()
  14904. req, _ := http.NewRequest("POST", urls, body)
  14905. req.Header = reqHeaders
  14906. gensupport.SetGetBody(req, getBody)
  14907. googleapi.Expand(req.URL, map[string]string{
  14908. "accountId": c.accountId,
  14909. "webPropertyId": c.webPropertyId,
  14910. "customDataSourceId": c.customDataSourceId,
  14911. })
  14912. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14913. }
  14914. // Do executes the "analytics.management.uploads.uploadData" call.
  14915. // Exactly one of *Upload or error will be non-nil. Any non-2xx status
  14916. // code is an error. Response headers are in either
  14917. // *Upload.ServerResponse.Header or (if a response was returned at all)
  14918. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  14919. // check whether the returned error was because http.StatusNotModified
  14920. // was returned.
  14921. func (c *ManagementUploadsUploadDataCall) Do(opts ...googleapi.CallOption) (*Upload, error) {
  14922. gensupport.SetOptions(c.urlParams_, opts...)
  14923. res, err := c.doRequest("json")
  14924. if res != nil && res.StatusCode == http.StatusNotModified {
  14925. if res.Body != nil {
  14926. res.Body.Close()
  14927. }
  14928. return nil, &googleapi.Error{
  14929. Code: res.StatusCode,
  14930. Header: res.Header,
  14931. }
  14932. }
  14933. if err != nil {
  14934. return nil, err
  14935. }
  14936. defer googleapi.CloseBody(res)
  14937. if err := googleapi.CheckResponse(res); err != nil {
  14938. return nil, err
  14939. }
  14940. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  14941. if rx != nil {
  14942. rx.Client = c.s.client
  14943. rx.UserAgent = c.s.userAgent()
  14944. ctx := c.ctx_
  14945. if ctx == nil {
  14946. ctx = context.TODO()
  14947. }
  14948. res, err = rx.Upload(ctx)
  14949. if err != nil {
  14950. return nil, err
  14951. }
  14952. defer res.Body.Close()
  14953. if err := googleapi.CheckResponse(res); err != nil {
  14954. return nil, err
  14955. }
  14956. }
  14957. ret := &Upload{
  14958. ServerResponse: googleapi.ServerResponse{
  14959. Header: res.Header,
  14960. HTTPStatusCode: res.StatusCode,
  14961. },
  14962. }
  14963. target := &ret
  14964. if err := gensupport.DecodeResponse(target, res); err != nil {
  14965. return nil, err
  14966. }
  14967. return ret, nil
  14968. // {
  14969. // "description": "Upload data for a custom data source.",
  14970. // "httpMethod": "POST",
  14971. // "id": "analytics.management.uploads.uploadData",
  14972. // "mediaUpload": {
  14973. // "accept": [
  14974. // "application/octet-stream"
  14975. // ],
  14976. // "maxSize": "1GB",
  14977. // "protocols": {
  14978. // "resumable": {
  14979. // "multipart": true,
  14980. // "path": "/resumable/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  14981. // },
  14982. // "simple": {
  14983. // "multipart": true,
  14984. // "path": "/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads"
  14985. // }
  14986. // }
  14987. // },
  14988. // "parameterOrder": [
  14989. // "accountId",
  14990. // "webPropertyId",
  14991. // "customDataSourceId"
  14992. // ],
  14993. // "parameters": {
  14994. // "accountId": {
  14995. // "description": "Account Id associated with the upload.",
  14996. // "location": "path",
  14997. // "pattern": "\\d+",
  14998. // "required": true,
  14999. // "type": "string"
  15000. // },
  15001. // "customDataSourceId": {
  15002. // "description": "Custom data source Id to which the data being uploaded belongs.",
  15003. // "location": "path",
  15004. // "required": true,
  15005. // "type": "string"
  15006. // },
  15007. // "webPropertyId": {
  15008. // "description": "Web property UA-string associated with the upload.",
  15009. // "location": "path",
  15010. // "pattern": "UA-\\d+-\\d+",
  15011. // "required": true,
  15012. // "type": "string"
  15013. // }
  15014. // },
  15015. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads",
  15016. // "response": {
  15017. // "$ref": "Upload"
  15018. // },
  15019. // "scopes": [
  15020. // "https://www.googleapis.com/auth/analytics",
  15021. // "https://www.googleapis.com/auth/analytics.edit"
  15022. // ],
  15023. // "supportsMediaUpload": true
  15024. // }
  15025. }
  15026. // method id "analytics.management.webPropertyAdWordsLinks.delete":
  15027. type ManagementWebPropertyAdWordsLinksDeleteCall struct {
  15028. s *Service
  15029. accountId string
  15030. webPropertyId string
  15031. webPropertyAdWordsLinkId string
  15032. urlParams_ gensupport.URLParams
  15033. ctx_ context.Context
  15034. header_ http.Header
  15035. }
  15036. // Delete: Deletes a web property-AdWords link.
  15037. func (r *ManagementWebPropertyAdWordsLinksService) Delete(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15038. c := &ManagementWebPropertyAdWordsLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15039. c.accountId = accountId
  15040. c.webPropertyId = webPropertyId
  15041. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15042. return c
  15043. }
  15044. // Fields allows partial responses to be retrieved. See
  15045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15046. // for more information.
  15047. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15049. return c
  15050. }
  15051. // Context sets the context to be used in this call's Do method. Any
  15052. // pending HTTP request will be aborted if the provided context is
  15053. // canceled.
  15054. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksDeleteCall {
  15055. c.ctx_ = ctx
  15056. return c
  15057. }
  15058. // Header returns an http.Header that can be modified by the caller to
  15059. // add HTTP headers to the request.
  15060. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Header() http.Header {
  15061. if c.header_ == nil {
  15062. c.header_ = make(http.Header)
  15063. }
  15064. return c.header_
  15065. }
  15066. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  15067. reqHeaders := make(http.Header)
  15068. for k, v := range c.header_ {
  15069. reqHeaders[k] = v
  15070. }
  15071. reqHeaders.Set("User-Agent", c.s.userAgent())
  15072. var body io.Reader = nil
  15073. c.urlParams_.Set("alt", alt)
  15074. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15075. urls += "?" + c.urlParams_.Encode()
  15076. req, _ := http.NewRequest("DELETE", urls, body)
  15077. req.Header = reqHeaders
  15078. googleapi.Expand(req.URL, map[string]string{
  15079. "accountId": c.accountId,
  15080. "webPropertyId": c.webPropertyId,
  15081. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15082. })
  15083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15084. }
  15085. // Do executes the "analytics.management.webPropertyAdWordsLinks.delete" call.
  15086. func (c *ManagementWebPropertyAdWordsLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  15087. gensupport.SetOptions(c.urlParams_, opts...)
  15088. res, err := c.doRequest("json")
  15089. if err != nil {
  15090. return err
  15091. }
  15092. defer googleapi.CloseBody(res)
  15093. if err := googleapi.CheckResponse(res); err != nil {
  15094. return err
  15095. }
  15096. return nil
  15097. // {
  15098. // "description": "Deletes a web property-AdWords link.",
  15099. // "httpMethod": "DELETE",
  15100. // "id": "analytics.management.webPropertyAdWordsLinks.delete",
  15101. // "parameterOrder": [
  15102. // "accountId",
  15103. // "webPropertyId",
  15104. // "webPropertyAdWordsLinkId"
  15105. // ],
  15106. // "parameters": {
  15107. // "accountId": {
  15108. // "description": "ID of the account which the given web property belongs to.",
  15109. // "location": "path",
  15110. // "required": true,
  15111. // "type": "string"
  15112. // },
  15113. // "webPropertyAdWordsLinkId": {
  15114. // "description": "Web property AdWords link ID.",
  15115. // "location": "path",
  15116. // "required": true,
  15117. // "type": "string"
  15118. // },
  15119. // "webPropertyId": {
  15120. // "description": "Web property ID to delete the AdWords link for.",
  15121. // "location": "path",
  15122. // "required": true,
  15123. // "type": "string"
  15124. // }
  15125. // },
  15126. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15127. // "scopes": [
  15128. // "https://www.googleapis.com/auth/analytics.edit"
  15129. // ]
  15130. // }
  15131. }
  15132. // method id "analytics.management.webPropertyAdWordsLinks.get":
  15133. type ManagementWebPropertyAdWordsLinksGetCall struct {
  15134. s *Service
  15135. accountId string
  15136. webPropertyId string
  15137. webPropertyAdWordsLinkId string
  15138. urlParams_ gensupport.URLParams
  15139. ifNoneMatch_ string
  15140. ctx_ context.Context
  15141. header_ http.Header
  15142. }
  15143. // Get: Returns a web property-AdWords link to which the user has
  15144. // access.
  15145. func (r *ManagementWebPropertyAdWordsLinksService) Get(accountId string, webPropertyId string, webPropertyAdWordsLinkId string) *ManagementWebPropertyAdWordsLinksGetCall {
  15146. c := &ManagementWebPropertyAdWordsLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15147. c.accountId = accountId
  15148. c.webPropertyId = webPropertyId
  15149. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15150. return c
  15151. }
  15152. // Fields allows partial responses to be retrieved. See
  15153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15154. // for more information.
  15155. func (c *ManagementWebPropertyAdWordsLinksGetCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksGetCall {
  15156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15157. return c
  15158. }
  15159. // IfNoneMatch sets the optional parameter which makes the operation
  15160. // fail if the object's ETag matches the given value. This is useful for
  15161. // getting updates only after the object has changed since the last
  15162. // request. Use googleapi.IsNotModified to check whether the response
  15163. // error from Do is the result of In-None-Match.
  15164. func (c *ManagementWebPropertyAdWordsLinksGetCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksGetCall {
  15165. c.ifNoneMatch_ = entityTag
  15166. return c
  15167. }
  15168. // Context sets the context to be used in this call's Do method. Any
  15169. // pending HTTP request will be aborted if the provided context is
  15170. // canceled.
  15171. func (c *ManagementWebPropertyAdWordsLinksGetCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksGetCall {
  15172. c.ctx_ = ctx
  15173. return c
  15174. }
  15175. // Header returns an http.Header that can be modified by the caller to
  15176. // add HTTP headers to the request.
  15177. func (c *ManagementWebPropertyAdWordsLinksGetCall) Header() http.Header {
  15178. if c.header_ == nil {
  15179. c.header_ = make(http.Header)
  15180. }
  15181. return c.header_
  15182. }
  15183. func (c *ManagementWebPropertyAdWordsLinksGetCall) doRequest(alt string) (*http.Response, error) {
  15184. reqHeaders := make(http.Header)
  15185. for k, v := range c.header_ {
  15186. reqHeaders[k] = v
  15187. }
  15188. reqHeaders.Set("User-Agent", c.s.userAgent())
  15189. if c.ifNoneMatch_ != "" {
  15190. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15191. }
  15192. var body io.Reader = nil
  15193. c.urlParams_.Set("alt", alt)
  15194. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15195. urls += "?" + c.urlParams_.Encode()
  15196. req, _ := http.NewRequest("GET", urls, body)
  15197. req.Header = reqHeaders
  15198. googleapi.Expand(req.URL, map[string]string{
  15199. "accountId": c.accountId,
  15200. "webPropertyId": c.webPropertyId,
  15201. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15202. })
  15203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15204. }
  15205. // Do executes the "analytics.management.webPropertyAdWordsLinks.get" call.
  15206. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15207. // non-2xx status code is an error. Response headers are in either
  15208. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15209. // returned at all) in error.(*googleapi.Error).Header. Use
  15210. // googleapi.IsNotModified to check whether the returned error was
  15211. // because http.StatusNotModified was returned.
  15212. func (c *ManagementWebPropertyAdWordsLinksGetCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15213. gensupport.SetOptions(c.urlParams_, opts...)
  15214. res, err := c.doRequest("json")
  15215. if res != nil && res.StatusCode == http.StatusNotModified {
  15216. if res.Body != nil {
  15217. res.Body.Close()
  15218. }
  15219. return nil, &googleapi.Error{
  15220. Code: res.StatusCode,
  15221. Header: res.Header,
  15222. }
  15223. }
  15224. if err != nil {
  15225. return nil, err
  15226. }
  15227. defer googleapi.CloseBody(res)
  15228. if err := googleapi.CheckResponse(res); err != nil {
  15229. return nil, err
  15230. }
  15231. ret := &EntityAdWordsLink{
  15232. ServerResponse: googleapi.ServerResponse{
  15233. Header: res.Header,
  15234. HTTPStatusCode: res.StatusCode,
  15235. },
  15236. }
  15237. target := &ret
  15238. if err := gensupport.DecodeResponse(target, res); err != nil {
  15239. return nil, err
  15240. }
  15241. return ret, nil
  15242. // {
  15243. // "description": "Returns a web property-AdWords link to which the user has access.",
  15244. // "httpMethod": "GET",
  15245. // "id": "analytics.management.webPropertyAdWordsLinks.get",
  15246. // "parameterOrder": [
  15247. // "accountId",
  15248. // "webPropertyId",
  15249. // "webPropertyAdWordsLinkId"
  15250. // ],
  15251. // "parameters": {
  15252. // "accountId": {
  15253. // "description": "ID of the account which the given web property belongs to.",
  15254. // "location": "path",
  15255. // "required": true,
  15256. // "type": "string"
  15257. // },
  15258. // "webPropertyAdWordsLinkId": {
  15259. // "description": "Web property-AdWords link ID.",
  15260. // "location": "path",
  15261. // "required": true,
  15262. // "type": "string"
  15263. // },
  15264. // "webPropertyId": {
  15265. // "description": "Web property ID to retrieve the AdWords link for.",
  15266. // "location": "path",
  15267. // "required": true,
  15268. // "type": "string"
  15269. // }
  15270. // },
  15271. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15272. // "response": {
  15273. // "$ref": "EntityAdWordsLink"
  15274. // },
  15275. // "scopes": [
  15276. // "https://www.googleapis.com/auth/analytics.edit",
  15277. // "https://www.googleapis.com/auth/analytics.readonly"
  15278. // ]
  15279. // }
  15280. }
  15281. // method id "analytics.management.webPropertyAdWordsLinks.insert":
  15282. type ManagementWebPropertyAdWordsLinksInsertCall struct {
  15283. s *Service
  15284. accountId string
  15285. webPropertyId string
  15286. entityadwordslink *EntityAdWordsLink
  15287. urlParams_ gensupport.URLParams
  15288. ctx_ context.Context
  15289. header_ http.Header
  15290. }
  15291. // Insert: Creates a webProperty-AdWords link.
  15292. func (r *ManagementWebPropertyAdWordsLinksService) Insert(accountId string, webPropertyId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksInsertCall {
  15293. c := &ManagementWebPropertyAdWordsLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15294. c.accountId = accountId
  15295. c.webPropertyId = webPropertyId
  15296. c.entityadwordslink = entityadwordslink
  15297. return c
  15298. }
  15299. // Fields allows partial responses to be retrieved. See
  15300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15301. // for more information.
  15302. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksInsertCall {
  15303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15304. return c
  15305. }
  15306. // Context sets the context to be used in this call's Do method. Any
  15307. // pending HTTP request will be aborted if the provided context is
  15308. // canceled.
  15309. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksInsertCall {
  15310. c.ctx_ = ctx
  15311. return c
  15312. }
  15313. // Header returns an http.Header that can be modified by the caller to
  15314. // add HTTP headers to the request.
  15315. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Header() http.Header {
  15316. if c.header_ == nil {
  15317. c.header_ = make(http.Header)
  15318. }
  15319. return c.header_
  15320. }
  15321. func (c *ManagementWebPropertyAdWordsLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  15322. reqHeaders := make(http.Header)
  15323. for k, v := range c.header_ {
  15324. reqHeaders[k] = v
  15325. }
  15326. reqHeaders.Set("User-Agent", c.s.userAgent())
  15327. var body io.Reader = nil
  15328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  15329. if err != nil {
  15330. return nil, err
  15331. }
  15332. reqHeaders.Set("Content-Type", "application/json")
  15333. c.urlParams_.Set("alt", alt)
  15334. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  15335. urls += "?" + c.urlParams_.Encode()
  15336. req, _ := http.NewRequest("POST", urls, body)
  15337. req.Header = reqHeaders
  15338. googleapi.Expand(req.URL, map[string]string{
  15339. "accountId": c.accountId,
  15340. "webPropertyId": c.webPropertyId,
  15341. })
  15342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15343. }
  15344. // Do executes the "analytics.management.webPropertyAdWordsLinks.insert" call.
  15345. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15346. // non-2xx status code is an error. Response headers are in either
  15347. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15348. // returned at all) in error.(*googleapi.Error).Header. Use
  15349. // googleapi.IsNotModified to check whether the returned error was
  15350. // because http.StatusNotModified was returned.
  15351. func (c *ManagementWebPropertyAdWordsLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15352. gensupport.SetOptions(c.urlParams_, opts...)
  15353. res, err := c.doRequest("json")
  15354. if res != nil && res.StatusCode == http.StatusNotModified {
  15355. if res.Body != nil {
  15356. res.Body.Close()
  15357. }
  15358. return nil, &googleapi.Error{
  15359. Code: res.StatusCode,
  15360. Header: res.Header,
  15361. }
  15362. }
  15363. if err != nil {
  15364. return nil, err
  15365. }
  15366. defer googleapi.CloseBody(res)
  15367. if err := googleapi.CheckResponse(res); err != nil {
  15368. return nil, err
  15369. }
  15370. ret := &EntityAdWordsLink{
  15371. ServerResponse: googleapi.ServerResponse{
  15372. Header: res.Header,
  15373. HTTPStatusCode: res.StatusCode,
  15374. },
  15375. }
  15376. target := &ret
  15377. if err := gensupport.DecodeResponse(target, res); err != nil {
  15378. return nil, err
  15379. }
  15380. return ret, nil
  15381. // {
  15382. // "description": "Creates a webProperty-AdWords link.",
  15383. // "httpMethod": "POST",
  15384. // "id": "analytics.management.webPropertyAdWordsLinks.insert",
  15385. // "parameterOrder": [
  15386. // "accountId",
  15387. // "webPropertyId"
  15388. // ],
  15389. // "parameters": {
  15390. // "accountId": {
  15391. // "description": "ID of the Google Analytics account to create the link for.",
  15392. // "location": "path",
  15393. // "required": true,
  15394. // "type": "string"
  15395. // },
  15396. // "webPropertyId": {
  15397. // "description": "Web property ID to create the link for.",
  15398. // "location": "path",
  15399. // "required": true,
  15400. // "type": "string"
  15401. // }
  15402. // },
  15403. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  15404. // "request": {
  15405. // "$ref": "EntityAdWordsLink"
  15406. // },
  15407. // "response": {
  15408. // "$ref": "EntityAdWordsLink"
  15409. // },
  15410. // "scopes": [
  15411. // "https://www.googleapis.com/auth/analytics.edit"
  15412. // ]
  15413. // }
  15414. }
  15415. // method id "analytics.management.webPropertyAdWordsLinks.list":
  15416. type ManagementWebPropertyAdWordsLinksListCall struct {
  15417. s *Service
  15418. accountId string
  15419. webPropertyId string
  15420. urlParams_ gensupport.URLParams
  15421. ifNoneMatch_ string
  15422. ctx_ context.Context
  15423. header_ http.Header
  15424. }
  15425. // List: Lists webProperty-AdWords links for a given web property.
  15426. func (r *ManagementWebPropertyAdWordsLinksService) List(accountId string, webPropertyId string) *ManagementWebPropertyAdWordsLinksListCall {
  15427. c := &ManagementWebPropertyAdWordsLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15428. c.accountId = accountId
  15429. c.webPropertyId = webPropertyId
  15430. return c
  15431. }
  15432. // MaxResults sets the optional parameter "max-results": The maximum
  15433. // number of webProperty-AdWords links to include in this response.
  15434. func (c *ManagementWebPropertyAdWordsLinksListCall) MaxResults(maxResults int64) *ManagementWebPropertyAdWordsLinksListCall {
  15435. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  15436. return c
  15437. }
  15438. // StartIndex sets the optional parameter "start-index": An index of the
  15439. // first webProperty-AdWords link to retrieve. Use this parameter as a
  15440. // pagination mechanism along with the max-results parameter.
  15441. func (c *ManagementWebPropertyAdWordsLinksListCall) StartIndex(startIndex int64) *ManagementWebPropertyAdWordsLinksListCall {
  15442. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  15443. return c
  15444. }
  15445. // Fields allows partial responses to be retrieved. See
  15446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15447. // for more information.
  15448. func (c *ManagementWebPropertyAdWordsLinksListCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksListCall {
  15449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15450. return c
  15451. }
  15452. // IfNoneMatch sets the optional parameter which makes the operation
  15453. // fail if the object's ETag matches the given value. This is useful for
  15454. // getting updates only after the object has changed since the last
  15455. // request. Use googleapi.IsNotModified to check whether the response
  15456. // error from Do is the result of In-None-Match.
  15457. func (c *ManagementWebPropertyAdWordsLinksListCall) IfNoneMatch(entityTag string) *ManagementWebPropertyAdWordsLinksListCall {
  15458. c.ifNoneMatch_ = entityTag
  15459. return c
  15460. }
  15461. // Context sets the context to be used in this call's Do method. Any
  15462. // pending HTTP request will be aborted if the provided context is
  15463. // canceled.
  15464. func (c *ManagementWebPropertyAdWordsLinksListCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksListCall {
  15465. c.ctx_ = ctx
  15466. return c
  15467. }
  15468. // Header returns an http.Header that can be modified by the caller to
  15469. // add HTTP headers to the request.
  15470. func (c *ManagementWebPropertyAdWordsLinksListCall) Header() http.Header {
  15471. if c.header_ == nil {
  15472. c.header_ = make(http.Header)
  15473. }
  15474. return c.header_
  15475. }
  15476. func (c *ManagementWebPropertyAdWordsLinksListCall) doRequest(alt string) (*http.Response, error) {
  15477. reqHeaders := make(http.Header)
  15478. for k, v := range c.header_ {
  15479. reqHeaders[k] = v
  15480. }
  15481. reqHeaders.Set("User-Agent", c.s.userAgent())
  15482. if c.ifNoneMatch_ != "" {
  15483. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15484. }
  15485. var body io.Reader = nil
  15486. c.urlParams_.Set("alt", alt)
  15487. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks")
  15488. urls += "?" + c.urlParams_.Encode()
  15489. req, _ := http.NewRequest("GET", urls, body)
  15490. req.Header = reqHeaders
  15491. googleapi.Expand(req.URL, map[string]string{
  15492. "accountId": c.accountId,
  15493. "webPropertyId": c.webPropertyId,
  15494. })
  15495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15496. }
  15497. // Do executes the "analytics.management.webPropertyAdWordsLinks.list" call.
  15498. // Exactly one of *EntityAdWordsLinks or error will be non-nil. Any
  15499. // non-2xx status code is an error. Response headers are in either
  15500. // *EntityAdWordsLinks.ServerResponse.Header or (if a response was
  15501. // returned at all) in error.(*googleapi.Error).Header. Use
  15502. // googleapi.IsNotModified to check whether the returned error was
  15503. // because http.StatusNotModified was returned.
  15504. func (c *ManagementWebPropertyAdWordsLinksListCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLinks, error) {
  15505. gensupport.SetOptions(c.urlParams_, opts...)
  15506. res, err := c.doRequest("json")
  15507. if res != nil && res.StatusCode == http.StatusNotModified {
  15508. if res.Body != nil {
  15509. res.Body.Close()
  15510. }
  15511. return nil, &googleapi.Error{
  15512. Code: res.StatusCode,
  15513. Header: res.Header,
  15514. }
  15515. }
  15516. if err != nil {
  15517. return nil, err
  15518. }
  15519. defer googleapi.CloseBody(res)
  15520. if err := googleapi.CheckResponse(res); err != nil {
  15521. return nil, err
  15522. }
  15523. ret := &EntityAdWordsLinks{
  15524. ServerResponse: googleapi.ServerResponse{
  15525. Header: res.Header,
  15526. HTTPStatusCode: res.StatusCode,
  15527. },
  15528. }
  15529. target := &ret
  15530. if err := gensupport.DecodeResponse(target, res); err != nil {
  15531. return nil, err
  15532. }
  15533. return ret, nil
  15534. // {
  15535. // "description": "Lists webProperty-AdWords links for a given web property.",
  15536. // "httpMethod": "GET",
  15537. // "id": "analytics.management.webPropertyAdWordsLinks.list",
  15538. // "parameterOrder": [
  15539. // "accountId",
  15540. // "webPropertyId"
  15541. // ],
  15542. // "parameters": {
  15543. // "accountId": {
  15544. // "description": "ID of the account which the given web property belongs to.",
  15545. // "location": "path",
  15546. // "pattern": "\\d+",
  15547. // "required": true,
  15548. // "type": "string"
  15549. // },
  15550. // "max-results": {
  15551. // "description": "The maximum number of webProperty-AdWords links to include in this response.",
  15552. // "format": "int32",
  15553. // "location": "query",
  15554. // "type": "integer"
  15555. // },
  15556. // "start-index": {
  15557. // "description": "An index of the first webProperty-AdWords link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  15558. // "format": "int32",
  15559. // "location": "query",
  15560. // "minimum": "1",
  15561. // "type": "integer"
  15562. // },
  15563. // "webPropertyId": {
  15564. // "description": "Web property ID to retrieve the AdWords links for.",
  15565. // "location": "path",
  15566. // "required": true,
  15567. // "type": "string"
  15568. // }
  15569. // },
  15570. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks",
  15571. // "response": {
  15572. // "$ref": "EntityAdWordsLinks"
  15573. // },
  15574. // "scopes": [
  15575. // "https://www.googleapis.com/auth/analytics.edit",
  15576. // "https://www.googleapis.com/auth/analytics.readonly"
  15577. // ]
  15578. // }
  15579. }
  15580. // method id "analytics.management.webPropertyAdWordsLinks.patch":
  15581. type ManagementWebPropertyAdWordsLinksPatchCall struct {
  15582. s *Service
  15583. accountId string
  15584. webPropertyId string
  15585. webPropertyAdWordsLinkId string
  15586. entityadwordslink *EntityAdWordsLink
  15587. urlParams_ gensupport.URLParams
  15588. ctx_ context.Context
  15589. header_ http.Header
  15590. }
  15591. // Patch: Updates an existing webProperty-AdWords link. This method
  15592. // supports patch semantics.
  15593. func (r *ManagementWebPropertyAdWordsLinksService) Patch(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksPatchCall {
  15594. c := &ManagementWebPropertyAdWordsLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15595. c.accountId = accountId
  15596. c.webPropertyId = webPropertyId
  15597. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15598. c.entityadwordslink = entityadwordslink
  15599. return c
  15600. }
  15601. // Fields allows partial responses to be retrieved. See
  15602. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15603. // for more information.
  15604. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksPatchCall {
  15605. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15606. return c
  15607. }
  15608. // Context sets the context to be used in this call's Do method. Any
  15609. // pending HTTP request will be aborted if the provided context is
  15610. // canceled.
  15611. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksPatchCall {
  15612. c.ctx_ = ctx
  15613. return c
  15614. }
  15615. // Header returns an http.Header that can be modified by the caller to
  15616. // add HTTP headers to the request.
  15617. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Header() http.Header {
  15618. if c.header_ == nil {
  15619. c.header_ = make(http.Header)
  15620. }
  15621. return c.header_
  15622. }
  15623. func (c *ManagementWebPropertyAdWordsLinksPatchCall) doRequest(alt string) (*http.Response, error) {
  15624. reqHeaders := make(http.Header)
  15625. for k, v := range c.header_ {
  15626. reqHeaders[k] = v
  15627. }
  15628. reqHeaders.Set("User-Agent", c.s.userAgent())
  15629. var body io.Reader = nil
  15630. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  15631. if err != nil {
  15632. return nil, err
  15633. }
  15634. reqHeaders.Set("Content-Type", "application/json")
  15635. c.urlParams_.Set("alt", alt)
  15636. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15637. urls += "?" + c.urlParams_.Encode()
  15638. req, _ := http.NewRequest("PATCH", urls, body)
  15639. req.Header = reqHeaders
  15640. googleapi.Expand(req.URL, map[string]string{
  15641. "accountId": c.accountId,
  15642. "webPropertyId": c.webPropertyId,
  15643. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15644. })
  15645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15646. }
  15647. // Do executes the "analytics.management.webPropertyAdWordsLinks.patch" call.
  15648. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15649. // non-2xx status code is an error. Response headers are in either
  15650. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15651. // returned at all) in error.(*googleapi.Error).Header. Use
  15652. // googleapi.IsNotModified to check whether the returned error was
  15653. // because http.StatusNotModified was returned.
  15654. func (c *ManagementWebPropertyAdWordsLinksPatchCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15655. gensupport.SetOptions(c.urlParams_, opts...)
  15656. res, err := c.doRequest("json")
  15657. if res != nil && res.StatusCode == http.StatusNotModified {
  15658. if res.Body != nil {
  15659. res.Body.Close()
  15660. }
  15661. return nil, &googleapi.Error{
  15662. Code: res.StatusCode,
  15663. Header: res.Header,
  15664. }
  15665. }
  15666. if err != nil {
  15667. return nil, err
  15668. }
  15669. defer googleapi.CloseBody(res)
  15670. if err := googleapi.CheckResponse(res); err != nil {
  15671. return nil, err
  15672. }
  15673. ret := &EntityAdWordsLink{
  15674. ServerResponse: googleapi.ServerResponse{
  15675. Header: res.Header,
  15676. HTTPStatusCode: res.StatusCode,
  15677. },
  15678. }
  15679. target := &ret
  15680. if err := gensupport.DecodeResponse(target, res); err != nil {
  15681. return nil, err
  15682. }
  15683. return ret, nil
  15684. // {
  15685. // "description": "Updates an existing webProperty-AdWords link. This method supports patch semantics.",
  15686. // "httpMethod": "PATCH",
  15687. // "id": "analytics.management.webPropertyAdWordsLinks.patch",
  15688. // "parameterOrder": [
  15689. // "accountId",
  15690. // "webPropertyId",
  15691. // "webPropertyAdWordsLinkId"
  15692. // ],
  15693. // "parameters": {
  15694. // "accountId": {
  15695. // "description": "ID of the account which the given web property belongs to.",
  15696. // "location": "path",
  15697. // "required": true,
  15698. // "type": "string"
  15699. // },
  15700. // "webPropertyAdWordsLinkId": {
  15701. // "description": "Web property-AdWords link ID.",
  15702. // "location": "path",
  15703. // "required": true,
  15704. // "type": "string"
  15705. // },
  15706. // "webPropertyId": {
  15707. // "description": "Web property ID to retrieve the AdWords link for.",
  15708. // "location": "path",
  15709. // "required": true,
  15710. // "type": "string"
  15711. // }
  15712. // },
  15713. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15714. // "request": {
  15715. // "$ref": "EntityAdWordsLink"
  15716. // },
  15717. // "response": {
  15718. // "$ref": "EntityAdWordsLink"
  15719. // },
  15720. // "scopes": [
  15721. // "https://www.googleapis.com/auth/analytics.edit"
  15722. // ]
  15723. // }
  15724. }
  15725. // method id "analytics.management.webPropertyAdWordsLinks.update":
  15726. type ManagementWebPropertyAdWordsLinksUpdateCall struct {
  15727. s *Service
  15728. accountId string
  15729. webPropertyId string
  15730. webPropertyAdWordsLinkId string
  15731. entityadwordslink *EntityAdWordsLink
  15732. urlParams_ gensupport.URLParams
  15733. ctx_ context.Context
  15734. header_ http.Header
  15735. }
  15736. // Update: Updates an existing webProperty-AdWords link.
  15737. func (r *ManagementWebPropertyAdWordsLinksService) Update(accountId string, webPropertyId string, webPropertyAdWordsLinkId string, entityadwordslink *EntityAdWordsLink) *ManagementWebPropertyAdWordsLinksUpdateCall {
  15738. c := &ManagementWebPropertyAdWordsLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15739. c.accountId = accountId
  15740. c.webPropertyId = webPropertyId
  15741. c.webPropertyAdWordsLinkId = webPropertyAdWordsLinkId
  15742. c.entityadwordslink = entityadwordslink
  15743. return c
  15744. }
  15745. // Fields allows partial responses to be retrieved. See
  15746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15747. // for more information.
  15748. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebPropertyAdWordsLinksUpdateCall {
  15749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15750. return c
  15751. }
  15752. // Context sets the context to be used in this call's Do method. Any
  15753. // pending HTTP request will be aborted if the provided context is
  15754. // canceled.
  15755. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Context(ctx context.Context) *ManagementWebPropertyAdWordsLinksUpdateCall {
  15756. c.ctx_ = ctx
  15757. return c
  15758. }
  15759. // Header returns an http.Header that can be modified by the caller to
  15760. // add HTTP headers to the request.
  15761. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Header() http.Header {
  15762. if c.header_ == nil {
  15763. c.header_ = make(http.Header)
  15764. }
  15765. return c.header_
  15766. }
  15767. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  15768. reqHeaders := make(http.Header)
  15769. for k, v := range c.header_ {
  15770. reqHeaders[k] = v
  15771. }
  15772. reqHeaders.Set("User-Agent", c.s.userAgent())
  15773. var body io.Reader = nil
  15774. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityadwordslink)
  15775. if err != nil {
  15776. return nil, err
  15777. }
  15778. reqHeaders.Set("Content-Type", "application/json")
  15779. c.urlParams_.Set("alt", alt)
  15780. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}")
  15781. urls += "?" + c.urlParams_.Encode()
  15782. req, _ := http.NewRequest("PUT", urls, body)
  15783. req.Header = reqHeaders
  15784. googleapi.Expand(req.URL, map[string]string{
  15785. "accountId": c.accountId,
  15786. "webPropertyId": c.webPropertyId,
  15787. "webPropertyAdWordsLinkId": c.webPropertyAdWordsLinkId,
  15788. })
  15789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15790. }
  15791. // Do executes the "analytics.management.webPropertyAdWordsLinks.update" call.
  15792. // Exactly one of *EntityAdWordsLink or error will be non-nil. Any
  15793. // non-2xx status code is an error. Response headers are in either
  15794. // *EntityAdWordsLink.ServerResponse.Header or (if a response was
  15795. // returned at all) in error.(*googleapi.Error).Header. Use
  15796. // googleapi.IsNotModified to check whether the returned error was
  15797. // because http.StatusNotModified was returned.
  15798. func (c *ManagementWebPropertyAdWordsLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityAdWordsLink, error) {
  15799. gensupport.SetOptions(c.urlParams_, opts...)
  15800. res, err := c.doRequest("json")
  15801. if res != nil && res.StatusCode == http.StatusNotModified {
  15802. if res.Body != nil {
  15803. res.Body.Close()
  15804. }
  15805. return nil, &googleapi.Error{
  15806. Code: res.StatusCode,
  15807. Header: res.Header,
  15808. }
  15809. }
  15810. if err != nil {
  15811. return nil, err
  15812. }
  15813. defer googleapi.CloseBody(res)
  15814. if err := googleapi.CheckResponse(res); err != nil {
  15815. return nil, err
  15816. }
  15817. ret := &EntityAdWordsLink{
  15818. ServerResponse: googleapi.ServerResponse{
  15819. Header: res.Header,
  15820. HTTPStatusCode: res.StatusCode,
  15821. },
  15822. }
  15823. target := &ret
  15824. if err := gensupport.DecodeResponse(target, res); err != nil {
  15825. return nil, err
  15826. }
  15827. return ret, nil
  15828. // {
  15829. // "description": "Updates an existing webProperty-AdWords link.",
  15830. // "httpMethod": "PUT",
  15831. // "id": "analytics.management.webPropertyAdWordsLinks.update",
  15832. // "parameterOrder": [
  15833. // "accountId",
  15834. // "webPropertyId",
  15835. // "webPropertyAdWordsLinkId"
  15836. // ],
  15837. // "parameters": {
  15838. // "accountId": {
  15839. // "description": "ID of the account which the given web property belongs to.",
  15840. // "location": "path",
  15841. // "required": true,
  15842. // "type": "string"
  15843. // },
  15844. // "webPropertyAdWordsLinkId": {
  15845. // "description": "Web property-AdWords link ID.",
  15846. // "location": "path",
  15847. // "required": true,
  15848. // "type": "string"
  15849. // },
  15850. // "webPropertyId": {
  15851. // "description": "Web property ID to retrieve the AdWords link for.",
  15852. // "location": "path",
  15853. // "required": true,
  15854. // "type": "string"
  15855. // }
  15856. // },
  15857. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}",
  15858. // "request": {
  15859. // "$ref": "EntityAdWordsLink"
  15860. // },
  15861. // "response": {
  15862. // "$ref": "EntityAdWordsLink"
  15863. // },
  15864. // "scopes": [
  15865. // "https://www.googleapis.com/auth/analytics.edit"
  15866. // ]
  15867. // }
  15868. }
  15869. // method id "analytics.management.webproperties.get":
  15870. type ManagementWebpropertiesGetCall struct {
  15871. s *Service
  15872. accountId string
  15873. webPropertyId string
  15874. urlParams_ gensupport.URLParams
  15875. ifNoneMatch_ string
  15876. ctx_ context.Context
  15877. header_ http.Header
  15878. }
  15879. // Get: Gets a web property to which the user has access.
  15880. func (r *ManagementWebpropertiesService) Get(accountId string, webPropertyId string) *ManagementWebpropertiesGetCall {
  15881. c := &ManagementWebpropertiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15882. c.accountId = accountId
  15883. c.webPropertyId = webPropertyId
  15884. return c
  15885. }
  15886. // Fields allows partial responses to be retrieved. See
  15887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15888. // for more information.
  15889. func (c *ManagementWebpropertiesGetCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesGetCall {
  15890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15891. return c
  15892. }
  15893. // IfNoneMatch sets the optional parameter which makes the operation
  15894. // fail if the object's ETag matches the given value. This is useful for
  15895. // getting updates only after the object has changed since the last
  15896. // request. Use googleapi.IsNotModified to check whether the response
  15897. // error from Do is the result of In-None-Match.
  15898. func (c *ManagementWebpropertiesGetCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesGetCall {
  15899. c.ifNoneMatch_ = entityTag
  15900. return c
  15901. }
  15902. // Context sets the context to be used in this call's Do method. Any
  15903. // pending HTTP request will be aborted if the provided context is
  15904. // canceled.
  15905. func (c *ManagementWebpropertiesGetCall) Context(ctx context.Context) *ManagementWebpropertiesGetCall {
  15906. c.ctx_ = ctx
  15907. return c
  15908. }
  15909. // Header returns an http.Header that can be modified by the caller to
  15910. // add HTTP headers to the request.
  15911. func (c *ManagementWebpropertiesGetCall) Header() http.Header {
  15912. if c.header_ == nil {
  15913. c.header_ = make(http.Header)
  15914. }
  15915. return c.header_
  15916. }
  15917. func (c *ManagementWebpropertiesGetCall) doRequest(alt string) (*http.Response, error) {
  15918. reqHeaders := make(http.Header)
  15919. for k, v := range c.header_ {
  15920. reqHeaders[k] = v
  15921. }
  15922. reqHeaders.Set("User-Agent", c.s.userAgent())
  15923. if c.ifNoneMatch_ != "" {
  15924. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15925. }
  15926. var body io.Reader = nil
  15927. c.urlParams_.Set("alt", alt)
  15928. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  15929. urls += "?" + c.urlParams_.Encode()
  15930. req, _ := http.NewRequest("GET", urls, body)
  15931. req.Header = reqHeaders
  15932. googleapi.Expand(req.URL, map[string]string{
  15933. "accountId": c.accountId,
  15934. "webPropertyId": c.webPropertyId,
  15935. })
  15936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15937. }
  15938. // Do executes the "analytics.management.webproperties.get" call.
  15939. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  15940. // status code is an error. Response headers are in either
  15941. // *Webproperty.ServerResponse.Header or (if a response was returned at
  15942. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15943. // to check whether the returned error was because
  15944. // http.StatusNotModified was returned.
  15945. func (c *ManagementWebpropertiesGetCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  15946. gensupport.SetOptions(c.urlParams_, opts...)
  15947. res, err := c.doRequest("json")
  15948. if res != nil && res.StatusCode == http.StatusNotModified {
  15949. if res.Body != nil {
  15950. res.Body.Close()
  15951. }
  15952. return nil, &googleapi.Error{
  15953. Code: res.StatusCode,
  15954. Header: res.Header,
  15955. }
  15956. }
  15957. if err != nil {
  15958. return nil, err
  15959. }
  15960. defer googleapi.CloseBody(res)
  15961. if err := googleapi.CheckResponse(res); err != nil {
  15962. return nil, err
  15963. }
  15964. ret := &Webproperty{
  15965. ServerResponse: googleapi.ServerResponse{
  15966. Header: res.Header,
  15967. HTTPStatusCode: res.StatusCode,
  15968. },
  15969. }
  15970. target := &ret
  15971. if err := gensupport.DecodeResponse(target, res); err != nil {
  15972. return nil, err
  15973. }
  15974. return ret, nil
  15975. // {
  15976. // "description": "Gets a web property to which the user has access.",
  15977. // "httpMethod": "GET",
  15978. // "id": "analytics.management.webproperties.get",
  15979. // "parameterOrder": [
  15980. // "accountId",
  15981. // "webPropertyId"
  15982. // ],
  15983. // "parameters": {
  15984. // "accountId": {
  15985. // "description": "Account ID to retrieve the web property for.",
  15986. // "location": "path",
  15987. // "pattern": "[0-9]+",
  15988. // "required": true,
  15989. // "type": "string"
  15990. // },
  15991. // "webPropertyId": {
  15992. // "description": "ID to retrieve the web property for.",
  15993. // "location": "path",
  15994. // "pattern": "UA-[0-9]+-[0-9]+",
  15995. // "required": true,
  15996. // "type": "string"
  15997. // }
  15998. // },
  15999. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  16000. // "response": {
  16001. // "$ref": "Webproperty"
  16002. // },
  16003. // "scopes": [
  16004. // "https://www.googleapis.com/auth/analytics.edit",
  16005. // "https://www.googleapis.com/auth/analytics.readonly"
  16006. // ]
  16007. // }
  16008. }
  16009. // method id "analytics.management.webproperties.insert":
  16010. type ManagementWebpropertiesInsertCall struct {
  16011. s *Service
  16012. accountId string
  16013. webproperty *Webproperty
  16014. urlParams_ gensupport.URLParams
  16015. ctx_ context.Context
  16016. header_ http.Header
  16017. }
  16018. // Insert: Create a new property if the account has fewer than 20
  16019. // properties. Web properties are visible in the Google Analytics
  16020. // interface only if they have at least one profile.
  16021. func (r *ManagementWebpropertiesService) Insert(accountId string, webproperty *Webproperty) *ManagementWebpropertiesInsertCall {
  16022. c := &ManagementWebpropertiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16023. c.accountId = accountId
  16024. c.webproperty = webproperty
  16025. return c
  16026. }
  16027. // Fields allows partial responses to be retrieved. See
  16028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16029. // for more information.
  16030. func (c *ManagementWebpropertiesInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesInsertCall {
  16031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16032. return c
  16033. }
  16034. // Context sets the context to be used in this call's Do method. Any
  16035. // pending HTTP request will be aborted if the provided context is
  16036. // canceled.
  16037. func (c *ManagementWebpropertiesInsertCall) Context(ctx context.Context) *ManagementWebpropertiesInsertCall {
  16038. c.ctx_ = ctx
  16039. return c
  16040. }
  16041. // Header returns an http.Header that can be modified by the caller to
  16042. // add HTTP headers to the request.
  16043. func (c *ManagementWebpropertiesInsertCall) Header() http.Header {
  16044. if c.header_ == nil {
  16045. c.header_ = make(http.Header)
  16046. }
  16047. return c.header_
  16048. }
  16049. func (c *ManagementWebpropertiesInsertCall) doRequest(alt string) (*http.Response, error) {
  16050. reqHeaders := make(http.Header)
  16051. for k, v := range c.header_ {
  16052. reqHeaders[k] = v
  16053. }
  16054. reqHeaders.Set("User-Agent", c.s.userAgent())
  16055. var body io.Reader = nil
  16056. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16057. if err != nil {
  16058. return nil, err
  16059. }
  16060. reqHeaders.Set("Content-Type", "application/json")
  16061. c.urlParams_.Set("alt", alt)
  16062. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  16063. urls += "?" + c.urlParams_.Encode()
  16064. req, _ := http.NewRequest("POST", urls, body)
  16065. req.Header = reqHeaders
  16066. googleapi.Expand(req.URL, map[string]string{
  16067. "accountId": c.accountId,
  16068. })
  16069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16070. }
  16071. // Do executes the "analytics.management.webproperties.insert" call.
  16072. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16073. // status code is an error. Response headers are in either
  16074. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16075. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16076. // to check whether the returned error was because
  16077. // http.StatusNotModified was returned.
  16078. func (c *ManagementWebpropertiesInsertCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16079. gensupport.SetOptions(c.urlParams_, opts...)
  16080. res, err := c.doRequest("json")
  16081. if res != nil && res.StatusCode == http.StatusNotModified {
  16082. if res.Body != nil {
  16083. res.Body.Close()
  16084. }
  16085. return nil, &googleapi.Error{
  16086. Code: res.StatusCode,
  16087. Header: res.Header,
  16088. }
  16089. }
  16090. if err != nil {
  16091. return nil, err
  16092. }
  16093. defer googleapi.CloseBody(res)
  16094. if err := googleapi.CheckResponse(res); err != nil {
  16095. return nil, err
  16096. }
  16097. ret := &Webproperty{
  16098. ServerResponse: googleapi.ServerResponse{
  16099. Header: res.Header,
  16100. HTTPStatusCode: res.StatusCode,
  16101. },
  16102. }
  16103. target := &ret
  16104. if err := gensupport.DecodeResponse(target, res); err != nil {
  16105. return nil, err
  16106. }
  16107. return ret, nil
  16108. // {
  16109. // "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.",
  16110. // "httpMethod": "POST",
  16111. // "id": "analytics.management.webproperties.insert",
  16112. // "parameterOrder": [
  16113. // "accountId"
  16114. // ],
  16115. // "parameters": {
  16116. // "accountId": {
  16117. // "description": "Account ID to create the web property for.",
  16118. // "location": "path",
  16119. // "required": true,
  16120. // "type": "string"
  16121. // }
  16122. // },
  16123. // "path": "management/accounts/{accountId}/webproperties",
  16124. // "request": {
  16125. // "$ref": "Webproperty"
  16126. // },
  16127. // "response": {
  16128. // "$ref": "Webproperty"
  16129. // },
  16130. // "scopes": [
  16131. // "https://www.googleapis.com/auth/analytics.edit"
  16132. // ]
  16133. // }
  16134. }
  16135. // method id "analytics.management.webproperties.list":
  16136. type ManagementWebpropertiesListCall struct {
  16137. s *Service
  16138. accountId string
  16139. urlParams_ gensupport.URLParams
  16140. ifNoneMatch_ string
  16141. ctx_ context.Context
  16142. header_ http.Header
  16143. }
  16144. // List: Lists web properties to which the user has access.
  16145. func (r *ManagementWebpropertiesService) List(accountId string) *ManagementWebpropertiesListCall {
  16146. c := &ManagementWebpropertiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16147. c.accountId = accountId
  16148. return c
  16149. }
  16150. // MaxResults sets the optional parameter "max-results": The maximum
  16151. // number of web properties to include in this response.
  16152. func (c *ManagementWebpropertiesListCall) MaxResults(maxResults int64) *ManagementWebpropertiesListCall {
  16153. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  16154. return c
  16155. }
  16156. // StartIndex sets the optional parameter "start-index": An index of the
  16157. // first entity to retrieve. Use this parameter as a pagination
  16158. // mechanism along with the max-results parameter.
  16159. func (c *ManagementWebpropertiesListCall) StartIndex(startIndex int64) *ManagementWebpropertiesListCall {
  16160. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  16161. return c
  16162. }
  16163. // Fields allows partial responses to be retrieved. See
  16164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16165. // for more information.
  16166. func (c *ManagementWebpropertiesListCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesListCall {
  16167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16168. return c
  16169. }
  16170. // IfNoneMatch sets the optional parameter which makes the operation
  16171. // fail if the object's ETag matches the given value. This is useful for
  16172. // getting updates only after the object has changed since the last
  16173. // request. Use googleapi.IsNotModified to check whether the response
  16174. // error from Do is the result of In-None-Match.
  16175. func (c *ManagementWebpropertiesListCall) IfNoneMatch(entityTag string) *ManagementWebpropertiesListCall {
  16176. c.ifNoneMatch_ = entityTag
  16177. return c
  16178. }
  16179. // Context sets the context to be used in this call's Do method. Any
  16180. // pending HTTP request will be aborted if the provided context is
  16181. // canceled.
  16182. func (c *ManagementWebpropertiesListCall) Context(ctx context.Context) *ManagementWebpropertiesListCall {
  16183. c.ctx_ = ctx
  16184. return c
  16185. }
  16186. // Header returns an http.Header that can be modified by the caller to
  16187. // add HTTP headers to the request.
  16188. func (c *ManagementWebpropertiesListCall) Header() http.Header {
  16189. if c.header_ == nil {
  16190. c.header_ = make(http.Header)
  16191. }
  16192. return c.header_
  16193. }
  16194. func (c *ManagementWebpropertiesListCall) doRequest(alt string) (*http.Response, error) {
  16195. reqHeaders := make(http.Header)
  16196. for k, v := range c.header_ {
  16197. reqHeaders[k] = v
  16198. }
  16199. reqHeaders.Set("User-Agent", c.s.userAgent())
  16200. if c.ifNoneMatch_ != "" {
  16201. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16202. }
  16203. var body io.Reader = nil
  16204. c.urlParams_.Set("alt", alt)
  16205. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties")
  16206. urls += "?" + c.urlParams_.Encode()
  16207. req, _ := http.NewRequest("GET", urls, body)
  16208. req.Header = reqHeaders
  16209. googleapi.Expand(req.URL, map[string]string{
  16210. "accountId": c.accountId,
  16211. })
  16212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16213. }
  16214. // Do executes the "analytics.management.webproperties.list" call.
  16215. // Exactly one of *Webproperties or error will be non-nil. Any non-2xx
  16216. // status code is an error. Response headers are in either
  16217. // *Webproperties.ServerResponse.Header or (if a response was returned
  16218. // at all) in error.(*googleapi.Error).Header. Use
  16219. // googleapi.IsNotModified to check whether the returned error was
  16220. // because http.StatusNotModified was returned.
  16221. func (c *ManagementWebpropertiesListCall) Do(opts ...googleapi.CallOption) (*Webproperties, error) {
  16222. gensupport.SetOptions(c.urlParams_, opts...)
  16223. res, err := c.doRequest("json")
  16224. if res != nil && res.StatusCode == http.StatusNotModified {
  16225. if res.Body != nil {
  16226. res.Body.Close()
  16227. }
  16228. return nil, &googleapi.Error{
  16229. Code: res.StatusCode,
  16230. Header: res.Header,
  16231. }
  16232. }
  16233. if err != nil {
  16234. return nil, err
  16235. }
  16236. defer googleapi.CloseBody(res)
  16237. if err := googleapi.CheckResponse(res); err != nil {
  16238. return nil, err
  16239. }
  16240. ret := &Webproperties{
  16241. ServerResponse: googleapi.ServerResponse{
  16242. Header: res.Header,
  16243. HTTPStatusCode: res.StatusCode,
  16244. },
  16245. }
  16246. target := &ret
  16247. if err := gensupport.DecodeResponse(target, res); err != nil {
  16248. return nil, err
  16249. }
  16250. return ret, nil
  16251. // {
  16252. // "description": "Lists web properties to which the user has access.",
  16253. // "httpMethod": "GET",
  16254. // "id": "analytics.management.webproperties.list",
  16255. // "parameterOrder": [
  16256. // "accountId"
  16257. // ],
  16258. // "parameters": {
  16259. // "accountId": {
  16260. // "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.",
  16261. // "location": "path",
  16262. // "required": true,
  16263. // "type": "string"
  16264. // },
  16265. // "max-results": {
  16266. // "description": "The maximum number of web properties to include in this response.",
  16267. // "format": "int32",
  16268. // "location": "query",
  16269. // "type": "integer"
  16270. // },
  16271. // "start-index": {
  16272. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  16273. // "format": "int32",
  16274. // "location": "query",
  16275. // "minimum": "1",
  16276. // "type": "integer"
  16277. // }
  16278. // },
  16279. // "path": "management/accounts/{accountId}/webproperties",
  16280. // "response": {
  16281. // "$ref": "Webproperties"
  16282. // },
  16283. // "scopes": [
  16284. // "https://www.googleapis.com/auth/analytics",
  16285. // "https://www.googleapis.com/auth/analytics.edit",
  16286. // "https://www.googleapis.com/auth/analytics.readonly"
  16287. // ]
  16288. // }
  16289. }
  16290. // method id "analytics.management.webproperties.patch":
  16291. type ManagementWebpropertiesPatchCall struct {
  16292. s *Service
  16293. accountId string
  16294. webPropertyId string
  16295. webproperty *Webproperty
  16296. urlParams_ gensupport.URLParams
  16297. ctx_ context.Context
  16298. header_ http.Header
  16299. }
  16300. // Patch: Updates an existing web property. This method supports patch
  16301. // semantics.
  16302. func (r *ManagementWebpropertiesService) Patch(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesPatchCall {
  16303. c := &ManagementWebpropertiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16304. c.accountId = accountId
  16305. c.webPropertyId = webPropertyId
  16306. c.webproperty = webproperty
  16307. return c
  16308. }
  16309. // Fields allows partial responses to be retrieved. See
  16310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16311. // for more information.
  16312. func (c *ManagementWebpropertiesPatchCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesPatchCall {
  16313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16314. return c
  16315. }
  16316. // Context sets the context to be used in this call's Do method. Any
  16317. // pending HTTP request will be aborted if the provided context is
  16318. // canceled.
  16319. func (c *ManagementWebpropertiesPatchCall) Context(ctx context.Context) *ManagementWebpropertiesPatchCall {
  16320. c.ctx_ = ctx
  16321. return c
  16322. }
  16323. // Header returns an http.Header that can be modified by the caller to
  16324. // add HTTP headers to the request.
  16325. func (c *ManagementWebpropertiesPatchCall) Header() http.Header {
  16326. if c.header_ == nil {
  16327. c.header_ = make(http.Header)
  16328. }
  16329. return c.header_
  16330. }
  16331. func (c *ManagementWebpropertiesPatchCall) doRequest(alt string) (*http.Response, error) {
  16332. reqHeaders := make(http.Header)
  16333. for k, v := range c.header_ {
  16334. reqHeaders[k] = v
  16335. }
  16336. reqHeaders.Set("User-Agent", c.s.userAgent())
  16337. var body io.Reader = nil
  16338. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16339. if err != nil {
  16340. return nil, err
  16341. }
  16342. reqHeaders.Set("Content-Type", "application/json")
  16343. c.urlParams_.Set("alt", alt)
  16344. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16345. urls += "?" + c.urlParams_.Encode()
  16346. req, _ := http.NewRequest("PATCH", urls, body)
  16347. req.Header = reqHeaders
  16348. googleapi.Expand(req.URL, map[string]string{
  16349. "accountId": c.accountId,
  16350. "webPropertyId": c.webPropertyId,
  16351. })
  16352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16353. }
  16354. // Do executes the "analytics.management.webproperties.patch" call.
  16355. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16356. // status code is an error. Response headers are in either
  16357. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16359. // to check whether the returned error was because
  16360. // http.StatusNotModified was returned.
  16361. func (c *ManagementWebpropertiesPatchCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16362. gensupport.SetOptions(c.urlParams_, opts...)
  16363. res, err := c.doRequest("json")
  16364. if res != nil && res.StatusCode == http.StatusNotModified {
  16365. if res.Body != nil {
  16366. res.Body.Close()
  16367. }
  16368. return nil, &googleapi.Error{
  16369. Code: res.StatusCode,
  16370. Header: res.Header,
  16371. }
  16372. }
  16373. if err != nil {
  16374. return nil, err
  16375. }
  16376. defer googleapi.CloseBody(res)
  16377. if err := googleapi.CheckResponse(res); err != nil {
  16378. return nil, err
  16379. }
  16380. ret := &Webproperty{
  16381. ServerResponse: googleapi.ServerResponse{
  16382. Header: res.Header,
  16383. HTTPStatusCode: res.StatusCode,
  16384. },
  16385. }
  16386. target := &ret
  16387. if err := gensupport.DecodeResponse(target, res); err != nil {
  16388. return nil, err
  16389. }
  16390. return ret, nil
  16391. // {
  16392. // "description": "Updates an existing web property. This method supports patch semantics.",
  16393. // "httpMethod": "PATCH",
  16394. // "id": "analytics.management.webproperties.patch",
  16395. // "parameterOrder": [
  16396. // "accountId",
  16397. // "webPropertyId"
  16398. // ],
  16399. // "parameters": {
  16400. // "accountId": {
  16401. // "description": "Account ID to which the web property belongs",
  16402. // "location": "path",
  16403. // "required": true,
  16404. // "type": "string"
  16405. // },
  16406. // "webPropertyId": {
  16407. // "description": "Web property ID",
  16408. // "location": "path",
  16409. // "required": true,
  16410. // "type": "string"
  16411. // }
  16412. // },
  16413. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  16414. // "request": {
  16415. // "$ref": "Webproperty"
  16416. // },
  16417. // "response": {
  16418. // "$ref": "Webproperty"
  16419. // },
  16420. // "scopes": [
  16421. // "https://www.googleapis.com/auth/analytics.edit"
  16422. // ]
  16423. // }
  16424. }
  16425. // method id "analytics.management.webproperties.update":
  16426. type ManagementWebpropertiesUpdateCall struct {
  16427. s *Service
  16428. accountId string
  16429. webPropertyId string
  16430. webproperty *Webproperty
  16431. urlParams_ gensupport.URLParams
  16432. ctx_ context.Context
  16433. header_ http.Header
  16434. }
  16435. // Update: Updates an existing web property.
  16436. func (r *ManagementWebpropertiesService) Update(accountId string, webPropertyId string, webproperty *Webproperty) *ManagementWebpropertiesUpdateCall {
  16437. c := &ManagementWebpropertiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16438. c.accountId = accountId
  16439. c.webPropertyId = webPropertyId
  16440. c.webproperty = webproperty
  16441. return c
  16442. }
  16443. // Fields allows partial responses to be retrieved. See
  16444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16445. // for more information.
  16446. func (c *ManagementWebpropertiesUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertiesUpdateCall {
  16447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16448. return c
  16449. }
  16450. // Context sets the context to be used in this call's Do method. Any
  16451. // pending HTTP request will be aborted if the provided context is
  16452. // canceled.
  16453. func (c *ManagementWebpropertiesUpdateCall) Context(ctx context.Context) *ManagementWebpropertiesUpdateCall {
  16454. c.ctx_ = ctx
  16455. return c
  16456. }
  16457. // Header returns an http.Header that can be modified by the caller to
  16458. // add HTTP headers to the request.
  16459. func (c *ManagementWebpropertiesUpdateCall) Header() http.Header {
  16460. if c.header_ == nil {
  16461. c.header_ = make(http.Header)
  16462. }
  16463. return c.header_
  16464. }
  16465. func (c *ManagementWebpropertiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16466. reqHeaders := make(http.Header)
  16467. for k, v := range c.header_ {
  16468. reqHeaders[k] = v
  16469. }
  16470. reqHeaders.Set("User-Agent", c.s.userAgent())
  16471. var body io.Reader = nil
  16472. body, err := googleapi.WithoutDataWrapper.JSONReader(c.webproperty)
  16473. if err != nil {
  16474. return nil, err
  16475. }
  16476. reqHeaders.Set("Content-Type", "application/json")
  16477. c.urlParams_.Set("alt", alt)
  16478. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}")
  16479. urls += "?" + c.urlParams_.Encode()
  16480. req, _ := http.NewRequest("PUT", urls, body)
  16481. req.Header = reqHeaders
  16482. googleapi.Expand(req.URL, map[string]string{
  16483. "accountId": c.accountId,
  16484. "webPropertyId": c.webPropertyId,
  16485. })
  16486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16487. }
  16488. // Do executes the "analytics.management.webproperties.update" call.
  16489. // Exactly one of *Webproperty or error will be non-nil. Any non-2xx
  16490. // status code is an error. Response headers are in either
  16491. // *Webproperty.ServerResponse.Header or (if a response was returned at
  16492. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16493. // to check whether the returned error was because
  16494. // http.StatusNotModified was returned.
  16495. func (c *ManagementWebpropertiesUpdateCall) Do(opts ...googleapi.CallOption) (*Webproperty, error) {
  16496. gensupport.SetOptions(c.urlParams_, opts...)
  16497. res, err := c.doRequest("json")
  16498. if res != nil && res.StatusCode == http.StatusNotModified {
  16499. if res.Body != nil {
  16500. res.Body.Close()
  16501. }
  16502. return nil, &googleapi.Error{
  16503. Code: res.StatusCode,
  16504. Header: res.Header,
  16505. }
  16506. }
  16507. if err != nil {
  16508. return nil, err
  16509. }
  16510. defer googleapi.CloseBody(res)
  16511. if err := googleapi.CheckResponse(res); err != nil {
  16512. return nil, err
  16513. }
  16514. ret := &Webproperty{
  16515. ServerResponse: googleapi.ServerResponse{
  16516. Header: res.Header,
  16517. HTTPStatusCode: res.StatusCode,
  16518. },
  16519. }
  16520. target := &ret
  16521. if err := gensupport.DecodeResponse(target, res); err != nil {
  16522. return nil, err
  16523. }
  16524. return ret, nil
  16525. // {
  16526. // "description": "Updates an existing web property.",
  16527. // "httpMethod": "PUT",
  16528. // "id": "analytics.management.webproperties.update",
  16529. // "parameterOrder": [
  16530. // "accountId",
  16531. // "webPropertyId"
  16532. // ],
  16533. // "parameters": {
  16534. // "accountId": {
  16535. // "description": "Account ID to which the web property belongs",
  16536. // "location": "path",
  16537. // "required": true,
  16538. // "type": "string"
  16539. // },
  16540. // "webPropertyId": {
  16541. // "description": "Web property ID",
  16542. // "location": "path",
  16543. // "required": true,
  16544. // "type": "string"
  16545. // }
  16546. // },
  16547. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}",
  16548. // "request": {
  16549. // "$ref": "Webproperty"
  16550. // },
  16551. // "response": {
  16552. // "$ref": "Webproperty"
  16553. // },
  16554. // "scopes": [
  16555. // "https://www.googleapis.com/auth/analytics.edit"
  16556. // ]
  16557. // }
  16558. }
  16559. // method id "analytics.management.webpropertyUserLinks.delete":
  16560. type ManagementWebpropertyUserLinksDeleteCall struct {
  16561. s *Service
  16562. accountId string
  16563. webPropertyId string
  16564. linkId string
  16565. urlParams_ gensupport.URLParams
  16566. ctx_ context.Context
  16567. header_ http.Header
  16568. }
  16569. // Delete: Removes a user from the given web property.
  16570. func (r *ManagementWebpropertyUserLinksService) Delete(accountId string, webPropertyId string, linkId string) *ManagementWebpropertyUserLinksDeleteCall {
  16571. c := &ManagementWebpropertyUserLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16572. c.accountId = accountId
  16573. c.webPropertyId = webPropertyId
  16574. c.linkId = linkId
  16575. return c
  16576. }
  16577. // Fields allows partial responses to be retrieved. See
  16578. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16579. // for more information.
  16580. func (c *ManagementWebpropertyUserLinksDeleteCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksDeleteCall {
  16581. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16582. return c
  16583. }
  16584. // Context sets the context to be used in this call's Do method. Any
  16585. // pending HTTP request will be aborted if the provided context is
  16586. // canceled.
  16587. func (c *ManagementWebpropertyUserLinksDeleteCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksDeleteCall {
  16588. c.ctx_ = ctx
  16589. return c
  16590. }
  16591. // Header returns an http.Header that can be modified by the caller to
  16592. // add HTTP headers to the request.
  16593. func (c *ManagementWebpropertyUserLinksDeleteCall) Header() http.Header {
  16594. if c.header_ == nil {
  16595. c.header_ = make(http.Header)
  16596. }
  16597. return c.header_
  16598. }
  16599. func (c *ManagementWebpropertyUserLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
  16600. reqHeaders := make(http.Header)
  16601. for k, v := range c.header_ {
  16602. reqHeaders[k] = v
  16603. }
  16604. reqHeaders.Set("User-Agent", c.s.userAgent())
  16605. var body io.Reader = nil
  16606. c.urlParams_.Set("alt", alt)
  16607. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  16608. urls += "?" + c.urlParams_.Encode()
  16609. req, _ := http.NewRequest("DELETE", urls, body)
  16610. req.Header = reqHeaders
  16611. googleapi.Expand(req.URL, map[string]string{
  16612. "accountId": c.accountId,
  16613. "webPropertyId": c.webPropertyId,
  16614. "linkId": c.linkId,
  16615. })
  16616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16617. }
  16618. // Do executes the "analytics.management.webpropertyUserLinks.delete" call.
  16619. func (c *ManagementWebpropertyUserLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
  16620. gensupport.SetOptions(c.urlParams_, opts...)
  16621. res, err := c.doRequest("json")
  16622. if err != nil {
  16623. return err
  16624. }
  16625. defer googleapi.CloseBody(res)
  16626. if err := googleapi.CheckResponse(res); err != nil {
  16627. return err
  16628. }
  16629. return nil
  16630. // {
  16631. // "description": "Removes a user from the given web property.",
  16632. // "httpMethod": "DELETE",
  16633. // "id": "analytics.management.webpropertyUserLinks.delete",
  16634. // "parameterOrder": [
  16635. // "accountId",
  16636. // "webPropertyId",
  16637. // "linkId"
  16638. // ],
  16639. // "parameters": {
  16640. // "accountId": {
  16641. // "description": "Account ID to delete the user link for.",
  16642. // "location": "path",
  16643. // "required": true,
  16644. // "type": "string"
  16645. // },
  16646. // "linkId": {
  16647. // "description": "Link ID to delete the user link for.",
  16648. // "location": "path",
  16649. // "required": true,
  16650. // "type": "string"
  16651. // },
  16652. // "webPropertyId": {
  16653. // "description": "Web Property ID to delete the user link for.",
  16654. // "location": "path",
  16655. // "required": true,
  16656. // "type": "string"
  16657. // }
  16658. // },
  16659. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  16660. // "scopes": [
  16661. // "https://www.googleapis.com/auth/analytics.manage.users"
  16662. // ]
  16663. // }
  16664. }
  16665. // method id "analytics.management.webpropertyUserLinks.insert":
  16666. type ManagementWebpropertyUserLinksInsertCall struct {
  16667. s *Service
  16668. accountId string
  16669. webPropertyId string
  16670. entityuserlink *EntityUserLink
  16671. urlParams_ gensupport.URLParams
  16672. ctx_ context.Context
  16673. header_ http.Header
  16674. }
  16675. // Insert: Adds a new user to the given web property.
  16676. func (r *ManagementWebpropertyUserLinksService) Insert(accountId string, webPropertyId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksInsertCall {
  16677. c := &ManagementWebpropertyUserLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16678. c.accountId = accountId
  16679. c.webPropertyId = webPropertyId
  16680. c.entityuserlink = entityuserlink
  16681. return c
  16682. }
  16683. // Fields allows partial responses to be retrieved. See
  16684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16685. // for more information.
  16686. func (c *ManagementWebpropertyUserLinksInsertCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksInsertCall {
  16687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16688. return c
  16689. }
  16690. // Context sets the context to be used in this call's Do method. Any
  16691. // pending HTTP request will be aborted if the provided context is
  16692. // canceled.
  16693. func (c *ManagementWebpropertyUserLinksInsertCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksInsertCall {
  16694. c.ctx_ = ctx
  16695. return c
  16696. }
  16697. // Header returns an http.Header that can be modified by the caller to
  16698. // add HTTP headers to the request.
  16699. func (c *ManagementWebpropertyUserLinksInsertCall) Header() http.Header {
  16700. if c.header_ == nil {
  16701. c.header_ = make(http.Header)
  16702. }
  16703. return c.header_
  16704. }
  16705. func (c *ManagementWebpropertyUserLinksInsertCall) doRequest(alt string) (*http.Response, error) {
  16706. reqHeaders := make(http.Header)
  16707. for k, v := range c.header_ {
  16708. reqHeaders[k] = v
  16709. }
  16710. reqHeaders.Set("User-Agent", c.s.userAgent())
  16711. var body io.Reader = nil
  16712. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  16713. if err != nil {
  16714. return nil, err
  16715. }
  16716. reqHeaders.Set("Content-Type", "application/json")
  16717. c.urlParams_.Set("alt", alt)
  16718. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  16719. urls += "?" + c.urlParams_.Encode()
  16720. req, _ := http.NewRequest("POST", urls, body)
  16721. req.Header = reqHeaders
  16722. googleapi.Expand(req.URL, map[string]string{
  16723. "accountId": c.accountId,
  16724. "webPropertyId": c.webPropertyId,
  16725. })
  16726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16727. }
  16728. // Do executes the "analytics.management.webpropertyUserLinks.insert" call.
  16729. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  16730. // status code is an error. Response headers are in either
  16731. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  16732. // at all) in error.(*googleapi.Error).Header. Use
  16733. // googleapi.IsNotModified to check whether the returned error was
  16734. // because http.StatusNotModified was returned.
  16735. func (c *ManagementWebpropertyUserLinksInsertCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  16736. gensupport.SetOptions(c.urlParams_, opts...)
  16737. res, err := c.doRequest("json")
  16738. if res != nil && res.StatusCode == http.StatusNotModified {
  16739. if res.Body != nil {
  16740. res.Body.Close()
  16741. }
  16742. return nil, &googleapi.Error{
  16743. Code: res.StatusCode,
  16744. Header: res.Header,
  16745. }
  16746. }
  16747. if err != nil {
  16748. return nil, err
  16749. }
  16750. defer googleapi.CloseBody(res)
  16751. if err := googleapi.CheckResponse(res); err != nil {
  16752. return nil, err
  16753. }
  16754. ret := &EntityUserLink{
  16755. ServerResponse: googleapi.ServerResponse{
  16756. Header: res.Header,
  16757. HTTPStatusCode: res.StatusCode,
  16758. },
  16759. }
  16760. target := &ret
  16761. if err := gensupport.DecodeResponse(target, res); err != nil {
  16762. return nil, err
  16763. }
  16764. return ret, nil
  16765. // {
  16766. // "description": "Adds a new user to the given web property.",
  16767. // "httpMethod": "POST",
  16768. // "id": "analytics.management.webpropertyUserLinks.insert",
  16769. // "parameterOrder": [
  16770. // "accountId",
  16771. // "webPropertyId"
  16772. // ],
  16773. // "parameters": {
  16774. // "accountId": {
  16775. // "description": "Account ID to create the user link for.",
  16776. // "location": "path",
  16777. // "required": true,
  16778. // "type": "string"
  16779. // },
  16780. // "webPropertyId": {
  16781. // "description": "Web Property ID to create the user link for.",
  16782. // "location": "path",
  16783. // "required": true,
  16784. // "type": "string"
  16785. // }
  16786. // },
  16787. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  16788. // "request": {
  16789. // "$ref": "EntityUserLink"
  16790. // },
  16791. // "response": {
  16792. // "$ref": "EntityUserLink"
  16793. // },
  16794. // "scopes": [
  16795. // "https://www.googleapis.com/auth/analytics.manage.users"
  16796. // ]
  16797. // }
  16798. }
  16799. // method id "analytics.management.webpropertyUserLinks.list":
  16800. type ManagementWebpropertyUserLinksListCall struct {
  16801. s *Service
  16802. accountId string
  16803. webPropertyId string
  16804. urlParams_ gensupport.URLParams
  16805. ifNoneMatch_ string
  16806. ctx_ context.Context
  16807. header_ http.Header
  16808. }
  16809. // List: Lists webProperty-user links for a given web property.
  16810. func (r *ManagementWebpropertyUserLinksService) List(accountId string, webPropertyId string) *ManagementWebpropertyUserLinksListCall {
  16811. c := &ManagementWebpropertyUserLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16812. c.accountId = accountId
  16813. c.webPropertyId = webPropertyId
  16814. return c
  16815. }
  16816. // MaxResults sets the optional parameter "max-results": The maximum
  16817. // number of webProperty-user Links to include in this response.
  16818. func (c *ManagementWebpropertyUserLinksListCall) MaxResults(maxResults int64) *ManagementWebpropertyUserLinksListCall {
  16819. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  16820. return c
  16821. }
  16822. // StartIndex sets the optional parameter "start-index": An index of the
  16823. // first webProperty-user link to retrieve. Use this parameter as a
  16824. // pagination mechanism along with the max-results parameter.
  16825. func (c *ManagementWebpropertyUserLinksListCall) StartIndex(startIndex int64) *ManagementWebpropertyUserLinksListCall {
  16826. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  16827. return c
  16828. }
  16829. // Fields allows partial responses to be retrieved. See
  16830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16831. // for more information.
  16832. func (c *ManagementWebpropertyUserLinksListCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksListCall {
  16833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16834. return c
  16835. }
  16836. // IfNoneMatch sets the optional parameter which makes the operation
  16837. // fail if the object's ETag matches the given value. This is useful for
  16838. // getting updates only after the object has changed since the last
  16839. // request. Use googleapi.IsNotModified to check whether the response
  16840. // error from Do is the result of In-None-Match.
  16841. func (c *ManagementWebpropertyUserLinksListCall) IfNoneMatch(entityTag string) *ManagementWebpropertyUserLinksListCall {
  16842. c.ifNoneMatch_ = entityTag
  16843. return c
  16844. }
  16845. // Context sets the context to be used in this call's Do method. Any
  16846. // pending HTTP request will be aborted if the provided context is
  16847. // canceled.
  16848. func (c *ManagementWebpropertyUserLinksListCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksListCall {
  16849. c.ctx_ = ctx
  16850. return c
  16851. }
  16852. // Header returns an http.Header that can be modified by the caller to
  16853. // add HTTP headers to the request.
  16854. func (c *ManagementWebpropertyUserLinksListCall) Header() http.Header {
  16855. if c.header_ == nil {
  16856. c.header_ = make(http.Header)
  16857. }
  16858. return c.header_
  16859. }
  16860. func (c *ManagementWebpropertyUserLinksListCall) doRequest(alt string) (*http.Response, error) {
  16861. reqHeaders := make(http.Header)
  16862. for k, v := range c.header_ {
  16863. reqHeaders[k] = v
  16864. }
  16865. reqHeaders.Set("User-Agent", c.s.userAgent())
  16866. if c.ifNoneMatch_ != "" {
  16867. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16868. }
  16869. var body io.Reader = nil
  16870. c.urlParams_.Set("alt", alt)
  16871. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks")
  16872. urls += "?" + c.urlParams_.Encode()
  16873. req, _ := http.NewRequest("GET", urls, body)
  16874. req.Header = reqHeaders
  16875. googleapi.Expand(req.URL, map[string]string{
  16876. "accountId": c.accountId,
  16877. "webPropertyId": c.webPropertyId,
  16878. })
  16879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16880. }
  16881. // Do executes the "analytics.management.webpropertyUserLinks.list" call.
  16882. // Exactly one of *EntityUserLinks or error will be non-nil. Any non-2xx
  16883. // status code is an error. Response headers are in either
  16884. // *EntityUserLinks.ServerResponse.Header or (if a response was returned
  16885. // at all) in error.(*googleapi.Error).Header. Use
  16886. // googleapi.IsNotModified to check whether the returned error was
  16887. // because http.StatusNotModified was returned.
  16888. func (c *ManagementWebpropertyUserLinksListCall) Do(opts ...googleapi.CallOption) (*EntityUserLinks, error) {
  16889. gensupport.SetOptions(c.urlParams_, opts...)
  16890. res, err := c.doRequest("json")
  16891. if res != nil && res.StatusCode == http.StatusNotModified {
  16892. if res.Body != nil {
  16893. res.Body.Close()
  16894. }
  16895. return nil, &googleapi.Error{
  16896. Code: res.StatusCode,
  16897. Header: res.Header,
  16898. }
  16899. }
  16900. if err != nil {
  16901. return nil, err
  16902. }
  16903. defer googleapi.CloseBody(res)
  16904. if err := googleapi.CheckResponse(res); err != nil {
  16905. return nil, err
  16906. }
  16907. ret := &EntityUserLinks{
  16908. ServerResponse: googleapi.ServerResponse{
  16909. Header: res.Header,
  16910. HTTPStatusCode: res.StatusCode,
  16911. },
  16912. }
  16913. target := &ret
  16914. if err := gensupport.DecodeResponse(target, res); err != nil {
  16915. return nil, err
  16916. }
  16917. return ret, nil
  16918. // {
  16919. // "description": "Lists webProperty-user links for a given web property.",
  16920. // "httpMethod": "GET",
  16921. // "id": "analytics.management.webpropertyUserLinks.list",
  16922. // "parameterOrder": [
  16923. // "accountId",
  16924. // "webPropertyId"
  16925. // ],
  16926. // "parameters": {
  16927. // "accountId": {
  16928. // "description": "Account ID which the given web property belongs to.",
  16929. // "location": "path",
  16930. // "required": true,
  16931. // "type": "string"
  16932. // },
  16933. // "max-results": {
  16934. // "description": "The maximum number of webProperty-user Links to include in this response.",
  16935. // "format": "int32",
  16936. // "location": "query",
  16937. // "type": "integer"
  16938. // },
  16939. // "start-index": {
  16940. // "description": "An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
  16941. // "format": "int32",
  16942. // "location": "query",
  16943. // "minimum": "1",
  16944. // "type": "integer"
  16945. // },
  16946. // "webPropertyId": {
  16947. // "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.",
  16948. // "location": "path",
  16949. // "required": true,
  16950. // "type": "string"
  16951. // }
  16952. // },
  16953. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks",
  16954. // "response": {
  16955. // "$ref": "EntityUserLinks"
  16956. // },
  16957. // "scopes": [
  16958. // "https://www.googleapis.com/auth/analytics.manage.users",
  16959. // "https://www.googleapis.com/auth/analytics.manage.users.readonly"
  16960. // ]
  16961. // }
  16962. }
  16963. // method id "analytics.management.webpropertyUserLinks.update":
  16964. type ManagementWebpropertyUserLinksUpdateCall struct {
  16965. s *Service
  16966. accountId string
  16967. webPropertyId string
  16968. linkId string
  16969. entityuserlink *EntityUserLink
  16970. urlParams_ gensupport.URLParams
  16971. ctx_ context.Context
  16972. header_ http.Header
  16973. }
  16974. // Update: Updates permissions for an existing user on the given web
  16975. // property.
  16976. func (r *ManagementWebpropertyUserLinksService) Update(accountId string, webPropertyId string, linkId string, entityuserlink *EntityUserLink) *ManagementWebpropertyUserLinksUpdateCall {
  16977. c := &ManagementWebpropertyUserLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16978. c.accountId = accountId
  16979. c.webPropertyId = webPropertyId
  16980. c.linkId = linkId
  16981. c.entityuserlink = entityuserlink
  16982. return c
  16983. }
  16984. // Fields allows partial responses to be retrieved. See
  16985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16986. // for more information.
  16987. func (c *ManagementWebpropertyUserLinksUpdateCall) Fields(s ...googleapi.Field) *ManagementWebpropertyUserLinksUpdateCall {
  16988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16989. return c
  16990. }
  16991. // Context sets the context to be used in this call's Do method. Any
  16992. // pending HTTP request will be aborted if the provided context is
  16993. // canceled.
  16994. func (c *ManagementWebpropertyUserLinksUpdateCall) Context(ctx context.Context) *ManagementWebpropertyUserLinksUpdateCall {
  16995. c.ctx_ = ctx
  16996. return c
  16997. }
  16998. // Header returns an http.Header that can be modified by the caller to
  16999. // add HTTP headers to the request.
  17000. func (c *ManagementWebpropertyUserLinksUpdateCall) Header() http.Header {
  17001. if c.header_ == nil {
  17002. c.header_ = make(http.Header)
  17003. }
  17004. return c.header_
  17005. }
  17006. func (c *ManagementWebpropertyUserLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
  17007. reqHeaders := make(http.Header)
  17008. for k, v := range c.header_ {
  17009. reqHeaders[k] = v
  17010. }
  17011. reqHeaders.Set("User-Agent", c.s.userAgent())
  17012. var body io.Reader = nil
  17013. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entityuserlink)
  17014. if err != nil {
  17015. return nil, err
  17016. }
  17017. reqHeaders.Set("Content-Type", "application/json")
  17018. c.urlParams_.Set("alt", alt)
  17019. urls := googleapi.ResolveRelative(c.s.BasePath, "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}")
  17020. urls += "?" + c.urlParams_.Encode()
  17021. req, _ := http.NewRequest("PUT", urls, body)
  17022. req.Header = reqHeaders
  17023. googleapi.Expand(req.URL, map[string]string{
  17024. "accountId": c.accountId,
  17025. "webPropertyId": c.webPropertyId,
  17026. "linkId": c.linkId,
  17027. })
  17028. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17029. }
  17030. // Do executes the "analytics.management.webpropertyUserLinks.update" call.
  17031. // Exactly one of *EntityUserLink or error will be non-nil. Any non-2xx
  17032. // status code is an error. Response headers are in either
  17033. // *EntityUserLink.ServerResponse.Header or (if a response was returned
  17034. // at all) in error.(*googleapi.Error).Header. Use
  17035. // googleapi.IsNotModified to check whether the returned error was
  17036. // because http.StatusNotModified was returned.
  17037. func (c *ManagementWebpropertyUserLinksUpdateCall) Do(opts ...googleapi.CallOption) (*EntityUserLink, error) {
  17038. gensupport.SetOptions(c.urlParams_, opts...)
  17039. res, err := c.doRequest("json")
  17040. if res != nil && res.StatusCode == http.StatusNotModified {
  17041. if res.Body != nil {
  17042. res.Body.Close()
  17043. }
  17044. return nil, &googleapi.Error{
  17045. Code: res.StatusCode,
  17046. Header: res.Header,
  17047. }
  17048. }
  17049. if err != nil {
  17050. return nil, err
  17051. }
  17052. defer googleapi.CloseBody(res)
  17053. if err := googleapi.CheckResponse(res); err != nil {
  17054. return nil, err
  17055. }
  17056. ret := &EntityUserLink{
  17057. ServerResponse: googleapi.ServerResponse{
  17058. Header: res.Header,
  17059. HTTPStatusCode: res.StatusCode,
  17060. },
  17061. }
  17062. target := &ret
  17063. if err := gensupport.DecodeResponse(target, res); err != nil {
  17064. return nil, err
  17065. }
  17066. return ret, nil
  17067. // {
  17068. // "description": "Updates permissions for an existing user on the given web property.",
  17069. // "httpMethod": "PUT",
  17070. // "id": "analytics.management.webpropertyUserLinks.update",
  17071. // "parameterOrder": [
  17072. // "accountId",
  17073. // "webPropertyId",
  17074. // "linkId"
  17075. // ],
  17076. // "parameters": {
  17077. // "accountId": {
  17078. // "description": "Account ID to update the account-user link for.",
  17079. // "location": "path",
  17080. // "required": true,
  17081. // "type": "string"
  17082. // },
  17083. // "linkId": {
  17084. // "description": "Link ID to update the account-user link for.",
  17085. // "location": "path",
  17086. // "required": true,
  17087. // "type": "string"
  17088. // },
  17089. // "webPropertyId": {
  17090. // "description": "Web property ID to update the account-user link for.",
  17091. // "location": "path",
  17092. // "required": true,
  17093. // "type": "string"
  17094. // }
  17095. // },
  17096. // "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}",
  17097. // "request": {
  17098. // "$ref": "EntityUserLink"
  17099. // },
  17100. // "response": {
  17101. // "$ref": "EntityUserLink"
  17102. // },
  17103. // "scopes": [
  17104. // "https://www.googleapis.com/auth/analytics.manage.users"
  17105. // ]
  17106. // }
  17107. }
  17108. // method id "analytics.metadata.columns.list":
  17109. type MetadataColumnsListCall struct {
  17110. s *Service
  17111. reportType string
  17112. urlParams_ gensupport.URLParams
  17113. ifNoneMatch_ string
  17114. ctx_ context.Context
  17115. header_ http.Header
  17116. }
  17117. // List: Lists all columns for a report type
  17118. func (r *MetadataColumnsService) List(reportType string) *MetadataColumnsListCall {
  17119. c := &MetadataColumnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17120. c.reportType = reportType
  17121. return c
  17122. }
  17123. // Fields allows partial responses to be retrieved. See
  17124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17125. // for more information.
  17126. func (c *MetadataColumnsListCall) Fields(s ...googleapi.Field) *MetadataColumnsListCall {
  17127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17128. return c
  17129. }
  17130. // IfNoneMatch sets the optional parameter which makes the operation
  17131. // fail if the object's ETag matches the given value. This is useful for
  17132. // getting updates only after the object has changed since the last
  17133. // request. Use googleapi.IsNotModified to check whether the response
  17134. // error from Do is the result of In-None-Match.
  17135. func (c *MetadataColumnsListCall) IfNoneMatch(entityTag string) *MetadataColumnsListCall {
  17136. c.ifNoneMatch_ = entityTag
  17137. return c
  17138. }
  17139. // Context sets the context to be used in this call's Do method. Any
  17140. // pending HTTP request will be aborted if the provided context is
  17141. // canceled.
  17142. func (c *MetadataColumnsListCall) Context(ctx context.Context) *MetadataColumnsListCall {
  17143. c.ctx_ = ctx
  17144. return c
  17145. }
  17146. // Header returns an http.Header that can be modified by the caller to
  17147. // add HTTP headers to the request.
  17148. func (c *MetadataColumnsListCall) Header() http.Header {
  17149. if c.header_ == nil {
  17150. c.header_ = make(http.Header)
  17151. }
  17152. return c.header_
  17153. }
  17154. func (c *MetadataColumnsListCall) doRequest(alt string) (*http.Response, error) {
  17155. reqHeaders := make(http.Header)
  17156. for k, v := range c.header_ {
  17157. reqHeaders[k] = v
  17158. }
  17159. reqHeaders.Set("User-Agent", c.s.userAgent())
  17160. if c.ifNoneMatch_ != "" {
  17161. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17162. }
  17163. var body io.Reader = nil
  17164. c.urlParams_.Set("alt", alt)
  17165. urls := googleapi.ResolveRelative(c.s.BasePath, "metadata/{reportType}/columns")
  17166. urls += "?" + c.urlParams_.Encode()
  17167. req, _ := http.NewRequest("GET", urls, body)
  17168. req.Header = reqHeaders
  17169. googleapi.Expand(req.URL, map[string]string{
  17170. "reportType": c.reportType,
  17171. })
  17172. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17173. }
  17174. // Do executes the "analytics.metadata.columns.list" call.
  17175. // Exactly one of *Columns or error will be non-nil. Any non-2xx status
  17176. // code is an error. Response headers are in either
  17177. // *Columns.ServerResponse.Header or (if a response was returned at all)
  17178. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  17179. // check whether the returned error was because http.StatusNotModified
  17180. // was returned.
  17181. func (c *MetadataColumnsListCall) Do(opts ...googleapi.CallOption) (*Columns, error) {
  17182. gensupport.SetOptions(c.urlParams_, opts...)
  17183. res, err := c.doRequest("json")
  17184. if res != nil && res.StatusCode == http.StatusNotModified {
  17185. if res.Body != nil {
  17186. res.Body.Close()
  17187. }
  17188. return nil, &googleapi.Error{
  17189. Code: res.StatusCode,
  17190. Header: res.Header,
  17191. }
  17192. }
  17193. if err != nil {
  17194. return nil, err
  17195. }
  17196. defer googleapi.CloseBody(res)
  17197. if err := googleapi.CheckResponse(res); err != nil {
  17198. return nil, err
  17199. }
  17200. ret := &Columns{
  17201. ServerResponse: googleapi.ServerResponse{
  17202. Header: res.Header,
  17203. HTTPStatusCode: res.StatusCode,
  17204. },
  17205. }
  17206. target := &ret
  17207. if err := gensupport.DecodeResponse(target, res); err != nil {
  17208. return nil, err
  17209. }
  17210. return ret, nil
  17211. // {
  17212. // "description": "Lists all columns for a report type",
  17213. // "httpMethod": "GET",
  17214. // "id": "analytics.metadata.columns.list",
  17215. // "parameterOrder": [
  17216. // "reportType"
  17217. // ],
  17218. // "parameters": {
  17219. // "reportType": {
  17220. // "description": "Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API",
  17221. // "location": "path",
  17222. // "pattern": "ga",
  17223. // "required": true,
  17224. // "type": "string"
  17225. // }
  17226. // },
  17227. // "path": "metadata/{reportType}/columns",
  17228. // "response": {
  17229. // "$ref": "Columns"
  17230. // },
  17231. // "scopes": [
  17232. // "https://www.googleapis.com/auth/analytics",
  17233. // "https://www.googleapis.com/auth/analytics.edit",
  17234. // "https://www.googleapis.com/auth/analytics.readonly"
  17235. // ]
  17236. // }
  17237. }
  17238. // method id "analytics.provisioning.createAccountTicket":
  17239. type ProvisioningCreateAccountTicketCall struct {
  17240. s *Service
  17241. accountticket *AccountTicket
  17242. urlParams_ gensupport.URLParams
  17243. ctx_ context.Context
  17244. header_ http.Header
  17245. }
  17246. // CreateAccountTicket: Creates an account ticket.
  17247. func (r *ProvisioningService) CreateAccountTicket(accountticket *AccountTicket) *ProvisioningCreateAccountTicketCall {
  17248. c := &ProvisioningCreateAccountTicketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17249. c.accountticket = accountticket
  17250. return c
  17251. }
  17252. // Fields allows partial responses to be retrieved. See
  17253. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17254. // for more information.
  17255. func (c *ProvisioningCreateAccountTicketCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTicketCall {
  17256. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17257. return c
  17258. }
  17259. // Context sets the context to be used in this call's Do method. Any
  17260. // pending HTTP request will be aborted if the provided context is
  17261. // canceled.
  17262. func (c *ProvisioningCreateAccountTicketCall) Context(ctx context.Context) *ProvisioningCreateAccountTicketCall {
  17263. c.ctx_ = ctx
  17264. return c
  17265. }
  17266. // Header returns an http.Header that can be modified by the caller to
  17267. // add HTTP headers to the request.
  17268. func (c *ProvisioningCreateAccountTicketCall) Header() http.Header {
  17269. if c.header_ == nil {
  17270. c.header_ = make(http.Header)
  17271. }
  17272. return c.header_
  17273. }
  17274. func (c *ProvisioningCreateAccountTicketCall) doRequest(alt string) (*http.Response, error) {
  17275. reqHeaders := make(http.Header)
  17276. for k, v := range c.header_ {
  17277. reqHeaders[k] = v
  17278. }
  17279. reqHeaders.Set("User-Agent", c.s.userAgent())
  17280. var body io.Reader = nil
  17281. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountticket)
  17282. if err != nil {
  17283. return nil, err
  17284. }
  17285. reqHeaders.Set("Content-Type", "application/json")
  17286. c.urlParams_.Set("alt", alt)
  17287. urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTicket")
  17288. urls += "?" + c.urlParams_.Encode()
  17289. req, _ := http.NewRequest("POST", urls, body)
  17290. req.Header = reqHeaders
  17291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17292. }
  17293. // Do executes the "analytics.provisioning.createAccountTicket" call.
  17294. // Exactly one of *AccountTicket or error will be non-nil. Any non-2xx
  17295. // status code is an error. Response headers are in either
  17296. // *AccountTicket.ServerResponse.Header or (if a response was returned
  17297. // at all) in error.(*googleapi.Error).Header. Use
  17298. // googleapi.IsNotModified to check whether the returned error was
  17299. // because http.StatusNotModified was returned.
  17300. func (c *ProvisioningCreateAccountTicketCall) Do(opts ...googleapi.CallOption) (*AccountTicket, error) {
  17301. gensupport.SetOptions(c.urlParams_, opts...)
  17302. res, err := c.doRequest("json")
  17303. if res != nil && res.StatusCode == http.StatusNotModified {
  17304. if res.Body != nil {
  17305. res.Body.Close()
  17306. }
  17307. return nil, &googleapi.Error{
  17308. Code: res.StatusCode,
  17309. Header: res.Header,
  17310. }
  17311. }
  17312. if err != nil {
  17313. return nil, err
  17314. }
  17315. defer googleapi.CloseBody(res)
  17316. if err := googleapi.CheckResponse(res); err != nil {
  17317. return nil, err
  17318. }
  17319. ret := &AccountTicket{
  17320. ServerResponse: googleapi.ServerResponse{
  17321. Header: res.Header,
  17322. HTTPStatusCode: res.StatusCode,
  17323. },
  17324. }
  17325. target := &ret
  17326. if err := gensupport.DecodeResponse(target, res); err != nil {
  17327. return nil, err
  17328. }
  17329. return ret, nil
  17330. // {
  17331. // "description": "Creates an account ticket.",
  17332. // "httpMethod": "POST",
  17333. // "id": "analytics.provisioning.createAccountTicket",
  17334. // "path": "provisioning/createAccountTicket",
  17335. // "request": {
  17336. // "$ref": "AccountTicket"
  17337. // },
  17338. // "response": {
  17339. // "$ref": "AccountTicket"
  17340. // },
  17341. // "scopes": [
  17342. // "https://www.googleapis.com/auth/analytics.provision"
  17343. // ]
  17344. // }
  17345. }
  17346. // method id "analytics.provisioning.createAccountTree":
  17347. type ProvisioningCreateAccountTreeCall struct {
  17348. s *Service
  17349. accounttreerequest *AccountTreeRequest
  17350. urlParams_ gensupport.URLParams
  17351. ctx_ context.Context
  17352. header_ http.Header
  17353. }
  17354. // CreateAccountTree: Provision account.
  17355. func (r *ProvisioningService) CreateAccountTree(accounttreerequest *AccountTreeRequest) *ProvisioningCreateAccountTreeCall {
  17356. c := &ProvisioningCreateAccountTreeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17357. c.accounttreerequest = accounttreerequest
  17358. return c
  17359. }
  17360. // Fields allows partial responses to be retrieved. See
  17361. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17362. // for more information.
  17363. func (c *ProvisioningCreateAccountTreeCall) Fields(s ...googleapi.Field) *ProvisioningCreateAccountTreeCall {
  17364. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17365. return c
  17366. }
  17367. // Context sets the context to be used in this call's Do method. Any
  17368. // pending HTTP request will be aborted if the provided context is
  17369. // canceled.
  17370. func (c *ProvisioningCreateAccountTreeCall) Context(ctx context.Context) *ProvisioningCreateAccountTreeCall {
  17371. c.ctx_ = ctx
  17372. return c
  17373. }
  17374. // Header returns an http.Header that can be modified by the caller to
  17375. // add HTTP headers to the request.
  17376. func (c *ProvisioningCreateAccountTreeCall) Header() http.Header {
  17377. if c.header_ == nil {
  17378. c.header_ = make(http.Header)
  17379. }
  17380. return c.header_
  17381. }
  17382. func (c *ProvisioningCreateAccountTreeCall) doRequest(alt string) (*http.Response, error) {
  17383. reqHeaders := make(http.Header)
  17384. for k, v := range c.header_ {
  17385. reqHeaders[k] = v
  17386. }
  17387. reqHeaders.Set("User-Agent", c.s.userAgent())
  17388. var body io.Reader = nil
  17389. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttreerequest)
  17390. if err != nil {
  17391. return nil, err
  17392. }
  17393. reqHeaders.Set("Content-Type", "application/json")
  17394. c.urlParams_.Set("alt", alt)
  17395. urls := googleapi.ResolveRelative(c.s.BasePath, "provisioning/createAccountTree")
  17396. urls += "?" + c.urlParams_.Encode()
  17397. req, _ := http.NewRequest("POST", urls, body)
  17398. req.Header = reqHeaders
  17399. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17400. }
  17401. // Do executes the "analytics.provisioning.createAccountTree" call.
  17402. // Exactly one of *AccountTreeResponse or error will be non-nil. Any
  17403. // non-2xx status code is an error. Response headers are in either
  17404. // *AccountTreeResponse.ServerResponse.Header or (if a response was
  17405. // returned at all) in error.(*googleapi.Error).Header. Use
  17406. // googleapi.IsNotModified to check whether the returned error was
  17407. // because http.StatusNotModified was returned.
  17408. func (c *ProvisioningCreateAccountTreeCall) Do(opts ...googleapi.CallOption) (*AccountTreeResponse, error) {
  17409. gensupport.SetOptions(c.urlParams_, opts...)
  17410. res, err := c.doRequest("json")
  17411. if res != nil && res.StatusCode == http.StatusNotModified {
  17412. if res.Body != nil {
  17413. res.Body.Close()
  17414. }
  17415. return nil, &googleapi.Error{
  17416. Code: res.StatusCode,
  17417. Header: res.Header,
  17418. }
  17419. }
  17420. if err != nil {
  17421. return nil, err
  17422. }
  17423. defer googleapi.CloseBody(res)
  17424. if err := googleapi.CheckResponse(res); err != nil {
  17425. return nil, err
  17426. }
  17427. ret := &AccountTreeResponse{
  17428. ServerResponse: googleapi.ServerResponse{
  17429. Header: res.Header,
  17430. HTTPStatusCode: res.StatusCode,
  17431. },
  17432. }
  17433. target := &ret
  17434. if err := gensupport.DecodeResponse(target, res); err != nil {
  17435. return nil, err
  17436. }
  17437. return ret, nil
  17438. // {
  17439. // "description": "Provision account.",
  17440. // "httpMethod": "POST",
  17441. // "id": "analytics.provisioning.createAccountTree",
  17442. // "path": "provisioning/createAccountTree",
  17443. // "request": {
  17444. // "$ref": "AccountTreeRequest"
  17445. // },
  17446. // "response": {
  17447. // "$ref": "AccountTreeResponse"
  17448. // },
  17449. // "scopes": [
  17450. // "https://www.googleapis.com/auth/analytics.provision"
  17451. // ]
  17452. // }
  17453. }
  17454. // method id "analytics.userDeletion.userDeletionRequest.upsert":
  17455. type UserDeletionUserDeletionRequestUpsertCall struct {
  17456. s *Service
  17457. userdeletionrequest *UserDeletionRequest
  17458. urlParams_ gensupport.URLParams
  17459. ctx_ context.Context
  17460. header_ http.Header
  17461. }
  17462. // Upsert: Insert or update a user deletion requests.
  17463. func (r *UserDeletionUserDeletionRequestService) Upsert(userdeletionrequest *UserDeletionRequest) *UserDeletionUserDeletionRequestUpsertCall {
  17464. c := &UserDeletionUserDeletionRequestUpsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17465. c.userdeletionrequest = userdeletionrequest
  17466. return c
  17467. }
  17468. // Fields allows partial responses to be retrieved. See
  17469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17470. // for more information.
  17471. func (c *UserDeletionUserDeletionRequestUpsertCall) Fields(s ...googleapi.Field) *UserDeletionUserDeletionRequestUpsertCall {
  17472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17473. return c
  17474. }
  17475. // Context sets the context to be used in this call's Do method. Any
  17476. // pending HTTP request will be aborted if the provided context is
  17477. // canceled.
  17478. func (c *UserDeletionUserDeletionRequestUpsertCall) Context(ctx context.Context) *UserDeletionUserDeletionRequestUpsertCall {
  17479. c.ctx_ = ctx
  17480. return c
  17481. }
  17482. // Header returns an http.Header that can be modified by the caller to
  17483. // add HTTP headers to the request.
  17484. func (c *UserDeletionUserDeletionRequestUpsertCall) Header() http.Header {
  17485. if c.header_ == nil {
  17486. c.header_ = make(http.Header)
  17487. }
  17488. return c.header_
  17489. }
  17490. func (c *UserDeletionUserDeletionRequestUpsertCall) doRequest(alt string) (*http.Response, error) {
  17491. reqHeaders := make(http.Header)
  17492. for k, v := range c.header_ {
  17493. reqHeaders[k] = v
  17494. }
  17495. reqHeaders.Set("User-Agent", c.s.userAgent())
  17496. var body io.Reader = nil
  17497. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userdeletionrequest)
  17498. if err != nil {
  17499. return nil, err
  17500. }
  17501. reqHeaders.Set("Content-Type", "application/json")
  17502. c.urlParams_.Set("alt", alt)
  17503. urls := googleapi.ResolveRelative(c.s.BasePath, "userDeletion/userDeletionRequests:upsert")
  17504. urls += "?" + c.urlParams_.Encode()
  17505. req, _ := http.NewRequest("POST", urls, body)
  17506. req.Header = reqHeaders
  17507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17508. }
  17509. // Do executes the "analytics.userDeletion.userDeletionRequest.upsert" call.
  17510. // Exactly one of *UserDeletionRequest or error will be non-nil. Any
  17511. // non-2xx status code is an error. Response headers are in either
  17512. // *UserDeletionRequest.ServerResponse.Header or (if a response was
  17513. // returned at all) in error.(*googleapi.Error).Header. Use
  17514. // googleapi.IsNotModified to check whether the returned error was
  17515. // because http.StatusNotModified was returned.
  17516. func (c *UserDeletionUserDeletionRequestUpsertCall) Do(opts ...googleapi.CallOption) (*UserDeletionRequest, error) {
  17517. gensupport.SetOptions(c.urlParams_, opts...)
  17518. res, err := c.doRequest("json")
  17519. if res != nil && res.StatusCode == http.StatusNotModified {
  17520. if res.Body != nil {
  17521. res.Body.Close()
  17522. }
  17523. return nil, &googleapi.Error{
  17524. Code: res.StatusCode,
  17525. Header: res.Header,
  17526. }
  17527. }
  17528. if err != nil {
  17529. return nil, err
  17530. }
  17531. defer googleapi.CloseBody(res)
  17532. if err := googleapi.CheckResponse(res); err != nil {
  17533. return nil, err
  17534. }
  17535. ret := &UserDeletionRequest{
  17536. ServerResponse: googleapi.ServerResponse{
  17537. Header: res.Header,
  17538. HTTPStatusCode: res.StatusCode,
  17539. },
  17540. }
  17541. target := &ret
  17542. if err := gensupport.DecodeResponse(target, res); err != nil {
  17543. return nil, err
  17544. }
  17545. return ret, nil
  17546. // {
  17547. // "description": "Insert or update a user deletion requests.",
  17548. // "httpMethod": "POST",
  17549. // "id": "analytics.userDeletion.userDeletionRequest.upsert",
  17550. // "path": "userDeletion/userDeletionRequests:upsert",
  17551. // "request": {
  17552. // "$ref": "UserDeletionRequest"
  17553. // },
  17554. // "response": {
  17555. // "$ref": "UserDeletionRequest"
  17556. // },
  17557. // "scopes": [
  17558. // "https://www.googleapis.com/auth/analytics.user.deletion"
  17559. // ]
  17560. // }
  17561. }