1 // Copyright 2021 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package analyticsdata provides access to the Google Analytics Data API. 8 // 9 // For product documentation, see: https://developers.google.com/analytics/devguides/reporting/data/v1/ 10 // 11 // # Creating a client 12 // 13 // Usage example: 14 // 15 // import "google.golang.org/api/analyticsdata/v1alpha" 16 // ... 17 // ctx := context.Background() 18 // analyticsdataService, err := analyticsdata.NewService(ctx) 19 // 20 // In this example, Google Application Default Credentials are used for authentication. 21 // 22 // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23 // 24 // # Other authentication options 25 // 26 // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27 // 28 // analyticsdataService, err := analyticsdata.NewService(ctx, option.WithScopes(analyticsdata.AnalyticsReadonlyScope)) 29 // 30 // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31 // 32 // analyticsdataService, err := analyticsdata.NewService(ctx, option.WithAPIKey("AIza...")) 33 // 34 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35 // 36 // config := &oauth2.Config{...} 37 // // ... 38 // token, err := config.Exchange(ctx, ...) 39 // analyticsdataService, err := analyticsdata.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40 // 41 // See https://godoc.org/google.golang.org/api/option/ for details on options. 42 package analyticsdata // import "google.golang.org/api/analyticsdata/v1alpha" 43 44 import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61 ) 62 63 // Always reference these packages, just in case the auto-generated code 64 // below doesn't. 65 var _ = bytes.NewBuffer 66 var _ = strconv.Itoa 67 var _ = fmt.Sprintf 68 var _ = json.NewDecoder 69 var _ = io.Copy 70 var _ = url.Parse 71 var _ = gensupport.MarshalJSON 72 var _ = googleapi.Version 73 var _ = errors.New 74 var _ = strings.Replace 75 var _ = context.Canceled 76 var _ = internaloption.WithDefaultEndpoint 77 78 const apiId = "analyticsdata:v1alpha" 79 const apiName = "analyticsdata" 80 const apiVersion = "v1alpha" 81 const basePath = "https://analyticsdata.googleapis.com/" 82 const mtlsBasePath = "https://analyticsdata.mtls.googleapis.com/" 83 84 // OAuth2 scopes used by this API. 85 const ( 86 // View and manage your Google Analytics data 87 AnalyticsScope = "https://www.googleapis.com/auth/analytics" 88 89 // See and download your Google Analytics data 90 AnalyticsReadonlyScope = "https://www.googleapis.com/auth/analytics.readonly" 91 ) 92 93 // NewService creates a new Service. 94 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 95 scopesOption := option.WithScopes( 96 "https://www.googleapis.com/auth/analytics", 97 "https://www.googleapis.com/auth/analytics.readonly", 98 ) 99 // NOTE: prepend, so we don't override user-specified scopes. 100 opts = append([]option.ClientOption{scopesOption}, opts...) 101 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 102 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 103 client, endpoint, err := htransport.NewClient(ctx, opts...) 104 if err != nil { 105 return nil, err 106 } 107 s, err := New(client) 108 if err != nil { 109 return nil, err 110 } 111 if endpoint != "" { 112 s.BasePath = endpoint 113 } 114 return s, nil 115 } 116 117 // New creates a new Service. It uses the provided http.Client for requests. 118 // 119 // Deprecated: please use NewService instead. 120 // To provide a custom HTTP client, use option.WithHTTPClient. 121 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 122 func New(client *http.Client) (*Service, error) { 123 if client == nil { 124 return nil, errors.New("client is nil") 125 } 126 s := &Service{client: client, BasePath: basePath} 127 s.Properties = NewPropertiesService(s) 128 s.V1alpha = NewV1alphaService(s) 129 return s, nil 130 } 131 132 type Service struct { 133 client *http.Client 134 BasePath string // API endpoint base URL 135 UserAgent string // optional additional User-Agent fragment 136 137 Properties *PropertiesService 138 139 V1alpha *V1alphaService 140 } 141 142 func (s *Service) userAgent() string { 143 if s.UserAgent == "" { 144 return googleapi.UserAgent 145 } 146 return googleapi.UserAgent + " " + s.UserAgent 147 } 148 149 func NewPropertiesService(s *Service) *PropertiesService { 150 rs := &PropertiesService{s: s} 151 return rs 152 } 153 154 type PropertiesService struct { 155 s *Service 156 } 157 158 func NewV1alphaService(s *Service) *V1alphaService { 159 rs := &V1alphaService{s: s} 160 return rs 161 } 162 163 type V1alphaService struct { 164 s *Service 165 } 166 167 // BatchRunPivotReportsRequest: The batch request containing multiple 168 // pivot report requests. 169 type BatchRunPivotReportsRequest struct { 170 // Entity: A property whose events are tracked. This entity must be 171 // specified for the batch. The entity within RunPivotReportRequest may 172 // either be unspecified or consistent with this entity. 173 Entity *Entity `json:"entity,omitempty"` 174 175 // Requests: Individual requests. Each request has a separate pivot 176 // report response. Each batch request is allowed up to 5 requests. 177 Requests []*RunPivotReportRequest `json:"requests,omitempty"` 178 179 // ForceSendFields is a list of field names (e.g. "Entity") to 180 // unconditionally include in API requests. By default, fields with 181 // empty values are omitted from API requests. However, any non-pointer, 182 // non-interface field appearing in ForceSendFields will be sent to the 183 // server regardless of whether the field is empty or not. This may be 184 // used to include empty fields in Patch requests. 185 ForceSendFields []string `json:"-"` 186 187 // NullFields is a list of field names (e.g. "Entity") to include in API 188 // requests with the JSON null value. By default, fields with empty 189 // values are omitted from API requests. However, any field with an 190 // empty value appearing in NullFields will be sent to the server as 191 // null. It is an error if a field in this list has a non-empty value. 192 // This may be used to include null fields in Patch requests. 193 NullFields []string `json:"-"` 194 } 195 196 func (s *BatchRunPivotReportsRequest) MarshalJSON() ([]byte, error) { 197 type NoMethod BatchRunPivotReportsRequest 198 raw := NoMethod(*s) 199 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 200 } 201 202 // BatchRunPivotReportsResponse: The batch response containing multiple 203 // pivot reports. 204 type BatchRunPivotReportsResponse struct { 205 // Kind: Identifies what kind of resource this message is. This `kind` 206 // is always the fixed string "analyticsData#batchRunPivotReports". 207 // Useful to distinguish between response types in JSON. 208 Kind string `json:"kind,omitempty"` 209 210 // PivotReports: Individual responses. Each response has a separate 211 // pivot report request. 212 PivotReports []*RunPivotReportResponse `json:"pivotReports,omitempty"` 213 214 // ServerResponse contains the HTTP response code and headers from the 215 // server. 216 googleapi.ServerResponse `json:"-"` 217 218 // ForceSendFields is a list of field names (e.g. "Kind") to 219 // unconditionally include in API requests. By default, fields with 220 // empty values are omitted from API requests. However, any non-pointer, 221 // non-interface field appearing in ForceSendFields will be sent to the 222 // server regardless of whether the field is empty or not. This may be 223 // used to include empty fields in Patch requests. 224 ForceSendFields []string `json:"-"` 225 226 // NullFields is a list of field names (e.g. "Kind") to include in API 227 // requests with the JSON null value. By default, fields with empty 228 // values are omitted from API requests. However, any field with an 229 // empty value appearing in NullFields will be sent to the server as 230 // null. It is an error if a field in this list has a non-empty value. 231 // This may be used to include null fields in Patch requests. 232 NullFields []string `json:"-"` 233 } 234 235 func (s *BatchRunPivotReportsResponse) MarshalJSON() ([]byte, error) { 236 type NoMethod BatchRunPivotReportsResponse 237 raw := NoMethod(*s) 238 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 239 } 240 241 // BatchRunReportsRequest: The batch request containing multiple report 242 // requests. 243 type BatchRunReportsRequest struct { 244 // Entity: A property whose events are tracked. This entity must be 245 // specified for the batch. The entity within RunReportRequest may 246 // either be unspecified or consistent with this entity. 247 Entity *Entity `json:"entity,omitempty"` 248 249 // Requests: Individual requests. Each request has a separate report 250 // response. Each batch request is allowed up to 5 requests. 251 Requests []*RunReportRequest `json:"requests,omitempty"` 252 253 // ForceSendFields is a list of field names (e.g. "Entity") to 254 // unconditionally include in API requests. By default, fields with 255 // empty values are omitted from API requests. However, any non-pointer, 256 // non-interface field appearing in ForceSendFields will be sent to the 257 // server regardless of whether the field is empty or not. This may be 258 // used to include empty fields in Patch requests. 259 ForceSendFields []string `json:"-"` 260 261 // NullFields is a list of field names (e.g. "Entity") to include in API 262 // requests with the JSON null value. By default, fields with empty 263 // values are omitted from API requests. However, any field with an 264 // empty value appearing in NullFields will be sent to the server as 265 // null. It is an error if a field in this list has a non-empty value. 266 // This may be used to include null fields in Patch requests. 267 NullFields []string `json:"-"` 268 } 269 270 func (s *BatchRunReportsRequest) MarshalJSON() ([]byte, error) { 271 type NoMethod BatchRunReportsRequest 272 raw := NoMethod(*s) 273 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 274 } 275 276 // BatchRunReportsResponse: The batch response containing multiple 277 // reports. 278 type BatchRunReportsResponse struct { 279 // Kind: Identifies what kind of resource this message is. This `kind` 280 // is always the fixed string "analyticsData#batchRunReports". Useful to 281 // distinguish between response types in JSON. 282 Kind string `json:"kind,omitempty"` 283 284 // Reports: Individual responses. Each response has a separate report 285 // request. 286 Reports []*RunReportResponse `json:"reports,omitempty"` 287 288 // ServerResponse contains the HTTP response code and headers from the 289 // server. 290 googleapi.ServerResponse `json:"-"` 291 292 // ForceSendFields is a list of field names (e.g. "Kind") to 293 // unconditionally include in API requests. By default, fields with 294 // empty values are omitted from API requests. However, any non-pointer, 295 // non-interface field appearing in ForceSendFields will be sent to the 296 // server regardless of whether the field is empty or not. This may be 297 // used to include empty fields in Patch requests. 298 ForceSendFields []string `json:"-"` 299 300 // NullFields is a list of field names (e.g. "Kind") to include in API 301 // requests with the JSON null value. By default, fields with empty 302 // values are omitted from API requests. However, any field with an 303 // empty value appearing in NullFields will be sent to the server as 304 // null. It is an error if a field in this list has a non-empty value. 305 // This may be used to include null fields in Patch requests. 306 NullFields []string `json:"-"` 307 } 308 309 func (s *BatchRunReportsResponse) MarshalJSON() ([]byte, error) { 310 type NoMethod BatchRunReportsResponse 311 raw := NoMethod(*s) 312 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 313 } 314 315 // BetweenFilter: To express that the result needs to be between two 316 // numbers (inclusive). 317 type BetweenFilter struct { 318 // FromValue: Begins with this number. 319 FromValue *NumericValue `json:"fromValue,omitempty"` 320 321 // ToValue: Ends with this number. 322 ToValue *NumericValue `json:"toValue,omitempty"` 323 324 // ForceSendFields is a list of field names (e.g. "FromValue") to 325 // unconditionally include in API requests. By default, fields with 326 // empty values are omitted from API requests. However, any non-pointer, 327 // non-interface field appearing in ForceSendFields will be sent to the 328 // server regardless of whether the field is empty or not. This may be 329 // used to include empty fields in Patch requests. 330 ForceSendFields []string `json:"-"` 331 332 // NullFields is a list of field names (e.g. "FromValue") to include in 333 // API requests with the JSON null value. By default, fields with empty 334 // values are omitted from API requests. However, any field with an 335 // empty value appearing in NullFields will be sent to the server as 336 // null. It is an error if a field in this list has a non-empty value. 337 // This may be used to include null fields in Patch requests. 338 NullFields []string `json:"-"` 339 } 340 341 func (s *BetweenFilter) MarshalJSON() ([]byte, error) { 342 type NoMethod BetweenFilter 343 raw := NoMethod(*s) 344 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 345 } 346 347 // CaseExpression: Used to convert a dimension value to a single case. 348 type CaseExpression struct { 349 // DimensionName: Name of a dimension. The name must refer back to a 350 // name in dimensions field of the request. 351 DimensionName string `json:"dimensionName,omitempty"` 352 353 // ForceSendFields is a list of field names (e.g. "DimensionName") to 354 // unconditionally include in API requests. By default, fields with 355 // empty values are omitted from API requests. However, any non-pointer, 356 // non-interface field appearing in ForceSendFields will be sent to the 357 // server regardless of whether the field is empty or not. This may be 358 // used to include empty fields in Patch requests. 359 ForceSendFields []string `json:"-"` 360 361 // NullFields is a list of field names (e.g. "DimensionName") to include 362 // in API requests with the JSON null value. By default, fields with 363 // empty values are omitted from API requests. However, any field with 364 // an empty value appearing in NullFields will be sent to the server as 365 // null. It is an error if a field in this list has a non-empty value. 366 // This may be used to include null fields in Patch requests. 367 NullFields []string `json:"-"` 368 } 369 370 func (s *CaseExpression) MarshalJSON() ([]byte, error) { 371 type NoMethod CaseExpression 372 raw := NoMethod(*s) 373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 374 } 375 376 // Cohort: Defines a cohort selection criteria. A cohort is a group of 377 // users who share a common characteristic. For example, users with the 378 // same `firstSessionDate` belong to the same cohort. 379 type Cohort struct { 380 // DateRange: The cohort selects users whose first touch date is between 381 // start date and end date defined in the `dateRange`. This `dateRange` 382 // does not specify the full date range of event data that is present in 383 // a cohort report. In a cohort report, this `dateRange` is extended by 384 // the granularity and offset present in the `cohortsRange`; event data 385 // for the extended reporting date range is present in a cohort report. 386 // In a cohort request, this `dateRange` is required and the 387 // `dateRanges` in the `RunReportRequest` or `RunPivotReportRequest` 388 // must be unspecified. This `dateRange` should generally be aligned 389 // with the cohort's granularity. If `CohortsRange` uses daily 390 // granularity, this `dateRange` can be a single day. If `CohortsRange` 391 // uses weekly granularity, this `dateRange` can be aligned to a week 392 // boundary, starting at Sunday and ending Saturday. If `CohortsRange` 393 // uses monthly granularity, this `dateRange` can be aligned to a month, 394 // starting at the first and ending on the last day of the month. 395 DateRange *DateRange `json:"dateRange,omitempty"` 396 397 // Dimension: Dimension used by the cohort. Required and only supports 398 // `firstSessionDate`. 399 Dimension string `json:"dimension,omitempty"` 400 401 // Name: Assigns a name to this cohort. The dimension `cohort` is valued 402 // to this name in a report response. If set, cannot begin with 403 // `cohort_` or `RESERVED_`. If not set, cohorts are named by their zero 404 // based index `cohort_0`, `cohort_1`, etc. 405 Name string `json:"name,omitempty"` 406 407 // ForceSendFields is a list of field names (e.g. "DateRange") to 408 // unconditionally include in API requests. By default, fields with 409 // empty values are omitted from API requests. However, any non-pointer, 410 // non-interface field appearing in ForceSendFields will be sent to the 411 // server regardless of whether the field is empty or not. This may be 412 // used to include empty fields in Patch requests. 413 ForceSendFields []string `json:"-"` 414 415 // NullFields is a list of field names (e.g. "DateRange") to include in 416 // API requests with the JSON null value. By default, fields with empty 417 // values are omitted from API requests. However, any field with an 418 // empty value appearing in NullFields will be sent to the server as 419 // null. It is an error if a field in this list has a non-empty value. 420 // This may be used to include null fields in Patch requests. 421 NullFields []string `json:"-"` 422 } 423 424 func (s *Cohort) MarshalJSON() ([]byte, error) { 425 type NoMethod Cohort 426 raw := NoMethod(*s) 427 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 428 } 429 430 // CohortReportSettings: Optional settings of a cohort report. 431 type CohortReportSettings struct { 432 // Accumulate: If true, accumulates the result from first touch day to 433 // the end day. Not supported in `RunReportRequest`. 434 Accumulate bool `json:"accumulate,omitempty"` 435 436 // ForceSendFields is a list of field names (e.g. "Accumulate") to 437 // unconditionally include in API requests. By default, fields with 438 // empty values are omitted from API requests. However, any non-pointer, 439 // non-interface field appearing in ForceSendFields will be sent to the 440 // server regardless of whether the field is empty or not. This may be 441 // used to include empty fields in Patch requests. 442 ForceSendFields []string `json:"-"` 443 444 // NullFields is a list of field names (e.g. "Accumulate") to include in 445 // API requests with the JSON null value. By default, fields with empty 446 // values are omitted from API requests. However, any field with an 447 // empty value appearing in NullFields will be sent to the server as 448 // null. It is an error if a field in this list has a non-empty value. 449 // This may be used to include null fields in Patch requests. 450 NullFields []string `json:"-"` 451 } 452 453 func (s *CohortReportSettings) MarshalJSON() ([]byte, error) { 454 type NoMethod CohortReportSettings 455 raw := NoMethod(*s) 456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 457 } 458 459 // CohortSpec: The specification of cohorts for a cohort report. Cohort 460 // reports create a time series of user retention for the cohort. For 461 // example, you could select the cohort of users that were acquired in 462 // the first week of September and follow that cohort for the next six 463 // weeks. Selecting the users acquired in the first week of September 464 // cohort is specified in the `cohort` object. Following that cohort for 465 // the next six weeks is specified in the `cohortsRange` object. For 466 // examples, see Cohort Report Examples 467 // (https://developers.google.com/analytics/devguides/reporting/data/v1/advanced#cohort_report_examples). 468 // The report response could show a weekly time series where say your 469 // app has retained 60% of this cohort after three weeks and 25% of this 470 // cohort after six weeks. These two percentages can be calculated by 471 // the metric `cohortActiveUsers/cohortTotalUsers` and will be separate 472 // rows in the report. 473 type CohortSpec struct { 474 // CohortReportSettings: Optional settings for a cohort report. 475 CohortReportSettings *CohortReportSettings `json:"cohortReportSettings,omitempty"` 476 477 // Cohorts: Defines the selection criteria to group users into cohorts. 478 // Most cohort reports define only a single cohort. If multiple cohorts 479 // are specified, each cohort can be recognized in the report by their 480 // name. 481 Cohorts []*Cohort `json:"cohorts,omitempty"` 482 483 // CohortsRange: Cohort reports follow cohorts over an extended 484 // reporting date range. This range specifies an offset duration to 485 // follow the cohorts over. 486 CohortsRange *CohortsRange `json:"cohortsRange,omitempty"` 487 488 // ForceSendFields is a list of field names (e.g. 489 // "CohortReportSettings") to unconditionally include in API requests. 490 // By default, fields with empty values are omitted from API requests. 491 // However, any non-pointer, non-interface field appearing in 492 // ForceSendFields will be sent to the server regardless of whether the 493 // field is empty or not. This may be used to include empty fields in 494 // Patch requests. 495 ForceSendFields []string `json:"-"` 496 497 // NullFields is a list of field names (e.g. "CohortReportSettings") to 498 // include in API requests with the JSON null value. By default, fields 499 // with empty values are omitted from API requests. However, any field 500 // with an empty value appearing in NullFields will be sent to the 501 // server as null. It is an error if a field in this list has a 502 // non-empty value. This may be used to include null fields in Patch 503 // requests. 504 NullFields []string `json:"-"` 505 } 506 507 func (s *CohortSpec) MarshalJSON() ([]byte, error) { 508 type NoMethod CohortSpec 509 raw := NoMethod(*s) 510 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 511 } 512 513 // CohortsRange: Configures the extended reporting date range for a 514 // cohort report. Specifies an offset duration to follow the cohorts 515 // over. 516 type CohortsRange struct { 517 // EndOffset: Required. `endOffset` specifies the end date of the 518 // extended reporting date range for a cohort report. `endOffset` can be 519 // any positive integer but is commonly set to 5 to 10 so that reports 520 // contain data on the cohort for the next several granularity time 521 // periods. If `granularity` is `DAILY`, the `endDate` of the extended 522 // reporting date range is `endDate` of the cohort plus `endOffset` 523 // days. If `granularity` is `WEEKLY`, the `endDate` of the extended 524 // reporting date range is `endDate` of the cohort plus `endOffset * 7` 525 // days. If `granularity` is `MONTHLY`, the `endDate` of the extended 526 // reporting date range is `endDate` of the cohort plus `endOffset * 30` 527 // days. 528 EndOffset int64 `json:"endOffset,omitempty"` 529 530 // Granularity: Required. The granularity used to interpret the 531 // `startOffset` and `endOffset` for the extended reporting date range 532 // for a cohort report. 533 // 534 // Possible values: 535 // "GRANULARITY_UNSPECIFIED" - Should never be specified. 536 // "DAILY" - Daily granularity. Commonly used if the cohort's 537 // `dateRange` is a single day and the request contains `cohortNthDay`. 538 // "WEEKLY" - Weekly granularity. Commonly used if the cohort's 539 // `dateRange` is a week in duration (starting on Sunday and ending on 540 // Saturday) and the request contains `cohortNthWeek`. 541 // "MONTHLY" - Monthly granularity. Commonly used if the cohort's 542 // `dateRange` is a month in duration and the request contains 543 // `cohortNthMonth`. 544 Granularity string `json:"granularity,omitempty"` 545 546 // StartOffset: `startOffset` specifies the start date of the extended 547 // reporting date range for a cohort report. `startOffset` is commonly 548 // set to 0 so that reports contain data from the acquisition of the 549 // cohort forward. If `granularity` is `DAILY`, the `startDate` of the 550 // extended reporting date range is `startDate` of the cohort plus 551 // `startOffset` days. If `granularity` is `WEEKLY`, the `startDate` of 552 // the extended reporting date range is `startDate` of the cohort plus 553 // `startOffset * 7` days. If `granularity` is `MONTHLY`, the 554 // `startDate` of the extended reporting date range is `startDate` of 555 // the cohort plus `startOffset * 30` days. 556 StartOffset int64 `json:"startOffset,omitempty"` 557 558 // ForceSendFields is a list of field names (e.g. "EndOffset") to 559 // unconditionally include in API requests. By default, fields with 560 // empty values are omitted from API requests. However, any non-pointer, 561 // non-interface field appearing in ForceSendFields will be sent to the 562 // server regardless of whether the field is empty or not. This may be 563 // used to include empty fields in Patch requests. 564 ForceSendFields []string `json:"-"` 565 566 // NullFields is a list of field names (e.g. "EndOffset") to include in 567 // API requests with the JSON null value. By default, fields with empty 568 // values are omitted from API requests. However, any field with an 569 // empty value appearing in NullFields will be sent to the server as 570 // null. It is an error if a field in this list has a non-empty value. 571 // This may be used to include null fields in Patch requests. 572 NullFields []string `json:"-"` 573 } 574 575 func (s *CohortsRange) MarshalJSON() ([]byte, error) { 576 type NoMethod CohortsRange 577 raw := NoMethod(*s) 578 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 579 } 580 581 // ConcatenateExpression: Used to combine dimension values to a single 582 // dimension. 583 type ConcatenateExpression struct { 584 // Delimiter: The delimiter placed between dimension names. Delimiters 585 // are often single characters such as "|" or "," but can be longer 586 // strings. If a dimension value contains the delimiter, both will be 587 // present in response with no distinction. For example if dimension 1 588 // value = "US,FR", dimension 2 value = "JP", and delimiter = ",", then 589 // the response will contain "US,FR,JP". 590 Delimiter string `json:"delimiter,omitempty"` 591 592 // DimensionNames: Names of dimensions. The names must refer back to 593 // names in the dimensions field of the request. 594 DimensionNames []string `json:"dimensionNames,omitempty"` 595 596 // ForceSendFields is a list of field names (e.g. "Delimiter") to 597 // unconditionally include in API requests. By default, fields with 598 // empty values are omitted from API requests. However, any non-pointer, 599 // non-interface field appearing in ForceSendFields will be sent to the 600 // server regardless of whether the field is empty or not. This may be 601 // used to include empty fields in Patch requests. 602 ForceSendFields []string `json:"-"` 603 604 // NullFields is a list of field names (e.g. "Delimiter") to include in 605 // API requests with the JSON null value. By default, fields with empty 606 // values are omitted from API requests. However, any field with an 607 // empty value appearing in NullFields will be sent to the server as 608 // null. It is an error if a field in this list has a non-empty value. 609 // This may be used to include null fields in Patch requests. 610 NullFields []string `json:"-"` 611 } 612 613 func (s *ConcatenateExpression) MarshalJSON() ([]byte, error) { 614 type NoMethod ConcatenateExpression 615 raw := NoMethod(*s) 616 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 617 } 618 619 // DateRange: A contiguous set of days: startDate, startDate + 1, ..., 620 // endDate. Requests are allowed up to 4 date ranges. 621 type DateRange struct { 622 // EndDate: The inclusive end date for the query in the format 623 // `YYYY-MM-DD`. Cannot be before `start_date`. The format `NdaysAgo`, 624 // `yesterday`, or `today` is also accepted, and in that case, the date 625 // is inferred based on the property's reporting time zone. 626 EndDate string `json:"endDate,omitempty"` 627 628 // Name: Assigns a name to this date range. The dimension `dateRange` is 629 // valued to this name in a report response. If set, cannot begin with 630 // `date_range_` or `RESERVED_`. If not set, date ranges are named by 631 // their zero based index in the request: `date_range_0`, 632 // `date_range_1`, etc. 633 Name string `json:"name,omitempty"` 634 635 // StartDate: The inclusive start date for the query in the format 636 // `YYYY-MM-DD`. Cannot be after `end_date`. The format `NdaysAgo`, 637 // `yesterday`, or `today` is also accepted, and in that case, the date 638 // is inferred based on the property's reporting time zone. 639 StartDate string `json:"startDate,omitempty"` 640 641 // ForceSendFields is a list of field names (e.g. "EndDate") to 642 // unconditionally include in API requests. By default, fields with 643 // empty values are omitted from API requests. However, any non-pointer, 644 // non-interface field appearing in ForceSendFields will be sent to the 645 // server regardless of whether the field is empty or not. This may be 646 // used to include empty fields in Patch requests. 647 ForceSendFields []string `json:"-"` 648 649 // NullFields is a list of field names (e.g. "EndDate") to include in 650 // API requests with the JSON null value. By default, fields with empty 651 // values are omitted from API requests. However, any field with an 652 // empty value appearing in NullFields will be sent to the server as 653 // null. It is an error if a field in this list has a non-empty value. 654 // This may be used to include null fields in Patch requests. 655 NullFields []string `json:"-"` 656 } 657 658 func (s *DateRange) MarshalJSON() ([]byte, error) { 659 type NoMethod DateRange 660 raw := NoMethod(*s) 661 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 662 } 663 664 // Dimension: Dimensions are attributes of your data. For example, the 665 // dimension city indicates the city from which an event originates. 666 // Dimension values in report responses are strings; for example, city 667 // could be "Paris" or "New York". Requests are allowed up to 8 668 // dimensions. 669 type Dimension struct { 670 // DimensionExpression: One dimension can be the result of an expression 671 // of multiple dimensions. For example, dimension "country, city": 672 // concatenate(country, ", ", city). 673 DimensionExpression *DimensionExpression `json:"dimensionExpression,omitempty"` 674 675 // Name: The name of the dimension. See the API Dimensions 676 // (https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) 677 // for the list of dimension names. If `dimensionExpression` is 678 // specified, `name` can be any string that you would like. For example 679 // if a `dimensionExpression` concatenates `country` and `city`, you 680 // could call that dimension `countryAndCity`. Dimensions are referenced 681 // by `name` in `dimensionFilter`, `orderBys`, `dimensionExpression`, 682 // and `pivots`. 683 Name string `json:"name,omitempty"` 684 685 // ForceSendFields is a list of field names (e.g. "DimensionExpression") 686 // to unconditionally include in API requests. By default, fields with 687 // empty values are omitted from API requests. However, any non-pointer, 688 // non-interface field appearing in ForceSendFields will be sent to the 689 // server regardless of whether the field is empty or not. This may be 690 // used to include empty fields in Patch requests. 691 ForceSendFields []string `json:"-"` 692 693 // NullFields is a list of field names (e.g. "DimensionExpression") to 694 // include in API requests with the JSON null value. By default, fields 695 // with empty values are omitted from API requests. However, any field 696 // with an empty value appearing in NullFields will be sent to the 697 // server as null. It is an error if a field in this list has a 698 // non-empty value. This may be used to include null fields in Patch 699 // requests. 700 NullFields []string `json:"-"` 701 } 702 703 func (s *Dimension) MarshalJSON() ([]byte, error) { 704 type NoMethod Dimension 705 raw := NoMethod(*s) 706 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 707 } 708 709 // DimensionExpression: Used to express a dimension which is the result 710 // of a formula of multiple dimensions. Example usages: 1) 711 // lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2). 712 type DimensionExpression struct { 713 // Concatenate: Used to combine dimension values to a single dimension. 714 // For example, dimension "country, city": concatenate(country, ", ", 715 // city). 716 Concatenate *ConcatenateExpression `json:"concatenate,omitempty"` 717 718 // LowerCase: Used to convert a dimension value to lower case. 719 LowerCase *CaseExpression `json:"lowerCase,omitempty"` 720 721 // UpperCase: Used to convert a dimension value to upper case. 722 UpperCase *CaseExpression `json:"upperCase,omitempty"` 723 724 // ForceSendFields is a list of field names (e.g. "Concatenate") to 725 // unconditionally include in API requests. By default, fields with 726 // empty values are omitted from API requests. However, any non-pointer, 727 // non-interface field appearing in ForceSendFields will be sent to the 728 // server regardless of whether the field is empty or not. This may be 729 // used to include empty fields in Patch requests. 730 ForceSendFields []string `json:"-"` 731 732 // NullFields is a list of field names (e.g. "Concatenate") to include 733 // in API requests with the JSON null value. By default, fields with 734 // empty values are omitted from API requests. However, any field with 735 // an empty value appearing in NullFields will be sent to the server as 736 // null. It is an error if a field in this list has a non-empty value. 737 // This may be used to include null fields in Patch requests. 738 NullFields []string `json:"-"` 739 } 740 741 func (s *DimensionExpression) MarshalJSON() ([]byte, error) { 742 type NoMethod DimensionExpression 743 raw := NoMethod(*s) 744 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 745 } 746 747 // DimensionHeader: Describes a dimension column in the report. 748 // Dimensions requested in a report produce column entries within rows 749 // and DimensionHeaders. However, dimensions used exclusively within 750 // filters or expressions do not produce columns in a report; 751 // correspondingly, those dimensions do not produce headers. 752 type DimensionHeader struct { 753 // Name: The dimension's name. 754 Name string `json:"name,omitempty"` 755 756 // ForceSendFields is a list of field names (e.g. "Name") to 757 // unconditionally include in API requests. By default, fields with 758 // empty values are omitted from API requests. However, any non-pointer, 759 // non-interface field appearing in ForceSendFields will be sent to the 760 // server regardless of whether the field is empty or not. This may be 761 // used to include empty fields in Patch requests. 762 ForceSendFields []string `json:"-"` 763 764 // NullFields is a list of field names (e.g. "Name") to include in API 765 // requests with the JSON null value. By default, fields with empty 766 // values are omitted from API requests. However, any field with an 767 // empty value appearing in NullFields will be sent to the server as 768 // null. It is an error if a field in this list has a non-empty value. 769 // This may be used to include null fields in Patch requests. 770 NullFields []string `json:"-"` 771 } 772 773 func (s *DimensionHeader) MarshalJSON() ([]byte, error) { 774 type NoMethod DimensionHeader 775 raw := NoMethod(*s) 776 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 777 } 778 779 // DimensionMetadata: Explains a dimension. 780 type DimensionMetadata struct { 781 // ApiName: This dimension's name. Useable in Dimension (#Dimension)'s 782 // `name`. For example, `eventName`. 783 ApiName string `json:"apiName,omitempty"` 784 785 // CustomDefinition: True if the dimension is a custom dimension for 786 // this property. 787 CustomDefinition bool `json:"customDefinition,omitempty"` 788 789 // DeprecatedApiNames: Still usable but deprecated names for this 790 // dimension. If populated, this dimension is available by either 791 // `apiName` or one of `deprecatedApiNames` for a period of time. After 792 // the deprecation period, the dimension will be available only by 793 // `apiName`. 794 DeprecatedApiNames []string `json:"deprecatedApiNames,omitempty"` 795 796 // Description: Description of how this dimension is used and 797 // calculated. 798 Description string `json:"description,omitempty"` 799 800 // UiName: This dimension's name within the Google Analytics user 801 // interface. For example, `Event name`. 802 UiName string `json:"uiName,omitempty"` 803 804 // ForceSendFields is a list of field names (e.g. "ApiName") to 805 // unconditionally include in API requests. By default, fields with 806 // empty values are omitted from API requests. However, any non-pointer, 807 // non-interface field appearing in ForceSendFields will be sent to the 808 // server regardless of whether the field is empty or not. This may be 809 // used to include empty fields in Patch requests. 810 ForceSendFields []string `json:"-"` 811 812 // NullFields is a list of field names (e.g. "ApiName") to include in 813 // API requests with the JSON null value. By default, fields with empty 814 // values are omitted from API requests. However, any field with an 815 // empty value appearing in NullFields will be sent to the server as 816 // null. It is an error if a field in this list has a non-empty value. 817 // This may be used to include null fields in Patch requests. 818 NullFields []string `json:"-"` 819 } 820 821 func (s *DimensionMetadata) MarshalJSON() ([]byte, error) { 822 type NoMethod DimensionMetadata 823 raw := NoMethod(*s) 824 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 825 } 826 827 // DimensionOrderBy: Sorts by dimension values. 828 type DimensionOrderBy struct { 829 // DimensionName: A dimension name in the request to order by. 830 DimensionName string `json:"dimensionName,omitempty"` 831 832 // OrderType: Controls the rule for dimension value ordering. 833 // 834 // Possible values: 835 // "ORDER_TYPE_UNSPECIFIED" - Unspecified. 836 // "ALPHANUMERIC" - Alphanumeric sort by Unicode code point. For 837 // example, "2" < "A" < "X" < "b" < "z". 838 // "CASE_INSENSITIVE_ALPHANUMERIC" - Case insensitive alphanumeric 839 // sort by lower case Unicode code point. For example, "2" < "A" < "b" < 840 // "X" < "z". 841 // "NUMERIC" - Dimension values are converted to numbers before 842 // sorting. For example in NUMERIC sort, "25" < "100", and in 843 // `ALPHANUMERIC` sort, "100" < "25". Non-numeric dimension values all 844 // have equal ordering value below all numeric values. 845 OrderType string `json:"orderType,omitempty"` 846 847 // ForceSendFields is a list of field names (e.g. "DimensionName") to 848 // unconditionally include in API requests. By default, fields with 849 // empty values are omitted from API requests. However, any non-pointer, 850 // non-interface field appearing in ForceSendFields will be sent to the 851 // server regardless of whether the field is empty or not. This may be 852 // used to include empty fields in Patch requests. 853 ForceSendFields []string `json:"-"` 854 855 // NullFields is a list of field names (e.g. "DimensionName") to include 856 // in API requests with the JSON null value. By default, fields with 857 // empty values are omitted from API requests. However, any field with 858 // an empty value appearing in NullFields will be sent to the server as 859 // null. It is an error if a field in this list has a non-empty value. 860 // This may be used to include null fields in Patch requests. 861 NullFields []string `json:"-"` 862 } 863 864 func (s *DimensionOrderBy) MarshalJSON() ([]byte, error) { 865 type NoMethod DimensionOrderBy 866 raw := NoMethod(*s) 867 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 868 } 869 870 // DimensionValue: The value of a dimension. 871 type DimensionValue struct { 872 // Value: Value as a string if the dimension type is a string. 873 Value string `json:"value,omitempty"` 874 875 // ForceSendFields is a list of field names (e.g. "Value") to 876 // unconditionally include in API requests. By default, fields with 877 // empty values are omitted from API requests. However, any non-pointer, 878 // non-interface field appearing in ForceSendFields will be sent to the 879 // server regardless of whether the field is empty or not. This may be 880 // used to include empty fields in Patch requests. 881 ForceSendFields []string `json:"-"` 882 883 // NullFields is a list of field names (e.g. "Value") to include in API 884 // requests with the JSON null value. By default, fields with empty 885 // values are omitted from API requests. However, any field with an 886 // empty value appearing in NullFields will be sent to the server as 887 // null. It is an error if a field in this list has a non-empty value. 888 // This may be used to include null fields in Patch requests. 889 NullFields []string `json:"-"` 890 } 891 892 func (s *DimensionValue) MarshalJSON() ([]byte, error) { 893 type NoMethod DimensionValue 894 raw := NoMethod(*s) 895 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 896 } 897 898 // Entity: The unique identifier of the property whose events are 899 // tracked. 900 type Entity struct { 901 // PropertyId: A Google Analytics GA4 property id. To learn more, see 902 // where to find your Property ID 903 // (https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). 904 PropertyId string `json:"propertyId,omitempty"` 905 906 // ForceSendFields is a list of field names (e.g. "PropertyId") to 907 // unconditionally include in API requests. By default, fields with 908 // empty values are omitted from API requests. However, any non-pointer, 909 // non-interface field appearing in ForceSendFields will be sent to the 910 // server regardless of whether the field is empty or not. This may be 911 // used to include empty fields in Patch requests. 912 ForceSendFields []string `json:"-"` 913 914 // NullFields is a list of field names (e.g. "PropertyId") to include in 915 // API requests with the JSON null value. By default, fields with empty 916 // values are omitted from API requests. However, any field with an 917 // empty value appearing in NullFields will be sent to the server as 918 // null. It is an error if a field in this list has a non-empty value. 919 // This may be used to include null fields in Patch requests. 920 NullFields []string `json:"-"` 921 } 922 923 func (s *Entity) MarshalJSON() ([]byte, error) { 924 type NoMethod Entity 925 raw := NoMethod(*s) 926 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 927 } 928 929 // Filter: An expression to filter dimension or metric values. 930 type Filter struct { 931 // BetweenFilter: A filter for two values. 932 BetweenFilter *BetweenFilter `json:"betweenFilter,omitempty"` 933 934 // FieldName: The dimension name or metric name. Must be a name defined 935 // in dimensions or metrics. 936 FieldName string `json:"fieldName,omitempty"` 937 938 // InListFilter: A filter for in list values. 939 InListFilter *InListFilter `json:"inListFilter,omitempty"` 940 941 // NumericFilter: A filter for numeric or date values. 942 NumericFilter *NumericFilter `json:"numericFilter,omitempty"` 943 944 // StringFilter: Strings related filter. 945 StringFilter *StringFilter `json:"stringFilter,omitempty"` 946 947 // ForceSendFields is a list of field names (e.g. "BetweenFilter") to 948 // unconditionally include in API requests. By default, fields with 949 // empty values are omitted from API requests. However, any non-pointer, 950 // non-interface field appearing in ForceSendFields will be sent to the 951 // server regardless of whether the field is empty or not. This may be 952 // used to include empty fields in Patch requests. 953 ForceSendFields []string `json:"-"` 954 955 // NullFields is a list of field names (e.g. "BetweenFilter") to include 956 // in API requests with the JSON null value. By default, fields with 957 // empty values are omitted from API requests. However, any field with 958 // an 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 964 func (s *Filter) MarshalJSON() ([]byte, error) { 965 type NoMethod Filter 966 raw := NoMethod(*s) 967 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 968 } 969 970 // FilterExpression: To express dimension or metric filters. The fields 971 // in the same FilterExpression need to be either all dimensions or all 972 // metrics. 973 type FilterExpression struct { 974 // AndGroup: The FilterExpressions in and_group have an AND 975 // relationship. 976 AndGroup *FilterExpressionList `json:"andGroup,omitempty"` 977 978 // Filter: A primitive filter. All fields in filter in same 979 // FilterExpression needs to be either all dimensions or metrics. 980 Filter *Filter `json:"filter,omitempty"` 981 982 // NotExpression: The FilterExpression is NOT of not_expression. 983 NotExpression *FilterExpression `json:"notExpression,omitempty"` 984 985 // OrGroup: The FilterExpressions in or_group have an OR relationship. 986 OrGroup *FilterExpressionList `json:"orGroup,omitempty"` 987 988 // ForceSendFields is a list of field names (e.g. "AndGroup") to 989 // unconditionally include in API requests. By default, fields with 990 // empty values are omitted from API requests. However, any non-pointer, 991 // non-interface field appearing in ForceSendFields will be sent to the 992 // server regardless of whether the field is empty or not. This may be 993 // used to include empty fields in Patch requests. 994 ForceSendFields []string `json:"-"` 995 996 // NullFields is a list of field names (e.g. "AndGroup") to include in 997 // API requests with the JSON null value. By default, fields with empty 998 // values are omitted from API requests. However, any field with an 999 // empty value appearing in NullFields will be sent to the server as 1000 // null. It is an error if a field in this list has a non-empty value. 1001 // This may be used to include null fields in Patch requests. 1002 NullFields []string `json:"-"` 1003 } 1004 1005 func (s *FilterExpression) MarshalJSON() ([]byte, error) { 1006 type NoMethod FilterExpression 1007 raw := NoMethod(*s) 1008 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1009 } 1010 1011 // FilterExpressionList: A list of filter expressions. 1012 type FilterExpressionList struct { 1013 // Expressions: A list of filter expressions. 1014 Expressions []*FilterExpression `json:"expressions,omitempty"` 1015 1016 // ForceSendFields is a list of field names (e.g. "Expressions") to 1017 // unconditionally include in API requests. By default, fields with 1018 // empty values are omitted from API requests. However, any non-pointer, 1019 // non-interface field appearing in ForceSendFields will be sent to the 1020 // server regardless of whether the field is empty or not. This may be 1021 // used to include empty fields in Patch requests. 1022 ForceSendFields []string `json:"-"` 1023 1024 // NullFields is a list of field names (e.g. "Expressions") to include 1025 // in API requests with the JSON null value. By default, fields with 1026 // empty values are omitted from API requests. However, any field with 1027 // an empty value appearing in NullFields will be sent to the server as 1028 // null. It is an error if a field in this list has a non-empty value. 1029 // This may be used to include null fields in Patch requests. 1030 NullFields []string `json:"-"` 1031 } 1032 1033 func (s *FilterExpressionList) MarshalJSON() ([]byte, error) { 1034 type NoMethod FilterExpressionList 1035 raw := NoMethod(*s) 1036 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1037 } 1038 1039 // InListFilter: The result needs to be in a list of string values. 1040 type InListFilter struct { 1041 // CaseSensitive: If true, the string value is case sensitive. 1042 CaseSensitive bool `json:"caseSensitive,omitempty"` 1043 1044 // Values: The list of string values. Must be non-empty. 1045 Values []string `json:"values,omitempty"` 1046 1047 // ForceSendFields is a list of field names (e.g. "CaseSensitive") to 1048 // unconditionally include in API requests. By default, fields with 1049 // empty values are omitted from API requests. However, any non-pointer, 1050 // non-interface field appearing in ForceSendFields will be sent to the 1051 // server regardless of whether the field is empty or not. This may be 1052 // used to include empty fields in Patch requests. 1053 ForceSendFields []string `json:"-"` 1054 1055 // NullFields is a list of field names (e.g. "CaseSensitive") to include 1056 // in API requests with the JSON null value. By default, fields with 1057 // empty values are omitted from API requests. However, any field with 1058 // an empty value appearing in NullFields will be sent to the server as 1059 // null. It is an error if a field in this list has a non-empty value. 1060 // This may be used to include null fields in Patch requests. 1061 NullFields []string `json:"-"` 1062 } 1063 1064 func (s *InListFilter) MarshalJSON() ([]byte, error) { 1065 type NoMethod InListFilter 1066 raw := NoMethod(*s) 1067 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1068 } 1069 1070 // Metadata: The dimensions and metrics currently accepted in reporting 1071 // methods. 1072 type Metadata struct { 1073 // Dimensions: The dimension descriptions. 1074 Dimensions []*DimensionMetadata `json:"dimensions,omitempty"` 1075 1076 // Metrics: The metric descriptions. 1077 Metrics []*MetricMetadata `json:"metrics,omitempty"` 1078 1079 // Name: Resource name of this metadata. 1080 Name string `json:"name,omitempty"` 1081 1082 // ServerResponse contains the HTTP response code and headers from the 1083 // server. 1084 googleapi.ServerResponse `json:"-"` 1085 1086 // ForceSendFields is a list of field names (e.g. "Dimensions") to 1087 // unconditionally include in API requests. By default, fields with 1088 // empty values are omitted from API requests. However, any non-pointer, 1089 // non-interface field appearing in ForceSendFields will be sent to the 1090 // server regardless of whether the field is empty or not. This may be 1091 // used to include empty fields in Patch requests. 1092 ForceSendFields []string `json:"-"` 1093 1094 // NullFields is a list of field names (e.g. "Dimensions") to include in 1095 // API requests with the JSON null value. By default, fields with empty 1096 // values are omitted from API requests. However, any field with an 1097 // empty value appearing in NullFields will be sent to the server as 1098 // null. It is an error if a field in this list has a non-empty value. 1099 // This may be used to include null fields in Patch requests. 1100 NullFields []string `json:"-"` 1101 } 1102 1103 func (s *Metadata) MarshalJSON() ([]byte, error) { 1104 type NoMethod Metadata 1105 raw := NoMethod(*s) 1106 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1107 } 1108 1109 // Metric: The quantitative measurements of a report. For example, the 1110 // metric `eventCount` is the total number of events. Requests are 1111 // allowed up to 10 metrics. 1112 type Metric struct { 1113 // Expression: A mathematical expression for derived metrics. For 1114 // example, the metric Event count per user is `eventCount/totalUsers`. 1115 Expression string `json:"expression,omitempty"` 1116 1117 // Invisible: Indicates if a metric is invisible in the report response. 1118 // If a metric is invisible, the metric will not produce a column in the 1119 // response, but can be used in `metricFilter`, `orderBys`, or a metric 1120 // `expression`. 1121 Invisible bool `json:"invisible,omitempty"` 1122 1123 // Name: The name of the metric. See the API Metrics 1124 // (https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics) 1125 // for the list of metric names. If `expression` is specified, `name` 1126 // can be any string that you would like. For example if `expression` is 1127 // `screenPageViews/sessions`, you could call that metric's name = 1128 // `viewsPerSession`. Metrics are referenced by `name` in 1129 // `metricFilter`, `orderBys`, and metric `expression`. 1130 Name string `json:"name,omitempty"` 1131 1132 // ForceSendFields is a list of field names (e.g. "Expression") to 1133 // unconditionally include in API requests. By default, fields with 1134 // empty values are omitted from API requests. However, any non-pointer, 1135 // non-interface field appearing in ForceSendFields will be sent to the 1136 // server regardless of whether the field is empty or not. This may be 1137 // used to include empty fields in Patch requests. 1138 ForceSendFields []string `json:"-"` 1139 1140 // NullFields is a list of field names (e.g. "Expression") to include in 1141 // API requests with the JSON null value. By default, fields with empty 1142 // values are omitted from API requests. However, any field with an 1143 // empty value appearing in NullFields will be sent to the server as 1144 // null. It is an error if a field in this list has a non-empty value. 1145 // This may be used to include null fields in Patch requests. 1146 NullFields []string `json:"-"` 1147 } 1148 1149 func (s *Metric) MarshalJSON() ([]byte, error) { 1150 type NoMethod Metric 1151 raw := NoMethod(*s) 1152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1153 } 1154 1155 // MetricHeader: Describes a metric column in the report. Visible 1156 // metrics requested in a report produce column entries within rows and 1157 // MetricHeaders. However, metrics used exclusively within filters or 1158 // expressions do not produce columns in a report; correspondingly, 1159 // those metrics do not produce headers. 1160 type MetricHeader struct { 1161 // Name: The metric's name. 1162 Name string `json:"name,omitempty"` 1163 1164 // Type: The metric's data type. 1165 // 1166 // Possible values: 1167 // "METRIC_TYPE_UNSPECIFIED" - Unspecified type. 1168 // "TYPE_INTEGER" - Integer type. 1169 // "TYPE_FLOAT" - Floating point type. 1170 // "TYPE_SECONDS" - A duration of seconds; a special floating point 1171 // type. 1172 // "TYPE_MILLISECONDS" - A duration in milliseconds; a special 1173 // floating point type. 1174 // "TYPE_MINUTES" - A duration in minutes; a special floating point 1175 // type. 1176 // "TYPE_HOURS" - A duration in hours; a special floating point type. 1177 // "TYPE_STANDARD" - A custom metric of standard type; a special 1178 // floating point type. 1179 // "TYPE_CURRENCY" - An amount of money; a special floating point 1180 // type. 1181 // "TYPE_FEET" - A length in feet; a special floating point type. 1182 // "TYPE_MILES" - A length in miles; a special floating point type. 1183 // "TYPE_METERS" - A length in meters; a special floating point type. 1184 // "TYPE_KILOMETERS" - A length in kilometers; a special floating 1185 // point type. 1186 Type string `json:"type,omitempty"` 1187 1188 // ForceSendFields is a list of field names (e.g. "Name") to 1189 // unconditionally include in API requests. By default, fields with 1190 // empty values are omitted from API requests. However, any non-pointer, 1191 // non-interface field appearing in ForceSendFields will be sent to the 1192 // server regardless of whether the field is empty or not. This may be 1193 // used to include empty fields in Patch requests. 1194 ForceSendFields []string `json:"-"` 1195 1196 // NullFields is a list of field names (e.g. "Name") to include in API 1197 // requests with the JSON null value. By default, fields with empty 1198 // values are omitted from API requests. However, any field with an 1199 // empty value appearing in NullFields will be sent to the server as 1200 // null. It is an error if a field in this list has a non-empty value. 1201 // This may be used to include null fields in Patch requests. 1202 NullFields []string `json:"-"` 1203 } 1204 1205 func (s *MetricHeader) MarshalJSON() ([]byte, error) { 1206 type NoMethod MetricHeader 1207 raw := NoMethod(*s) 1208 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1209 } 1210 1211 // MetricMetadata: Explains a metric. 1212 type MetricMetadata struct { 1213 // ApiName: A metric name. Useable in Metric (#Metric)'s `name`. For 1214 // example, `eventCount`. 1215 ApiName string `json:"apiName,omitempty"` 1216 1217 // CustomDefinition: True if the metric is a custom metric for this 1218 // property. 1219 CustomDefinition bool `json:"customDefinition,omitempty"` 1220 1221 // DeprecatedApiNames: Still usable but deprecated names for this 1222 // metric. If populated, this metric is available by either `apiName` or 1223 // one of `deprecatedApiNames` for a period of time. After the 1224 // deprecation period, the metric will be available only by `apiName`. 1225 DeprecatedApiNames []string `json:"deprecatedApiNames,omitempty"` 1226 1227 // Description: Description of how this metric is used and calculated. 1228 Description string `json:"description,omitempty"` 1229 1230 // Expression: The mathematical expression for this derived metric. Can 1231 // be used in Metric (#Metric)'s `expression` field for equivalent 1232 // reports. Most metrics are not expressions, and for non-expressions, 1233 // this field is empty. 1234 Expression string `json:"expression,omitempty"` 1235 1236 // Type: The type of this metric. 1237 // 1238 // Possible values: 1239 // "METRIC_TYPE_UNSPECIFIED" - Unspecified type. 1240 // "TYPE_INTEGER" - Integer type. 1241 // "TYPE_FLOAT" - Floating point type. 1242 // "TYPE_SECONDS" - A duration of seconds; a special floating point 1243 // type. 1244 // "TYPE_MILLISECONDS" - A duration in milliseconds; a special 1245 // floating point type. 1246 // "TYPE_MINUTES" - A duration in minutes; a special floating point 1247 // type. 1248 // "TYPE_HOURS" - A duration in hours; a special floating point type. 1249 // "TYPE_STANDARD" - A custom metric of standard type; a special 1250 // floating point type. 1251 // "TYPE_CURRENCY" - An amount of money; a special floating point 1252 // type. 1253 // "TYPE_FEET" - A length in feet; a special floating point type. 1254 // "TYPE_MILES" - A length in miles; a special floating point type. 1255 // "TYPE_METERS" - A length in meters; a special floating point type. 1256 // "TYPE_KILOMETERS" - A length in kilometers; a special floating 1257 // point type. 1258 Type string `json:"type,omitempty"` 1259 1260 // UiName: This metric's name within the Google Analytics user 1261 // interface. For example, `Event count`. 1262 UiName string `json:"uiName,omitempty"` 1263 1264 // ForceSendFields is a list of field names (e.g. "ApiName") to 1265 // unconditionally include in API requests. By default, fields with 1266 // empty values are omitted from API requests. However, any non-pointer, 1267 // non-interface field appearing in ForceSendFields will be sent to the 1268 // server regardless of whether the field is empty or not. This may be 1269 // used to include empty fields in Patch requests. 1270 ForceSendFields []string `json:"-"` 1271 1272 // NullFields is a list of field names (e.g. "ApiName") to include in 1273 // API requests with the JSON null value. By default, fields with empty 1274 // values are omitted from API requests. However, any field with an 1275 // empty value appearing in NullFields will be sent to the server as 1276 // null. It is an error if a field in this list has a non-empty value. 1277 // This may be used to include null fields in Patch requests. 1278 NullFields []string `json:"-"` 1279 } 1280 1281 func (s *MetricMetadata) MarshalJSON() ([]byte, error) { 1282 type NoMethod MetricMetadata 1283 raw := NoMethod(*s) 1284 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1285 } 1286 1287 // MetricOrderBy: Sorts by metric values. 1288 type MetricOrderBy struct { 1289 // MetricName: A metric name in the request to order by. 1290 MetricName string `json:"metricName,omitempty"` 1291 1292 // ForceSendFields is a list of field names (e.g. "MetricName") to 1293 // unconditionally include in API requests. By default, fields with 1294 // empty values are omitted from API requests. However, any non-pointer, 1295 // non-interface field appearing in ForceSendFields will be sent to the 1296 // server regardless of whether the field is empty or not. This may be 1297 // used to include empty fields in Patch requests. 1298 ForceSendFields []string `json:"-"` 1299 1300 // NullFields is a list of field names (e.g. "MetricName") to include in 1301 // API requests with the JSON null value. By default, fields with empty 1302 // values are omitted from API requests. However, any field with an 1303 // empty value appearing in NullFields will be sent to the server as 1304 // null. It is an error if a field in this list has a non-empty value. 1305 // This may be used to include null fields in Patch requests. 1306 NullFields []string `json:"-"` 1307 } 1308 1309 func (s *MetricOrderBy) MarshalJSON() ([]byte, error) { 1310 type NoMethod MetricOrderBy 1311 raw := NoMethod(*s) 1312 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1313 } 1314 1315 // MetricValue: The value of a metric. 1316 type MetricValue struct { 1317 // Value: Measurement value. See MetricHeader for type. 1318 Value string `json:"value,omitempty"` 1319 1320 // ForceSendFields is a list of field names (e.g. "Value") to 1321 // unconditionally include in API requests. By default, fields with 1322 // empty values are omitted from API requests. However, any non-pointer, 1323 // non-interface field appearing in ForceSendFields will be sent to the 1324 // server regardless of whether the field is empty or not. This may be 1325 // used to include empty fields in Patch requests. 1326 ForceSendFields []string `json:"-"` 1327 1328 // NullFields is a list of field names (e.g. "Value") to include in API 1329 // requests with the JSON null value. By default, fields with empty 1330 // values are omitted from API requests. However, any field with an 1331 // empty value appearing in NullFields will be sent to the server as 1332 // null. It is an error if a field in this list has a non-empty value. 1333 // This may be used to include null fields in Patch requests. 1334 NullFields []string `json:"-"` 1335 } 1336 1337 func (s *MetricValue) MarshalJSON() ([]byte, error) { 1338 type NoMethod MetricValue 1339 raw := NoMethod(*s) 1340 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1341 } 1342 1343 // NumericFilter: Filters for numeric or date values. 1344 type NumericFilter struct { 1345 // Operation: The operation type for this filter. 1346 // 1347 // Possible values: 1348 // "OPERATION_UNSPECIFIED" - Unspecified. 1349 // "EQUAL" - Equal 1350 // "LESS_THAN" - Less than 1351 // "LESS_THAN_OR_EQUAL" - Less than or equal 1352 // "GREATER_THAN" - Greater than 1353 // "GREATER_THAN_OR_EQUAL" - Greater than or equal 1354 Operation string `json:"operation,omitempty"` 1355 1356 // Value: A numeric value or a date value. 1357 Value *NumericValue `json:"value,omitempty"` 1358 1359 // ForceSendFields is a list of field names (e.g. "Operation") to 1360 // unconditionally include in API requests. By default, fields with 1361 // empty values are omitted from API requests. However, any non-pointer, 1362 // non-interface field appearing in ForceSendFields will be sent to the 1363 // server regardless of whether the field is empty or not. This may be 1364 // used to include empty fields in Patch requests. 1365 ForceSendFields []string `json:"-"` 1366 1367 // NullFields is a list of field names (e.g. "Operation") to include in 1368 // API requests with the JSON null value. By default, fields with empty 1369 // values are omitted from API requests. However, any field with an 1370 // empty value appearing in NullFields will be sent to the server as 1371 // null. It is an error if a field in this list has a non-empty value. 1372 // This may be used to include null fields in Patch requests. 1373 NullFields []string `json:"-"` 1374 } 1375 1376 func (s *NumericFilter) MarshalJSON() ([]byte, error) { 1377 type NoMethod NumericFilter 1378 raw := NoMethod(*s) 1379 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1380 } 1381 1382 // NumericValue: To represent a number. 1383 type NumericValue struct { 1384 // DoubleValue: Double value 1385 DoubleValue float64 `json:"doubleValue,omitempty"` 1386 1387 // Int64Value: Integer value 1388 Int64Value int64 `json:"int64Value,omitempty,string"` 1389 1390 // ForceSendFields is a list of field names (e.g. "DoubleValue") to 1391 // unconditionally include in API requests. By default, fields with 1392 // empty values are omitted from API requests. However, any non-pointer, 1393 // non-interface field appearing in ForceSendFields will be sent to the 1394 // server regardless of whether the field is empty or not. This may be 1395 // used to include empty fields in Patch requests. 1396 ForceSendFields []string `json:"-"` 1397 1398 // NullFields is a list of field names (e.g. "DoubleValue") to include 1399 // in API requests with the JSON null value. By default, fields with 1400 // empty values are omitted from API requests. However, any field with 1401 // an empty value appearing in NullFields will be sent to the server as 1402 // null. It is an error if a field in this list has a non-empty value. 1403 // This may be used to include null fields in Patch requests. 1404 NullFields []string `json:"-"` 1405 } 1406 1407 func (s *NumericValue) MarshalJSON() ([]byte, error) { 1408 type NoMethod NumericValue 1409 raw := NoMethod(*s) 1410 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1411 } 1412 1413 func (s *NumericValue) UnmarshalJSON(data []byte) error { 1414 type NoMethod NumericValue 1415 var s1 struct { 1416 DoubleValue gensupport.JSONFloat64 `json:"doubleValue"` 1417 *NoMethod 1418 } 1419 s1.NoMethod = (*NoMethod)(s) 1420 if err := json.Unmarshal(data, &s1); err != nil { 1421 return err 1422 } 1423 s.DoubleValue = float64(s1.DoubleValue) 1424 return nil 1425 } 1426 1427 // OrderBy: The sort options. 1428 type OrderBy struct { 1429 // Desc: If true, sorts by descending order. 1430 Desc bool `json:"desc,omitempty"` 1431 1432 // Dimension: Sorts results by a dimension's values. 1433 Dimension *DimensionOrderBy `json:"dimension,omitempty"` 1434 1435 // Metric: Sorts results by a metric's values. 1436 Metric *MetricOrderBy `json:"metric,omitempty"` 1437 1438 // Pivot: Sorts results by a metric's values within a pivot column 1439 // group. 1440 Pivot *PivotOrderBy `json:"pivot,omitempty"` 1441 1442 // ForceSendFields is a list of field names (e.g. "Desc") to 1443 // unconditionally include in API requests. By default, fields with 1444 // empty values are omitted from API requests. However, any non-pointer, 1445 // non-interface field appearing in ForceSendFields will be sent to the 1446 // server regardless of whether the field is empty or not. This may be 1447 // used to include empty fields in Patch requests. 1448 ForceSendFields []string `json:"-"` 1449 1450 // NullFields is a list of field names (e.g. "Desc") to include in API 1451 // requests with the JSON null value. By default, fields with empty 1452 // values are omitted from API requests. However, any field with an 1453 // empty value appearing in NullFields will be sent to the server as 1454 // null. It is an error if a field in this list has a non-empty value. 1455 // This may be used to include null fields in Patch requests. 1456 NullFields []string `json:"-"` 1457 } 1458 1459 func (s *OrderBy) MarshalJSON() ([]byte, error) { 1460 type NoMethod OrderBy 1461 raw := NoMethod(*s) 1462 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1463 } 1464 1465 // Pivot: Describes the visible dimension columns and rows in the report 1466 // response. 1467 type Pivot struct { 1468 // FieldNames: Dimension names for visible columns in the report 1469 // response. Including "dateRange" produces a date range column; for 1470 // each row in the response, dimension values in the date range column 1471 // will indicate the corresponding date range from the request. 1472 FieldNames []string `json:"fieldNames,omitempty"` 1473 1474 // Limit: The number of rows to return in this pivot. The `limit` 1475 // parameter is required. A `limit` of 10,000 is common for single pivot 1476 // requests. The product of the `limit` for each `pivot` in a 1477 // `RunPivotReportRequest` must not exceed 100,000. For example, a two 1478 // pivot request with `limit: 1000` in each pivot will fail because the 1479 // product is `1,000,000`. 1480 Limit int64 `json:"limit,omitempty,string"` 1481 1482 // MetricAggregations: Aggregate the metrics by dimensions in this pivot 1483 // using the specified metric_aggregations. 1484 // 1485 // Possible values: 1486 // "METRIC_AGGREGATION_UNSPECIFIED" - Unspecified operator. 1487 // "TOTAL" - SUM operator. 1488 // "MINIMUM" - Minimum operator. 1489 // "MAXIMUM" - Maximum operator. 1490 // "COUNT" - Count operator. 1491 MetricAggregations []string `json:"metricAggregations,omitempty"` 1492 1493 // Offset: The row count of the start row. The first row is counted as 1494 // row 0. 1495 Offset int64 `json:"offset,omitempty,string"` 1496 1497 // OrderBys: Specifies how dimensions are ordered in the pivot. In the 1498 // first Pivot, the OrderBys determine Row and PivotDimensionHeader 1499 // ordering; in subsequent Pivots, the OrderBys determine only 1500 // PivotDimensionHeader ordering. Dimensions specified in these OrderBys 1501 // must be a subset of Pivot.field_names. 1502 OrderBys []*OrderBy `json:"orderBys,omitempty"` 1503 1504 // ForceSendFields is a list of field names (e.g. "FieldNames") to 1505 // unconditionally include in API requests. By default, fields with 1506 // empty values are omitted from API requests. However, any non-pointer, 1507 // non-interface field appearing in ForceSendFields will be sent to the 1508 // server regardless of whether the field is empty or not. This may be 1509 // used to include empty fields in Patch requests. 1510 ForceSendFields []string `json:"-"` 1511 1512 // NullFields is a list of field names (e.g. "FieldNames") to include in 1513 // API requests with the JSON null value. By default, fields with empty 1514 // values are omitted from API requests. However, any field with an 1515 // empty value appearing in NullFields will be sent to the server as 1516 // null. It is an error if a field in this list has a non-empty value. 1517 // This may be used to include null fields in Patch requests. 1518 NullFields []string `json:"-"` 1519 } 1520 1521 func (s *Pivot) MarshalJSON() ([]byte, error) { 1522 type NoMethod Pivot 1523 raw := NoMethod(*s) 1524 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1525 } 1526 1527 // PivotDimensionHeader: Summarizes dimension values from a row for this 1528 // pivot. 1529 type PivotDimensionHeader struct { 1530 // DimensionValues: Values of multiple dimensions in a pivot. 1531 DimensionValues []*DimensionValue `json:"dimensionValues,omitempty"` 1532 1533 // ForceSendFields is a list of field names (e.g. "DimensionValues") to 1534 // unconditionally include in API requests. By default, fields with 1535 // empty values are omitted from API requests. However, any non-pointer, 1536 // non-interface field appearing in ForceSendFields will be sent to the 1537 // server regardless of whether the field is empty or not. This may be 1538 // used to include empty fields in Patch requests. 1539 ForceSendFields []string `json:"-"` 1540 1541 // NullFields is a list of field names (e.g. "DimensionValues") to 1542 // include in API requests with the JSON null value. By default, fields 1543 // with empty values are omitted from API requests. However, any field 1544 // with an empty value appearing in NullFields will be sent to the 1545 // server as null. It is an error if a field in this list has a 1546 // non-empty value. This may be used to include null fields in Patch 1547 // requests. 1548 NullFields []string `json:"-"` 1549 } 1550 1551 func (s *PivotDimensionHeader) MarshalJSON() ([]byte, error) { 1552 type NoMethod PivotDimensionHeader 1553 raw := NoMethod(*s) 1554 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1555 } 1556 1557 // PivotHeader: Dimensions' values in a single pivot. 1558 type PivotHeader struct { 1559 // PivotDimensionHeaders: The size is the same as the cardinality of the 1560 // corresponding dimension combinations. 1561 PivotDimensionHeaders []*PivotDimensionHeader `json:"pivotDimensionHeaders,omitempty"` 1562 1563 // RowCount: The cardinality of the pivot. The total number of rows for 1564 // this pivot's fields regardless of how the parameters `offset` and 1565 // `limit` are specified in the request. 1566 RowCount int64 `json:"rowCount,omitempty"` 1567 1568 // ForceSendFields is a list of field names (e.g. 1569 // "PivotDimensionHeaders") to unconditionally include in API requests. 1570 // By default, fields with empty values are omitted from API requests. 1571 // However, any non-pointer, non-interface field appearing in 1572 // ForceSendFields will be sent to the server regardless of whether the 1573 // field is empty or not. This may be used to include empty fields in 1574 // Patch requests. 1575 ForceSendFields []string `json:"-"` 1576 1577 // NullFields is a list of field names (e.g. "PivotDimensionHeaders") to 1578 // include in API requests with the JSON null value. By default, fields 1579 // with empty values are omitted from API requests. However, any field 1580 // with an empty value appearing in NullFields will be sent to the 1581 // server as null. It is an error if a field in this list has a 1582 // non-empty value. This may be used to include null fields in Patch 1583 // requests. 1584 NullFields []string `json:"-"` 1585 } 1586 1587 func (s *PivotHeader) MarshalJSON() ([]byte, error) { 1588 type NoMethod PivotHeader 1589 raw := NoMethod(*s) 1590 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1591 } 1592 1593 // PivotOrderBy: Sorts by a pivot column group. 1594 type PivotOrderBy struct { 1595 // MetricName: In the response to order by, order rows by this column. 1596 // Must be a metric name from the request. 1597 MetricName string `json:"metricName,omitempty"` 1598 1599 // PivotSelections: Used to select a dimension name and value pivot. If 1600 // multiple pivot selections are given, the sort occurs on rows where 1601 // all pivot selection dimension name and value pairs match the row's 1602 // dimension name and value pair. 1603 PivotSelections []*PivotSelection `json:"pivotSelections,omitempty"` 1604 1605 // ForceSendFields is a list of field names (e.g. "MetricName") to 1606 // unconditionally include in API requests. By default, fields with 1607 // empty values are omitted from API requests. However, any non-pointer, 1608 // non-interface field appearing in ForceSendFields will be sent to the 1609 // server regardless of whether the field is empty or not. This may be 1610 // used to include empty fields in Patch requests. 1611 ForceSendFields []string `json:"-"` 1612 1613 // NullFields is a list of field names (e.g. "MetricName") to include in 1614 // API requests with the JSON null value. By default, fields with empty 1615 // values are omitted from API requests. However, any field with an 1616 // empty value appearing in NullFields will be sent to the server as 1617 // null. It is an error if a field in this list has a non-empty value. 1618 // This may be used to include null fields in Patch requests. 1619 NullFields []string `json:"-"` 1620 } 1621 1622 func (s *PivotOrderBy) MarshalJSON() ([]byte, error) { 1623 type NoMethod PivotOrderBy 1624 raw := NoMethod(*s) 1625 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1626 } 1627 1628 // PivotSelection: A pair of dimension names and values. Rows with this 1629 // dimension pivot pair are ordered by the metric's value. For example 1630 // if pivots = {{"browser", "Chrome"}} and metric_name = "Sessions", 1631 // then the rows will be sorted based on Sessions in Chrome. 1632 // ---------|----------|----------------|----------|---------------- | 1633 // Chrome | Chrome | Safari | Safari 1634 // ---------|----------|----------------|----------|---------------- 1635 // Country | Sessions | Pages/Sessions | Sessions | Pages/Sessions 1636 // ---------|----------|----------------|----------|---------------- US 1637 // | 2 | 2 | 3 | 1 1638 // ---------|----------|----------------|----------|---------------- 1639 // Canada | 3 | 1 | 4 | 1 1640 // ---------|----------|----------------|----------|---------------- 1641 type PivotSelection struct { 1642 // DimensionName: Must be a dimension name from the request. 1643 DimensionName string `json:"dimensionName,omitempty"` 1644 1645 // DimensionValue: Order by only when the named dimension is this value. 1646 DimensionValue string `json:"dimensionValue,omitempty"` 1647 1648 // ForceSendFields is a list of field names (e.g. "DimensionName") to 1649 // unconditionally include in API requests. By default, fields with 1650 // empty values are omitted from API requests. However, any non-pointer, 1651 // non-interface field appearing in ForceSendFields will be sent to the 1652 // server regardless of whether the field is empty or not. This may be 1653 // used to include empty fields in Patch requests. 1654 ForceSendFields []string `json:"-"` 1655 1656 // NullFields is a list of field names (e.g. "DimensionName") to include 1657 // in API requests with the JSON null value. By default, fields with 1658 // empty values are omitted from API requests. However, any field with 1659 // an empty value appearing in NullFields will be sent to the server as 1660 // null. It is an error if a field in this list has a non-empty value. 1661 // This may be used to include null fields in Patch requests. 1662 NullFields []string `json:"-"` 1663 } 1664 1665 func (s *PivotSelection) MarshalJSON() ([]byte, error) { 1666 type NoMethod PivotSelection 1667 raw := NoMethod(*s) 1668 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1669 } 1670 1671 // PropertyQuota: Current state of all quotas for this Analytics 1672 // Property. If any quota for a property is exhausted, all requests to 1673 // that property will return Resource Exhausted errors. 1674 type PropertyQuota struct { 1675 // ConcurrentRequests: Standard Analytics Properties can send up to 10 1676 // concurrent requests; Analytics 360 Properties can use up to 50 1677 // concurrent requests. 1678 ConcurrentRequests *QuotaStatus `json:"concurrentRequests,omitempty"` 1679 1680 // PotentiallyThresholdedRequestsPerHour: Analytics Properties can send 1681 // up to 120 requests with potentially thresholded dimensions per hour. 1682 // In a batch request, each report request is individually counted for 1683 // this quota if the request contains potentially thresholded 1684 // dimensions. 1685 PotentiallyThresholdedRequestsPerHour *QuotaStatus `json:"potentiallyThresholdedRequestsPerHour,omitempty"` 1686 1687 // ServerErrorsPerProjectPerHour: Standard Analytics Properties and 1688 // cloud project pairs can have up to 10 server errors per hour; 1689 // Analytics 360 Properties and cloud project pairs can have up to 50 1690 // server errors per hour. 1691 ServerErrorsPerProjectPerHour *QuotaStatus `json:"serverErrorsPerProjectPerHour,omitempty"` 1692 1693 // TokensPerDay: Standard Analytics Properties can use up to 25,000 1694 // tokens per day; Analytics 360 Properties can use 250,000 tokens per 1695 // day. Most requests consume fewer than 10 tokens. 1696 TokensPerDay *QuotaStatus `json:"tokensPerDay,omitempty"` 1697 1698 // TokensPerHour: Standard Analytics Properties can use up to 5,000 1699 // tokens per hour; Analytics 360 Properties can use 50,000 tokens per 1700 // hour. An API request consumes a single number of tokens, and that 1701 // number is deducted from both the hourly and daily quotas. 1702 TokensPerHour *QuotaStatus `json:"tokensPerHour,omitempty"` 1703 1704 // ForceSendFields is a list of field names (e.g. "ConcurrentRequests") 1705 // to unconditionally include in API requests. By default, fields with 1706 // empty values are omitted from API requests. However, any non-pointer, 1707 // non-interface field appearing in ForceSendFields will be sent to the 1708 // server regardless of whether the field is empty or not. This may be 1709 // used to include empty fields in Patch requests. 1710 ForceSendFields []string `json:"-"` 1711 1712 // NullFields is a list of field names (e.g. "ConcurrentRequests") to 1713 // include in API requests with the JSON null value. By default, fields 1714 // with empty values are omitted from API requests. However, any field 1715 // with an empty value appearing in NullFields will be sent to the 1716 // server as null. It is an error if a field in this list has a 1717 // non-empty value. This may be used to include null fields in Patch 1718 // requests. 1719 NullFields []string `json:"-"` 1720 } 1721 1722 func (s *PropertyQuota) MarshalJSON() ([]byte, error) { 1723 type NoMethod PropertyQuota 1724 raw := NoMethod(*s) 1725 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1726 } 1727 1728 // QuotaStatus: Current state for a particular quota group. 1729 type QuotaStatus struct { 1730 // Consumed: Quota consumed by this request. 1731 Consumed int64 `json:"consumed,omitempty"` 1732 1733 // Remaining: Quota remaining after this request. 1734 Remaining int64 `json:"remaining,omitempty"` 1735 1736 // ForceSendFields is a list of field names (e.g. "Consumed") to 1737 // unconditionally include in API requests. By default, fields with 1738 // empty values are omitted from API requests. However, any non-pointer, 1739 // non-interface field appearing in ForceSendFields will be sent to the 1740 // server regardless of whether the field is empty or not. This may be 1741 // used to include empty fields in Patch requests. 1742 ForceSendFields []string `json:"-"` 1743 1744 // NullFields is a list of field names (e.g. "Consumed") to include in 1745 // API requests with the JSON null value. By default, fields with empty 1746 // values are omitted from API requests. However, any field with an 1747 // empty value appearing in NullFields will be sent to the server as 1748 // null. It is an error if a field in this list has a non-empty value. 1749 // This may be used to include null fields in Patch requests. 1750 NullFields []string `json:"-"` 1751 } 1752 1753 func (s *QuotaStatus) MarshalJSON() ([]byte, error) { 1754 type NoMethod QuotaStatus 1755 raw := NoMethod(*s) 1756 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1757 } 1758 1759 // ResponseMetaData: Response's metadata carrying additional information 1760 // about the report content. 1761 type ResponseMetaData struct { 1762 // DataLossFromOtherRow: If true, indicates some buckets of dimension 1763 // combinations are rolled into "(other)" row. This can happen for high 1764 // cardinality reports. 1765 DataLossFromOtherRow bool `json:"dataLossFromOtherRow,omitempty"` 1766 1767 // ForceSendFields is a list of field names (e.g. 1768 // "DataLossFromOtherRow") to unconditionally include in API requests. 1769 // By default, fields with empty values are omitted from API requests. 1770 // However, any non-pointer, non-interface field appearing in 1771 // ForceSendFields will be sent to the server regardless of whether the 1772 // field is empty or not. This may be used to include empty fields in 1773 // Patch requests. 1774 ForceSendFields []string `json:"-"` 1775 1776 // NullFields is a list of field names (e.g. "DataLossFromOtherRow") to 1777 // include in API requests with the JSON null value. By default, fields 1778 // with empty values are omitted from API requests. However, any field 1779 // with an empty value appearing in NullFields will be sent to the 1780 // server as null. It is an error if a field in this list has a 1781 // non-empty value. This may be used to include null fields in Patch 1782 // requests. 1783 NullFields []string `json:"-"` 1784 } 1785 1786 func (s *ResponseMetaData) MarshalJSON() ([]byte, error) { 1787 type NoMethod ResponseMetaData 1788 raw := NoMethod(*s) 1789 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1790 } 1791 1792 // Row: Report data for each row. For example if RunReportRequest 1793 // contains: ```none "dimensions": [ { "name": "eventName" }, { "name": 1794 // "countryId" } ], "metrics": [ { "name": "eventCount" } ] ``` One row 1795 // with 'in_app_purchase' as the eventName, 'JP' as the countryId, and 1796 // 15 as the eventCount, would be: ```none "dimensionValues": [ { 1797 // "value": "in_app_purchase" }, { "value": "JP" } ], "metricValues": [ 1798 // { "value": "15" } ] ``` 1799 type Row struct { 1800 // DimensionValues: List of requested dimension values. In a 1801 // PivotReport, dimension_values are only listed for dimensions included 1802 // in a pivot. 1803 DimensionValues []*DimensionValue `json:"dimensionValues,omitempty"` 1804 1805 // MetricValues: List of requested visible metric values. 1806 MetricValues []*MetricValue `json:"metricValues,omitempty"` 1807 1808 // ForceSendFields is a list of field names (e.g. "DimensionValues") to 1809 // unconditionally include in API requests. By default, fields with 1810 // empty values are omitted from API requests. However, any non-pointer, 1811 // non-interface field appearing in ForceSendFields will be sent to the 1812 // server regardless of whether the field is empty or not. This may be 1813 // used to include empty fields in Patch requests. 1814 ForceSendFields []string `json:"-"` 1815 1816 // NullFields is a list of field names (e.g. "DimensionValues") to 1817 // include in API requests with the JSON null value. By default, fields 1818 // with empty values are omitted from API requests. However, any field 1819 // with an empty value appearing in NullFields will be sent to the 1820 // server as null. It is an error if a field in this list has a 1821 // non-empty value. This may be used to include null fields in Patch 1822 // requests. 1823 NullFields []string `json:"-"` 1824 } 1825 1826 func (s *Row) MarshalJSON() ([]byte, error) { 1827 type NoMethod Row 1828 raw := NoMethod(*s) 1829 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1830 } 1831 1832 // RunPivotReportRequest: The request to generate a pivot report. 1833 type RunPivotReportRequest struct { 1834 // CohortSpec: Cohort group associated with this request. If there is a 1835 // cohort group in the request the 'cohort' dimension must be present. 1836 CohortSpec *CohortSpec `json:"cohortSpec,omitempty"` 1837 1838 // CurrencyCode: A currency code in ISO4217 format, such as "AED", 1839 // "USD", "JPY". If the field is empty, the report uses the entity's 1840 // default currency. 1841 CurrencyCode string `json:"currencyCode,omitempty"` 1842 1843 // DateRanges: The date range to retrieve event data for the report. If 1844 // multiple date ranges are specified, event data from each date range 1845 // is used in the report. A special dimension with field name 1846 // "dateRange" can be included in a Pivot's field names; if included, 1847 // the report compares between date ranges. In a cohort request, this 1848 // `dateRanges` must be unspecified. 1849 DateRanges []*DateRange `json:"dateRanges,omitempty"` 1850 1851 // DimensionFilter: The filter clause of dimensions. Dimensions must be 1852 // requested to be used in this filter. Metrics cannot be used in this 1853 // filter. 1854 DimensionFilter *FilterExpression `json:"dimensionFilter,omitempty"` 1855 1856 // Dimensions: The dimensions requested. All defined dimensions must be 1857 // used by one of the following: dimension_expression, dimension_filter, 1858 // pivots, order_bys. 1859 Dimensions []*Dimension `json:"dimensions,omitempty"` 1860 1861 // Entity: A property whose events are tracked. Within a batch request, 1862 // this entity should either be unspecified or consistent with the 1863 // batch-level entity. 1864 Entity *Entity `json:"entity,omitempty"` 1865 1866 // KeepEmptyRows: If false or unspecified, each row with all metrics 1867 // equal to 0 will not be returned. If true, these rows will be returned 1868 // if they are not separately removed by a filter. 1869 KeepEmptyRows bool `json:"keepEmptyRows,omitempty"` 1870 1871 // MetricFilter: The filter clause of metrics. Applied at post 1872 // aggregation phase, similar to SQL having-clause. Metrics must be 1873 // requested to be used in this filter. Dimensions cannot be used in 1874 // this filter. 1875 MetricFilter *FilterExpression `json:"metricFilter,omitempty"` 1876 1877 // Metrics: The metrics requested, at least one metric needs to be 1878 // specified. All defined metrics must be used by one of the following: 1879 // metric_expression, metric_filter, order_bys. 1880 Metrics []*Metric `json:"metrics,omitempty"` 1881 1882 // Pivots: Describes the visual format of the report's dimensions in 1883 // columns or rows. The union of the fieldNames (dimension names) in all 1884 // pivots must be a subset of dimension names defined in Dimensions. No 1885 // two pivots can share a dimension. A dimension is only visible if it 1886 // appears in a pivot. 1887 Pivots []*Pivot `json:"pivots,omitempty"` 1888 1889 // ReturnPropertyQuota: Toggles whether to return the current state of 1890 // this Analytics Property's quota. Quota is returned in PropertyQuota 1891 // (#PropertyQuota). 1892 ReturnPropertyQuota bool `json:"returnPropertyQuota,omitempty"` 1893 1894 // ForceSendFields is a list of field names (e.g. "CohortSpec") to 1895 // unconditionally include in API requests. By default, fields with 1896 // empty values are omitted from API requests. However, any non-pointer, 1897 // non-interface field appearing in ForceSendFields will be sent to the 1898 // server regardless of whether the field is empty or not. This may be 1899 // used to include empty fields in Patch requests. 1900 ForceSendFields []string `json:"-"` 1901 1902 // NullFields is a list of field names (e.g. "CohortSpec") to include in 1903 // API requests with the JSON null value. By default, fields with empty 1904 // values are omitted from API requests. However, any field with an 1905 // empty value appearing in NullFields will be sent to the server as 1906 // null. It is an error if a field in this list has a non-empty value. 1907 // This may be used to include null fields in Patch requests. 1908 NullFields []string `json:"-"` 1909 } 1910 1911 func (s *RunPivotReportRequest) MarshalJSON() ([]byte, error) { 1912 type NoMethod RunPivotReportRequest 1913 raw := NoMethod(*s) 1914 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1915 } 1916 1917 // RunPivotReportResponse: The response pivot report table corresponding 1918 // to a pivot request. 1919 type RunPivotReportResponse struct { 1920 // Aggregates: Aggregation of metric values. Can be totals, minimums, or 1921 // maximums. The returned aggregations are controlled by the 1922 // metric_aggregations in the pivot. The type of aggregation returned in 1923 // each row is shown by the dimension_values which are set to 1924 // "RESERVED_". 1925 Aggregates []*Row `json:"aggregates,omitempty"` 1926 1927 // DimensionHeaders: Describes dimension columns. The number of 1928 // DimensionHeaders and ordering of DimensionHeaders matches the 1929 // dimensions present in rows. 1930 DimensionHeaders []*DimensionHeader `json:"dimensionHeaders,omitempty"` 1931 1932 // Kind: Identifies what kind of resource this message is. This `kind` 1933 // is always the fixed string "analyticsData#runPivotReport". Useful to 1934 // distinguish between response types in JSON. 1935 Kind string `json:"kind,omitempty"` 1936 1937 // Metadata: Metadata for the report. 1938 Metadata *ResponseMetaData `json:"metadata,omitempty"` 1939 1940 // MetricHeaders: Describes metric columns. The number of MetricHeaders 1941 // and ordering of MetricHeaders matches the metrics present in rows. 1942 MetricHeaders []*MetricHeader `json:"metricHeaders,omitempty"` 1943 1944 // PivotHeaders: Summarizes the columns and rows created by a pivot. 1945 // Each pivot in the request produces one header in the response. If we 1946 // have a request like this: "pivots": [{ "fieldNames": ["country", 1947 // "city"] }, { "fieldNames": "eventName" }] We will have the following 1948 // `pivotHeaders` in the response: "pivotHeaders" : [{ 1949 // "dimensionHeaders": [{ "dimensionValues": [ { "value": "United 1950 // Kingdom" }, { "value": "London" } ] }, { "dimensionValues": [ { 1951 // "value": "Japan" }, { "value": "Osaka" } ] }] }, { 1952 // "dimensionHeaders": [{ "dimensionValues": [{ "value": "session_start" 1953 // }] }, { "dimensionValues": [{ "value": "scroll" }] }] }] 1954 PivotHeaders []*PivotHeader `json:"pivotHeaders,omitempty"` 1955 1956 // PropertyQuota: This Analytics Property's quota state including this 1957 // request. 1958 PropertyQuota *PropertyQuota `json:"propertyQuota,omitempty"` 1959 1960 // Rows: Rows of dimension value combinations and metric values in the 1961 // report. 1962 Rows []*Row `json:"rows,omitempty"` 1963 1964 // ServerResponse contains the HTTP response code and headers from the 1965 // server. 1966 googleapi.ServerResponse `json:"-"` 1967 1968 // ForceSendFields is a list of field names (e.g. "Aggregates") to 1969 // unconditionally include in API requests. By default, fields with 1970 // empty values are omitted from API requests. However, any non-pointer, 1971 // non-interface field appearing in ForceSendFields will be sent to the 1972 // server regardless of whether the field is empty or not. This may be 1973 // used to include empty fields in Patch requests. 1974 ForceSendFields []string `json:"-"` 1975 1976 // NullFields is a list of field names (e.g. "Aggregates") to include in 1977 // API requests with the JSON null value. By default, fields with empty 1978 // values are omitted from API requests. However, any field with an 1979 // empty value appearing in NullFields will be sent to the server as 1980 // null. It is an error if a field in this list has a non-empty value. 1981 // This may be used to include null fields in Patch requests. 1982 NullFields []string `json:"-"` 1983 } 1984 1985 func (s *RunPivotReportResponse) MarshalJSON() ([]byte, error) { 1986 type NoMethod RunPivotReportResponse 1987 raw := NoMethod(*s) 1988 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1989 } 1990 1991 // RunRealtimeReportRequest: The request to generate a realtime report. 1992 type RunRealtimeReportRequest struct { 1993 // DimensionFilter: The filter clause of dimensions. Dimensions must be 1994 // requested to be used in this filter. Metrics cannot be used in this 1995 // filter. 1996 DimensionFilter *FilterExpression `json:"dimensionFilter,omitempty"` 1997 1998 // Dimensions: The dimensions requested and displayed. 1999 Dimensions []*Dimension `json:"dimensions,omitempty"` 2000 2001 // Limit: The number of rows to return. If the `limit` parameter is 2002 // unspecified, 10,000 rows are returned. The API returns a maximum of 2003 // 100,000 rows per request, no matter how many you ask for. 2004 Limit int64 `json:"limit,omitempty,string"` 2005 2006 // MetricAggregations: Aggregation of metrics. Aggregated metric values 2007 // will be shown in rows where the dimension_values are set to 2008 // "RESERVED_(MetricAggregation)". 2009 // 2010 // Possible values: 2011 // "METRIC_AGGREGATION_UNSPECIFIED" - Unspecified operator. 2012 // "TOTAL" - SUM operator. 2013 // "MINIMUM" - Minimum operator. 2014 // "MAXIMUM" - Maximum operator. 2015 // "COUNT" - Count operator. 2016 MetricAggregations []string `json:"metricAggregations,omitempty"` 2017 2018 // MetricFilter: The filter clause of metrics. Applied at post 2019 // aggregation phase, similar to SQL having-clause. Metrics must be 2020 // requested to be used in this filter. Dimensions cannot be used in 2021 // this filter. 2022 MetricFilter *FilterExpression `json:"metricFilter,omitempty"` 2023 2024 // Metrics: The metrics requested and displayed. 2025 Metrics []*Metric `json:"metrics,omitempty"` 2026 2027 // OrderBys: Specifies how rows are ordered in the response. 2028 OrderBys []*OrderBy `json:"orderBys,omitempty"` 2029 2030 // ReturnPropertyQuota: Toggles whether to return the current state of 2031 // this Analytics Property's Realtime quota. Quota is returned in 2032 // PropertyQuota (#PropertyQuota). 2033 ReturnPropertyQuota bool `json:"returnPropertyQuota,omitempty"` 2034 2035 // ForceSendFields is a list of field names (e.g. "DimensionFilter") to 2036 // unconditionally include in API requests. By default, fields with 2037 // empty values are omitted from API requests. However, any non-pointer, 2038 // non-interface field appearing in ForceSendFields will be sent to the 2039 // server regardless of whether the field is empty or not. This may be 2040 // used to include empty fields in Patch requests. 2041 ForceSendFields []string `json:"-"` 2042 2043 // NullFields is a list of field names (e.g. "DimensionFilter") to 2044 // include in API requests with the JSON null value. By default, fields 2045 // with empty values are omitted from API requests. However, any field 2046 // with an empty value appearing in NullFields will be sent to the 2047 // server as null. It is an error if a field in this list has a 2048 // non-empty value. This may be used to include null fields in Patch 2049 // requests. 2050 NullFields []string `json:"-"` 2051 } 2052 2053 func (s *RunRealtimeReportRequest) MarshalJSON() ([]byte, error) { 2054 type NoMethod RunRealtimeReportRequest 2055 raw := NoMethod(*s) 2056 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2057 } 2058 2059 // RunRealtimeReportResponse: The response realtime report table 2060 // corresponding to a request. 2061 type RunRealtimeReportResponse struct { 2062 // DimensionHeaders: Describes dimension columns. The number of 2063 // DimensionHeaders and ordering of DimensionHeaders matches the 2064 // dimensions present in rows. 2065 DimensionHeaders []*DimensionHeader `json:"dimensionHeaders,omitempty"` 2066 2067 // Kind: Identifies what kind of resource this message is. This `kind` 2068 // is always the fixed string "analyticsData#runRealtimeReport". Useful 2069 // to distinguish between response types in JSON. 2070 Kind string `json:"kind,omitempty"` 2071 2072 // Maximums: If requested, the maximum values of metrics. 2073 Maximums []*Row `json:"maximums,omitempty"` 2074 2075 // MetricHeaders: Describes metric columns. The number of MetricHeaders 2076 // and ordering of MetricHeaders matches the metrics present in rows. 2077 MetricHeaders []*MetricHeader `json:"metricHeaders,omitempty"` 2078 2079 // Minimums: If requested, the minimum values of metrics. 2080 Minimums []*Row `json:"minimums,omitempty"` 2081 2082 // PropertyQuota: This Analytics Property's Realtime quota state 2083 // including this request. 2084 PropertyQuota *PropertyQuota `json:"propertyQuota,omitempty"` 2085 2086 // RowCount: The total number of rows in the query result, regardless of 2087 // the number of rows returned in the response. For example if a query 2088 // returns 175 rows and includes limit = 50 in the API request, the 2089 // response will contain row_count = 175 but only 50 rows. 2090 RowCount int64 `json:"rowCount,omitempty"` 2091 2092 // Rows: Rows of dimension value combinations and metric values in the 2093 // report. 2094 Rows []*Row `json:"rows,omitempty"` 2095 2096 // Totals: If requested, the totaled values of metrics. 2097 Totals []*Row `json:"totals,omitempty"` 2098 2099 // ServerResponse contains the HTTP response code and headers from the 2100 // server. 2101 googleapi.ServerResponse `json:"-"` 2102 2103 // ForceSendFields is a list of field names (e.g. "DimensionHeaders") to 2104 // unconditionally include in API requests. By default, fields with 2105 // empty values are omitted from API requests. However, any non-pointer, 2106 // non-interface field appearing in ForceSendFields will be sent to the 2107 // server regardless of whether the field is empty or not. This may be 2108 // used to include empty fields in Patch requests. 2109 ForceSendFields []string `json:"-"` 2110 2111 // NullFields is a list of field names (e.g. "DimensionHeaders") to 2112 // include in API requests with the JSON null value. By default, fields 2113 // with empty values are omitted from API requests. However, any field 2114 // with an empty value appearing in NullFields will be sent to the 2115 // server as null. It is an error if a field in this list has a 2116 // non-empty value. This may be used to include null fields in Patch 2117 // requests. 2118 NullFields []string `json:"-"` 2119 } 2120 2121 func (s *RunRealtimeReportResponse) MarshalJSON() ([]byte, error) { 2122 type NoMethod RunRealtimeReportResponse 2123 raw := NoMethod(*s) 2124 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2125 } 2126 2127 // RunReportRequest: The request to generate a report. 2128 type RunReportRequest struct { 2129 // CohortSpec: Cohort group associated with this request. If there is a 2130 // cohort group in the request the 'cohort' dimension must be present. 2131 CohortSpec *CohortSpec `json:"cohortSpec,omitempty"` 2132 2133 // CurrencyCode: A currency code in ISO4217 format, such as "AED", 2134 // "USD", "JPY". If the field is empty, the report uses the entity's 2135 // default currency. 2136 CurrencyCode string `json:"currencyCode,omitempty"` 2137 2138 // DateRanges: Date ranges of data to read. If multiple date ranges are 2139 // requested, each response row will contain a zero based date range 2140 // index. If two date ranges overlap, the event data for the overlapping 2141 // days is included in the response rows for both date ranges. In a 2142 // cohort request, this `dateRanges` must be unspecified. 2143 DateRanges []*DateRange `json:"dateRanges,omitempty"` 2144 2145 // DimensionFilter: The filter clause of dimensions. Dimensions must be 2146 // requested to be used in this filter. Metrics cannot be used in this 2147 // filter. 2148 DimensionFilter *FilterExpression `json:"dimensionFilter,omitempty"` 2149 2150 // Dimensions: The dimensions requested and displayed. 2151 Dimensions []*Dimension `json:"dimensions,omitempty"` 2152 2153 // Entity: A property whose events are tracked. Within a batch request, 2154 // this entity should either be unspecified or consistent with the 2155 // batch-level entity. 2156 Entity *Entity `json:"entity,omitempty"` 2157 2158 // KeepEmptyRows: If false or unspecified, each row with all metrics 2159 // equal to 0 will not be returned. If true, these rows will be returned 2160 // if they are not separately removed by a filter. 2161 KeepEmptyRows bool `json:"keepEmptyRows,omitempty"` 2162 2163 // Limit: The number of rows to return. If the `limit` parameter is 2164 // unspecified, 10,000 rows are returned. The API returns a maximum of 2165 // 100,000 rows per request, no matter how many you ask for. To learn 2166 // more about this pagination parameter, see Pagination 2167 // (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). 2168 Limit int64 `json:"limit,omitempty,string"` 2169 2170 // MetricAggregations: Aggregation of metrics. Aggregated metric values 2171 // will be shown in rows where the dimension_values are set to 2172 // "RESERVED_(MetricAggregation)". 2173 // 2174 // Possible values: 2175 // "METRIC_AGGREGATION_UNSPECIFIED" - Unspecified operator. 2176 // "TOTAL" - SUM operator. 2177 // "MINIMUM" - Minimum operator. 2178 // "MAXIMUM" - Maximum operator. 2179 // "COUNT" - Count operator. 2180 MetricAggregations []string `json:"metricAggregations,omitempty"` 2181 2182 // MetricFilter: The filter clause of metrics. Applied at post 2183 // aggregation phase, similar to SQL having-clause. Metrics must be 2184 // requested to be used in this filter. Dimensions cannot be used in 2185 // this filter. 2186 MetricFilter *FilterExpression `json:"metricFilter,omitempty"` 2187 2188 // Metrics: The metrics requested and displayed. 2189 Metrics []*Metric `json:"metrics,omitempty"` 2190 2191 // Offset: The row count of the start row. The first row is counted as 2192 // row 0. To learn more about this pagination parameter, see Pagination 2193 // (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). 2194 Offset int64 `json:"offset,omitempty,string"` 2195 2196 // OrderBys: Specifies how rows are ordered in the response. 2197 OrderBys []*OrderBy `json:"orderBys,omitempty"` 2198 2199 // ReturnPropertyQuota: Toggles whether to return the current state of 2200 // this Analytics Property's quota. Quota is returned in PropertyQuota 2201 // (#PropertyQuota). 2202 ReturnPropertyQuota bool `json:"returnPropertyQuota,omitempty"` 2203 2204 // ForceSendFields is a list of field names (e.g. "CohortSpec") to 2205 // unconditionally include in API requests. By default, fields with 2206 // empty values are omitted from API requests. However, any non-pointer, 2207 // non-interface field appearing in ForceSendFields will be sent to the 2208 // server regardless of whether the field is empty or not. This may be 2209 // used to include empty fields in Patch requests. 2210 ForceSendFields []string `json:"-"` 2211 2212 // NullFields is a list of field names (e.g. "CohortSpec") to include in 2213 // API requests with the JSON null value. By default, fields with empty 2214 // values are omitted from API requests. However, any field with an 2215 // empty value appearing in NullFields will be sent to the server as 2216 // null. It is an error if a field in this list has a non-empty value. 2217 // This may be used to include null fields in Patch requests. 2218 NullFields []string `json:"-"` 2219 } 2220 2221 func (s *RunReportRequest) MarshalJSON() ([]byte, error) { 2222 type NoMethod RunReportRequest 2223 raw := NoMethod(*s) 2224 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2225 } 2226 2227 // RunReportResponse: The response report table corresponding to a 2228 // request. 2229 type RunReportResponse struct { 2230 // DimensionHeaders: Describes dimension columns. The number of 2231 // DimensionHeaders and ordering of DimensionHeaders matches the 2232 // dimensions present in rows. 2233 DimensionHeaders []*DimensionHeader `json:"dimensionHeaders,omitempty"` 2234 2235 // Kind: Identifies what kind of resource this message is. This `kind` 2236 // is always the fixed string "analyticsData#runReport". Useful to 2237 // distinguish between response types in JSON. 2238 Kind string `json:"kind,omitempty"` 2239 2240 // Maximums: If requested, the maximum values of metrics. 2241 Maximums []*Row `json:"maximums,omitempty"` 2242 2243 // Metadata: Metadata for the report. 2244 Metadata *ResponseMetaData `json:"metadata,omitempty"` 2245 2246 // MetricHeaders: Describes metric columns. The number of MetricHeaders 2247 // and ordering of MetricHeaders matches the metrics present in rows. 2248 MetricHeaders []*MetricHeader `json:"metricHeaders,omitempty"` 2249 2250 // Minimums: If requested, the minimum values of metrics. 2251 Minimums []*Row `json:"minimums,omitempty"` 2252 2253 // PropertyQuota: This Analytics Property's quota state including this 2254 // request. 2255 PropertyQuota *PropertyQuota `json:"propertyQuota,omitempty"` 2256 2257 // RowCount: The total number of rows in the query result, regardless of 2258 // the number of rows returned in the response. For example if a query 2259 // returns 175 rows and includes limit = 50 in the API request, the 2260 // response will contain row_count = 175 but only 50 rows. To learn more 2261 // about this pagination parameter, see Pagination 2262 // (https://developers.google.com/analytics/devguides/reporting/data/v1/basics#pagination). 2263 RowCount int64 `json:"rowCount,omitempty"` 2264 2265 // Rows: Rows of dimension value combinations and metric values in the 2266 // report. 2267 Rows []*Row `json:"rows,omitempty"` 2268 2269 // Totals: If requested, the totaled values of metrics. 2270 Totals []*Row `json:"totals,omitempty"` 2271 2272 // ServerResponse contains the HTTP response code and headers from the 2273 // server. 2274 googleapi.ServerResponse `json:"-"` 2275 2276 // ForceSendFields is a list of field names (e.g. "DimensionHeaders") to 2277 // unconditionally include in API requests. By default, fields with 2278 // empty values are omitted from API requests. However, any non-pointer, 2279 // non-interface field appearing in ForceSendFields will be sent to the 2280 // server regardless of whether the field is empty or not. This may be 2281 // used to include empty fields in Patch requests. 2282 ForceSendFields []string `json:"-"` 2283 2284 // NullFields is a list of field names (e.g. "DimensionHeaders") to 2285 // include in API requests with the JSON null value. By default, fields 2286 // with empty values are omitted from API requests. However, any field 2287 // with an empty value appearing in NullFields will be sent to the 2288 // server as null. It is an error if a field in this list has a 2289 // non-empty value. This may be used to include null fields in Patch 2290 // requests. 2291 NullFields []string `json:"-"` 2292 } 2293 2294 func (s *RunReportResponse) MarshalJSON() ([]byte, error) { 2295 type NoMethod RunReportResponse 2296 raw := NoMethod(*s) 2297 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2298 } 2299 2300 // StringFilter: The filter for string 2301 type StringFilter struct { 2302 // CaseSensitive: If true, the string value is case sensitive. 2303 CaseSensitive bool `json:"caseSensitive,omitempty"` 2304 2305 // MatchType: The match type for this filter. 2306 // 2307 // Possible values: 2308 // "MATCH_TYPE_UNSPECIFIED" - Unspecified 2309 // "EXACT" - Exact match of the string value. 2310 // "BEGINS_WITH" - Begins with the string value. 2311 // "ENDS_WITH" - Ends with the string value. 2312 // "CONTAINS" - Contains the string value. 2313 // "FULL_REGEXP" - Full regular expression match with the string 2314 // value. 2315 // "PARTIAL_REGEXP" - Partial regular expression match with the string 2316 // value. 2317 MatchType string `json:"matchType,omitempty"` 2318 2319 // Value: The string value used for the matching. 2320 Value string `json:"value,omitempty"` 2321 2322 // ForceSendFields is a list of field names (e.g. "CaseSensitive") to 2323 // unconditionally include in API requests. By default, fields with 2324 // empty values are omitted from API requests. However, any non-pointer, 2325 // non-interface field appearing in ForceSendFields will be sent to the 2326 // server regardless of whether the field is empty or not. This may be 2327 // used to include empty fields in Patch requests. 2328 ForceSendFields []string `json:"-"` 2329 2330 // NullFields is a list of field names (e.g. "CaseSensitive") to include 2331 // in API requests with the JSON null value. By default, fields with 2332 // empty values are omitted from API requests. However, any field with 2333 // an empty value appearing in NullFields will be sent to the server as 2334 // null. It is an error if a field in this list has a non-empty value. 2335 // This may be used to include null fields in Patch requests. 2336 NullFields []string `json:"-"` 2337 } 2338 2339 func (s *StringFilter) MarshalJSON() ([]byte, error) { 2340 type NoMethod StringFilter 2341 raw := NoMethod(*s) 2342 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2343 } 2344 2345 // method id "analyticsdata.properties.getMetadata": 2346 2347 type PropertiesGetMetadataCall struct { 2348 s *Service 2349 nameid string 2350 urlParams_ gensupport.URLParams 2351 ifNoneMatch_ string 2352 ctx_ context.Context 2353 header_ http.Header 2354 } 2355 2356 // GetMetadata: Returns metadata for dimensions and metrics available in 2357 // reporting methods. Used to explore the dimensions and metrics. In 2358 // this method, a Google Analytics GA4 Property Identifier is specified 2359 // in the request, and the metadata response includes Custom dimensions 2360 // and metrics as well as Universal metadata. For example if a custom 2361 // metric with parameter name `levels_unlocked` is registered to a 2362 // property, the Metadata response will contain 2363 // `customEvent:levels_unlocked`. Universal metadata are dimensions and 2364 // metrics applicable to any property such as `country` and 2365 // `totalUsers`. 2366 func (r *PropertiesService) GetMetadata(nameid string) *PropertiesGetMetadataCall { 2367 c := &PropertiesGetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2368 c.nameid = nameid 2369 return c 2370 } 2371 2372 // Fields allows partial responses to be retrieved. See 2373 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2374 // for more information. 2375 func (c *PropertiesGetMetadataCall) Fields(s ...googleapi.Field) *PropertiesGetMetadataCall { 2376 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2377 return c 2378 } 2379 2380 // IfNoneMatch sets the optional parameter which makes the operation 2381 // fail if the object's ETag matches the given value. This is useful for 2382 // getting updates only after the object has changed since the last 2383 // request. Use googleapi.IsNotModified to check whether the response 2384 // error from Do is the result of In-None-Match. 2385 func (c *PropertiesGetMetadataCall) IfNoneMatch(entityTag string) *PropertiesGetMetadataCall { 2386 c.ifNoneMatch_ = entityTag 2387 return c 2388 } 2389 2390 // Context sets the context to be used in this call's Do method. Any 2391 // pending HTTP request will be aborted if the provided context is 2392 // canceled. 2393 func (c *PropertiesGetMetadataCall) Context(ctx context.Context) *PropertiesGetMetadataCall { 2394 c.ctx_ = ctx 2395 return c 2396 } 2397 2398 // Header returns an http.Header that can be modified by the caller to 2399 // add HTTP headers to the request. 2400 func (c *PropertiesGetMetadataCall) Header() http.Header { 2401 if c.header_ == nil { 2402 c.header_ = make(http.Header) 2403 } 2404 return c.header_ 2405 } 2406 2407 func (c *PropertiesGetMetadataCall) doRequest(alt string) (*http.Response, error) { 2408 reqHeaders := make(http.Header) 2409 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210321") 2410 for k, v := range c.header_ { 2411 reqHeaders[k] = v 2412 } 2413 reqHeaders.Set("User-Agent", c.s.userAgent()) 2414 if c.ifNoneMatch_ != "" { 2415 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2416 } 2417 var body io.Reader = nil 2418 c.urlParams_.Set("alt", alt) 2419 c.urlParams_.Set("prettyPrint", "false") 2420 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}") 2421 urls += "?" + c.urlParams_.Encode() 2422 req, err := http.NewRequest("GET", urls, body) 2423 if err != nil { 2424 return nil, err 2425 } 2426 req.Header = reqHeaders 2427 googleapi.Expand(req.URL, map[string]string{ 2428 "name": c.nameid, 2429 }) 2430 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2431 } 2432 2433 // Do executes the "analyticsdata.properties.getMetadata" call. 2434 // Exactly one of *Metadata or error will be non-nil. Any non-2xx status 2435 // code is an error. Response headers are in either 2436 // *Metadata.ServerResponse.Header or (if a response was returned at 2437 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2438 // to check whether the returned error was because 2439 // http.StatusNotModified was returned. 2440 func (c *PropertiesGetMetadataCall) Do(opts ...googleapi.CallOption) (*Metadata, error) { 2441 gensupport.SetOptions(c.urlParams_, opts...) 2442 res, err := c.doRequest("json") 2443 if res != nil && res.StatusCode == http.StatusNotModified { 2444 if res.Body != nil { 2445 res.Body.Close() 2446 } 2447 return nil, &googleapi.Error{ 2448 Code: res.StatusCode, 2449 Header: res.Header, 2450 } 2451 } 2452 if err != nil { 2453 return nil, err 2454 } 2455 defer googleapi.CloseBody(res) 2456 if err := googleapi.CheckResponse(res); err != nil { 2457 return nil, err 2458 } 2459 ret := &Metadata{ 2460 ServerResponse: googleapi.ServerResponse{ 2461 Header: res.Header, 2462 HTTPStatusCode: res.StatusCode, 2463 }, 2464 } 2465 target := &ret 2466 if err := gensupport.DecodeResponse(target, res); err != nil { 2467 return nil, err 2468 } 2469 return ret, nil 2470 // { 2471 // "description": "Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata. For example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.", 2472 // "flatPath": "v1alpha/properties/{propertiesId}/metadata", 2473 // "httpMethod": "GET", 2474 // "id": "analyticsdata.properties.getMetadata", 2475 // "parameterOrder": [ 2476 // "name" 2477 // ], 2478 // "parameters": { 2479 // "name": { 2480 // "description": "Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics.", 2481 // "location": "path", 2482 // "pattern": "^properties/[^/]+/metadata$", 2483 // "required": true, 2484 // "type": "string" 2485 // } 2486 // }, 2487 // "path": "v1alpha/{+name}", 2488 // "response": { 2489 // "$ref": "Metadata" 2490 // }, 2491 // "scopes": [ 2492 // "https://www.googleapis.com/auth/analytics", 2493 // "https://www.googleapis.com/auth/analytics.readonly" 2494 // ] 2495 // } 2496 2497 } 2498 2499 // method id "analyticsdata.properties.runRealtimeReport": 2500 2501 type PropertiesRunRealtimeReportCall struct { 2502 s *Service 2503 propertyid string 2504 runrealtimereportrequest *RunRealtimeReportRequest 2505 urlParams_ gensupport.URLParams 2506 ctx_ context.Context 2507 header_ http.Header 2508 } 2509 2510 // RunRealtimeReport: The Google Analytics Realtime API returns a 2511 // customized report of realtime event data for your property. These 2512 // reports show events and usage from the last 30 minutes. 2513 func (r *PropertiesService) RunRealtimeReport(propertyid string, runrealtimereportrequest *RunRealtimeReportRequest) *PropertiesRunRealtimeReportCall { 2514 c := &PropertiesRunRealtimeReportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2515 c.propertyid = propertyid 2516 c.runrealtimereportrequest = runrealtimereportrequest 2517 return c 2518 } 2519 2520 // Fields allows partial responses to be retrieved. See 2521 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2522 // for more information. 2523 func (c *PropertiesRunRealtimeReportCall) Fields(s ...googleapi.Field) *PropertiesRunRealtimeReportCall { 2524 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2525 return c 2526 } 2527 2528 // Context sets the context to be used in this call's Do method. Any 2529 // pending HTTP request will be aborted if the provided context is 2530 // canceled. 2531 func (c *PropertiesRunRealtimeReportCall) Context(ctx context.Context) *PropertiesRunRealtimeReportCall { 2532 c.ctx_ = ctx 2533 return c 2534 } 2535 2536 // Header returns an http.Header that can be modified by the caller to 2537 // add HTTP headers to the request. 2538 func (c *PropertiesRunRealtimeReportCall) Header() http.Header { 2539 if c.header_ == nil { 2540 c.header_ = make(http.Header) 2541 } 2542 return c.header_ 2543 } 2544 2545 func (c *PropertiesRunRealtimeReportCall) doRequest(alt string) (*http.Response, error) { 2546 reqHeaders := make(http.Header) 2547 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210321") 2548 for k, v := range c.header_ { 2549 reqHeaders[k] = v 2550 } 2551 reqHeaders.Set("User-Agent", c.s.userAgent()) 2552 var body io.Reader = nil 2553 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runrealtimereportrequest) 2554 if err != nil { 2555 return nil, err 2556 } 2557 reqHeaders.Set("Content-Type", "application/json") 2558 c.urlParams_.Set("alt", alt) 2559 c.urlParams_.Set("prettyPrint", "false") 2560 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+property}:runRealtimeReport") 2561 urls += "?" + c.urlParams_.Encode() 2562 req, err := http.NewRequest("POST", urls, body) 2563 if err != nil { 2564 return nil, err 2565 } 2566 req.Header = reqHeaders 2567 googleapi.Expand(req.URL, map[string]string{ 2568 "property": c.propertyid, 2569 }) 2570 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2571 } 2572 2573 // Do executes the "analyticsdata.properties.runRealtimeReport" call. 2574 // Exactly one of *RunRealtimeReportResponse or error will be non-nil. 2575 // Any non-2xx status code is an error. Response headers are in either 2576 // *RunRealtimeReportResponse.ServerResponse.Header or (if a response 2577 // was returned at all) in error.(*googleapi.Error).Header. Use 2578 // googleapi.IsNotModified to check whether the returned error was 2579 // because http.StatusNotModified was returned. 2580 func (c *PropertiesRunRealtimeReportCall) Do(opts ...googleapi.CallOption) (*RunRealtimeReportResponse, error) { 2581 gensupport.SetOptions(c.urlParams_, opts...) 2582 res, err := c.doRequest("json") 2583 if res != nil && res.StatusCode == http.StatusNotModified { 2584 if res.Body != nil { 2585 res.Body.Close() 2586 } 2587 return nil, &googleapi.Error{ 2588 Code: res.StatusCode, 2589 Header: res.Header, 2590 } 2591 } 2592 if err != nil { 2593 return nil, err 2594 } 2595 defer googleapi.CloseBody(res) 2596 if err := googleapi.CheckResponse(res); err != nil { 2597 return nil, err 2598 } 2599 ret := &RunRealtimeReportResponse{ 2600 ServerResponse: googleapi.ServerResponse{ 2601 Header: res.Header, 2602 HTTPStatusCode: res.StatusCode, 2603 }, 2604 } 2605 target := &ret 2606 if err := gensupport.DecodeResponse(target, res); err != nil { 2607 return nil, err 2608 } 2609 return ret, nil 2610 // { 2611 // "description": "The Google Analytics Realtime API returns a customized report of realtime event data for your property. These reports show events and usage from the last 30 minutes.", 2612 // "flatPath": "v1alpha/properties/{propertiesId}:runRealtimeReport", 2613 // "httpMethod": "POST", 2614 // "id": "analyticsdata.properties.runRealtimeReport", 2615 // "parameterOrder": [ 2616 // "property" 2617 // ], 2618 // "parameters": { 2619 // "property": { 2620 // "description": "A Google Analytics GA4 property identifier whose events are tracked. Specified in the URL path and not the body. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Example: properties/1234", 2621 // "location": "path", 2622 // "pattern": "^properties/[^/]+$", 2623 // "required": true, 2624 // "type": "string" 2625 // } 2626 // }, 2627 // "path": "v1alpha/{+property}:runRealtimeReport", 2628 // "request": { 2629 // "$ref": "RunRealtimeReportRequest" 2630 // }, 2631 // "response": { 2632 // "$ref": "RunRealtimeReportResponse" 2633 // }, 2634 // "scopes": [ 2635 // "https://www.googleapis.com/auth/analytics", 2636 // "https://www.googleapis.com/auth/analytics.readonly" 2637 // ] 2638 // } 2639 2640 } 2641 2642 // method id "analyticsdata.batchRunPivotReports": 2643 2644 type V1alphaBatchRunPivotReportsCall struct { 2645 s *Service 2646 batchrunpivotreportsrequest *BatchRunPivotReportsRequest 2647 urlParams_ gensupport.URLParams 2648 ctx_ context.Context 2649 header_ http.Header 2650 } 2651 2652 // BatchRunPivotReports: Returns multiple pivot reports in a batch. All 2653 // reports must be for the same Entity. 2654 func (r *V1alphaService) BatchRunPivotReports(batchrunpivotreportsrequest *BatchRunPivotReportsRequest) *V1alphaBatchRunPivotReportsCall { 2655 c := &V1alphaBatchRunPivotReportsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2656 c.batchrunpivotreportsrequest = batchrunpivotreportsrequest 2657 return c 2658 } 2659 2660 // Fields allows partial responses to be retrieved. See 2661 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2662 // for more information. 2663 func (c *V1alphaBatchRunPivotReportsCall) Fields(s ...googleapi.Field) *V1alphaBatchRunPivotReportsCall { 2664 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2665 return c 2666 } 2667 2668 // Context sets the context to be used in this call's Do method. Any 2669 // pending HTTP request will be aborted if the provided context is 2670 // canceled. 2671 func (c *V1alphaBatchRunPivotReportsCall) Context(ctx context.Context) *V1alphaBatchRunPivotReportsCall { 2672 c.ctx_ = ctx 2673 return c 2674 } 2675 2676 // Header returns an http.Header that can be modified by the caller to 2677 // add HTTP headers to the request. 2678 func (c *V1alphaBatchRunPivotReportsCall) Header() http.Header { 2679 if c.header_ == nil { 2680 c.header_ = make(http.Header) 2681 } 2682 return c.header_ 2683 } 2684 2685 func (c *V1alphaBatchRunPivotReportsCall) doRequest(alt string) (*http.Response, error) { 2686 reqHeaders := make(http.Header) 2687 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210321") 2688 for k, v := range c.header_ { 2689 reqHeaders[k] = v 2690 } 2691 reqHeaders.Set("User-Agent", c.s.userAgent()) 2692 var body io.Reader = nil 2693 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchrunpivotreportsrequest) 2694 if err != nil { 2695 return nil, err 2696 } 2697 reqHeaders.Set("Content-Type", "application/json") 2698 c.urlParams_.Set("alt", alt) 2699 c.urlParams_.Set("prettyPrint", "false") 2700 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha:batchRunPivotReports") 2701 urls += "?" + c.urlParams_.Encode() 2702 req, err := http.NewRequest("POST", urls, body) 2703 if err != nil { 2704 return nil, err 2705 } 2706 req.Header = reqHeaders 2707 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2708 } 2709 2710 // Do executes the "analyticsdata.batchRunPivotReports" call. 2711 // Exactly one of *BatchRunPivotReportsResponse or error will be 2712 // non-nil. Any non-2xx status code is an error. Response headers are in 2713 // either *BatchRunPivotReportsResponse.ServerResponse.Header or (if a 2714 // response was returned at all) in error.(*googleapi.Error).Header. Use 2715 // googleapi.IsNotModified to check whether the returned error was 2716 // because http.StatusNotModified was returned. 2717 func (c *V1alphaBatchRunPivotReportsCall) Do(opts ...googleapi.CallOption) (*BatchRunPivotReportsResponse, error) { 2718 gensupport.SetOptions(c.urlParams_, opts...) 2719 res, err := c.doRequest("json") 2720 if res != nil && res.StatusCode == http.StatusNotModified { 2721 if res.Body != nil { 2722 res.Body.Close() 2723 } 2724 return nil, &googleapi.Error{ 2725 Code: res.StatusCode, 2726 Header: res.Header, 2727 } 2728 } 2729 if err != nil { 2730 return nil, err 2731 } 2732 defer googleapi.CloseBody(res) 2733 if err := googleapi.CheckResponse(res); err != nil { 2734 return nil, err 2735 } 2736 ret := &BatchRunPivotReportsResponse{ 2737 ServerResponse: googleapi.ServerResponse{ 2738 Header: res.Header, 2739 HTTPStatusCode: res.StatusCode, 2740 }, 2741 } 2742 target := &ret 2743 if err := gensupport.DecodeResponse(target, res); err != nil { 2744 return nil, err 2745 } 2746 return ret, nil 2747 // { 2748 // "description": "Returns multiple pivot reports in a batch. All reports must be for the same Entity.", 2749 // "flatPath": "v1alpha:batchRunPivotReports", 2750 // "httpMethod": "POST", 2751 // "id": "analyticsdata.batchRunPivotReports", 2752 // "parameterOrder": [], 2753 // "parameters": {}, 2754 // "path": "v1alpha:batchRunPivotReports", 2755 // "request": { 2756 // "$ref": "BatchRunPivotReportsRequest" 2757 // }, 2758 // "response": { 2759 // "$ref": "BatchRunPivotReportsResponse" 2760 // }, 2761 // "scopes": [ 2762 // "https://www.googleapis.com/auth/analytics", 2763 // "https://www.googleapis.com/auth/analytics.readonly" 2764 // ] 2765 // } 2766 2767 } 2768 2769 // method id "analyticsdata.batchRunReports": 2770 2771 type V1alphaBatchRunReportsCall struct { 2772 s *Service 2773 batchrunreportsrequest *BatchRunReportsRequest 2774 urlParams_ gensupport.URLParams 2775 ctx_ context.Context 2776 header_ http.Header 2777 } 2778 2779 // BatchRunReports: Returns multiple reports in a batch. All reports 2780 // must be for the same Entity. 2781 func (r *V1alphaService) BatchRunReports(batchrunreportsrequest *BatchRunReportsRequest) *V1alphaBatchRunReportsCall { 2782 c := &V1alphaBatchRunReportsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2783 c.batchrunreportsrequest = batchrunreportsrequest 2784 return c 2785 } 2786 2787 // Fields allows partial responses to be retrieved. See 2788 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2789 // for more information. 2790 func (c *V1alphaBatchRunReportsCall) Fields(s ...googleapi.Field) *V1alphaBatchRunReportsCall { 2791 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2792 return c 2793 } 2794 2795 // Context sets the context to be used in this call's Do method. Any 2796 // pending HTTP request will be aborted if the provided context is 2797 // canceled. 2798 func (c *V1alphaBatchRunReportsCall) Context(ctx context.Context) *V1alphaBatchRunReportsCall { 2799 c.ctx_ = ctx 2800 return c 2801 } 2802 2803 // Header returns an http.Header that can be modified by the caller to 2804 // add HTTP headers to the request. 2805 func (c *V1alphaBatchRunReportsCall) Header() http.Header { 2806 if c.header_ == nil { 2807 c.header_ = make(http.Header) 2808 } 2809 return c.header_ 2810 } 2811 2812 func (c *V1alphaBatchRunReportsCall) doRequest(alt string) (*http.Response, error) { 2813 reqHeaders := make(http.Header) 2814 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210321") 2815 for k, v := range c.header_ { 2816 reqHeaders[k] = v 2817 } 2818 reqHeaders.Set("User-Agent", c.s.userAgent()) 2819 var body io.Reader = nil 2820 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchrunreportsrequest) 2821 if err != nil { 2822 return nil, err 2823 } 2824 reqHeaders.Set("Content-Type", "application/json") 2825 c.urlParams_.Set("alt", alt) 2826 c.urlParams_.Set("prettyPrint", "false") 2827 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha:batchRunReports") 2828 urls += "?" + c.urlParams_.Encode() 2829 req, err := http.NewRequest("POST", urls, body) 2830 if err != nil { 2831 return nil, err 2832 } 2833 req.Header = reqHeaders 2834 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2835 } 2836 2837 // Do executes the "analyticsdata.batchRunReports" call. 2838 // Exactly one of *BatchRunReportsResponse or error will be non-nil. Any 2839 // non-2xx status code is an error. Response headers are in either 2840 // *BatchRunReportsResponse.ServerResponse.Header or (if a response was 2841 // returned at all) in error.(*googleapi.Error).Header. Use 2842 // googleapi.IsNotModified to check whether the returned error was 2843 // because http.StatusNotModified was returned. 2844 func (c *V1alphaBatchRunReportsCall) Do(opts ...googleapi.CallOption) (*BatchRunReportsResponse, error) { 2845 gensupport.SetOptions(c.urlParams_, opts...) 2846 res, err := c.doRequest("json") 2847 if res != nil && res.StatusCode == http.StatusNotModified { 2848 if res.Body != nil { 2849 res.Body.Close() 2850 } 2851 return nil, &googleapi.Error{ 2852 Code: res.StatusCode, 2853 Header: res.Header, 2854 } 2855 } 2856 if err != nil { 2857 return nil, err 2858 } 2859 defer googleapi.CloseBody(res) 2860 if err := googleapi.CheckResponse(res); err != nil { 2861 return nil, err 2862 } 2863 ret := &BatchRunReportsResponse{ 2864 ServerResponse: googleapi.ServerResponse{ 2865 Header: res.Header, 2866 HTTPStatusCode: res.StatusCode, 2867 }, 2868 } 2869 target := &ret 2870 if err := gensupport.DecodeResponse(target, res); err != nil { 2871 return nil, err 2872 } 2873 return ret, nil 2874 // { 2875 // "description": "Returns multiple reports in a batch. All reports must be for the same Entity.", 2876 // "flatPath": "v1alpha:batchRunReports", 2877 // "httpMethod": "POST", 2878 // "id": "analyticsdata.batchRunReports", 2879 // "parameterOrder": [], 2880 // "parameters": {}, 2881 // "path": "v1alpha:batchRunReports", 2882 // "request": { 2883 // "$ref": "BatchRunReportsRequest" 2884 // }, 2885 // "response": { 2886 // "$ref": "BatchRunReportsResponse" 2887 // }, 2888 // "scopes": [ 2889 // "https://www.googleapis.com/auth/analytics", 2890 // "https://www.googleapis.com/auth/analytics.readonly" 2891 // ] 2892 // } 2893 2894 } 2895 2896 // method id "analyticsdata.runPivotReport": 2897 2898 type V1alphaRunPivotReportCall struct { 2899 s *Service 2900 runpivotreportrequest *RunPivotReportRequest 2901 urlParams_ gensupport.URLParams 2902 ctx_ context.Context 2903 header_ http.Header 2904 } 2905 2906 // RunPivotReport: Returns a customized pivot report of your Google 2907 // Analytics event data. Pivot reports are more advanced and expressive 2908 // formats than regular reports. In a pivot report, dimensions are only 2909 // visible if they are included in a pivot. Multiple pivots can be 2910 // specified to further dissect your data. 2911 func (r *V1alphaService) RunPivotReport(runpivotreportrequest *RunPivotReportRequest) *V1alphaRunPivotReportCall { 2912 c := &V1alphaRunPivotReportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2913 c.runpivotreportrequest = runpivotreportrequest 2914 return c 2915 } 2916 2917 // Fields allows partial responses to be retrieved. See 2918 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2919 // for more information. 2920 func (c *V1alphaRunPivotReportCall) Fields(s ...googleapi.Field) *V1alphaRunPivotReportCall { 2921 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2922 return c 2923 } 2924 2925 // Context sets the context to be used in this call's Do method. Any 2926 // pending HTTP request will be aborted if the provided context is 2927 // canceled. 2928 func (c *V1alphaRunPivotReportCall) Context(ctx context.Context) *V1alphaRunPivotReportCall { 2929 c.ctx_ = ctx 2930 return c 2931 } 2932 2933 // Header returns an http.Header that can be modified by the caller to 2934 // add HTTP headers to the request. 2935 func (c *V1alphaRunPivotReportCall) Header() http.Header { 2936 if c.header_ == nil { 2937 c.header_ = make(http.Header) 2938 } 2939 return c.header_ 2940 } 2941 2942 func (c *V1alphaRunPivotReportCall) doRequest(alt string) (*http.Response, error) { 2943 reqHeaders := make(http.Header) 2944 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210321") 2945 for k, v := range c.header_ { 2946 reqHeaders[k] = v 2947 } 2948 reqHeaders.Set("User-Agent", c.s.userAgent()) 2949 var body io.Reader = nil 2950 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runpivotreportrequest) 2951 if err != nil { 2952 return nil, err 2953 } 2954 reqHeaders.Set("Content-Type", "application/json") 2955 c.urlParams_.Set("alt", alt) 2956 c.urlParams_.Set("prettyPrint", "false") 2957 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha:runPivotReport") 2958 urls += "?" + c.urlParams_.Encode() 2959 req, err := http.NewRequest("POST", urls, body) 2960 if err != nil { 2961 return nil, err 2962 } 2963 req.Header = reqHeaders 2964 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2965 } 2966 2967 // Do executes the "analyticsdata.runPivotReport" call. 2968 // Exactly one of *RunPivotReportResponse or error will be non-nil. Any 2969 // non-2xx status code is an error. Response headers are in either 2970 // *RunPivotReportResponse.ServerResponse.Header or (if a response was 2971 // returned at all) in error.(*googleapi.Error).Header. Use 2972 // googleapi.IsNotModified to check whether the returned error was 2973 // because http.StatusNotModified was returned. 2974 func (c *V1alphaRunPivotReportCall) Do(opts ...googleapi.CallOption) (*RunPivotReportResponse, error) { 2975 gensupport.SetOptions(c.urlParams_, opts...) 2976 res, err := c.doRequest("json") 2977 if res != nil && res.StatusCode == http.StatusNotModified { 2978 if res.Body != nil { 2979 res.Body.Close() 2980 } 2981 return nil, &googleapi.Error{ 2982 Code: res.StatusCode, 2983 Header: res.Header, 2984 } 2985 } 2986 if err != nil { 2987 return nil, err 2988 } 2989 defer googleapi.CloseBody(res) 2990 if err := googleapi.CheckResponse(res); err != nil { 2991 return nil, err 2992 } 2993 ret := &RunPivotReportResponse{ 2994 ServerResponse: googleapi.ServerResponse{ 2995 Header: res.Header, 2996 HTTPStatusCode: res.StatusCode, 2997 }, 2998 } 2999 target := &ret 3000 if err := gensupport.DecodeResponse(target, res); err != nil { 3001 return nil, err 3002 } 3003 return ret, nil 3004 // { 3005 // "description": "Returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.", 3006 // "flatPath": "v1alpha:runPivotReport", 3007 // "httpMethod": "POST", 3008 // "id": "analyticsdata.runPivotReport", 3009 // "parameterOrder": [], 3010 // "parameters": {}, 3011 // "path": "v1alpha:runPivotReport", 3012 // "request": { 3013 // "$ref": "RunPivotReportRequest" 3014 // }, 3015 // "response": { 3016 // "$ref": "RunPivotReportResponse" 3017 // }, 3018 // "scopes": [ 3019 // "https://www.googleapis.com/auth/analytics", 3020 // "https://www.googleapis.com/auth/analytics.readonly" 3021 // ] 3022 // } 3023 3024 } 3025 3026 // method id "analyticsdata.runReport": 3027 3028 type V1alphaRunReportCall struct { 3029 s *Service 3030 runreportrequest *RunReportRequest 3031 urlParams_ gensupport.URLParams 3032 ctx_ context.Context 3033 header_ http.Header 3034 } 3035 3036 // RunReport: Returns a customized report of your Google Analytics event 3037 // data. Reports contain statistics derived from data collected by the 3038 // Google Analytics tracking code. The data returned from the API is as 3039 // a table with columns for the requested dimensions and metrics. 3040 // Metrics are individual measurements of user activity on your 3041 // property, such as active users or event count. Dimensions break down 3042 // metrics across some common criteria, such as country or event name. 3043 func (r *V1alphaService) RunReport(runreportrequest *RunReportRequest) *V1alphaRunReportCall { 3044 c := &V1alphaRunReportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3045 c.runreportrequest = runreportrequest 3046 return c 3047 } 3048 3049 // Fields allows partial responses to be retrieved. See 3050 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3051 // for more information. 3052 func (c *V1alphaRunReportCall) Fields(s ...googleapi.Field) *V1alphaRunReportCall { 3053 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3054 return c 3055 } 3056 3057 // Context sets the context to be used in this call's Do method. Any 3058 // pending HTTP request will be aborted if the provided context is 3059 // canceled. 3060 func (c *V1alphaRunReportCall) Context(ctx context.Context) *V1alphaRunReportCall { 3061 c.ctx_ = ctx 3062 return c 3063 } 3064 3065 // Header returns an http.Header that can be modified by the caller to 3066 // add HTTP headers to the request. 3067 func (c *V1alphaRunReportCall) Header() http.Header { 3068 if c.header_ == nil { 3069 c.header_ = make(http.Header) 3070 } 3071 return c.header_ 3072 } 3073 3074 func (c *V1alphaRunReportCall) doRequest(alt string) (*http.Response, error) { 3075 reqHeaders := make(http.Header) 3076 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210321") 3077 for k, v := range c.header_ { 3078 reqHeaders[k] = v 3079 } 3080 reqHeaders.Set("User-Agent", c.s.userAgent()) 3081 var body io.Reader = nil 3082 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runreportrequest) 3083 if err != nil { 3084 return nil, err 3085 } 3086 reqHeaders.Set("Content-Type", "application/json") 3087 c.urlParams_.Set("alt", alt) 3088 c.urlParams_.Set("prettyPrint", "false") 3089 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha:runReport") 3090 urls += "?" + c.urlParams_.Encode() 3091 req, err := http.NewRequest("POST", urls, body) 3092 if err != nil { 3093 return nil, err 3094 } 3095 req.Header = reqHeaders 3096 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3097 } 3098 3099 // Do executes the "analyticsdata.runReport" call. 3100 // Exactly one of *RunReportResponse or error will be non-nil. Any 3101 // non-2xx status code is an error. Response headers are in either 3102 // *RunReportResponse.ServerResponse.Header or (if a response was 3103 // returned at all) in error.(*googleapi.Error).Header. Use 3104 // googleapi.IsNotModified to check whether the returned error was 3105 // because http.StatusNotModified was returned. 3106 func (c *V1alphaRunReportCall) Do(opts ...googleapi.CallOption) (*RunReportResponse, error) { 3107 gensupport.SetOptions(c.urlParams_, opts...) 3108 res, err := c.doRequest("json") 3109 if res != nil && res.StatusCode == http.StatusNotModified { 3110 if res.Body != nil { 3111 res.Body.Close() 3112 } 3113 return nil, &googleapi.Error{ 3114 Code: res.StatusCode, 3115 Header: res.Header, 3116 } 3117 } 3118 if err != nil { 3119 return nil, err 3120 } 3121 defer googleapi.CloseBody(res) 3122 if err := googleapi.CheckResponse(res); err != nil { 3123 return nil, err 3124 } 3125 ret := &RunReportResponse{ 3126 ServerResponse: googleapi.ServerResponse{ 3127 Header: res.Header, 3128 HTTPStatusCode: res.StatusCode, 3129 }, 3130 } 3131 target := &ret 3132 if err := gensupport.DecodeResponse(target, res); err != nil { 3133 return nil, err 3134 } 3135 return ret, nil 3136 // { 3137 // "description": "Returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.", 3138 // "flatPath": "v1alpha:runReport", 3139 // "httpMethod": "POST", 3140 // "id": "analyticsdata.runReport", 3141 // "parameterOrder": [], 3142 // "parameters": {}, 3143 // "path": "v1alpha:runReport", 3144 // "request": { 3145 // "$ref": "RunReportRequest" 3146 // }, 3147 // "response": { 3148 // "$ref": "RunReportResponse" 3149 // }, 3150 // "scopes": [ 3151 // "https://www.googleapis.com/auth/analytics", 3152 // "https://www.googleapis.com/auth/analytics.readonly" 3153 // ] 3154 // } 3155 3156 } 3157