1// Copyright 2020 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 admin provides access to the Admin SDK API. 8// 9// For product documentation, see: http://developers.google.com/admin-sdk/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/admin/reports/v1" 16// ... 17// ctx := context.Background() 18// adminService, err := admin.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// adminService, err := admin.NewService(ctx, option.WithScopes(admin.AdminReportsUsageReadonlyScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// adminService, err := admin.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// adminService, err := admin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package admin // import "google.golang.org/api/admin/reports/v1" 43 44import ( 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. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "admin:reports_v1" 79const apiName = "admin" 80const apiVersion = "reports_v1" 81const basePath = "https://admin.googleapis.com/" 82const mtlsBasePath = "https://admin.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // View audit reports for your G Suite domain 87 AdminReportsAuditReadonlyScope = "https://www.googleapis.com/auth/admin.reports.audit.readonly" 88 89 // View usage reports for your G Suite domain 90 AdminReportsUsageReadonlyScope = "https://www.googleapis.com/auth/admin.reports.usage.readonly" 91) 92 93// NewService creates a new Service. 94func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 95 scopesOption := option.WithScopes( 96 "https://www.googleapis.com/auth/admin.reports.audit.readonly", 97 "https://www.googleapis.com/auth/admin.reports.usage.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. 122func 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.Activities = NewActivitiesService(s) 128 s.Channels = NewChannelsService(s) 129 s.CustomerUsageReports = NewCustomerUsageReportsService(s) 130 s.EntityUsageReports = NewEntityUsageReportsService(s) 131 s.UserUsageReport = NewUserUsageReportService(s) 132 return s, nil 133} 134 135type Service struct { 136 client *http.Client 137 BasePath string // API endpoint base URL 138 UserAgent string // optional additional User-Agent fragment 139 140 Activities *ActivitiesService 141 142 Channels *ChannelsService 143 144 CustomerUsageReports *CustomerUsageReportsService 145 146 EntityUsageReports *EntityUsageReportsService 147 148 UserUsageReport *UserUsageReportService 149} 150 151func (s *Service) userAgent() string { 152 if s.UserAgent == "" { 153 return googleapi.UserAgent 154 } 155 return googleapi.UserAgent + " " + s.UserAgent 156} 157 158func NewActivitiesService(s *Service) *ActivitiesService { 159 rs := &ActivitiesService{s: s} 160 return rs 161} 162 163type ActivitiesService struct { 164 s *Service 165} 166 167func NewChannelsService(s *Service) *ChannelsService { 168 rs := &ChannelsService{s: s} 169 return rs 170} 171 172type ChannelsService struct { 173 s *Service 174} 175 176func NewCustomerUsageReportsService(s *Service) *CustomerUsageReportsService { 177 rs := &CustomerUsageReportsService{s: s} 178 return rs 179} 180 181type CustomerUsageReportsService struct { 182 s *Service 183} 184 185func NewEntityUsageReportsService(s *Service) *EntityUsageReportsService { 186 rs := &EntityUsageReportsService{s: s} 187 return rs 188} 189 190type EntityUsageReportsService struct { 191 s *Service 192} 193 194func NewUserUsageReportService(s *Service) *UserUsageReportService { 195 rs := &UserUsageReportService{s: s} 196 return rs 197} 198 199type UserUsageReportService struct { 200 s *Service 201} 202 203// Activities: JSON template for a collection of activities. 204type Activities struct { 205 // Etag: ETag of the resource. 206 Etag string `json:"etag,omitempty"` 207 208 // Items: Each activity record in the response. 209 Items []*Activity `json:"items,omitempty"` 210 211 // Kind: The type of API resource. For an activity report, the value is 212 // `reports#activities`. 213 Kind string `json:"kind,omitempty"` 214 215 // NextPageToken: Token for retrieving the follow-on next page of the 216 // report. The `nextPageToken` value is used in the request's 217 // `pageToken` query string. 218 NextPageToken string `json:"nextPageToken,omitempty"` 219 220 // ServerResponse contains the HTTP response code and headers from the 221 // server. 222 googleapi.ServerResponse `json:"-"` 223 224 // ForceSendFields is a list of field names (e.g. "Etag") to 225 // unconditionally include in API requests. By default, fields with 226 // empty values are omitted from API requests. However, any non-pointer, 227 // non-interface field appearing in ForceSendFields will be sent to the 228 // server regardless of whether the field is empty or not. This may be 229 // used to include empty fields in Patch requests. 230 ForceSendFields []string `json:"-"` 231 232 // NullFields is a list of field names (e.g. "Etag") to include in API 233 // requests with the JSON null value. By default, fields with empty 234 // values are omitted from API requests. However, any field with an 235 // empty value appearing in NullFields will be sent to the server as 236 // null. It is an error if a field in this list has a non-empty value. 237 // This may be used to include null fields in Patch requests. 238 NullFields []string `json:"-"` 239} 240 241func (s *Activities) MarshalJSON() ([]byte, error) { 242 type NoMethod Activities 243 raw := NoMethod(*s) 244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 245} 246 247// Activity: JSON template for the activity resource. 248type Activity struct { 249 // Actor: User doing the action. 250 Actor *ActivityActor `json:"actor,omitempty"` 251 252 // Etag: ETag of the entry. 253 Etag string `json:"etag,omitempty"` 254 255 // Events: Activity events in the report. 256 Events []*ActivityEvents `json:"events,omitempty"` 257 258 // Id: Unique identifier for each activity record. 259 Id *ActivityId `json:"id,omitempty"` 260 261 // IpAddress: IP address of the user doing the action. This is the 262 // Internet Protocol (IP) address of the user when logging into G Suite 263 // which may or may not reflect the user's physical location. For 264 // example, the IP address can be the user's proxy server's address or a 265 // virtual private network (VPN) address. The API supports IPv4 and 266 // IPv6. 267 IpAddress string `json:"ipAddress,omitempty"` 268 269 // Kind: The type of API resource. For an activity report, the value is 270 // `audit#activity`. 271 Kind string `json:"kind,omitempty"` 272 273 // OwnerDomain: This is the domain that is affected by the report's 274 // event. For example domain of Admin console or the Drive application's 275 // document owner. 276 OwnerDomain string `json:"ownerDomain,omitempty"` 277 278 // ForceSendFields is a list of field names (e.g. "Actor") to 279 // unconditionally include in API requests. By default, fields with 280 // empty values are omitted from API requests. However, any non-pointer, 281 // non-interface field appearing in ForceSendFields will be sent to the 282 // server regardless of whether the field is empty or not. This may be 283 // used to include empty fields in Patch requests. 284 ForceSendFields []string `json:"-"` 285 286 // NullFields is a list of field names (e.g. "Actor") to include in API 287 // requests with the JSON null value. By default, fields with empty 288 // values are omitted from API requests. However, any field with an 289 // empty value appearing in NullFields will be sent to the server as 290 // null. It is an error if a field in this list has a non-empty value. 291 // This may be used to include null fields in Patch requests. 292 NullFields []string `json:"-"` 293} 294 295func (s *Activity) MarshalJSON() ([]byte, error) { 296 type NoMethod Activity 297 raw := NoMethod(*s) 298 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 299} 300 301// ActivityActor: User doing the action. 302type ActivityActor struct { 303 // CallerType: The type of actor. 304 CallerType string `json:"callerType,omitempty"` 305 306 // Email: The primary email address of the actor. May be absent if there 307 // is no email address associated with the actor. 308 Email string `json:"email,omitempty"` 309 310 // Key: Only present when `callerType` is `KEY`. Can be the 311 // `consumer_key` of the requestor for OAuth 2LO API requests or an 312 // identifier for robot accounts. 313 Key string `json:"key,omitempty"` 314 315 // ProfileId: The unique G Suite profile ID of the actor. May be absent 316 // if the actor is not a G Suite user. 317 ProfileId string `json:"profileId,omitempty"` 318 319 // ForceSendFields is a list of field names (e.g. "CallerType") to 320 // unconditionally include in API requests. By default, fields with 321 // empty values are omitted from API requests. However, any non-pointer, 322 // non-interface field appearing in ForceSendFields will be sent to the 323 // server regardless of whether the field is empty or not. This may be 324 // used to include empty fields in Patch requests. 325 ForceSendFields []string `json:"-"` 326 327 // NullFields is a list of field names (e.g. "CallerType") to include in 328 // API requests with the JSON null value. By default, fields with empty 329 // values are omitted from API requests. However, any field with an 330 // empty value appearing in NullFields will be sent to the server as 331 // null. It is an error if a field in this list has a non-empty value. 332 // This may be used to include null fields in Patch requests. 333 NullFields []string `json:"-"` 334} 335 336func (s *ActivityActor) MarshalJSON() ([]byte, error) { 337 type NoMethod ActivityActor 338 raw := NoMethod(*s) 339 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 340} 341 342type ActivityEvents struct { 343 // Name: Name of the event. This is the specific name of the activity 344 // reported by the API. And each `eventName` is related to a specific G 345 // Suite service or feature which the API organizes into types of 346 // events. For `eventName` request parameters in general: - If no 347 // `eventName` is given, the report returns all possible instances of an 348 // `eventName`. - When you request an `eventName`, the API's response 349 // returns all activities which contain that `eventName`. It is possible 350 // that the returned activities will have other `eventName` properties 351 // in addition to the one requested. For more information about 352 // `eventName` properties, see the list of event names for various 353 // applications above in `applicationName`. 354 Name string `json:"name,omitempty"` 355 356 // Parameters: Parameter value pairs for various applications. For more 357 // information about `eventName` parameters, see the list of event names 358 // for various applications above in `applicationName`. 359 Parameters []*ActivityEventsParameters `json:"parameters,omitempty"` 360 361 // Type: Type of event. The G Suite service or feature that an 362 // administrator changes is identified in the `type` property which 363 // identifies an event using the `eventName` property. For a full list 364 // of the API's `type` categories, see the list of event names for 365 // various applications above in `applicationName`. 366 Type string `json:"type,omitempty"` 367 368 // ForceSendFields is a list of field names (e.g. "Name") to 369 // unconditionally include in API requests. By default, fields with 370 // empty values are omitted from API requests. However, any non-pointer, 371 // non-interface field appearing in ForceSendFields will be sent to the 372 // server regardless of whether the field is empty or not. This may be 373 // used to include empty fields in Patch requests. 374 ForceSendFields []string `json:"-"` 375 376 // NullFields is a list of field names (e.g. "Name") to include in API 377 // requests with the JSON null value. By default, fields with empty 378 // values are omitted from API requests. However, any field with an 379 // empty value appearing in NullFields will be sent to the server as 380 // null. It is an error if a field in this list has a non-empty value. 381 // This may be used to include null fields in Patch requests. 382 NullFields []string `json:"-"` 383} 384 385func (s *ActivityEvents) MarshalJSON() ([]byte, error) { 386 type NoMethod ActivityEvents 387 raw := NoMethod(*s) 388 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 389} 390 391type ActivityEventsParameters struct { 392 // BoolValue: Boolean value of the parameter. 393 BoolValue bool `json:"boolValue,omitempty"` 394 395 // IntValue: Integer value of the parameter. 396 IntValue int64 `json:"intValue,omitempty,string"` 397 398 // MessageValue: Nested parameter value pairs associated with this 399 // parameter. Complex value type for a parameter are returned as a list 400 // of parameter values. For example, the address parameter may have a 401 // value as `[{parameter: [{name: city, value: abc}]}]` 402 MessageValue *ActivityEventsParametersMessageValue `json:"messageValue,omitempty"` 403 404 // MultiIntValue: Integer values of the parameter. 405 MultiIntValue googleapi.Int64s `json:"multiIntValue,omitempty"` 406 407 // MultiMessageValue: List of `messageValue` objects. 408 MultiMessageValue []*ActivityEventsParametersMultiMessageValue `json:"multiMessageValue,omitempty"` 409 410 // MultiValue: String values of the parameter. 411 MultiValue []string `json:"multiValue,omitempty"` 412 413 // Name: The name of the parameter. 414 Name string `json:"name,omitempty"` 415 416 // Value: String value of the parameter. 417 Value string `json:"value,omitempty"` 418 419 // ForceSendFields is a list of field names (e.g. "BoolValue") to 420 // unconditionally include in API requests. By default, fields with 421 // empty values are omitted from API requests. However, any non-pointer, 422 // non-interface field appearing in ForceSendFields will be sent to the 423 // server regardless of whether the field is empty or not. This may be 424 // used to include empty fields in Patch requests. 425 ForceSendFields []string `json:"-"` 426 427 // NullFields is a list of field names (e.g. "BoolValue") to include in 428 // API requests with the JSON null value. By default, fields with empty 429 // values are omitted from API requests. However, any field with an 430 // empty value appearing in NullFields will be sent to the server as 431 // null. It is an error if a field in this list has a non-empty value. 432 // This may be used to include null fields in Patch requests. 433 NullFields []string `json:"-"` 434} 435 436func (s *ActivityEventsParameters) MarshalJSON() ([]byte, error) { 437 type NoMethod ActivityEventsParameters 438 raw := NoMethod(*s) 439 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 440} 441 442// ActivityEventsParametersMessageValue: Nested parameter value pairs 443// associated with this parameter. Complex value type for a parameter 444// are returned as a list of parameter values. For example, the address 445// parameter may have a value as `[{parameter: [{name: city, value: 446// abc}]}]` 447type ActivityEventsParametersMessageValue struct { 448 // Parameter: Parameter values 449 Parameter []*NestedParameter `json:"parameter,omitempty"` 450 451 // ForceSendFields is a list of field names (e.g. "Parameter") to 452 // unconditionally include in API requests. By default, fields with 453 // empty values are omitted from API requests. However, any non-pointer, 454 // non-interface field appearing in ForceSendFields will be sent to the 455 // server regardless of whether the field is empty or not. This may be 456 // used to include empty fields in Patch requests. 457 ForceSendFields []string `json:"-"` 458 459 // NullFields is a list of field names (e.g. "Parameter") to include in 460 // API requests with the JSON null value. By default, fields with empty 461 // values are omitted from API requests. However, any field with an 462 // empty value appearing in NullFields will be sent to the server as 463 // null. It is an error if a field in this list has a non-empty value. 464 // This may be used to include null fields in Patch requests. 465 NullFields []string `json:"-"` 466} 467 468func (s *ActivityEventsParametersMessageValue) MarshalJSON() ([]byte, error) { 469 type NoMethod ActivityEventsParametersMessageValue 470 raw := NoMethod(*s) 471 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 472} 473 474type ActivityEventsParametersMultiMessageValue struct { 475 // Parameter: Parameter values 476 Parameter []*NestedParameter `json:"parameter,omitempty"` 477 478 // ForceSendFields is a list of field names (e.g. "Parameter") to 479 // unconditionally include in API requests. By default, fields with 480 // empty values are omitted from API requests. However, any non-pointer, 481 // non-interface field appearing in ForceSendFields will be sent to the 482 // server regardless of whether the field is empty or not. This may be 483 // used to include empty fields in Patch requests. 484 ForceSendFields []string `json:"-"` 485 486 // NullFields is a list of field names (e.g. "Parameter") to include in 487 // API requests with the JSON null value. By default, fields with empty 488 // values are omitted from API requests. However, any field with an 489 // empty value appearing in NullFields will be sent to the server as 490 // null. It is an error if a field in this list has a non-empty value. 491 // This may be used to include null fields in Patch requests. 492 NullFields []string `json:"-"` 493} 494 495func (s *ActivityEventsParametersMultiMessageValue) MarshalJSON() ([]byte, error) { 496 type NoMethod ActivityEventsParametersMultiMessageValue 497 raw := NoMethod(*s) 498 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 499} 500 501// ActivityId: Unique identifier for each activity record. 502type ActivityId struct { 503 // ApplicationName: Application name to which the event belongs. For 504 // possible values see the list of applications above in 505 // `applicationName`. 506 ApplicationName string `json:"applicationName,omitempty"` 507 508 // CustomerId: The unique identifier for a G suite account. 509 CustomerId string `json:"customerId,omitempty"` 510 511 // Time: Time of occurrence of the activity. This is in UNIX epoch time 512 // in seconds. 513 Time string `json:"time,omitempty"` 514 515 // UniqueQualifier: Unique qualifier if multiple events have the same 516 // time. 517 UniqueQualifier int64 `json:"uniqueQualifier,omitempty,string"` 518 519 // ForceSendFields is a list of field names (e.g. "ApplicationName") to 520 // unconditionally include in API requests. By default, fields with 521 // empty values are omitted from API requests. However, any non-pointer, 522 // non-interface field appearing in ForceSendFields will be sent to the 523 // server regardless of whether the field is empty or not. This may be 524 // used to include empty fields in Patch requests. 525 ForceSendFields []string `json:"-"` 526 527 // NullFields is a list of field names (e.g. "ApplicationName") to 528 // include in API requests with the JSON null value. By default, fields 529 // with empty values are omitted from API requests. However, any field 530 // with an empty value appearing in NullFields will be sent to the 531 // server as null. It is an error if a field in this list has a 532 // non-empty value. This may be used to include null fields in Patch 533 // requests. 534 NullFields []string `json:"-"` 535} 536 537func (s *ActivityId) MarshalJSON() ([]byte, error) { 538 type NoMethod ActivityId 539 raw := NoMethod(*s) 540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 541} 542 543// Channel: A notification channel used to watch for resource changes. 544type Channel struct { 545 // Address: The address where notifications are delivered for this 546 // channel. 547 Address string `json:"address,omitempty"` 548 549 // Expiration: Date and time of notification channel expiration, 550 // expressed as a Unix timestamp, in milliseconds. Optional. 551 Expiration int64 `json:"expiration,omitempty,string"` 552 553 // Id: A UUID or similar unique string that identifies this channel. 554 Id string `json:"id,omitempty"` 555 556 // Kind: Identifies this as a notification channel used to watch for 557 // changes to a resource, which is "api#channel". 558 Kind string `json:"kind,omitempty"` 559 560 // Params: Additional parameters controlling delivery channel behavior. 561 // Optional. 562 Params map[string]string `json:"params,omitempty"` 563 564 // Payload: A Boolean value to indicate whether payload is wanted. 565 // Optional. 566 Payload bool `json:"payload,omitempty"` 567 568 // ResourceId: An opaque ID that identifies the resource being watched 569 // on this channel. Stable across different API versions. 570 ResourceId string `json:"resourceId,omitempty"` 571 572 // ResourceUri: A version-specific identifier for the watched resource. 573 ResourceUri string `json:"resourceUri,omitempty"` 574 575 // Token: An arbitrary string delivered to the target address with each 576 // notification delivered over this channel. Optional. 577 Token string `json:"token,omitempty"` 578 579 // Type: The type of delivery mechanism used for this channel. The value 580 // should be set to "web_hook". 581 Type string `json:"type,omitempty"` 582 583 // ServerResponse contains the HTTP response code and headers from the 584 // server. 585 googleapi.ServerResponse `json:"-"` 586 587 // ForceSendFields is a list of field names (e.g. "Address") to 588 // unconditionally include in API requests. By default, fields with 589 // empty values are omitted from API requests. However, any non-pointer, 590 // non-interface field appearing in ForceSendFields will be sent to the 591 // server regardless of whether the field is empty or not. This may be 592 // used to include empty fields in Patch requests. 593 ForceSendFields []string `json:"-"` 594 595 // NullFields is a list of field names (e.g. "Address") to include in 596 // API requests with the JSON null value. By default, fields with empty 597 // values are omitted from API requests. However, any field with an 598 // empty value appearing in NullFields will be sent to the server as 599 // null. It is an error if a field in this list has a non-empty value. 600 // This may be used to include null fields in Patch requests. 601 NullFields []string `json:"-"` 602} 603 604func (s *Channel) MarshalJSON() ([]byte, error) { 605 type NoMethod Channel 606 raw := NoMethod(*s) 607 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 608} 609 610// NestedParameter: JSON template for a parameter used in various 611// reports. 612type NestedParameter struct { 613 // BoolValue: Boolean value of the parameter. 614 BoolValue bool `json:"boolValue,omitempty"` 615 616 // IntValue: Integer value of the parameter. 617 IntValue int64 `json:"intValue,omitempty,string"` 618 619 // MultiBoolValue: Multiple boolean values of the parameter. 620 MultiBoolValue []bool `json:"multiBoolValue,omitempty"` 621 622 // MultiIntValue: Multiple integer values of the parameter. 623 MultiIntValue googleapi.Int64s `json:"multiIntValue,omitempty"` 624 625 // MultiValue: Multiple string values of the parameter. 626 MultiValue []string `json:"multiValue,omitempty"` 627 628 // Name: The name of the parameter. 629 Name string `json:"name,omitempty"` 630 631 // Value: String value of the parameter. 632 Value string `json:"value,omitempty"` 633 634 // ForceSendFields is a list of field names (e.g. "BoolValue") to 635 // unconditionally include in API requests. By default, fields with 636 // empty values are omitted from API requests. However, any non-pointer, 637 // non-interface field appearing in ForceSendFields will be sent to the 638 // server regardless of whether the field is empty or not. This may be 639 // used to include empty fields in Patch requests. 640 ForceSendFields []string `json:"-"` 641 642 // NullFields is a list of field names (e.g. "BoolValue") to include in 643 // API requests with the JSON null value. By default, fields with empty 644 // values are omitted from API requests. However, any field with an 645 // empty value appearing in NullFields will be sent to the server as 646 // null. It is an error if a field in this list has a non-empty value. 647 // This may be used to include null fields in Patch requests. 648 NullFields []string `json:"-"` 649} 650 651func (s *NestedParameter) MarshalJSON() ([]byte, error) { 652 type NoMethod NestedParameter 653 raw := NoMethod(*s) 654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 655} 656 657// UsageReport: JSON template for a usage report. 658type UsageReport struct { 659 // Date: Output only. The date of the report request. 660 Date string `json:"date,omitempty"` 661 662 // Entity: Output only. Information about the type of the item. 663 Entity *UsageReportEntity `json:"entity,omitempty"` 664 665 // Etag: ETag of the resource. 666 Etag string `json:"etag,omitempty"` 667 668 // Kind: The type of API resource. For a usage report, the value is 669 // `admin#reports#usageReport`. 670 Kind string `json:"kind,omitempty"` 671 672 // Parameters: Output only. Parameter value pairs for various 673 // applications. For the Entity Usage Report parameters and values, see 674 // [the Entity Usage parameters 675 // reference](/admin-sdk/reports/v1/reference/usage-ref-appendix-a/entiti 676 // es). 677 Parameters []*UsageReportParameters `json:"parameters,omitempty"` 678 679 // ForceSendFields is a list of field names (e.g. "Date") to 680 // unconditionally include in API requests. By default, fields with 681 // empty values are omitted from API requests. However, any non-pointer, 682 // non-interface field appearing in ForceSendFields will be sent to the 683 // server regardless of whether the field is empty or not. This may be 684 // used to include empty fields in Patch requests. 685 ForceSendFields []string `json:"-"` 686 687 // NullFields is a list of field names (e.g. "Date") to include in API 688 // requests with the JSON null value. By default, fields with empty 689 // values are omitted from API requests. However, any field with an 690 // empty value appearing in NullFields will be sent to the server as 691 // null. It is an error if a field in this list has a non-empty value. 692 // This may be used to include null fields in Patch requests. 693 NullFields []string `json:"-"` 694} 695 696func (s *UsageReport) MarshalJSON() ([]byte, error) { 697 type NoMethod UsageReport 698 raw := NoMethod(*s) 699 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 700} 701 702// UsageReportEntity: Output only. Information about the type of the 703// item. 704type UsageReportEntity struct { 705 // CustomerId: Output only. The unique identifier of the customer's 706 // account. 707 CustomerId string `json:"customerId,omitempty"` 708 709 // EntityId: Output only. Object key. Only relevant if entity.type = 710 // "OBJECT" Note: external-facing name of report is "Entities" rather 711 // than "Objects". 712 EntityId string `json:"entityId,omitempty"` 713 714 // ProfileId: Output only. The user's immutable G Suite profile 715 // identifier. 716 ProfileId string `json:"profileId,omitempty"` 717 718 // Type: Output only. The type of item. The value is `user`. 719 Type string `json:"type,omitempty"` 720 721 // UserEmail: Output only. The user's email address. Only relevant if 722 // entity.type = "USER" 723 UserEmail string `json:"userEmail,omitempty"` 724 725 // ForceSendFields is a list of field names (e.g. "CustomerId") to 726 // unconditionally include in API requests. By default, fields with 727 // empty values are omitted from API requests. However, any non-pointer, 728 // non-interface field appearing in ForceSendFields will be sent to the 729 // server regardless of whether the field is empty or not. This may be 730 // used to include empty fields in Patch requests. 731 ForceSendFields []string `json:"-"` 732 733 // NullFields is a list of field names (e.g. "CustomerId") to include in 734 // API requests with the JSON null value. By default, fields with empty 735 // values are omitted from API requests. However, any field with an 736 // empty value appearing in NullFields will be sent to the server as 737 // null. It is an error if a field in this list has a non-empty value. 738 // This may be used to include null fields in Patch requests. 739 NullFields []string `json:"-"` 740} 741 742func (s *UsageReportEntity) MarshalJSON() ([]byte, error) { 743 type NoMethod UsageReportEntity 744 raw := NoMethod(*s) 745 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 746} 747 748type UsageReportParameters struct { 749 // BoolValue: Output only. Boolean value of the parameter. 750 BoolValue bool `json:"boolValue,omitempty"` 751 752 // DatetimeValue: The RFC 3339 formatted value of the parameter, for 753 // example 2010-10-28T10:26:35.000Z. 754 DatetimeValue string `json:"datetimeValue,omitempty"` 755 756 // IntValue: Output only. Integer value of the parameter. 757 IntValue int64 `json:"intValue,omitempty,string"` 758 759 // MsgValue: Output only. Nested message value of the parameter. 760 MsgValue []googleapi.RawMessage `json:"msgValue,omitempty"` 761 762 // Name: The name of the parameter. For the User Usage Report parameter 763 // names, see the User Usage parameters reference. 764 Name string `json:"name,omitempty"` 765 766 // StringValue: Output only. String value of the parameter. 767 StringValue string `json:"stringValue,omitempty"` 768 769 // ForceSendFields is a list of field names (e.g. "BoolValue") to 770 // unconditionally include in API requests. By default, fields with 771 // empty values are omitted from API requests. However, any non-pointer, 772 // non-interface field appearing in ForceSendFields will be sent to the 773 // server regardless of whether the field is empty or not. This may be 774 // used to include empty fields in Patch requests. 775 ForceSendFields []string `json:"-"` 776 777 // NullFields is a list of field names (e.g. "BoolValue") to include in 778 // API requests with the JSON null value. By default, fields with empty 779 // values are omitted from API requests. However, any field with an 780 // empty value appearing in NullFields will be sent to the server as 781 // null. It is an error if a field in this list has a non-empty value. 782 // This may be used to include null fields in Patch requests. 783 NullFields []string `json:"-"` 784} 785 786func (s *UsageReportParameters) MarshalJSON() ([]byte, error) { 787 type NoMethod UsageReportParameters 788 raw := NoMethod(*s) 789 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 790} 791 792type UsageReports struct { 793 // Etag: ETag of the resource. 794 Etag string `json:"etag,omitempty"` 795 796 // Kind: The type of API resource. For a usage report, the value is 797 // `admin#reports#usageReports`. 798 Kind string `json:"kind,omitempty"` 799 800 // NextPageToken: Token to specify next page. A report with multiple 801 // pages has a `nextPageToken` property in the response. For your 802 // follow-on requests getting all of the report's pages, enter the 803 // `nextPageToken` value in the `pageToken` query string. 804 NextPageToken string `json:"nextPageToken,omitempty"` 805 806 // UsageReports: Various application parameter records. 807 UsageReports []*UsageReport `json:"usageReports,omitempty"` 808 809 // Warnings: Warnings, if any. 810 Warnings []*UsageReportsWarnings `json:"warnings,omitempty"` 811 812 // ServerResponse contains the HTTP response code and headers from the 813 // server. 814 googleapi.ServerResponse `json:"-"` 815 816 // ForceSendFields is a list of field names (e.g. "Etag") to 817 // unconditionally include in API requests. By default, fields with 818 // empty values are omitted from API requests. However, any non-pointer, 819 // non-interface field appearing in ForceSendFields will be sent to the 820 // server regardless of whether the field is empty or not. This may be 821 // used to include empty fields in Patch requests. 822 ForceSendFields []string `json:"-"` 823 824 // NullFields is a list of field names (e.g. "Etag") to include in API 825 // requests with the JSON null value. By default, fields with empty 826 // values are omitted from API requests. However, any field with an 827 // empty value appearing in NullFields will be sent to the server as 828 // null. It is an error if a field in this list has a non-empty value. 829 // This may be used to include null fields in Patch requests. 830 NullFields []string `json:"-"` 831} 832 833func (s *UsageReports) MarshalJSON() ([]byte, error) { 834 type NoMethod UsageReports 835 raw := NoMethod(*s) 836 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 837} 838 839type UsageReportsWarnings struct { 840 // Code: Machine readable code or warning type. The warning code value 841 // is `200`. 842 Code string `json:"code,omitempty"` 843 844 // Data: Key-value pairs to give detailed information on the warning. 845 Data []*UsageReportsWarningsData `json:"data,omitempty"` 846 847 // Message: The human readable messages for a warning are: - Data is not 848 // available warning - Sorry, data for date yyyy-mm-dd for application 849 // "application name" is not available. - Partial data is available 850 // warning - Data for date yyyy-mm-dd for application "application 851 // name" is not available right now, please try again after a few 852 // hours. 853 Message string `json:"message,omitempty"` 854 855 // ForceSendFields is a list of field names (e.g. "Code") to 856 // unconditionally include in API requests. By default, fields with 857 // empty values are omitted from API requests. However, any non-pointer, 858 // non-interface field appearing in ForceSendFields will be sent to the 859 // server regardless of whether the field is empty or not. This may be 860 // used to include empty fields in Patch requests. 861 ForceSendFields []string `json:"-"` 862 863 // NullFields is a list of field names (e.g. "Code") to include in API 864 // requests with the JSON null value. By default, fields with empty 865 // values are omitted from API requests. However, any field with an 866 // empty value appearing in NullFields will be sent to the server as 867 // null. It is an error if a field in this list has a non-empty value. 868 // This may be used to include null fields in Patch requests. 869 NullFields []string `json:"-"` 870} 871 872func (s *UsageReportsWarnings) MarshalJSON() ([]byte, error) { 873 type NoMethod UsageReportsWarnings 874 raw := NoMethod(*s) 875 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 876} 877 878type UsageReportsWarningsData struct { 879 // Key: Key associated with a key-value pair to give detailed 880 // information on the warning. 881 Key string `json:"key,omitempty"` 882 883 // Value: Value associated with a key-value pair to give detailed 884 // information on the warning. 885 Value string `json:"value,omitempty"` 886 887 // ForceSendFields is a list of field names (e.g. "Key") to 888 // unconditionally include in API requests. By default, fields with 889 // empty values are omitted from API requests. However, any non-pointer, 890 // non-interface field appearing in ForceSendFields will be sent to the 891 // server regardless of whether the field is empty or not. This may be 892 // used to include empty fields in Patch requests. 893 ForceSendFields []string `json:"-"` 894 895 // NullFields is a list of field names (e.g. "Key") to include in API 896 // requests with the JSON null value. By default, fields with empty 897 // values are omitted from API requests. However, any field with an 898 // empty value appearing in NullFields will be sent to the server as 899 // null. It is an error if a field in this list has a non-empty value. 900 // This may be used to include null fields in Patch requests. 901 NullFields []string `json:"-"` 902} 903 904func (s *UsageReportsWarningsData) MarshalJSON() ([]byte, error) { 905 type NoMethod UsageReportsWarningsData 906 raw := NoMethod(*s) 907 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 908} 909 910// method id "reports.activities.list": 911 912type ActivitiesListCall struct { 913 s *Service 914 userKey string 915 applicationName string 916 urlParams_ gensupport.URLParams 917 ifNoneMatch_ string 918 ctx_ context.Context 919 header_ http.Header 920} 921 922// List: Retrieves a list of activities for a specific customer's 923// account and application such as the Admin console application or the 924// Google Drive application. For more information, see the guides for 925// administrator and Google Drive activity reports. For more information 926// about the activity report's parameters, see the activity parameters 927// reference guides. 928func (r *ActivitiesService) List(userKey string, applicationName string) *ActivitiesListCall { 929 c := &ActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 930 c.userKey = userKey 931 c.applicationName = applicationName 932 return c 933} 934 935// ActorIpAddress sets the optional parameter "actorIpAddress": The 936// Internet Protocol (IP) Address of host where the event was performed. 937// This is an additional way to filter a report's summary using the IP 938// address of the user whose activity is being reported. This IP address 939// may or may not reflect the user's physical location. For example, the 940// IP address can be the user's proxy server's address or a virtual 941// private network (VPN) address. This parameter supports both IPv4 and 942// IPv6 address versions. 943func (c *ActivitiesListCall) ActorIpAddress(actorIpAddress string) *ActivitiesListCall { 944 c.urlParams_.Set("actorIpAddress", actorIpAddress) 945 return c 946} 947 948// CustomerId sets the optional parameter "customerId": The unique ID of 949// the customer to retrieve data for. 950func (c *ActivitiesListCall) CustomerId(customerId string) *ActivitiesListCall { 951 c.urlParams_.Set("customerId", customerId) 952 return c 953} 954 955// EndTime sets the optional parameter "endTime": Sets the end of the 956// range of time shown in the report. The date is in the RFC 3339 957// format, for example 2010-10-28T10:26:35.000Z. The default value is 958// the approximate time of the API request. An API report has three 959// basic time concepts: - *Date of the API's request for a report*: When 960// the API created and retrieved the report. - *Report's start time*: 961// The beginning of the timespan shown in the report. The `startTime` 962// must be before the `endTime` (if specified) and the current time when 963// the request is made, or the API returns an error. - *Report's end 964// time*: The end of the timespan shown in the report. For example, the 965// timespan of events summarized in a report can start in April and end 966// in May. The report itself can be requested in August. If the 967// `endTime` is not specified, the report returns all activities from 968// the `startTime` until the current time or the most recent 180 days if 969// the `startTime` is more than 180 days in the past. 970func (c *ActivitiesListCall) EndTime(endTime string) *ActivitiesListCall { 971 c.urlParams_.Set("endTime", endTime) 972 return c 973} 974 975// EventName sets the optional parameter "eventName": The name of the 976// event being queried by the API. Each `eventName` is related to a 977// specific G Suite service or feature which the API organizes into 978// types of events. An example is the Google Calendar events in the 979// Admin console application's reports. The Calendar Settings `type` 980// structure has all of the Calendar `eventName` activities reported by 981// the API. When an administrator changes a Calendar setting, the API 982// reports this activity in the Calendar Settings `type` and `eventName` 983// parameters. For more information about `eventName` query strings and 984// parameters, see the list of event names for various applications 985// above in `applicationName`. 986func (c *ActivitiesListCall) EventName(eventName string) *ActivitiesListCall { 987 c.urlParams_.Set("eventName", eventName) 988 return c 989} 990 991// Filters sets the optional parameter "filters": The `filters` query 992// string is a comma-separated list. The list is composed of event 993// parameters that are manipulated by relational operators. Event 994// parameters are in the form `parameter1 name[parameter1 995// value],parameter2 name[parameter2 value],...` These event parameters 996// are associated with a specific `eventName`. An empty report is 997// returned if the filtered request's parameter does not belong to the 998// `eventName`. For more information about `eventName` parameters, see 999// the list of event names for various applications above in 1000// `applicationName`. In the following Admin Activity example, the <> 1001// operator is URL-encoded in the request's query string (%3C%3E): 1002// GET...&eventName=CHANGE_CALENDAR_SETTING 1003// &filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS In the following Drive 1004// example, the list can be a view or edit event's `doc_id` parameter 1005// with a value that is manipulated by an 'equal to' (==) or 'not equal 1006// to' (<>) relational operator. In the first example, the report 1007// returns each edited document's `doc_id`. In the second example, the 1008// report returns each viewed document's `doc_id` that equals the value 1009// 12345 and does not return any viewed document's which have a `doc_id` 1010// value of 98765. The <> operator is URL-encoded in the request's query 1011// string (%3C%3E): GET...&eventName=edit&filters=doc_id 1012// GET...&eventName=view&filters=doc_id==12345,doc_id%3C%3E98765 The 1013// relational operators include: - `==` - 'equal to'. - `<>` - 'not 1014// equal to'. It is URL-encoded (%3C%3E). - `<` - 'less than'. It is 1015// URL-encoded (%3C). - `<=` - 'less than or equal to'. It is 1016// URL-encoded (%3C=). - `>` - 'greater than'. It is URL-encoded (%3E). 1017// - `>=` - 'greater than or equal to'. It is URL-encoded (%3E=). 1018// *Note:* The API doesn't accept multiple values of a parameter. If a 1019// particular parameter is supplied more than once in the API request, 1020// the API only accepts the last value of that request parameter. In 1021// addition, if an invalid request parameter is supplied in the API 1022// request, the API ignores that request parameter and returns the 1023// response corresponding to the remaining valid request parameters. If 1024// no parameters are requested, all parameters are returned. 1025func (c *ActivitiesListCall) Filters(filters string) *ActivitiesListCall { 1026 c.urlParams_.Set("filters", filters) 1027 return c 1028} 1029 1030// GroupIdFilter sets the optional parameter "groupIdFilter": Comma 1031// separated group ids (obfuscated) on which user activities are 1032// filtered, i.e, the response will contain activities for only those 1033// users that are a part of at least one of the group ids mentioned 1034// here. Format: "id:abc123,id:xyz456" 1035func (c *ActivitiesListCall) GroupIdFilter(groupIdFilter string) *ActivitiesListCall { 1036 c.urlParams_.Set("groupIdFilter", groupIdFilter) 1037 return c 1038} 1039 1040// MaxResults sets the optional parameter "maxResults": Determines how 1041// many activity records are shown on each response page. For example, 1042// if the request sets `maxResults=1` and the report has two activities, 1043// the report has two pages. The response's `nextPageToken` property has 1044// the token to the second page. The `maxResults` query string is 1045// optional in the request. The default value is 1000. 1046func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall { 1047 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 1048 return c 1049} 1050 1051// OrgUnitID sets the optional parameter "orgUnitID": ID of the 1052// organizational unit to report on. Activity records will be shown only 1053// for users who belong to the specified organizational unit. Data 1054// before Dec 17, 2018 doesn't appear in the filtered results. 1055func (c *ActivitiesListCall) OrgUnitID(orgUnitID string) *ActivitiesListCall { 1056 c.urlParams_.Set("orgUnitID", orgUnitID) 1057 return c 1058} 1059 1060// PageToken sets the optional parameter "pageToken": The token to 1061// specify next page. A report with multiple pages has a `nextPageToken` 1062// property in the response. In your follow-on request getting the next 1063// page of the report, enter the `nextPageToken` value in the 1064// `pageToken` query string. 1065func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall { 1066 c.urlParams_.Set("pageToken", pageToken) 1067 return c 1068} 1069 1070// StartTime sets the optional parameter "startTime": Sets the beginning 1071// of the range of time shown in the report. The date is in the RFC 3339 1072// format, for example 2010-10-28T10:26:35.000Z. The report returns all 1073// activities from `startTime` until `endTime`. The `startTime` must be 1074// before the `endTime` (if specified) and the current time when the 1075// request is made, or the API returns an error. 1076func (c *ActivitiesListCall) StartTime(startTime string) *ActivitiesListCall { 1077 c.urlParams_.Set("startTime", startTime) 1078 return c 1079} 1080 1081// Fields allows partial responses to be retrieved. See 1082// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1083// for more information. 1084func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall { 1085 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1086 return c 1087} 1088 1089// IfNoneMatch sets the optional parameter which makes the operation 1090// fail if the object's ETag matches the given value. This is useful for 1091// getting updates only after the object has changed since the last 1092// request. Use googleapi.IsNotModified to check whether the response 1093// error from Do is the result of In-None-Match. 1094func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall { 1095 c.ifNoneMatch_ = entityTag 1096 return c 1097} 1098 1099// Context sets the context to be used in this call's Do method. Any 1100// pending HTTP request will be aborted if the provided context is 1101// canceled. 1102func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall { 1103 c.ctx_ = ctx 1104 return c 1105} 1106 1107// Header returns an http.Header that can be modified by the caller to 1108// add HTTP headers to the request. 1109func (c *ActivitiesListCall) Header() http.Header { 1110 if c.header_ == nil { 1111 c.header_ = make(http.Header) 1112 } 1113 return c.header_ 1114} 1115 1116func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) { 1117 reqHeaders := make(http.Header) 1118 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1119 for k, v := range c.header_ { 1120 reqHeaders[k] = v 1121 } 1122 reqHeaders.Set("User-Agent", c.s.userAgent()) 1123 if c.ifNoneMatch_ != "" { 1124 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1125 } 1126 var body io.Reader = nil 1127 c.urlParams_.Set("alt", alt) 1128 c.urlParams_.Set("prettyPrint", "false") 1129 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/activity/users/{userKey}/applications/{applicationName}") 1130 urls += "?" + c.urlParams_.Encode() 1131 req, err := http.NewRequest("GET", urls, body) 1132 if err != nil { 1133 return nil, err 1134 } 1135 req.Header = reqHeaders 1136 googleapi.Expand(req.URL, map[string]string{ 1137 "userKey": c.userKey, 1138 "applicationName": c.applicationName, 1139 }) 1140 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1141} 1142 1143// Do executes the "reports.activities.list" call. 1144// Exactly one of *Activities or error will be non-nil. Any non-2xx 1145// status code is an error. Response headers are in either 1146// *Activities.ServerResponse.Header or (if a response was returned at 1147// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1148// to check whether the returned error was because 1149// http.StatusNotModified was returned. 1150func (c *ActivitiesListCall) Do(opts ...googleapi.CallOption) (*Activities, error) { 1151 gensupport.SetOptions(c.urlParams_, opts...) 1152 res, err := c.doRequest("json") 1153 if res != nil && res.StatusCode == http.StatusNotModified { 1154 if res.Body != nil { 1155 res.Body.Close() 1156 } 1157 return nil, &googleapi.Error{ 1158 Code: res.StatusCode, 1159 Header: res.Header, 1160 } 1161 } 1162 if err != nil { 1163 return nil, err 1164 } 1165 defer googleapi.CloseBody(res) 1166 if err := googleapi.CheckResponse(res); err != nil { 1167 return nil, err 1168 } 1169 ret := &Activities{ 1170 ServerResponse: googleapi.ServerResponse{ 1171 Header: res.Header, 1172 HTTPStatusCode: res.StatusCode, 1173 }, 1174 } 1175 target := &ret 1176 if err := gensupport.DecodeResponse(target, res); err != nil { 1177 return nil, err 1178 } 1179 return ret, nil 1180 // { 1181 // "description": "Retrieves a list of activities for a specific customer's account and application such as the Admin console application or the Google Drive application. For more information, see the guides for administrator and Google Drive activity reports. For more information about the activity report's parameters, see the activity parameters reference guides. ", 1182 // "flatPath": "admin/reports/v1/activity/users/{userKey}/applications/{applicationName}", 1183 // "httpMethod": "GET", 1184 // "id": "reports.activities.list", 1185 // "parameterOrder": [ 1186 // "userKey", 1187 // "applicationName" 1188 // ], 1189 // "parameters": { 1190 // "actorIpAddress": { 1191 // "description": "The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.", 1192 // "location": "query", 1193 // "type": "string" 1194 // }, 1195 // "applicationName": { 1196 // "description": "Application name for which the events are to be retrieved.", 1197 // "enum": [ 1198 // "application_name_undefined", 1199 // "access_transparency", 1200 // "admin", 1201 // "calendar", 1202 // "chat", 1203 // "drive", 1204 // "gcp", 1205 // "gplus", 1206 // "groups", 1207 // "groups_enterprise", 1208 // "jamboard", 1209 // "login", 1210 // "meet", 1211 // "mobile", 1212 // "rules", 1213 // "saml", 1214 // "token", 1215 // "user_accounts", 1216 // "context_aware_access", 1217 // "chrome", 1218 // "data_studio" 1219 // ], 1220 // "enumDescriptions": [ 1221 // "", 1222 // "The G Suite Access Transparency activity reports return information about different types of Access Transparency activity events.", 1223 // "The Admin console application's activity reports return account information about different types of administrator activity events.", 1224 // "The G Suite Calendar application's activity reports return information about various Calendar activity events.", 1225 // "The Chat activity reports return information about various Chat activity events.", 1226 // "The Google Drive application's activity reports return information about various Google Drive activity events. The Drive activity report is only available for G Suite Business customers.", 1227 // "The Google Cloud Platform application's activity reports return information about various GCP activity events.", 1228 // "The Google+ application's activity reports return information about various Google+ activity events.", 1229 // "The Google Groups application's activity reports return information about various Groups activity events.", 1230 // "The Enterprise Groups activity reports return information about various Enterprise group activity events.", 1231 // "The Jamboard activity reports return information about various Jamboard activity events.", 1232 // "The Login application's activity reports return account information about different types of Login activity events.", 1233 // "The Meet Audit activity report return information about different types of Meet Audit activity events.", 1234 // "The Mobile Audit activity report return information about different types of Mobile Audit activity events.", 1235 // "The Rules activity report return information about different types of Rules activity events.", 1236 // "The SAML activity report return information about different types of SAML activity events.", 1237 // "The Token application's activity reports return account information about different types of Token activity events.", 1238 // "The User Accounts application's activity reports return account information about different types of User Accounts activity events.", 1239 // "The Context-aware access activity reports return information about users' access denied events due to Context-aware access rules.", 1240 // "The Chrome activity reports return information about unsafe events reported in the context of the WebProtect features of BeyondCorp.", 1241 // "The Data Studio activity reports return information about various types of Data Studio activity events." 1242 // ], 1243 // "location": "path", 1244 // "pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)|(context_aware_access)|(data_studio)|(chrome)", 1245 // "required": true, 1246 // "type": "string" 1247 // }, 1248 // "customerId": { 1249 // "description": "The unique ID of the customer to retrieve data for.", 1250 // "location": "query", 1251 // "pattern": "C.+", 1252 // "type": "string" 1253 // }, 1254 // "endTime": { 1255 // "description": "Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: - *Date of the API's request for a report*: When the API created and retrieved the report. - *Report's start time*: The beginning of the timespan shown in the report. The `startTime` must be before the `endTime` (if specified) and the current time when the request is made, or the API returns an error. - *Report's end time*: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the `endTime` is not specified, the report returns all activities from the `startTime` until the current time or the most recent 180 days if the `startTime` is more than 180 days in the past.", 1256 // "location": "query", 1257 // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", 1258 // "type": "string" 1259 // }, 1260 // "eventName": { 1261 // "description": "The name of the event being queried by the API. Each `eventName` is related to a specific G Suite service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings `type` structure has all of the Calendar `eventName` activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings `type` and `eventName` parameters. For more information about `eventName` query strings and parameters, see the list of event names for various applications above in `applicationName`.", 1262 // "location": "query", 1263 // "type": "string" 1264 // }, 1265 // "filters": { 1266 // "description": "The `filters` query string is a comma-separated list. The list is composed of event parameters that are manipulated by relational operators. Event parameters are in the form `parameter1 name[parameter1 value],parameter2 name[parameter2 value],...` These event parameters are associated with a specific `eventName`. An empty report is returned if the filtered request's parameter does not belong to the `eventName`. For more information about `eventName` parameters, see the list of event names for various applications above in `applicationName`. In the following Admin Activity example, the \u003c\u003e operator is URL-encoded in the request's query string (%3C%3E): GET...\u0026eventName=CHANGE_CALENDAR_SETTING \u0026filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS In the following Drive example, the list can be a view or edit event's `doc_id` parameter with a value that is manipulated by an 'equal to' (==) or 'not equal to' (\u003c\u003e) relational operator. In the first example, the report returns each edited document's `doc_id`. In the second example, the report returns each viewed document's `doc_id` that equals the value 12345 and does not return any viewed document's which have a `doc_id` value of 98765. The \u003c\u003e operator is URL-encoded in the request's query string (%3C%3E): GET...\u0026eventName=edit\u0026filters=doc_id GET...\u0026eventName=view\u0026filters=doc_id==12345,doc_id%3C%3E98765 The relational operators include: - `==` - 'equal to'. - `\u003c\u003e` - 'not equal to'. It is URL-encoded (%3C%3E). - `\u003c` - 'less than'. It is URL-encoded (%3C). - `\u003c=` - 'less than or equal to'. It is URL-encoded (%3C=). - `\u003e` - 'greater than'. It is URL-encoded (%3E). - `\u003e=` - 'greater than or equal to'. It is URL-encoded (%3E=). *Note:* The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. If no parameters are requested, all parameters are returned. ", 1267 // "location": "query", 1268 // "pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)", 1269 // "type": "string" 1270 // }, 1271 // "groupIdFilter": { 1272 // "description": "Comma separated group ids (obfuscated) on which user activities are filtered, i.e, the response will contain activities for only those users that are a part of at least one of the group ids mentioned here. Format: \"id:abc123,id:xyz456\"", 1273 // "location": "query", 1274 // "pattern": "(id:[a-z0-9]+(,id:[a-z0-9]+)*)", 1275 // "type": "string" 1276 // }, 1277 // "maxResults": { 1278 // "default": "1000", 1279 // "description": "Determines how many activity records are shown on each response page. For example, if the request sets `maxResults=1` and the report has two activities, the report has two pages. The response's `nextPageToken` property has the token to the second page. The `maxResults` query string is optional in the request. The default value is 1000.", 1280 // "format": "int32", 1281 // "location": "query", 1282 // "maximum": "1000", 1283 // "minimum": "1", 1284 // "type": "integer" 1285 // }, 1286 // "orgUnitID": { 1287 // "default": "", 1288 // "description": "ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results.", 1289 // "location": "query", 1290 // "pattern": "(id:[a-z0-9]+)", 1291 // "type": "string" 1292 // }, 1293 // "pageToken": { 1294 // "description": "The token to specify next page. A report with multiple pages has a `nextPageToken` property in the response. In your follow-on request getting the next page of the report, enter the `nextPageToken` value in the `pageToken` query string.", 1295 // "location": "query", 1296 // "type": "string" 1297 // }, 1298 // "startTime": { 1299 // "description": "Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from `startTime` until `endTime`. The `startTime` must be before the `endTime` (if specified) and the current time when the request is made, or the API returns an error.", 1300 // "location": "query", 1301 // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", 1302 // "type": "string" 1303 // }, 1304 // "userKey": { 1305 // "description": "Represents the profile ID or the user email for which the data should be filtered. Can be `all` for all information, or `userKey` for a user's unique G Suite profile ID or their primary email address.", 1306 // "location": "path", 1307 // "required": true, 1308 // "type": "string" 1309 // } 1310 // }, 1311 // "path": "admin/reports/v1/activity/users/{userKey}/applications/{applicationName}", 1312 // "response": { 1313 // "$ref": "Activities" 1314 // }, 1315 // "scopes": [ 1316 // "https://www.googleapis.com/auth/admin.reports.audit.readonly" 1317 // ] 1318 // } 1319 1320} 1321 1322// Pages invokes f for each page of results. 1323// A non-nil error returned from f will halt the iteration. 1324// The provided context supersedes any context provided to the Context method. 1325func (c *ActivitiesListCall) Pages(ctx context.Context, f func(*Activities) error) error { 1326 c.ctx_ = ctx 1327 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1328 for { 1329 x, err := c.Do() 1330 if err != nil { 1331 return err 1332 } 1333 if err := f(x); err != nil { 1334 return err 1335 } 1336 if x.NextPageToken == "" { 1337 return nil 1338 } 1339 c.PageToken(x.NextPageToken) 1340 } 1341} 1342 1343// method id "reports.activities.watch": 1344 1345type ActivitiesWatchCall struct { 1346 s *Service 1347 userKey string 1348 applicationName string 1349 channel *Channel 1350 urlParams_ gensupport.URLParams 1351 ctx_ context.Context 1352 header_ http.Header 1353} 1354 1355// Watch: Start receiving notifications for account activities. For more 1356// information, see Receiving Push Notifications. 1357func (r *ActivitiesService) Watch(userKey string, applicationName string, channel *Channel) *ActivitiesWatchCall { 1358 c := &ActivitiesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1359 c.userKey = userKey 1360 c.applicationName = applicationName 1361 c.channel = channel 1362 return c 1363} 1364 1365// ActorIpAddress sets the optional parameter "actorIpAddress": The 1366// Internet Protocol (IP) Address of host where the event was performed. 1367// This is an additional way to filter a report's summary using the IP 1368// address of the user whose activity is being reported. This IP address 1369// may or may not reflect the user's physical location. For example, the 1370// IP address can be the user's proxy server's address or a virtual 1371// private network (VPN) address. This parameter supports both IPv4 and 1372// IPv6 address versions. 1373func (c *ActivitiesWatchCall) ActorIpAddress(actorIpAddress string) *ActivitiesWatchCall { 1374 c.urlParams_.Set("actorIpAddress", actorIpAddress) 1375 return c 1376} 1377 1378// CustomerId sets the optional parameter "customerId": The unique ID of 1379// the customer to retrieve data for. 1380func (c *ActivitiesWatchCall) CustomerId(customerId string) *ActivitiesWatchCall { 1381 c.urlParams_.Set("customerId", customerId) 1382 return c 1383} 1384 1385// EndTime sets the optional parameter "endTime": Sets the end of the 1386// range of time shown in the report. The date is in the RFC 3339 1387// format, for example 2010-10-28T10:26:35.000Z. The default value is 1388// the approximate time of the API request. An API report has three 1389// basic time concepts: - *Date of the API's request for a report*: When 1390// the API created and retrieved the report. - *Report's start time*: 1391// The beginning of the timespan shown in the report. The `startTime` 1392// must be before the `endTime` (if specified) and the current time when 1393// the request is made, or the API returns an error. - *Report's end 1394// time*: The end of the timespan shown in the report. For example, the 1395// timespan of events summarized in a report can start in April and end 1396// in May. The report itself can be requested in August. If the 1397// `endTime` is not specified, the report returns all activities from 1398// the `startTime` until the current time or the most recent 180 days if 1399// the `startTime` is more than 180 days in the past. 1400func (c *ActivitiesWatchCall) EndTime(endTime string) *ActivitiesWatchCall { 1401 c.urlParams_.Set("endTime", endTime) 1402 return c 1403} 1404 1405// EventName sets the optional parameter "eventName": The name of the 1406// event being queried by the API. Each `eventName` is related to a 1407// specific G Suite service or feature which the API organizes into 1408// types of events. An example is the Google Calendar events in the 1409// Admin console application's reports. The Calendar Settings `type` 1410// structure has all of the Calendar `eventName` activities reported by 1411// the API. When an administrator changes a Calendar setting, the API 1412// reports this activity in the Calendar Settings `type` and `eventName` 1413// parameters. For more information about `eventName` query strings and 1414// parameters, see the list of event names for various applications 1415// above in `applicationName`. 1416func (c *ActivitiesWatchCall) EventName(eventName string) *ActivitiesWatchCall { 1417 c.urlParams_.Set("eventName", eventName) 1418 return c 1419} 1420 1421// Filters sets the optional parameter "filters": The `filters` query 1422// string is a comma-separated list. The list is composed of event 1423// parameters that are manipulated by relational operators. Event 1424// parameters are in the form `parameter1 name[parameter1 1425// value],parameter2 name[parameter2 value],...` These event parameters 1426// are associated with a specific `eventName`. An empty report is 1427// returned if the filtered request's parameter does not belong to the 1428// `eventName`. For more information about `eventName` parameters, see 1429// the list of event names for various applications above in 1430// `applicationName`. In the following Admin Activity example, the <> 1431// operator is URL-encoded in the request's query string (%3C%3E): 1432// GET...&eventName=CHANGE_CALENDAR_SETTING 1433// &filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS In the following Drive 1434// example, the list can be a view or edit event's `doc_id` parameter 1435// with a value that is manipulated by an 'equal to' (==) or 'not equal 1436// to' (<>) relational operator. In the first example, the report 1437// returns each edited document's `doc_id`. In the second example, the 1438// report returns each viewed document's `doc_id` that equals the value 1439// 12345 and does not return any viewed document's which have a `doc_id` 1440// value of 98765. The <> operator is URL-encoded in the request's query 1441// string (%3C%3E): GET...&eventName=edit&filters=doc_id 1442// GET...&eventName=view&filters=doc_id==12345,doc_id%3C%3E98765 The 1443// relational operators include: - `==` - 'equal to'. - `<>` - 'not 1444// equal to'. It is URL-encoded (%3C%3E). - `<` - 'less than'. It is 1445// URL-encoded (%3C). - `<=` - 'less than or equal to'. It is 1446// URL-encoded (%3C=). - `>` - 'greater than'. It is URL-encoded (%3E). 1447// - `>=` - 'greater than or equal to'. It is URL-encoded (%3E=). 1448// *Note:* The API doesn't accept multiple values of a parameter. If a 1449// particular parameter is supplied more than once in the API request, 1450// the API only accepts the last value of that request parameter. In 1451// addition, if an invalid request parameter is supplied in the API 1452// request, the API ignores that request parameter and returns the 1453// response corresponding to the remaining valid request parameters. If 1454// no parameters are requested, all parameters are returned. 1455func (c *ActivitiesWatchCall) Filters(filters string) *ActivitiesWatchCall { 1456 c.urlParams_.Set("filters", filters) 1457 return c 1458} 1459 1460// GroupIdFilter sets the optional parameter "groupIdFilter": Comma 1461// separated group ids (obfuscated) on which user activities are 1462// filtered, i.e, the response will contain activities for only those 1463// users that are a part of at least one of the group ids mentioned 1464// here. Format: "id:abc123,id:xyz456" 1465func (c *ActivitiesWatchCall) GroupIdFilter(groupIdFilter string) *ActivitiesWatchCall { 1466 c.urlParams_.Set("groupIdFilter", groupIdFilter) 1467 return c 1468} 1469 1470// MaxResults sets the optional parameter "maxResults": Determines how 1471// many activity records are shown on each response page. For example, 1472// if the request sets `maxResults=1` and the report has two activities, 1473// the report has two pages. The response's `nextPageToken` property has 1474// the token to the second page. The `maxResults` query string is 1475// optional in the request. The default value is 1000. 1476func (c *ActivitiesWatchCall) MaxResults(maxResults int64) *ActivitiesWatchCall { 1477 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 1478 return c 1479} 1480 1481// OrgUnitID sets the optional parameter "orgUnitID": ID of the 1482// organizational unit to report on. Activity records will be shown only 1483// for users who belong to the specified organizational unit. Data 1484// before Dec 17, 2018 doesn't appear in the filtered results. 1485func (c *ActivitiesWatchCall) OrgUnitID(orgUnitID string) *ActivitiesWatchCall { 1486 c.urlParams_.Set("orgUnitID", orgUnitID) 1487 return c 1488} 1489 1490// PageToken sets the optional parameter "pageToken": The token to 1491// specify next page. A report with multiple pages has a `nextPageToken` 1492// property in the response. In your follow-on request getting the next 1493// page of the report, enter the `nextPageToken` value in the 1494// `pageToken` query string. 1495func (c *ActivitiesWatchCall) PageToken(pageToken string) *ActivitiesWatchCall { 1496 c.urlParams_.Set("pageToken", pageToken) 1497 return c 1498} 1499 1500// StartTime sets the optional parameter "startTime": Sets the beginning 1501// of the range of time shown in the report. The date is in the RFC 3339 1502// format, for example 2010-10-28T10:26:35.000Z. The report returns all 1503// activities from `startTime` until `endTime`. The `startTime` must be 1504// before the `endTime` (if specified) and the current time when the 1505// request is made, or the API returns an error. 1506func (c *ActivitiesWatchCall) StartTime(startTime string) *ActivitiesWatchCall { 1507 c.urlParams_.Set("startTime", startTime) 1508 return c 1509} 1510 1511// Fields allows partial responses to be retrieved. See 1512// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1513// for more information. 1514func (c *ActivitiesWatchCall) Fields(s ...googleapi.Field) *ActivitiesWatchCall { 1515 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1516 return c 1517} 1518 1519// Context sets the context to be used in this call's Do method. Any 1520// pending HTTP request will be aborted if the provided context is 1521// canceled. 1522func (c *ActivitiesWatchCall) Context(ctx context.Context) *ActivitiesWatchCall { 1523 c.ctx_ = ctx 1524 return c 1525} 1526 1527// Header returns an http.Header that can be modified by the caller to 1528// add HTTP headers to the request. 1529func (c *ActivitiesWatchCall) Header() http.Header { 1530 if c.header_ == nil { 1531 c.header_ = make(http.Header) 1532 } 1533 return c.header_ 1534} 1535 1536func (c *ActivitiesWatchCall) doRequest(alt string) (*http.Response, error) { 1537 reqHeaders := make(http.Header) 1538 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1539 for k, v := range c.header_ { 1540 reqHeaders[k] = v 1541 } 1542 reqHeaders.Set("User-Agent", c.s.userAgent()) 1543 var body io.Reader = nil 1544 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 1545 if err != nil { 1546 return nil, err 1547 } 1548 reqHeaders.Set("Content-Type", "application/json") 1549 c.urlParams_.Set("alt", alt) 1550 c.urlParams_.Set("prettyPrint", "false") 1551 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch") 1552 urls += "?" + c.urlParams_.Encode() 1553 req, err := http.NewRequest("POST", urls, body) 1554 if err != nil { 1555 return nil, err 1556 } 1557 req.Header = reqHeaders 1558 googleapi.Expand(req.URL, map[string]string{ 1559 "userKey": c.userKey, 1560 "applicationName": c.applicationName, 1561 }) 1562 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1563} 1564 1565// Do executes the "reports.activities.watch" call. 1566// Exactly one of *Channel or error will be non-nil. Any non-2xx status 1567// code is an error. Response headers are in either 1568// *Channel.ServerResponse.Header or (if a response was returned at all) 1569// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1570// check whether the returned error was because http.StatusNotModified 1571// was returned. 1572func (c *ActivitiesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 1573 gensupport.SetOptions(c.urlParams_, opts...) 1574 res, err := c.doRequest("json") 1575 if res != nil && res.StatusCode == http.StatusNotModified { 1576 if res.Body != nil { 1577 res.Body.Close() 1578 } 1579 return nil, &googleapi.Error{ 1580 Code: res.StatusCode, 1581 Header: res.Header, 1582 } 1583 } 1584 if err != nil { 1585 return nil, err 1586 } 1587 defer googleapi.CloseBody(res) 1588 if err := googleapi.CheckResponse(res); err != nil { 1589 return nil, err 1590 } 1591 ret := &Channel{ 1592 ServerResponse: googleapi.ServerResponse{ 1593 Header: res.Header, 1594 HTTPStatusCode: res.StatusCode, 1595 }, 1596 } 1597 target := &ret 1598 if err := gensupport.DecodeResponse(target, res); err != nil { 1599 return nil, err 1600 } 1601 return ret, nil 1602 // { 1603 // "description": "Start receiving notifications for account activities. For more information, see Receiving Push Notifications.", 1604 // "flatPath": "admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch", 1605 // "httpMethod": "POST", 1606 // "id": "reports.activities.watch", 1607 // "parameterOrder": [ 1608 // "userKey", 1609 // "applicationName" 1610 // ], 1611 // "parameters": { 1612 // "actorIpAddress": { 1613 // "description": "The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.", 1614 // "location": "query", 1615 // "type": "string" 1616 // }, 1617 // "applicationName": { 1618 // "description": "Application name for which the events are to be retrieved.", 1619 // "enum": [ 1620 // "application_name_unspecified", 1621 // "access_transparency", 1622 // "admin", 1623 // "calendar", 1624 // "chat", 1625 // "drive", 1626 // "gcp", 1627 // "gplus", 1628 // "groups", 1629 // "groups_enterprise", 1630 // "jamboard", 1631 // "login", 1632 // "meet", 1633 // "mobile", 1634 // "rules", 1635 // "saml", 1636 // "token", 1637 // "user_accounts", 1638 // "context_aware_access", 1639 // "chrome", 1640 // "data_studio" 1641 // ], 1642 // "enumDescriptions": [ 1643 // "", 1644 // "The G Suite Access Transparency activity reports return information about different types of Access Transparency activity events.", 1645 // "The Admin console application's activity reports return account information about different types of administrator activity events.", 1646 // "The G Suite Calendar application's activity reports return information about various Calendar activity events.", 1647 // "The Chat activity reports return information about various Chat activity events.", 1648 // "The Google Drive application's activity reports return information about various Google Drive activity events. The Drive activity report is only available for G Suite Business customers.", 1649 // "The Google Cloud Platform application's activity reports return information about various GCP activity events.", 1650 // "The Google+ application's activity reports return information about various Google+ activity events.", 1651 // "The Google Groups application's activity reports return information about various Groups activity events.", 1652 // "The Enterprise Groups activity reports return information about various Enterprise group activity events.", 1653 // "The Jamboard activity reports return information about various Jamboard activity events.", 1654 // "The Login application's activity reports return account information about different types of Login activity events.", 1655 // "The Meet Audit activity report return information about different types of Meet Audit activity events.", 1656 // "The Mobile Audit activity report return information about different types of Mobile Audit activity events.", 1657 // "The Rules activity report return information about different types of Rules activity events.", 1658 // "The SAML activity report return information about different types of SAML activity events.", 1659 // "The Token application's activity reports return account information about different types of Token activity events.", 1660 // "The User Accounts application's activity reports return account information about different types of User Accounts activity events.", 1661 // "The Context-aware access activity reports return information about users' access denied events due to Context-aware access rules.", 1662 // "The Chrome activity reports return information about unsafe events reported in the context of the WebProtect features of BeyondCorp.", 1663 // "The Data Studio activity reports return information about various types of Data Studio activity events." 1664 // ], 1665 // "location": "path", 1666 // "pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)|(context_aware_access)|(data_studio)|(chrome)", 1667 // "required": true, 1668 // "type": "string" 1669 // }, 1670 // "customerId": { 1671 // "description": "The unique ID of the customer to retrieve data for.", 1672 // "location": "query", 1673 // "pattern": "C.+", 1674 // "type": "string" 1675 // }, 1676 // "endTime": { 1677 // "description": "Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: - *Date of the API's request for a report*: When the API created and retrieved the report. - *Report's start time*: The beginning of the timespan shown in the report. The `startTime` must be before the `endTime` (if specified) and the current time when the request is made, or the API returns an error. - *Report's end time*: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the `endTime` is not specified, the report returns all activities from the `startTime` until the current time or the most recent 180 days if the `startTime` is more than 180 days in the past.", 1678 // "location": "query", 1679 // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", 1680 // "type": "string" 1681 // }, 1682 // "eventName": { 1683 // "description": "The name of the event being queried by the API. Each `eventName` is related to a specific G Suite service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings `type` structure has all of the Calendar `eventName` activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings `type` and `eventName` parameters. For more information about `eventName` query strings and parameters, see the list of event names for various applications above in `applicationName`.", 1684 // "location": "query", 1685 // "type": "string" 1686 // }, 1687 // "filters": { 1688 // "description": "The `filters` query string is a comma-separated list. The list is composed of event parameters that are manipulated by relational operators. Event parameters are in the form `parameter1 name[parameter1 value],parameter2 name[parameter2 value],...` These event parameters are associated with a specific `eventName`. An empty report is returned if the filtered request's parameter does not belong to the `eventName`. For more information about `eventName` parameters, see the list of event names for various applications above in `applicationName`. In the following Admin Activity example, the \u003c\u003e operator is URL-encoded in the request's query string (%3C%3E): GET...\u0026eventName=CHANGE_CALENDAR_SETTING \u0026filters=NEW_VALUE%3C%3EREAD_ONLY_ACCESS In the following Drive example, the list can be a view or edit event's `doc_id` parameter with a value that is manipulated by an 'equal to' (==) or 'not equal to' (\u003c\u003e) relational operator. In the first example, the report returns each edited document's `doc_id`. In the second example, the report returns each viewed document's `doc_id` that equals the value 12345 and does not return any viewed document's which have a `doc_id` value of 98765. The \u003c\u003e operator is URL-encoded in the request's query string (%3C%3E): GET...\u0026eventName=edit\u0026filters=doc_id GET...\u0026eventName=view\u0026filters=doc_id==12345,doc_id%3C%3E98765 The relational operators include: - `==` - 'equal to'. - `\u003c\u003e` - 'not equal to'. It is URL-encoded (%3C%3E). - `\u003c` - 'less than'. It is URL-encoded (%3C). - `\u003c=` - 'less than or equal to'. It is URL-encoded (%3C=). - `\u003e` - 'greater than'. It is URL-encoded (%3E). - `\u003e=` - 'greater than or equal to'. It is URL-encoded (%3E=). *Note:* The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. If no parameters are requested, all parameters are returned. ", 1689 // "location": "query", 1690 // "pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)", 1691 // "type": "string" 1692 // }, 1693 // "groupIdFilter": { 1694 // "description": "Comma separated group ids (obfuscated) on which user activities are filtered, i.e, the response will contain activities for only those users that are a part of at least one of the group ids mentioned here. Format: \"id:abc123,id:xyz456\"", 1695 // "location": "query", 1696 // "pattern": "(id:[a-z0-9]+(,id:[a-z0-9]+)*)", 1697 // "type": "string" 1698 // }, 1699 // "maxResults": { 1700 // "default": "1000", 1701 // "description": "Determines how many activity records are shown on each response page. For example, if the request sets `maxResults=1` and the report has two activities, the report has two pages. The response's `nextPageToken` property has the token to the second page. The `maxResults` query string is optional in the request. The default value is 1000.", 1702 // "format": "int32", 1703 // "location": "query", 1704 // "maximum": "1000", 1705 // "minimum": "1", 1706 // "type": "integer" 1707 // }, 1708 // "orgUnitID": { 1709 // "default": "", 1710 // "description": "ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results.", 1711 // "location": "query", 1712 // "pattern": "(id:[a-z0-9]+)", 1713 // "type": "string" 1714 // }, 1715 // "pageToken": { 1716 // "description": "The token to specify next page. A report with multiple pages has a `nextPageToken` property in the response. In your follow-on request getting the next page of the report, enter the `nextPageToken` value in the `pageToken` query string.", 1717 // "location": "query", 1718 // "type": "string" 1719 // }, 1720 // "startTime": { 1721 // "description": "Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from `startTime` until `endTime`. The `startTime` must be before the `endTime` (if specified) and the current time when the request is made, or the API returns an error.", 1722 // "location": "query", 1723 // "pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))", 1724 // "type": "string" 1725 // }, 1726 // "userKey": { 1727 // "description": "Represents the profile ID or the user email for which the data should be filtered. Can be `all` for all information, or `userKey` for a user's unique G Suite profile ID or their primary email address.", 1728 // "location": "path", 1729 // "required": true, 1730 // "type": "string" 1731 // } 1732 // }, 1733 // "path": "admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch", 1734 // "request": { 1735 // "$ref": "Channel" 1736 // }, 1737 // "response": { 1738 // "$ref": "Channel" 1739 // }, 1740 // "scopes": [ 1741 // "https://www.googleapis.com/auth/admin.reports.audit.readonly" 1742 // ] 1743 // } 1744 1745} 1746 1747// method id "admin.channels.stop": 1748 1749type ChannelsStopCall struct { 1750 s *Service 1751 channel *Channel 1752 urlParams_ gensupport.URLParams 1753 ctx_ context.Context 1754 header_ http.Header 1755} 1756 1757// Stop: Stop watching resources through this channel. 1758func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 1759 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1760 c.channel = channel 1761 return c 1762} 1763 1764// Fields allows partial responses to be retrieved. See 1765// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1766// for more information. 1767func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 1768 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1769 return c 1770} 1771 1772// Context sets the context to be used in this call's Do method. Any 1773// pending HTTP request will be aborted if the provided context is 1774// canceled. 1775func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 1776 c.ctx_ = ctx 1777 return c 1778} 1779 1780// Header returns an http.Header that can be modified by the caller to 1781// add HTTP headers to the request. 1782func (c *ChannelsStopCall) Header() http.Header { 1783 if c.header_ == nil { 1784 c.header_ = make(http.Header) 1785 } 1786 return c.header_ 1787} 1788 1789func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 1790 reqHeaders := make(http.Header) 1791 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1792 for k, v := range c.header_ { 1793 reqHeaders[k] = v 1794 } 1795 reqHeaders.Set("User-Agent", c.s.userAgent()) 1796 var body io.Reader = nil 1797 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 1798 if err != nil { 1799 return nil, err 1800 } 1801 reqHeaders.Set("Content-Type", "application/json") 1802 c.urlParams_.Set("alt", alt) 1803 c.urlParams_.Set("prettyPrint", "false") 1804 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports_v1/channels/stop") 1805 urls += "?" + c.urlParams_.Encode() 1806 req, err := http.NewRequest("POST", urls, body) 1807 if err != nil { 1808 return nil, err 1809 } 1810 req.Header = reqHeaders 1811 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1812} 1813 1814// Do executes the "admin.channels.stop" call. 1815func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { 1816 gensupport.SetOptions(c.urlParams_, opts...) 1817 res, err := c.doRequest("json") 1818 if err != nil { 1819 return err 1820 } 1821 defer googleapi.CloseBody(res) 1822 if err := googleapi.CheckResponse(res); err != nil { 1823 return err 1824 } 1825 return nil 1826 // { 1827 // "description": "Stop watching resources through this channel.", 1828 // "flatPath": "admin/reports_v1/channels/stop", 1829 // "httpMethod": "POST", 1830 // "id": "admin.channels.stop", 1831 // "parameterOrder": [], 1832 // "parameters": {}, 1833 // "path": "admin/reports_v1/channels/stop", 1834 // "request": { 1835 // "$ref": "Channel" 1836 // }, 1837 // "scopes": [ 1838 // "https://www.googleapis.com/auth/admin.reports.audit.readonly" 1839 // ] 1840 // } 1841 1842} 1843 1844// method id "reports.customerUsageReports.get": 1845 1846type CustomerUsageReportsGetCall struct { 1847 s *Service 1848 date string 1849 urlParams_ gensupport.URLParams 1850 ifNoneMatch_ string 1851 ctx_ context.Context 1852 header_ http.Header 1853} 1854 1855// Get: Retrieves a report which is a collection of properties and 1856// statistics for a specific customer's account. For more information, 1857// see the Customers Usage Report guide. For more information about the 1858// customer report's parameters, see the Customers Usage parameters 1859// reference guides. 1860func (r *CustomerUsageReportsService) Get(date string) *CustomerUsageReportsGetCall { 1861 c := &CustomerUsageReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1862 c.date = date 1863 return c 1864} 1865 1866// CustomerId sets the optional parameter "customerId": The unique ID of 1867// the customer to retrieve data for. 1868func (c *CustomerUsageReportsGetCall) CustomerId(customerId string) *CustomerUsageReportsGetCall { 1869 c.urlParams_.Set("customerId", customerId) 1870 return c 1871} 1872 1873// PageToken sets the optional parameter "pageToken": Token to specify 1874// next page. A report with multiple pages has a `nextPageToken` 1875// property in the response. For your follow-on requests getting all of 1876// the report's pages, enter the `nextPageToken` value in the 1877// `pageToken` query string. 1878func (c *CustomerUsageReportsGetCall) PageToken(pageToken string) *CustomerUsageReportsGetCall { 1879 c.urlParams_.Set("pageToken", pageToken) 1880 return c 1881} 1882 1883// Parameters sets the optional parameter "parameters": The `parameters` 1884// query string is a comma-separated list of event parameters that 1885// refine a report's results. The parameter is associated with a 1886// specific application. The application values for the Customers usage 1887// report include `accounts`, `app_maker`, `apps_scripts`, `calendar`, 1888// `classroom`, `cros`, `docs`, `gmail`, `gplus`, `device_management`, 1889// `meet`, and `sites`. A `parameters` query string is in the CSV form 1890// of `app_name1:param_name1, app_name2:param_name2`. *Note:* The API 1891// doesn't accept multiple values of a parameter. If a particular 1892// parameter is supplied more than once in the API request, the API only 1893// accepts the last value of that request parameter. In addition, if an 1894// invalid request parameter is supplied in the API request, the API 1895// ignores that request parameter and returns the response corresponding 1896// to the remaining valid request parameters. An example of an invalid 1897// request parameter is one that does not belong to the application. If 1898// no parameters are requested, all parameters are returned. 1899func (c *CustomerUsageReportsGetCall) Parameters(parameters string) *CustomerUsageReportsGetCall { 1900 c.urlParams_.Set("parameters", parameters) 1901 return c 1902} 1903 1904// Fields allows partial responses to be retrieved. See 1905// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1906// for more information. 1907func (c *CustomerUsageReportsGetCall) Fields(s ...googleapi.Field) *CustomerUsageReportsGetCall { 1908 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1909 return c 1910} 1911 1912// IfNoneMatch sets the optional parameter which makes the operation 1913// fail if the object's ETag matches the given value. This is useful for 1914// getting updates only after the object has changed since the last 1915// request. Use googleapi.IsNotModified to check whether the response 1916// error from Do is the result of In-None-Match. 1917func (c *CustomerUsageReportsGetCall) IfNoneMatch(entityTag string) *CustomerUsageReportsGetCall { 1918 c.ifNoneMatch_ = entityTag 1919 return c 1920} 1921 1922// Context sets the context to be used in this call's Do method. Any 1923// pending HTTP request will be aborted if the provided context is 1924// canceled. 1925func (c *CustomerUsageReportsGetCall) Context(ctx context.Context) *CustomerUsageReportsGetCall { 1926 c.ctx_ = ctx 1927 return c 1928} 1929 1930// Header returns an http.Header that can be modified by the caller to 1931// add HTTP headers to the request. 1932func (c *CustomerUsageReportsGetCall) Header() http.Header { 1933 if c.header_ == nil { 1934 c.header_ = make(http.Header) 1935 } 1936 return c.header_ 1937} 1938 1939func (c *CustomerUsageReportsGetCall) doRequest(alt string) (*http.Response, error) { 1940 reqHeaders := make(http.Header) 1941 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1942 for k, v := range c.header_ { 1943 reqHeaders[k] = v 1944 } 1945 reqHeaders.Set("User-Agent", c.s.userAgent()) 1946 if c.ifNoneMatch_ != "" { 1947 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1948 } 1949 var body io.Reader = nil 1950 c.urlParams_.Set("alt", alt) 1951 c.urlParams_.Set("prettyPrint", "false") 1952 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/usage/dates/{date}") 1953 urls += "?" + c.urlParams_.Encode() 1954 req, err := http.NewRequest("GET", urls, body) 1955 if err != nil { 1956 return nil, err 1957 } 1958 req.Header = reqHeaders 1959 googleapi.Expand(req.URL, map[string]string{ 1960 "date": c.date, 1961 }) 1962 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1963} 1964 1965// Do executes the "reports.customerUsageReports.get" call. 1966// Exactly one of *UsageReports or error will be non-nil. Any non-2xx 1967// status code is an error. Response headers are in either 1968// *UsageReports.ServerResponse.Header or (if a response was returned at 1969// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1970// to check whether the returned error was because 1971// http.StatusNotModified was returned. 1972func (c *CustomerUsageReportsGetCall) Do(opts ...googleapi.CallOption) (*UsageReports, error) { 1973 gensupport.SetOptions(c.urlParams_, opts...) 1974 res, err := c.doRequest("json") 1975 if res != nil && res.StatusCode == http.StatusNotModified { 1976 if res.Body != nil { 1977 res.Body.Close() 1978 } 1979 return nil, &googleapi.Error{ 1980 Code: res.StatusCode, 1981 Header: res.Header, 1982 } 1983 } 1984 if err != nil { 1985 return nil, err 1986 } 1987 defer googleapi.CloseBody(res) 1988 if err := googleapi.CheckResponse(res); err != nil { 1989 return nil, err 1990 } 1991 ret := &UsageReports{ 1992 ServerResponse: googleapi.ServerResponse{ 1993 Header: res.Header, 1994 HTTPStatusCode: res.StatusCode, 1995 }, 1996 } 1997 target := &ret 1998 if err := gensupport.DecodeResponse(target, res); err != nil { 1999 return nil, err 2000 } 2001 return ret, nil 2002 // { 2003 // "description": "Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information about the customer report's parameters, see the Customers Usage parameters reference guides. ", 2004 // "flatPath": "admin/reports/v1/usage/dates/{date}", 2005 // "httpMethod": "GET", 2006 // "id": "reports.customerUsageReports.get", 2007 // "parameterOrder": [ 2008 // "date" 2009 // ], 2010 // "parameters": { 2011 // "customerId": { 2012 // "description": "The unique ID of the customer to retrieve data for.", 2013 // "location": "query", 2014 // "pattern": "C.+", 2015 // "type": "string" 2016 // }, 2017 // "date": { 2018 // "description": "Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this.", 2019 // "location": "path", 2020 // "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", 2021 // "required": true, 2022 // "type": "string" 2023 // }, 2024 // "pageToken": { 2025 // "description": "Token to specify next page. A report with multiple pages has a `nextPageToken` property in the response. For your follow-on requests getting all of the report's pages, enter the `nextPageToken` value in the `pageToken` query string.", 2026 // "location": "query", 2027 // "type": "string" 2028 // }, 2029 // "parameters": { 2030 // "description": "The `parameters` query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Customers usage report include `accounts`, `app_maker`, `apps_scripts`, `calendar`, `classroom`, `cros`, `docs`, `gmail`, `gplus`, `device_management`, `meet`, and `sites`. A `parameters` query string is in the CSV form of `app_name1:param_name1, app_name2:param_name2`. *Note:* The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned. ", 2031 // "location": "query", 2032 // "pattern": "(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+,)*(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+)", 2033 // "type": "string" 2034 // } 2035 // }, 2036 // "path": "admin/reports/v1/usage/dates/{date}", 2037 // "response": { 2038 // "$ref": "UsageReports" 2039 // }, 2040 // "scopes": [ 2041 // "https://www.googleapis.com/auth/admin.reports.usage.readonly" 2042 // ] 2043 // } 2044 2045} 2046 2047// Pages invokes f for each page of results. 2048// A non-nil error returned from f will halt the iteration. 2049// The provided context supersedes any context provided to the Context method. 2050func (c *CustomerUsageReportsGetCall) Pages(ctx context.Context, f func(*UsageReports) error) error { 2051 c.ctx_ = ctx 2052 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2053 for { 2054 x, err := c.Do() 2055 if err != nil { 2056 return err 2057 } 2058 if err := f(x); err != nil { 2059 return err 2060 } 2061 if x.NextPageToken == "" { 2062 return nil 2063 } 2064 c.PageToken(x.NextPageToken) 2065 } 2066} 2067 2068// method id "reports.entityUsageReports.get": 2069 2070type EntityUsageReportsGetCall struct { 2071 s *Service 2072 entityType string 2073 entityKey string 2074 date string 2075 urlParams_ gensupport.URLParams 2076 ifNoneMatch_ string 2077 ctx_ context.Context 2078 header_ http.Header 2079} 2080 2081// Get: Retrieves a report which is a collection of properties and 2082// statistics for entities used by users within the account. For more 2083// information, see the Entities Usage Report guide. For more 2084// information about the entities report's parameters, see the Entities 2085// Usage parameters reference guides. 2086func (r *EntityUsageReportsService) Get(entityType string, entityKey string, date string) *EntityUsageReportsGetCall { 2087 c := &EntityUsageReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2088 c.entityType = entityType 2089 c.entityKey = entityKey 2090 c.date = date 2091 return c 2092} 2093 2094// CustomerId sets the optional parameter "customerId": The unique ID of 2095// the customer to retrieve data for. 2096func (c *EntityUsageReportsGetCall) CustomerId(customerId string) *EntityUsageReportsGetCall { 2097 c.urlParams_.Set("customerId", customerId) 2098 return c 2099} 2100 2101// Filters sets the optional parameter "filters": The `filters` query 2102// string is a comma-separated list of an application's event parameters 2103// where the parameter's value is manipulated by a relational operator. 2104// The `filters` query string includes the name of the application whose 2105// usage is returned in the report. The application values for the 2106// Entities usage report include `accounts`, `docs`, and `gmail`. 2107// Filters are in the form `[application name]:parameter name[parameter 2108// value],...`. In this example, the `<>` 'not equal to' operator is 2109// URL-encoded in the request's query string (%3C%3E): GET 2110// https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01 ?parameters=gplus:community_name,gplus:num_total_members &filters=gplus:num_total_members%3C%3E0 The relational operators include: - `==` - 'equal to'. - `<>` - 'not equal to'. It is URL-encoded (%3C%3E). - `<` - 'less than'. It is URL-encoded (%3C). - `<=` - 'less than or equal to'. It is URL-encoded (%3C=). - `>` - 'greater than'. It is URL-encoded (%3E). - `>=` - 'greater than or equal to'. It is URL-encoded (%3E=). Filters can only be applied to numeric 2111// parameters. 2112func (c *EntityUsageReportsGetCall) Filters(filters string) *EntityUsageReportsGetCall { 2113 c.urlParams_.Set("filters", filters) 2114 return c 2115} 2116 2117// MaxResults sets the optional parameter "maxResults": Determines how 2118// many activity records are shown on each response page. For example, 2119// if the request sets `maxResults=1` and the report has two activities, 2120// the report has two pages. The response's `nextPageToken` property has 2121// the token to the second page. 2122func (c *EntityUsageReportsGetCall) MaxResults(maxResults int64) *EntityUsageReportsGetCall { 2123 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 2124 return c 2125} 2126 2127// PageToken sets the optional parameter "pageToken": Token to specify 2128// next page. A report with multiple pages has a `nextPageToken` 2129// property in the response. In your follow-on request getting the next 2130// page of the report, enter the `nextPageToken` value in the 2131// `pageToken` query string. 2132func (c *EntityUsageReportsGetCall) PageToken(pageToken string) *EntityUsageReportsGetCall { 2133 c.urlParams_.Set("pageToken", pageToken) 2134 return c 2135} 2136 2137// Parameters sets the optional parameter "parameters": The `parameters` 2138// query string is a comma-separated list of event parameters that 2139// refine a report's results. The parameter is associated with a 2140// specific application. The application values for the Entities usage 2141// report are only `gplus`. A `parameter` query string is in the CSV 2142// form of `[app_name1:param_name1], [app_name2:param_name2]...`. 2143// *Note:* The API doesn't accept multiple values of a parameter. If a 2144// particular parameter is supplied more than once in the API request, 2145// the API only accepts the last value of that request parameter. In 2146// addition, if an invalid request parameter is supplied in the API 2147// request, the API ignores that request parameter and returns the 2148// response corresponding to the remaining valid request parameters. An 2149// example of an invalid request parameter is one that does not belong 2150// to the application. If no parameters are requested, all parameters 2151// are returned. 2152func (c *EntityUsageReportsGetCall) Parameters(parameters string) *EntityUsageReportsGetCall { 2153 c.urlParams_.Set("parameters", parameters) 2154 return c 2155} 2156 2157// Fields allows partial responses to be retrieved. See 2158// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2159// for more information. 2160func (c *EntityUsageReportsGetCall) Fields(s ...googleapi.Field) *EntityUsageReportsGetCall { 2161 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2162 return c 2163} 2164 2165// IfNoneMatch sets the optional parameter which makes the operation 2166// fail if the object's ETag matches the given value. This is useful for 2167// getting updates only after the object has changed since the last 2168// request. Use googleapi.IsNotModified to check whether the response 2169// error from Do is the result of In-None-Match. 2170func (c *EntityUsageReportsGetCall) IfNoneMatch(entityTag string) *EntityUsageReportsGetCall { 2171 c.ifNoneMatch_ = entityTag 2172 return c 2173} 2174 2175// Context sets the context to be used in this call's Do method. Any 2176// pending HTTP request will be aborted if the provided context is 2177// canceled. 2178func (c *EntityUsageReportsGetCall) Context(ctx context.Context) *EntityUsageReportsGetCall { 2179 c.ctx_ = ctx 2180 return c 2181} 2182 2183// Header returns an http.Header that can be modified by the caller to 2184// add HTTP headers to the request. 2185func (c *EntityUsageReportsGetCall) Header() http.Header { 2186 if c.header_ == nil { 2187 c.header_ = make(http.Header) 2188 } 2189 return c.header_ 2190} 2191 2192func (c *EntityUsageReportsGetCall) doRequest(alt string) (*http.Response, error) { 2193 reqHeaders := make(http.Header) 2194 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2195 for k, v := range c.header_ { 2196 reqHeaders[k] = v 2197 } 2198 reqHeaders.Set("User-Agent", c.s.userAgent()) 2199 if c.ifNoneMatch_ != "" { 2200 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2201 } 2202 var body io.Reader = nil 2203 c.urlParams_.Set("alt", alt) 2204 c.urlParams_.Set("prettyPrint", "false") 2205 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}") 2206 urls += "?" + c.urlParams_.Encode() 2207 req, err := http.NewRequest("GET", urls, body) 2208 if err != nil { 2209 return nil, err 2210 } 2211 req.Header = reqHeaders 2212 googleapi.Expand(req.URL, map[string]string{ 2213 "entityType": c.entityType, 2214 "entityKey": c.entityKey, 2215 "date": c.date, 2216 }) 2217 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2218} 2219 2220// Do executes the "reports.entityUsageReports.get" call. 2221// Exactly one of *UsageReports or error will be non-nil. Any non-2xx 2222// status code is an error. Response headers are in either 2223// *UsageReports.ServerResponse.Header or (if a response was returned at 2224// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2225// to check whether the returned error was because 2226// http.StatusNotModified was returned. 2227func (c *EntityUsageReportsGetCall) Do(opts ...googleapi.CallOption) (*UsageReports, error) { 2228 gensupport.SetOptions(c.urlParams_, opts...) 2229 res, err := c.doRequest("json") 2230 if res != nil && res.StatusCode == http.StatusNotModified { 2231 if res.Body != nil { 2232 res.Body.Close() 2233 } 2234 return nil, &googleapi.Error{ 2235 Code: res.StatusCode, 2236 Header: res.Header, 2237 } 2238 } 2239 if err != nil { 2240 return nil, err 2241 } 2242 defer googleapi.CloseBody(res) 2243 if err := googleapi.CheckResponse(res); err != nil { 2244 return nil, err 2245 } 2246 ret := &UsageReports{ 2247 ServerResponse: googleapi.ServerResponse{ 2248 Header: res.Header, 2249 HTTPStatusCode: res.StatusCode, 2250 }, 2251 } 2252 target := &ret 2253 if err := gensupport.DecodeResponse(target, res); err != nil { 2254 return nil, err 2255 } 2256 return ret, nil 2257 // { 2258 // "description": "Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more information about the entities report's parameters, see the Entities Usage parameters reference guides.", 2259 // "flatPath": "admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}", 2260 // "httpMethod": "GET", 2261 // "id": "reports.entityUsageReports.get", 2262 // "parameterOrder": [ 2263 // "entityType", 2264 // "entityKey", 2265 // "date" 2266 // ], 2267 // "parameters": { 2268 // "customerId": { 2269 // "description": "The unique ID of the customer to retrieve data for.", 2270 // "location": "query", 2271 // "pattern": "C.+", 2272 // "type": "string" 2273 // }, 2274 // "date": { 2275 // "description": "Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this.", 2276 // "location": "path", 2277 // "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", 2278 // "required": true, 2279 // "type": "string" 2280 // }, 2281 // "entityKey": { 2282 // "description": "Represents the key of the object to filter the data with.", 2283 // "enum": [ 2284 // "entityKeyUndefined", 2285 // "all", 2286 // "entityKey" 2287 // ], 2288 // "enumDescriptions": [ 2289 // "", 2290 // "Returns activity events for all users.", 2291 // "Represents an app-specific identifier for the entity. For details on how to obtain the `entityKey` for a particular `entityType`, see the Entities Usage parameters reference guides." 2292 // ], 2293 // "location": "path", 2294 // "required": true, 2295 // "type": "string" 2296 // }, 2297 // "entityType": { 2298 // "description": "Represents the type of entity for the report.", 2299 // "enum": [ 2300 // "entity_type_undefined", 2301 // "gplus_communities" 2302 // ], 2303 // "enumDescriptions": [ 2304 // "", 2305 // "Returns a report on Google+ communities." 2306 // ], 2307 // "location": "path", 2308 // "pattern": "(gplus_communities)", 2309 // "required": true, 2310 // "type": "string" 2311 // }, 2312 // "filters": { 2313 // "description": "The `filters` query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The `filters` query string includes the name of the application whose usage is returned in the report. The application values for the Entities usage report include `accounts`, `docs`, and `gmail`. Filters are in the form `[application name]:parameter name[parameter value],...`. In this example, the `\u003c\u003e` 'not equal to' operator is URL-encoded in the request's query string (%3C%3E): GET https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01 ?parameters=gplus:community_name,gplus:num_total_members \u0026filters=gplus:num_total_members%3C%3E0 The relational operators include: - `==` - 'equal to'. - `\u003c\u003e` - 'not equal to'. It is URL-encoded (%3C%3E). - `\u003c` - 'less than'. It is URL-encoded (%3C). - `\u003c=` - 'less than or equal to'. It is URL-encoded (%3C=). - `\u003e` - 'greater than'. It is URL-encoded (%3E). - `\u003e=` - 'greater than or equal to'. It is URL-encoded (%3E=). Filters can only be applied to numeric parameters.", 2314 // "location": "query", 2315 // "pattern": "(((gplus)):[a-z0-9_]+[\u003c,\u003c=,==,\u003e=,\u003e,!=][^,]+,)*(((gplus)):[a-z0-9_]+[\u003c,\u003c=,==,\u003e=,\u003e,!=][^,]+)", 2316 // "type": "string" 2317 // }, 2318 // "maxResults": { 2319 // "default": "1000", 2320 // "description": "Determines how many activity records are shown on each response page. For example, if the request sets `maxResults=1` and the report has two activities, the report has two pages. The response's `nextPageToken` property has the token to the second page.", 2321 // "format": "uint32", 2322 // "location": "query", 2323 // "maximum": "1000", 2324 // "minimum": "1", 2325 // "type": "integer" 2326 // }, 2327 // "pageToken": { 2328 // "description": "Token to specify next page. A report with multiple pages has a `nextPageToken` property in the response. In your follow-on request getting the next page of the report, enter the `nextPageToken` value in the `pageToken` query string.", 2329 // "location": "query", 2330 // "type": "string" 2331 // }, 2332 // "parameters": { 2333 // "description": "The `parameters` query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Entities usage report are only `gplus`. A `parameter` query string is in the CSV form of `[app_name1:param_name1], [app_name2:param_name2]...`. *Note:* The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned. ", 2334 // "location": "query", 2335 // "pattern": "(((gplus)):[^,]+,)*(((gplus)):[^,]+)", 2336 // "type": "string" 2337 // } 2338 // }, 2339 // "path": "admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}", 2340 // "response": { 2341 // "$ref": "UsageReports" 2342 // }, 2343 // "scopes": [ 2344 // "https://www.googleapis.com/auth/admin.reports.usage.readonly" 2345 // ] 2346 // } 2347 2348} 2349 2350// Pages invokes f for each page of results. 2351// A non-nil error returned from f will halt the iteration. 2352// The provided context supersedes any context provided to the Context method. 2353func (c *EntityUsageReportsGetCall) Pages(ctx context.Context, f func(*UsageReports) error) error { 2354 c.ctx_ = ctx 2355 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2356 for { 2357 x, err := c.Do() 2358 if err != nil { 2359 return err 2360 } 2361 if err := f(x); err != nil { 2362 return err 2363 } 2364 if x.NextPageToken == "" { 2365 return nil 2366 } 2367 c.PageToken(x.NextPageToken) 2368 } 2369} 2370 2371// method id "reports.userUsageReport.get": 2372 2373type UserUsageReportGetCall struct { 2374 s *Service 2375 userKey string 2376 date string 2377 urlParams_ gensupport.URLParams 2378 ifNoneMatch_ string 2379 ctx_ context.Context 2380 header_ http.Header 2381} 2382 2383// Get: Retrieves a report which is a collection of properties and 2384// statistics for a set of users with the account. For more information, 2385// see the User Usage Report guide. For more information about the user 2386// report's parameters, see the Users Usage parameters reference guides. 2387func (r *UserUsageReportService) Get(userKey string, date string) *UserUsageReportGetCall { 2388 c := &UserUsageReportGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2389 c.userKey = userKey 2390 c.date = date 2391 return c 2392} 2393 2394// CustomerId sets the optional parameter "customerId": The unique ID of 2395// the customer to retrieve data for. 2396func (c *UserUsageReportGetCall) CustomerId(customerId string) *UserUsageReportGetCall { 2397 c.urlParams_.Set("customerId", customerId) 2398 return c 2399} 2400 2401// Filters sets the optional parameter "filters": The `filters` query 2402// string is a comma-separated list of an application's event parameters 2403// where the parameter's value is manipulated by a relational operator. 2404// The `filters` query string includes the name of the application whose 2405// usage is returned in the report. The application values for the Users 2406// Usage Report include `accounts`, `docs`, and `gmail`. Filters are in 2407// the form `[application name]:parameter name[parameter value],...`. In 2408// this example, the `<>` 'not equal to' operator is URL-encoded in the 2409// request's query string (%3C%3E): GET 2410// https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03 ?parameters=accounts:last_login_time &filters=accounts:last_login_time%3C%3E2010-10-28T10:26:35.000Z The relational operators include: - `==` - 'equal to'. - `<>` - 'not equal to'. It is URL-encoded (%3C%3E). - `<` - 'less than'. It is URL-encoded (%3C). - `<=` - 'less than or equal to'. It is URL-encoded (%3C=). - `>` - 'greater than'. It is URL-encoded (%3E). - `>=` - 'greater than or equal to'. It is URL-encoded 2411// (%3E=). 2412func (c *UserUsageReportGetCall) Filters(filters string) *UserUsageReportGetCall { 2413 c.urlParams_.Set("filters", filters) 2414 return c 2415} 2416 2417// GroupIdFilter sets the optional parameter "groupIdFilter": Comma 2418// separated group ids (obfuscated) on which user activities are 2419// filtered, i.e, the response will contain activities for only those 2420// users that are a part of at least one of the group ids mentioned 2421// here. Format: "id:abc123,id:xyz456" 2422func (c *UserUsageReportGetCall) GroupIdFilter(groupIdFilter string) *UserUsageReportGetCall { 2423 c.urlParams_.Set("groupIdFilter", groupIdFilter) 2424 return c 2425} 2426 2427// MaxResults sets the optional parameter "maxResults": Determines how 2428// many activity records are shown on each response page. For example, 2429// if the request sets `maxResults=1` and the report has two activities, 2430// the report has two pages. The response's `nextPageToken` property has 2431// the token to the second page. The `maxResults` query string is 2432// optional. 2433func (c *UserUsageReportGetCall) MaxResults(maxResults int64) *UserUsageReportGetCall { 2434 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 2435 return c 2436} 2437 2438// OrgUnitID sets the optional parameter "orgUnitID": ID of the 2439// organizational unit to report on. User activity will be shown only 2440// for users who belong to the specified organizational unit. Data 2441// before Dec 17, 2018 doesn't appear in the filtered results. 2442func (c *UserUsageReportGetCall) OrgUnitID(orgUnitID string) *UserUsageReportGetCall { 2443 c.urlParams_.Set("orgUnitID", orgUnitID) 2444 return c 2445} 2446 2447// PageToken sets the optional parameter "pageToken": Token to specify 2448// next page. A report with multiple pages has a `nextPageToken` 2449// property in the response. In your follow-on request getting the next 2450// page of the report, enter the `nextPageToken` value in the 2451// `pageToken` query string. 2452func (c *UserUsageReportGetCall) PageToken(pageToken string) *UserUsageReportGetCall { 2453 c.urlParams_.Set("pageToken", pageToken) 2454 return c 2455} 2456 2457// Parameters sets the optional parameter "parameters": The `parameters` 2458// query string is a comma-separated list of event parameters that 2459// refine a report's results. The parameter is associated with a 2460// specific application. The application values for the Customers Usage 2461// report include `accounts`, `app_maker`, `apps_scripts`, `calendar`, 2462// `classroom`, `cros`, `docs`, `gmail`, `gplus`, `device_management`, 2463// `meet`, and `sites`. A `parameters` query string is in the CSV form 2464// of `app_name1:param_name1, app_name2:param_name2`. *Note:* The API 2465// doesn't accept multiple values of a parameter. If a particular 2466// parameter is supplied more than once in the API request, the API only 2467// accepts the last value of that request parameter. In addition, if an 2468// invalid request parameter is supplied in the API request, the API 2469// ignores that request parameter and returns the response corresponding 2470// to the remaining valid request parameters. An example of an invalid 2471// request parameter is one that does not belong to the application. If 2472// no parameters are requested, all parameters are returned. 2473func (c *UserUsageReportGetCall) Parameters(parameters string) *UserUsageReportGetCall { 2474 c.urlParams_.Set("parameters", parameters) 2475 return c 2476} 2477 2478// Fields allows partial responses to be retrieved. See 2479// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2480// for more information. 2481func (c *UserUsageReportGetCall) Fields(s ...googleapi.Field) *UserUsageReportGetCall { 2482 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2483 return c 2484} 2485 2486// IfNoneMatch sets the optional parameter which makes the operation 2487// fail if the object's ETag matches the given value. This is useful for 2488// getting updates only after the object has changed since the last 2489// request. Use googleapi.IsNotModified to check whether the response 2490// error from Do is the result of In-None-Match. 2491func (c *UserUsageReportGetCall) IfNoneMatch(entityTag string) *UserUsageReportGetCall { 2492 c.ifNoneMatch_ = entityTag 2493 return c 2494} 2495 2496// Context sets the context to be used in this call's Do method. Any 2497// pending HTTP request will be aborted if the provided context is 2498// canceled. 2499func (c *UserUsageReportGetCall) Context(ctx context.Context) *UserUsageReportGetCall { 2500 c.ctx_ = ctx 2501 return c 2502} 2503 2504// Header returns an http.Header that can be modified by the caller to 2505// add HTTP headers to the request. 2506func (c *UserUsageReportGetCall) Header() http.Header { 2507 if c.header_ == nil { 2508 c.header_ = make(http.Header) 2509 } 2510 return c.header_ 2511} 2512 2513func (c *UserUsageReportGetCall) doRequest(alt string) (*http.Response, error) { 2514 reqHeaders := make(http.Header) 2515 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2516 for k, v := range c.header_ { 2517 reqHeaders[k] = v 2518 } 2519 reqHeaders.Set("User-Agent", c.s.userAgent()) 2520 if c.ifNoneMatch_ != "" { 2521 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2522 } 2523 var body io.Reader = nil 2524 c.urlParams_.Set("alt", alt) 2525 c.urlParams_.Set("prettyPrint", "false") 2526 urls := googleapi.ResolveRelative(c.s.BasePath, "admin/reports/v1/usage/users/{userKey}/dates/{date}") 2527 urls += "?" + c.urlParams_.Encode() 2528 req, err := http.NewRequest("GET", urls, body) 2529 if err != nil { 2530 return nil, err 2531 } 2532 req.Header = reqHeaders 2533 googleapi.Expand(req.URL, map[string]string{ 2534 "userKey": c.userKey, 2535 "date": c.date, 2536 }) 2537 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2538} 2539 2540// Do executes the "reports.userUsageReport.get" call. 2541// Exactly one of *UsageReports or error will be non-nil. Any non-2xx 2542// status code is an error. Response headers are in either 2543// *UsageReports.ServerResponse.Header or (if a response was returned at 2544// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2545// to check whether the returned error was because 2546// http.StatusNotModified was returned. 2547func (c *UserUsageReportGetCall) Do(opts ...googleapi.CallOption) (*UsageReports, error) { 2548 gensupport.SetOptions(c.urlParams_, opts...) 2549 res, err := c.doRequest("json") 2550 if res != nil && res.StatusCode == http.StatusNotModified { 2551 if res.Body != nil { 2552 res.Body.Close() 2553 } 2554 return nil, &googleapi.Error{ 2555 Code: res.StatusCode, 2556 Header: res.Header, 2557 } 2558 } 2559 if err != nil { 2560 return nil, err 2561 } 2562 defer googleapi.CloseBody(res) 2563 if err := googleapi.CheckResponse(res); err != nil { 2564 return nil, err 2565 } 2566 ret := &UsageReports{ 2567 ServerResponse: googleapi.ServerResponse{ 2568 Header: res.Header, 2569 HTTPStatusCode: res.StatusCode, 2570 }, 2571 } 2572 target := &ret 2573 if err := gensupport.DecodeResponse(target, res); err != nil { 2574 return nil, err 2575 } 2576 return ret, nil 2577 // { 2578 // "description": "Retrieves a report which is a collection of properties and statistics for a set of users with the account. For more information, see the User Usage Report guide. For more information about the user report's parameters, see the Users Usage parameters reference guides.", 2579 // "flatPath": "admin/reports/v1/usage/users/{userKey}/dates/{date}", 2580 // "httpMethod": "GET", 2581 // "id": "reports.userUsageReport.get", 2582 // "parameterOrder": [ 2583 // "userKey", 2584 // "date" 2585 // ], 2586 // "parameters": { 2587 // "customerId": { 2588 // "description": "The unique ID of the customer to retrieve data for.", 2589 // "location": "query", 2590 // "pattern": "C.+", 2591 // "type": "string" 2592 // }, 2593 // "date": { 2594 // "description": "Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We recommend you use your account's time zone for this.", 2595 // "location": "path", 2596 // "pattern": "(\\d){4}-(\\d){2}-(\\d){2}", 2597 // "required": true, 2598 // "type": "string" 2599 // }, 2600 // "filters": { 2601 // "description": "The `filters` query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The `filters` query string includes the name of the application whose usage is returned in the report. The application values for the Users Usage Report include `accounts`, `docs`, and `gmail`. Filters are in the form `[application name]:parameter name[parameter value],...`. In this example, the `\u003c\u003e` 'not equal to' operator is URL-encoded in the request's query string (%3C%3E): GET https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03 ?parameters=accounts:last_login_time \u0026filters=accounts:last_login_time%3C%3E2010-10-28T10:26:35.000Z The relational operators include: - `==` - 'equal to'. - `\u003c\u003e` - 'not equal to'. It is URL-encoded (%3C%3E). - `\u003c` - 'less than'. It is URL-encoded (%3C). - `\u003c=` - 'less than or equal to'. It is URL-encoded (%3C=). - `\u003e` - 'greater than'. It is URL-encoded (%3E). - `\u003e=` - 'greater than or equal to'. It is URL-encoded (%3E=). ", 2602 // "location": "query", 2603 // "pattern": "(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[\u003c,\u003c=,==,\u003e=,\u003e,!=][^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[\u003c,\u003c=,==,\u003e=,\u003e,!=][^,]+)", 2604 // "type": "string" 2605 // }, 2606 // "groupIdFilter": { 2607 // "description": "Comma separated group ids (obfuscated) on which user activities are filtered, i.e, the response will contain activities for only those users that are a part of at least one of the group ids mentioned here. Format: \"id:abc123,id:xyz456\"", 2608 // "location": "query", 2609 // "pattern": "(id:[a-z0-9]+(,id:[a-z0-9]+)*)", 2610 // "type": "string" 2611 // }, 2612 // "maxResults": { 2613 // "default": "1000", 2614 // "description": "Determines how many activity records are shown on each response page. For example, if the request sets `maxResults=1` and the report has two activities, the report has two pages. The response's `nextPageToken` property has the token to the second page. The `maxResults` query string is optional.", 2615 // "format": "uint32", 2616 // "location": "query", 2617 // "maximum": "1000", 2618 // "minimum": "1", 2619 // "type": "integer" 2620 // }, 2621 // "orgUnitID": { 2622 // "default": "", 2623 // "description": "ID of the organizational unit to report on. User activity will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results.", 2624 // "location": "query", 2625 // "pattern": "(id:[a-z0-9]+)", 2626 // "type": "string" 2627 // }, 2628 // "pageToken": { 2629 // "description": "Token to specify next page. A report with multiple pages has a `nextPageToken` property in the response. In your follow-on request getting the next page of the report, enter the `nextPageToken` value in the `pageToken` query string.", 2630 // "location": "query", 2631 // "type": "string" 2632 // }, 2633 // "parameters": { 2634 // "description": "The `parameters` query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Customers Usage report include `accounts`, `app_maker`, `apps_scripts`, `calendar`, `classroom`, `cros`, `docs`, `gmail`, `gplus`, `device_management`, `meet`, and `sites`. A `parameters` query string is in the CSV form of `app_name1:param_name1, app_name2:param_name2`. *Note:* The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned. ", 2635 // "location": "query", 2636 // "pattern": "(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+)", 2637 // "type": "string" 2638 // }, 2639 // "userKey": { 2640 // "description": "Represents the profile ID or the user email for which the data should be filtered. Can be `all` for all information, or `userKey` for a user's unique G Suite profile ID or their primary email address.", 2641 // "location": "path", 2642 // "required": true, 2643 // "type": "string" 2644 // } 2645 // }, 2646 // "path": "admin/reports/v1/usage/users/{userKey}/dates/{date}", 2647 // "response": { 2648 // "$ref": "UsageReports" 2649 // }, 2650 // "scopes": [ 2651 // "https://www.googleapis.com/auth/admin.reports.usage.readonly" 2652 // ] 2653 // } 2654 2655} 2656 2657// Pages invokes f for each page of results. 2658// A non-nil error returned from f will halt the iteration. 2659// The provided context supersedes any context provided to the Context method. 2660func (c *UserUsageReportGetCall) Pages(ctx context.Context, f func(*UsageReports) error) error { 2661 c.ctx_ = ctx 2662 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2663 for { 2664 x, err := c.Do() 2665 if err != nil { 2666 return err 2667 } 2668 if err := f(x); err != nil { 2669 return err 2670 } 2671 if x.NextPageToken == "" { 2672 return nil 2673 } 2674 c.PageToken(x.NextPageToken) 2675 } 2676} 2677