1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package driveactivity provides access to the Drive Activity API. 8// 9// For product documentation, see: https://developers.google.com/drive/activity/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/driveactivity/v2" 16// ... 17// ctx := context.Background() 18// driveactivityService, err := driveactivity.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// driveactivityService, err := driveactivity.NewService(ctx, option.WithScopes(driveactivity.DriveActivityReadonlyScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// driveactivityService, err := driveactivity.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// driveactivityService, err := driveactivity.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package driveactivity // import "google.golang.org/api/driveactivity/v2" 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 = "driveactivity:v2" 79const apiName = "driveactivity" 80const apiVersion = "v2" 81const basePath = "https://driveactivity.googleapis.com/" 82const mtlsBasePath = "https://driveactivity.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // View and add to the activity record of files in your Google Drive 87 DriveActivityScope = "https://www.googleapis.com/auth/drive.activity" 88 89 // View the activity record of files in your Google Drive 90 DriveActivityReadonlyScope = "https://www.googleapis.com/auth/drive.activity.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/drive.activity", 97 "https://www.googleapis.com/auth/drive.activity.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.Activity = NewActivityService(s) 128 return s, nil 129} 130 131type Service struct { 132 client *http.Client 133 BasePath string // API endpoint base URL 134 UserAgent string // optional additional User-Agent fragment 135 136 Activity *ActivityService 137} 138 139func (s *Service) userAgent() string { 140 if s.UserAgent == "" { 141 return googleapi.UserAgent 142 } 143 return googleapi.UserAgent + " " + s.UserAgent 144} 145 146func NewActivityService(s *Service) *ActivityService { 147 rs := &ActivityService{s: s} 148 return rs 149} 150 151type ActivityService struct { 152 s *Service 153} 154 155// Action: Information about the action. 156type Action struct { 157 // Actor: The actor responsible for this action (or empty if all actors 158 // are responsible). 159 Actor *Actor `json:"actor,omitempty"` 160 161 // Detail: The type and detailed information about the action. 162 Detail *ActionDetail `json:"detail,omitempty"` 163 164 // Target: The target this action affects (or empty if affecting all 165 // targets). This represents the state of the target immediately after 166 // this action occurred. 167 Target *Target `json:"target,omitempty"` 168 169 // TimeRange: The action occurred over this time range. 170 TimeRange *TimeRange `json:"timeRange,omitempty"` 171 172 // Timestamp: The action occurred at this specific time. 173 Timestamp string `json:"timestamp,omitempty"` 174 175 // ForceSendFields is a list of field names (e.g. "Actor") to 176 // unconditionally include in API requests. By default, fields with 177 // empty or default values are omitted from API requests. However, any 178 // non-pointer, non-interface field appearing in ForceSendFields will be 179 // sent to the server regardless of whether the field is empty or not. 180 // This may be used to include empty fields in Patch requests. 181 ForceSendFields []string `json:"-"` 182 183 // NullFields is a list of field names (e.g. "Actor") to include in API 184 // requests with the JSON null value. By default, fields with empty 185 // values are omitted from API requests. However, any field with an 186 // empty value appearing in NullFields will be sent to the server as 187 // null. It is an error if a field in this list has a non-empty value. 188 // This may be used to include null fields in Patch requests. 189 NullFields []string `json:"-"` 190} 191 192func (s *Action) MarshalJSON() ([]byte, error) { 193 type NoMethod Action 194 raw := NoMethod(*s) 195 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 196} 197 198// ActionDetail: Data describing the type and additional information of 199// an action. 200type ActionDetail struct { 201 // Comment: A change about comments was made. 202 Comment *Comment `json:"comment,omitempty"` 203 204 // Create: An object was created. 205 Create *Create `json:"create,omitempty"` 206 207 // Delete: An object was deleted. 208 Delete *Delete `json:"delete,omitempty"` 209 210 // DlpChange: A change happened in data leak prevention status. 211 DlpChange *DataLeakPreventionChange `json:"dlpChange,omitempty"` 212 213 // Edit: An object was edited. 214 Edit *Edit `json:"edit,omitempty"` 215 216 // Move: An object was moved. 217 Move *Move `json:"move,omitempty"` 218 219 // PermissionChange: The permission on an object was changed. 220 PermissionChange *PermissionChange `json:"permissionChange,omitempty"` 221 222 // Reference: An object was referenced in an application outside of 223 // Drive/Docs. 224 Reference *ApplicationReference `json:"reference,omitempty"` 225 226 // Rename: An object was renamed. 227 Rename *Rename `json:"rename,omitempty"` 228 229 // Restore: A deleted object was restored. 230 Restore *Restore `json:"restore,omitempty"` 231 232 // SettingsChange: Settings were changed. 233 SettingsChange *SettingsChange `json:"settingsChange,omitempty"` 234 235 // ForceSendFields is a list of field names (e.g. "Comment") to 236 // unconditionally include in API requests. By default, fields with 237 // empty or default values are omitted from API requests. However, any 238 // non-pointer, non-interface field appearing in ForceSendFields will be 239 // sent to the server regardless of whether the field is empty or not. 240 // This may be used to include empty fields in Patch requests. 241 ForceSendFields []string `json:"-"` 242 243 // NullFields is a list of field names (e.g. "Comment") to include in 244 // API requests with the JSON null value. By default, fields with empty 245 // values are omitted from API requests. However, any field with an 246 // empty value appearing in NullFields will be sent to the server as 247 // null. It is an error if a field in this list has a non-empty value. 248 // This may be used to include null fields in Patch requests. 249 NullFields []string `json:"-"` 250} 251 252func (s *ActionDetail) MarshalJSON() ([]byte, error) { 253 type NoMethod ActionDetail 254 raw := NoMethod(*s) 255 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 256} 257 258// Actor: The actor of a Drive activity. 259type Actor struct { 260 // Administrator: An administrator. 261 Administrator *Administrator `json:"administrator,omitempty"` 262 263 // Anonymous: An anonymous user. 264 Anonymous *AnonymousUser `json:"anonymous,omitempty"` 265 266 // Impersonation: An account acting on behalf of another. 267 Impersonation *Impersonation `json:"impersonation,omitempty"` 268 269 // System: A non-user actor (i.e. system triggered). 270 System *SystemEvent `json:"system,omitempty"` 271 272 // User: An end user. 273 User *User `json:"user,omitempty"` 274 275 // ForceSendFields is a list of field names (e.g. "Administrator") to 276 // unconditionally include in API requests. By default, fields with 277 // empty or default values are omitted from API requests. However, any 278 // non-pointer, non-interface field appearing in ForceSendFields will be 279 // sent to the server regardless of whether the field is empty or not. 280 // This may be used to include empty fields in Patch requests. 281 ForceSendFields []string `json:"-"` 282 283 // NullFields is a list of field names (e.g. "Administrator") to include 284 // in API requests with the JSON null value. By default, fields with 285 // empty values are omitted from API requests. However, any field with 286 // an empty value appearing in NullFields will be sent to the server as 287 // null. It is an error if a field in this list has a non-empty value. 288 // This may be used to include null fields in Patch requests. 289 NullFields []string `json:"-"` 290} 291 292func (s *Actor) MarshalJSON() ([]byte, error) { 293 type NoMethod Actor 294 raw := NoMethod(*s) 295 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 296} 297 298// Administrator: Empty message representing an administrator. 299type Administrator struct { 300} 301 302// AnonymousUser: Empty message representing an anonymous user or 303// indicating the authenticated user should be anonymized. 304type AnonymousUser struct { 305} 306 307// Anyone: Represents any user (including a logged out user). 308type Anyone struct { 309} 310 311// ApplicationReference: Activity in applications other than Drive. 312type ApplicationReference struct { 313 // Type: The reference type corresponding to this event. 314 // 315 // Possible values: 316 // "UNSPECIFIED_REFERENCE_TYPE" - The type is not available. 317 // "LINK" - The links of one or more Drive items were posted. 318 // "DISCUSS" - Comments were made regarding a Drive item. 319 Type string `json:"type,omitempty"` 320 321 // ForceSendFields is a list of field names (e.g. "Type") to 322 // unconditionally include in API requests. By default, fields with 323 // empty or default values are omitted from API requests. However, any 324 // non-pointer, non-interface field appearing in ForceSendFields will be 325 // sent to the server regardless of whether the field is empty or not. 326 // This may be used to include empty fields in Patch requests. 327 ForceSendFields []string `json:"-"` 328 329 // NullFields is a list of field names (e.g. "Type") to include in API 330 // requests with the JSON null value. By default, fields with empty 331 // values are omitted from API requests. However, any field with an 332 // empty value appearing in NullFields will be sent to the server as 333 // null. It is an error if a field in this list has a non-empty value. 334 // This may be used to include null fields in Patch requests. 335 NullFields []string `json:"-"` 336} 337 338func (s *ApplicationReference) MarshalJSON() ([]byte, error) { 339 type NoMethod ApplicationReference 340 raw := NoMethod(*s) 341 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 342} 343 344// Assignment: A comment with an assignment. 345type Assignment struct { 346 // AssignedUser: The user to whom the comment was assigned. 347 AssignedUser *User `json:"assignedUser,omitempty"` 348 349 // Subtype: The sub-type of this event. 350 // 351 // Possible values: 352 // "SUBTYPE_UNSPECIFIED" - Subtype not available. 353 // "ADDED" - An assignment was added. 354 // "DELETED" - An assignment was deleted. 355 // "REPLY_ADDED" - An assignment reply was added. 356 // "REPLY_DELETED" - An assignment reply was deleted. 357 // "RESOLVED" - An assignment was resolved. 358 // "REOPENED" - A resolved assignment was reopened. 359 // "REASSIGNED" - An assignment was reassigned. 360 Subtype string `json:"subtype,omitempty"` 361 362 // ForceSendFields is a list of field names (e.g. "AssignedUser") to 363 // unconditionally include in API requests. By default, fields with 364 // empty or default values are omitted from API requests. However, any 365 // non-pointer, non-interface field appearing in ForceSendFields will be 366 // sent to the server regardless of whether the field is empty or not. 367 // This may be used to include empty fields in Patch requests. 368 ForceSendFields []string `json:"-"` 369 370 // NullFields is a list of field names (e.g. "AssignedUser") to include 371 // in API requests with the JSON null value. By default, fields with 372 // empty values are omitted from API requests. However, any field with 373 // an empty value appearing in NullFields will be sent to the server as 374 // null. It is an error if a field in this list has a non-empty value. 375 // This may be used to include null fields in Patch requests. 376 NullFields []string `json:"-"` 377} 378 379func (s *Assignment) MarshalJSON() ([]byte, error) { 380 type NoMethod Assignment 381 raw := NoMethod(*s) 382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 383} 384 385// Comment: A change about comments on an object. 386type Comment struct { 387 // Assignment: A change on an assignment. 388 Assignment *Assignment `json:"assignment,omitempty"` 389 390 // MentionedUsers: Users who are mentioned in this comment. 391 MentionedUsers []*User `json:"mentionedUsers,omitempty"` 392 393 // Post: A change on a regular posted comment. 394 Post *Post `json:"post,omitempty"` 395 396 // Suggestion: A change on a suggestion. 397 Suggestion *Suggestion `json:"suggestion,omitempty"` 398 399 // ForceSendFields is a list of field names (e.g. "Assignment") to 400 // unconditionally include in API requests. By default, fields with 401 // empty or default values are omitted from API requests. However, any 402 // non-pointer, non-interface field appearing in ForceSendFields will be 403 // sent to the server regardless of whether the field is empty or not. 404 // This may be used to include empty fields in Patch requests. 405 ForceSendFields []string `json:"-"` 406 407 // NullFields is a list of field names (e.g. "Assignment") to include in 408 // API requests with the JSON null value. By default, fields with empty 409 // values are omitted from API requests. However, any field with an 410 // empty value appearing in NullFields will be sent to the server as 411 // null. It is an error if a field in this list has a non-empty value. 412 // This may be used to include null fields in Patch requests. 413 NullFields []string `json:"-"` 414} 415 416func (s *Comment) MarshalJSON() ([]byte, error) { 417 type NoMethod Comment 418 raw := NoMethod(*s) 419 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 420} 421 422// ConsolidationStrategy: How the individual activities are 423// consolidated. A set of activities may be consolidated into one 424// combined activity if they are related in some way, such as one actor 425// performing the same action on multiple targets, or multiple actors 426// performing the same action on a single target. The strategy defines 427// the rules for which activities are related. 428type ConsolidationStrategy struct { 429 // Legacy: The individual activities are consolidated using the legacy 430 // strategy. 431 Legacy *Legacy `json:"legacy,omitempty"` 432 433 // None: The individual activities are not consolidated. 434 None *NoConsolidation `json:"none,omitempty"` 435 436 // ForceSendFields is a list of field names (e.g. "Legacy") to 437 // unconditionally include in API requests. By default, fields with 438 // empty or default values are omitted from API requests. However, any 439 // non-pointer, non-interface field appearing in ForceSendFields will be 440 // sent to the server regardless of whether the field is empty or not. 441 // This may be used to include empty fields in Patch requests. 442 ForceSendFields []string `json:"-"` 443 444 // NullFields is a list of field names (e.g. "Legacy") to include in API 445 // requests with the JSON null value. By default, fields with empty 446 // values are omitted from API requests. However, any field with an 447 // empty value appearing in NullFields will be sent to the server as 448 // null. It is an error if a field in this list has a non-empty value. 449 // This may be used to include null fields in Patch requests. 450 NullFields []string `json:"-"` 451} 452 453func (s *ConsolidationStrategy) MarshalJSON() ([]byte, error) { 454 type NoMethod ConsolidationStrategy 455 raw := NoMethod(*s) 456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 457} 458 459// Copy: An object was created by copying an existing object. 460type Copy struct { 461 // OriginalObject: The original object. 462 OriginalObject *TargetReference `json:"originalObject,omitempty"` 463 464 // ForceSendFields is a list of field names (e.g. "OriginalObject") to 465 // unconditionally include in API requests. By default, fields with 466 // empty or default values are omitted from API requests. However, any 467 // non-pointer, non-interface field appearing in ForceSendFields will be 468 // sent to the server regardless of whether the field is empty or not. 469 // This may be used to include empty fields in Patch requests. 470 ForceSendFields []string `json:"-"` 471 472 // NullFields is a list of field names (e.g. "OriginalObject") to 473 // include in API requests with the JSON null value. By default, fields 474 // with empty values are omitted from API requests. However, any field 475 // with an empty value appearing in NullFields will be sent to the 476 // server as null. It is an error if a field in this list has a 477 // non-empty value. This may be used to include null fields in Patch 478 // requests. 479 NullFields []string `json:"-"` 480} 481 482func (s *Copy) MarshalJSON() ([]byte, error) { 483 type NoMethod Copy 484 raw := NoMethod(*s) 485 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 486} 487 488// Create: An object was created. 489type Create struct { 490 // Copy: If present, indicates the object was created by copying an 491 // existing Drive object. 492 Copy *Copy `json:"copy,omitempty"` 493 494 // New: If present, indicates the object was newly created (e.g. as a 495 // blank document), not derived from a Drive object or external object. 496 New *New1 `json:"new,omitempty"` 497 498 // Upload: If present, indicates the object originated externally and 499 // was uploaded to Drive. 500 Upload *Upload `json:"upload,omitempty"` 501 502 // ForceSendFields is a list of field names (e.g. "Copy") to 503 // unconditionally include in API requests. By default, fields with 504 // empty or default values are omitted from API requests. However, any 505 // non-pointer, non-interface field appearing in ForceSendFields will be 506 // sent to the server regardless of whether the field is empty or not. 507 // This may be used to include empty fields in Patch requests. 508 ForceSendFields []string `json:"-"` 509 510 // NullFields is a list of field names (e.g. "Copy") to include in API 511 // requests with the JSON null value. By default, fields with empty 512 // values are omitted from API requests. However, any field with an 513 // empty value appearing in NullFields will be sent to the server as 514 // null. It is an error if a field in this list has a non-empty value. 515 // This may be used to include null fields in Patch requests. 516 NullFields []string `json:"-"` 517} 518 519func (s *Create) MarshalJSON() ([]byte, error) { 520 type NoMethod Create 521 raw := NoMethod(*s) 522 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 523} 524 525// DataLeakPreventionChange: A change in the object's data leak 526// prevention status. 527type DataLeakPreventionChange struct { 528 // Type: The type of Data Leak Prevention (DLP) change. 529 // 530 // Possible values: 531 // "TYPE_UNSPECIFIED" - An update to the DLP state that is neither 532 // FLAGGED or CLEARED. 533 // "FLAGGED" - Document has been flagged as containing sensitive 534 // content. 535 // "CLEARED" - Document is no longer flagged as containing sensitive 536 // content. 537 Type string `json:"type,omitempty"` 538 539 // ForceSendFields is a list of field names (e.g. "Type") to 540 // unconditionally include in API requests. By default, fields with 541 // empty or default values are omitted from API requests. However, any 542 // non-pointer, non-interface field appearing in ForceSendFields will be 543 // sent to the server regardless of whether the field is empty or not. 544 // This may be used to include empty fields in Patch requests. 545 ForceSendFields []string `json:"-"` 546 547 // NullFields is a list of field names (e.g. "Type") to include in API 548 // requests with the JSON null value. By default, fields with empty 549 // values are omitted from API requests. However, any field with an 550 // empty value appearing in NullFields will be sent to the server as 551 // null. It is an error if a field in this list has a non-empty value. 552 // This may be used to include null fields in Patch requests. 553 NullFields []string `json:"-"` 554} 555 556func (s *DataLeakPreventionChange) MarshalJSON() ([]byte, error) { 557 type NoMethod DataLeakPreventionChange 558 raw := NoMethod(*s) 559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 560} 561 562// Delete: An object was deleted. 563type Delete struct { 564 // Type: The type of delete action taken. 565 // 566 // Possible values: 567 // "TYPE_UNSPECIFIED" - Deletion type is not available. 568 // "TRASH" - An object was put into the trash. 569 // "PERMANENT_DELETE" - An object was deleted permanently. 570 Type string `json:"type,omitempty"` 571 572 // ForceSendFields is a list of field names (e.g. "Type") to 573 // unconditionally include in API requests. By default, fields with 574 // empty or default values are omitted from API requests. However, any 575 // non-pointer, non-interface field appearing in ForceSendFields will be 576 // sent to the server regardless of whether the field is empty or not. 577 // This may be used to include empty fields in Patch requests. 578 ForceSendFields []string `json:"-"` 579 580 // NullFields is a list of field names (e.g. "Type") to include in API 581 // requests with the JSON null value. By default, fields with empty 582 // values are omitted from API requests. However, any field with an 583 // empty value appearing in NullFields will be sent to the server as 584 // null. It is an error if a field in this list has a non-empty value. 585 // This may be used to include null fields in Patch requests. 586 NullFields []string `json:"-"` 587} 588 589func (s *Delete) MarshalJSON() ([]byte, error) { 590 type NoMethod Delete 591 raw := NoMethod(*s) 592 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 593} 594 595// DeletedUser: A user whose account has since been deleted. 596type DeletedUser struct { 597} 598 599// Domain: Information about a domain. 600type Domain struct { 601 // LegacyId: An opaque string used to identify this domain. 602 LegacyId string `json:"legacyId,omitempty"` 603 604 // Name: The name of the domain, e.g. `google.com`. 605 Name string `json:"name,omitempty"` 606 607 // ForceSendFields is a list of field names (e.g. "LegacyId") to 608 // unconditionally include in API requests. By default, fields with 609 // empty or default values are omitted from API requests. However, any 610 // non-pointer, non-interface field appearing in ForceSendFields will be 611 // sent to the server regardless of whether the field is empty or not. 612 // This may be used to include empty fields in Patch requests. 613 ForceSendFields []string `json:"-"` 614 615 // NullFields is a list of field names (e.g. "LegacyId") to include in 616 // API requests with the JSON null value. By default, fields with empty 617 // values are omitted from API requests. However, any field with an 618 // empty value appearing in NullFields will be sent to the server as 619 // null. It is an error if a field in this list has a non-empty value. 620 // This may be used to include null fields in Patch requests. 621 NullFields []string `json:"-"` 622} 623 624func (s *Domain) MarshalJSON() ([]byte, error) { 625 type NoMethod Domain 626 raw := NoMethod(*s) 627 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 628} 629 630// Drive: Information about a shared drive. 631type Drive struct { 632 // Name: The resource name of the shared drive. The format is 633 // `COLLECTION_ID/DRIVE_ID`. Clients should not assume a specific 634 // collection ID for this resource name. 635 Name string `json:"name,omitempty"` 636 637 // Root: The root of this shared drive. 638 Root *DriveItem `json:"root,omitempty"` 639 640 // Title: The title of the shared drive. 641 Title string `json:"title,omitempty"` 642 643 // ForceSendFields is a list of field names (e.g. "Name") to 644 // unconditionally include in API requests. By default, fields with 645 // empty or default values are omitted from API requests. However, any 646 // non-pointer, non-interface field appearing in ForceSendFields will be 647 // sent to the server regardless of whether the field is empty or not. 648 // This may be used to include empty fields in Patch requests. 649 ForceSendFields []string `json:"-"` 650 651 // NullFields is a list of field names (e.g. "Name") to include in API 652 // requests with the JSON null value. By default, fields with empty 653 // values are omitted from API requests. However, any field with an 654 // empty value appearing in NullFields will be sent to the server as 655 // null. It is an error if a field in this list has a non-empty value. 656 // This may be used to include null fields in Patch requests. 657 NullFields []string `json:"-"` 658} 659 660func (s *Drive) MarshalJSON() ([]byte, error) { 661 type NoMethod Drive 662 raw := NoMethod(*s) 663 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 664} 665 666// DriveActivity: A single Drive activity comprising one or more Actions 667// by one or more Actors on one or more Targets. Some Action groupings 668// occur spontaneously, such as moving an item into a shared folder 669// triggering a permission change. Other groupings of related Actions, 670// such as multiple Actors editing one item or moving multiple files 671// into a new folder, are controlled by the selection of a 672// ConsolidationStrategy in the QueryDriveActivityRequest. 673type DriveActivity struct { 674 // Actions: Details on all actions in this activity. 675 Actions []*Action `json:"actions,omitempty"` 676 677 // Actors: All actor(s) responsible for the activity. 678 Actors []*Actor `json:"actors,omitempty"` 679 680 // PrimaryActionDetail: Key information about the primary action for 681 // this activity. This is either representative, or the most important, 682 // of all actions in the activity, according to the 683 // ConsolidationStrategy in the request. 684 PrimaryActionDetail *ActionDetail `json:"primaryActionDetail,omitempty"` 685 686 // Targets: All Google Drive objects this activity is about (e.g. file, 687 // folder, drive). This represents the state of the target immediately 688 // after the actions occurred. 689 Targets []*Target `json:"targets,omitempty"` 690 691 // TimeRange: The activity occurred over this time range. 692 TimeRange *TimeRange `json:"timeRange,omitempty"` 693 694 // Timestamp: The activity occurred at this specific time. 695 Timestamp string `json:"timestamp,omitempty"` 696 697 // ForceSendFields is a list of field names (e.g. "Actions") to 698 // unconditionally include in API requests. By default, fields with 699 // empty or default values are omitted from API requests. However, any 700 // non-pointer, non-interface field appearing in ForceSendFields will be 701 // sent to the server regardless of whether the field is empty or not. 702 // This may be used to include empty fields in Patch requests. 703 ForceSendFields []string `json:"-"` 704 705 // NullFields is a list of field names (e.g. "Actions") to include in 706 // API requests with the JSON null value. By default, fields with empty 707 // values are omitted from API requests. However, any field with an 708 // empty value appearing in NullFields will be sent to the server as 709 // null. It is an error if a field in this list has a non-empty value. 710 // This may be used to include null fields in Patch requests. 711 NullFields []string `json:"-"` 712} 713 714func (s *DriveActivity) MarshalJSON() ([]byte, error) { 715 type NoMethod DriveActivity 716 raw := NoMethod(*s) 717 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 718} 719 720// DriveFile: A Drive item which is a file. 721type DriveFile struct { 722} 723 724// DriveFolder: A Drive item which is a folder. 725type DriveFolder struct { 726 // Type: The type of Drive folder. 727 // 728 // Possible values: 729 // "TYPE_UNSPECIFIED" - The folder type is unknown. 730 // "MY_DRIVE_ROOT" - The folder is the root of a user's MyDrive. 731 // "SHARED_DRIVE_ROOT" - The folder is the root of a shared drive. 732 // "STANDARD_FOLDER" - The folder is a standard, non-root, folder. 733 Type string `json:"type,omitempty"` 734 735 // ForceSendFields is a list of field names (e.g. "Type") to 736 // unconditionally include in API requests. By default, fields with 737 // empty or default values are omitted from API requests. However, any 738 // non-pointer, non-interface field appearing in ForceSendFields will be 739 // sent to the server regardless of whether the field is empty or not. 740 // This may be used to include empty fields in Patch requests. 741 ForceSendFields []string `json:"-"` 742 743 // NullFields is a list of field names (e.g. "Type") to include in API 744 // requests with the JSON null value. By default, fields with empty 745 // values are omitted from API requests. However, any field with an 746 // empty value appearing in NullFields will be sent to the server as 747 // null. It is an error if a field in this list has a non-empty value. 748 // This may be used to include null fields in Patch requests. 749 NullFields []string `json:"-"` 750} 751 752func (s *DriveFolder) MarshalJSON() ([]byte, error) { 753 type NoMethod DriveFolder 754 raw := NoMethod(*s) 755 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 756} 757 758// DriveItem: A Drive item, such as a file or folder. 759type DriveItem struct { 760 // DriveFile: The Drive item is a file. 761 DriveFile *DriveFile `json:"driveFile,omitempty"` 762 763 // DriveFolder: The Drive item is a folder. Includes information about 764 // the type of folder. 765 DriveFolder *DriveFolder `json:"driveFolder,omitempty"` 766 767 // File: This field is deprecated; please use the `driveFile` field 768 // instead. 769 File *File `json:"file,omitempty"` 770 771 // Folder: This field is deprecated; please use the `driveFolder` field 772 // instead. 773 Folder *Folder `json:"folder,omitempty"` 774 775 // MimeType: The MIME type of the Drive item. See 776 // https://developers.google.com/drive/v3/web/mime-types. 777 MimeType string `json:"mimeType,omitempty"` 778 779 // Name: The target Drive item. The format is `items/ITEM_ID`. 780 Name string `json:"name,omitempty"` 781 782 // Owner: Information about the owner of this Drive item. 783 Owner *Owner `json:"owner,omitempty"` 784 785 // Title: The title of the Drive item. 786 Title string `json:"title,omitempty"` 787 788 // ForceSendFields is a list of field names (e.g. "DriveFile") to 789 // unconditionally include in API requests. By default, fields with 790 // empty or default values are omitted from API requests. However, any 791 // non-pointer, non-interface field appearing in ForceSendFields will be 792 // sent to the server regardless of whether the field is empty or not. 793 // This may be used to include empty fields in Patch requests. 794 ForceSendFields []string `json:"-"` 795 796 // NullFields is a list of field names (e.g. "DriveFile") to include in 797 // API requests with the JSON null value. By default, fields with empty 798 // values are omitted from API requests. However, any field with an 799 // empty value appearing in NullFields will be sent to the server as 800 // null. It is an error if a field in this list has a non-empty value. 801 // This may be used to include null fields in Patch requests. 802 NullFields []string `json:"-"` 803} 804 805func (s *DriveItem) MarshalJSON() ([]byte, error) { 806 type NoMethod DriveItem 807 raw := NoMethod(*s) 808 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 809} 810 811// DriveItemReference: A lightweight reference to a Drive item, such as 812// a file or folder. 813type DriveItemReference struct { 814 // DriveFile: The Drive item is a file. 815 DriveFile *DriveFile `json:"driveFile,omitempty"` 816 817 // DriveFolder: The Drive item is a folder. Includes information about 818 // the type of folder. 819 DriveFolder *DriveFolder `json:"driveFolder,omitempty"` 820 821 // File: This field is deprecated; please use the `driveFile` field 822 // instead. 823 File *File `json:"file,omitempty"` 824 825 // Folder: This field is deprecated; please use the `driveFolder` field 826 // instead. 827 Folder *Folder `json:"folder,omitempty"` 828 829 // Name: The target Drive item. The format is `items/ITEM_ID`. 830 Name string `json:"name,omitempty"` 831 832 // Title: The title of the Drive item. 833 Title string `json:"title,omitempty"` 834 835 // ForceSendFields is a list of field names (e.g. "DriveFile") to 836 // unconditionally include in API requests. By default, fields with 837 // empty or default values are omitted from API requests. However, any 838 // non-pointer, non-interface field appearing in ForceSendFields will be 839 // sent to the server regardless of whether the field is empty or not. 840 // This may be used to include empty fields in Patch requests. 841 ForceSendFields []string `json:"-"` 842 843 // NullFields is a list of field names (e.g. "DriveFile") to include in 844 // API requests with the JSON null value. By default, fields with empty 845 // values are omitted from API requests. However, any field with an 846 // empty value appearing in NullFields will be sent to the server as 847 // null. It is an error if a field in this list has a non-empty value. 848 // This may be used to include null fields in Patch requests. 849 NullFields []string `json:"-"` 850} 851 852func (s *DriveItemReference) MarshalJSON() ([]byte, error) { 853 type NoMethod DriveItemReference 854 raw := NoMethod(*s) 855 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 856} 857 858// DriveReference: A lightweight reference to a shared drive. 859type DriveReference struct { 860 // Name: The resource name of the shared drive. The format is 861 // `COLLECTION_ID/DRIVE_ID`. Clients should not assume a specific 862 // collection ID for this resource name. 863 Name string `json:"name,omitempty"` 864 865 // Title: The title of the shared drive. 866 Title string `json:"title,omitempty"` 867 868 // ForceSendFields is a list of field names (e.g. "Name") to 869 // unconditionally include in API requests. By default, fields with 870 // empty or default values are omitted from API requests. However, any 871 // non-pointer, non-interface field appearing in ForceSendFields will be 872 // sent to the server regardless of whether the field is empty or not. 873 // This may be used to include empty fields in Patch requests. 874 ForceSendFields []string `json:"-"` 875 876 // NullFields is a list of field names (e.g. "Name") to include in API 877 // requests with the JSON null value. By default, fields with empty 878 // values are omitted from API requests. However, any field with an 879 // empty value appearing in NullFields will be sent to the server as 880 // null. It is an error if a field in this list has a non-empty value. 881 // This may be used to include null fields in Patch requests. 882 NullFields []string `json:"-"` 883} 884 885func (s *DriveReference) MarshalJSON() ([]byte, error) { 886 type NoMethod DriveReference 887 raw := NoMethod(*s) 888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 889} 890 891// Edit: An empty message indicating an object was edited. 892type Edit struct { 893} 894 895// File: This item is deprecated; please see `DriveFile` instead. 896type File struct { 897} 898 899// FileComment: A comment on a file. 900type FileComment struct { 901 // LegacyCommentId: The comment in the discussion thread. This 902 // identifier is an opaque string compatible with the Drive API; see 903 // https://developers.google.com/drive/v3/reference/comments/get 904 LegacyCommentId string `json:"legacyCommentId,omitempty"` 905 906 // LegacyDiscussionId: The discussion thread to which the comment was 907 // added. This identifier is an opaque string compatible with the Drive 908 // API and references the first comment in a discussion; see 909 // https://developers.google.com/drive/v3/reference/comments/get 910 LegacyDiscussionId string `json:"legacyDiscussionId,omitempty"` 911 912 // LinkToDiscussion: The link to the discussion thread containing this 913 // comment, for example, 914 // `https://docs.google.com/DOCUMENT_ID/edit?disco=THREAD_ID`. 915 LinkToDiscussion string `json:"linkToDiscussion,omitempty"` 916 917 // Parent: The Drive item containing this comment. 918 Parent *DriveItem `json:"parent,omitempty"` 919 920 // ForceSendFields is a list of field names (e.g. "LegacyCommentId") to 921 // unconditionally include in API requests. By default, fields with 922 // empty or default values are omitted from API requests. However, any 923 // non-pointer, non-interface field appearing in ForceSendFields will be 924 // sent to the server regardless of whether the field is empty or not. 925 // This may be used to include empty fields in Patch requests. 926 ForceSendFields []string `json:"-"` 927 928 // NullFields is a list of field names (e.g. "LegacyCommentId") to 929 // include in API requests with the JSON null value. By default, fields 930 // with empty values are omitted from API requests. However, any field 931 // with an empty value appearing in NullFields will be sent to the 932 // server as null. It is an error if a field in this list has a 933 // non-empty value. This may be used to include null fields in Patch 934 // requests. 935 NullFields []string `json:"-"` 936} 937 938func (s *FileComment) MarshalJSON() ([]byte, error) { 939 type NoMethod FileComment 940 raw := NoMethod(*s) 941 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 942} 943 944// Folder: This item is deprecated; please see `DriveFolder` instead. 945type Folder struct { 946 // Type: This field is deprecated; please see `DriveFolder.type` 947 // instead. 948 // 949 // Possible values: 950 // "TYPE_UNSPECIFIED" - This item is deprecated; please see 951 // `DriveFolder.Type` instead. 952 // "MY_DRIVE_ROOT" - This item is deprecated; please see 953 // `DriveFolder.Type` instead. 954 // "TEAM_DRIVE_ROOT" - This item is deprecated; please see 955 // `DriveFolder.Type` instead. 956 // "STANDARD_FOLDER" - This item is deprecated; please see 957 // `DriveFolder.Type` instead. 958 Type string `json:"type,omitempty"` 959 960 // ForceSendFields is a list of field names (e.g. "Type") to 961 // unconditionally include in API requests. By default, fields with 962 // empty or default values are omitted from API requests. However, any 963 // non-pointer, non-interface field appearing in ForceSendFields will be 964 // sent to the server regardless of whether the field is empty or not. 965 // This may be used to include empty fields in Patch requests. 966 ForceSendFields []string `json:"-"` 967 968 // NullFields is a list of field names (e.g. "Type") to include in API 969 // requests with the JSON null value. By default, fields with empty 970 // values are omitted from API requests. However, any field with an 971 // empty value appearing in NullFields will be sent to the server as 972 // null. It is an error if a field in this list has a non-empty value. 973 // This may be used to include null fields in Patch requests. 974 NullFields []string `json:"-"` 975} 976 977func (s *Folder) MarshalJSON() ([]byte, error) { 978 type NoMethod Folder 979 raw := NoMethod(*s) 980 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 981} 982 983// Group: Information about a group. 984type Group struct { 985 // Email: The email address of the group. 986 Email string `json:"email,omitempty"` 987 988 // Title: The title of the group. 989 Title string `json:"title,omitempty"` 990 991 // ForceSendFields is a list of field names (e.g. "Email") to 992 // unconditionally include in API requests. By default, fields with 993 // empty or default values are omitted from API requests. However, any 994 // non-pointer, non-interface field appearing in ForceSendFields will be 995 // sent to the server regardless of whether the field is empty or not. 996 // This may be used to include empty fields in Patch requests. 997 ForceSendFields []string `json:"-"` 998 999 // NullFields is a list of field names (e.g. "Email") to include in API 1000 // requests with the JSON null value. By default, fields with empty 1001 // values are omitted from API requests. However, any field with an 1002 // empty value appearing in NullFields will be sent to the server as 1003 // null. It is an error if a field in this list has a non-empty value. 1004 // This may be used to include null fields in Patch requests. 1005 NullFields []string `json:"-"` 1006} 1007 1008func (s *Group) MarshalJSON() ([]byte, error) { 1009 type NoMethod Group 1010 raw := NoMethod(*s) 1011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1012} 1013 1014// Impersonation: Information about an impersonation, where an admin 1015// acts on behalf of an end user. Information about the acting admin is 1016// not currently available. 1017type Impersonation struct { 1018 // ImpersonatedUser: The impersonated user. 1019 ImpersonatedUser *User `json:"impersonatedUser,omitempty"` 1020 1021 // ForceSendFields is a list of field names (e.g. "ImpersonatedUser") to 1022 // unconditionally include in API requests. By default, fields with 1023 // empty or default values are omitted from API requests. However, any 1024 // non-pointer, non-interface field appearing in ForceSendFields will be 1025 // sent to the server regardless of whether the field is empty or not. 1026 // This may be used to include empty fields in Patch requests. 1027 ForceSendFields []string `json:"-"` 1028 1029 // NullFields is a list of field names (e.g. "ImpersonatedUser") to 1030 // include in API requests with the JSON null value. By default, fields 1031 // with empty values are omitted from API requests. However, any field 1032 // with an empty value appearing in NullFields will be sent to the 1033 // server as null. It is an error if a field in this list has a 1034 // non-empty value. This may be used to include null fields in Patch 1035 // requests. 1036 NullFields []string `json:"-"` 1037} 1038 1039func (s *Impersonation) MarshalJSON() ([]byte, error) { 1040 type NoMethod Impersonation 1041 raw := NoMethod(*s) 1042 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1043} 1044 1045// KnownUser: A known user. 1046type KnownUser struct { 1047 // IsCurrentUser: True if this is the user making the request. 1048 IsCurrentUser bool `json:"isCurrentUser,omitempty"` 1049 1050 // PersonName: The identifier for this user that can be used with the 1051 // People API to get more information. The format is 1052 // `people/ACCOUNT_ID`. See https://developers.google.com/people/. 1053 PersonName string `json:"personName,omitempty"` 1054 1055 // ForceSendFields is a list of field names (e.g. "IsCurrentUser") to 1056 // unconditionally include in API requests. By default, fields with 1057 // empty or default values are omitted from API requests. However, any 1058 // non-pointer, non-interface field appearing in ForceSendFields will be 1059 // sent to the server regardless of whether the field is empty or not. 1060 // This may be used to include empty fields in Patch requests. 1061 ForceSendFields []string `json:"-"` 1062 1063 // NullFields is a list of field names (e.g. "IsCurrentUser") to include 1064 // in API requests with the JSON null value. By default, fields with 1065 // empty values are omitted from API requests. However, any field with 1066 // an empty value appearing in NullFields will be sent to the server as 1067 // null. It is an error if a field in this list has a non-empty value. 1068 // This may be used to include null fields in Patch requests. 1069 NullFields []string `json:"-"` 1070} 1071 1072func (s *KnownUser) MarshalJSON() ([]byte, error) { 1073 type NoMethod KnownUser 1074 raw := NoMethod(*s) 1075 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1076} 1077 1078// Legacy: A strategy which consolidates activities using the grouping 1079// rules from the legacy V1 Activity API. Similar actions occurring 1080// within a window of time can be grouped across multiple targets (such 1081// as moving a set of files at once) or multiple actors (such as several 1082// users editing the same item). Grouping rules for this strategy are 1083// specific to each type of action. 1084type Legacy struct { 1085} 1086 1087// Move: An object was moved. 1088type Move struct { 1089 // AddedParents: The added parent object(s). 1090 AddedParents []*TargetReference `json:"addedParents,omitempty"` 1091 1092 // RemovedParents: The removed parent object(s). 1093 RemovedParents []*TargetReference `json:"removedParents,omitempty"` 1094 1095 // ForceSendFields is a list of field names (e.g. "AddedParents") to 1096 // unconditionally include in API requests. By default, fields with 1097 // empty or default values are omitted from API requests. However, any 1098 // non-pointer, non-interface field appearing in ForceSendFields will be 1099 // sent to the server regardless of whether the field is empty or not. 1100 // This may be used to include empty fields in Patch requests. 1101 ForceSendFields []string `json:"-"` 1102 1103 // NullFields is a list of field names (e.g. "AddedParents") to include 1104 // in API requests with the JSON null value. By default, fields with 1105 // empty values are omitted from API requests. However, any field with 1106 // an empty value appearing in NullFields will be sent to the server as 1107 // null. It is an error if a field in this list has a non-empty value. 1108 // This may be used to include null fields in Patch requests. 1109 NullFields []string `json:"-"` 1110} 1111 1112func (s *Move) MarshalJSON() ([]byte, error) { 1113 type NoMethod Move 1114 raw := NoMethod(*s) 1115 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1116} 1117 1118// New1: An object was created from scratch. 1119type New1 struct { 1120} 1121 1122// NoConsolidation: A strategy which does no consolidation of individual 1123// activities. 1124type NoConsolidation struct { 1125} 1126 1127// Owner: Information about the owner of a Drive item. 1128type Owner struct { 1129 // Domain: The domain of the Drive item owner. 1130 Domain *Domain `json:"domain,omitempty"` 1131 1132 // Drive: The drive that owns the item. 1133 Drive *DriveReference `json:"drive,omitempty"` 1134 1135 // TeamDrive: This field is deprecated; please use the `drive` field 1136 // instead. 1137 TeamDrive *TeamDriveReference `json:"teamDrive,omitempty"` 1138 1139 // User: The user that owns the Drive item. 1140 User *User `json:"user,omitempty"` 1141 1142 // ForceSendFields is a list of field names (e.g. "Domain") to 1143 // unconditionally include in API requests. By default, fields with 1144 // empty or default values are omitted from API requests. However, any 1145 // non-pointer, non-interface field appearing in ForceSendFields will be 1146 // sent to the server regardless of whether the field is empty or not. 1147 // This may be used to include empty fields in Patch requests. 1148 ForceSendFields []string `json:"-"` 1149 1150 // NullFields is a list of field names (e.g. "Domain") to include in API 1151 // requests with the JSON null value. By default, fields with empty 1152 // values are omitted from API requests. However, any field with an 1153 // empty value appearing in NullFields will be sent to the server as 1154 // null. It is an error if a field in this list has a non-empty value. 1155 // This may be used to include null fields in Patch requests. 1156 NullFields []string `json:"-"` 1157} 1158 1159func (s *Owner) MarshalJSON() ([]byte, error) { 1160 type NoMethod Owner 1161 raw := NoMethod(*s) 1162 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1163} 1164 1165// Permission: The permission setting of an object. 1166type Permission struct { 1167 // AllowDiscovery: If true, the item can be discovered (e.g. in the 1168 // user's "Shared with me" collection) without needing a link to the 1169 // item. 1170 AllowDiscovery bool `json:"allowDiscovery,omitempty"` 1171 1172 // Anyone: If set, this permission applies to anyone, even logged out 1173 // users. 1174 Anyone *Anyone `json:"anyone,omitempty"` 1175 1176 // Domain: The domain to whom this permission applies. 1177 Domain *Domain `json:"domain,omitempty"` 1178 1179 // Group: The group to whom this permission applies. 1180 Group *Group `json:"group,omitempty"` 1181 1182 // Role: Indicates the Google Drive permissions role 1183 // (https://developers.google.com/drive/web/manage-sharing#roles). The 1184 // role determines a user's ability to read, write, and comment on 1185 // items. 1186 // 1187 // Possible values: 1188 // "ROLE_UNSPECIFIED" - The role is not available. 1189 // "OWNER" - A role granting full access. 1190 // "ORGANIZER" - A role granting the ability to manage people and 1191 // settings. 1192 // "FILE_ORGANIZER" - A role granting the ability to contribute and 1193 // manage content. 1194 // "EDITOR" - A role granting the ability to contribute content. This 1195 // role is sometimes also known as "writer". 1196 // "COMMENTER" - A role granting the ability to view and comment on 1197 // content. 1198 // "VIEWER" - A role granting the ability to view content. This role 1199 // is sometimes also known as "reader". 1200 // "PUBLISHED_VIEWER" - A role granting the ability to view content 1201 // only after it has been published to the web. This role is sometimes 1202 // also known as "published reader". See 1203 // https://support.google.com/sites/answer/6372880 for more information. 1204 Role string `json:"role,omitempty"` 1205 1206 // User: The user to whom this permission applies. 1207 User *User `json:"user,omitempty"` 1208 1209 // ForceSendFields is a list of field names (e.g. "AllowDiscovery") to 1210 // unconditionally include in API requests. By default, fields with 1211 // empty or default values are omitted from API requests. However, any 1212 // non-pointer, non-interface field appearing in ForceSendFields will be 1213 // sent to the server regardless of whether the field is empty or not. 1214 // This may be used to include empty fields in Patch requests. 1215 ForceSendFields []string `json:"-"` 1216 1217 // NullFields is a list of field names (e.g. "AllowDiscovery") to 1218 // include in API requests with the JSON null value. By default, fields 1219 // with empty values are omitted from API requests. However, any field 1220 // with an empty value appearing in NullFields will be sent to the 1221 // server as null. It is an error if a field in this list has a 1222 // non-empty value. This may be used to include null fields in Patch 1223 // requests. 1224 NullFields []string `json:"-"` 1225} 1226 1227func (s *Permission) MarshalJSON() ([]byte, error) { 1228 type NoMethod Permission 1229 raw := NoMethod(*s) 1230 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1231} 1232 1233// PermissionChange: A change of the permission setting on an item. 1234type PermissionChange struct { 1235 // AddedPermissions: The set of permissions added by this change. 1236 AddedPermissions []*Permission `json:"addedPermissions,omitempty"` 1237 1238 // RemovedPermissions: The set of permissions removed by this change. 1239 RemovedPermissions []*Permission `json:"removedPermissions,omitempty"` 1240 1241 // ForceSendFields is a list of field names (e.g. "AddedPermissions") to 1242 // unconditionally include in API requests. By default, fields with 1243 // empty or default values are omitted from API requests. However, any 1244 // non-pointer, non-interface field appearing in ForceSendFields will be 1245 // sent to the server regardless of whether the field is empty or not. 1246 // This may be used to include empty fields in Patch requests. 1247 ForceSendFields []string `json:"-"` 1248 1249 // NullFields is a list of field names (e.g. "AddedPermissions") to 1250 // include in API requests with the JSON null value. By default, fields 1251 // with empty values are omitted from API requests. However, any field 1252 // with an empty value appearing in NullFields will be sent to the 1253 // server as null. It is an error if a field in this list has a 1254 // non-empty value. This may be used to include null fields in Patch 1255 // requests. 1256 NullFields []string `json:"-"` 1257} 1258 1259func (s *PermissionChange) MarshalJSON() ([]byte, error) { 1260 type NoMethod PermissionChange 1261 raw := NoMethod(*s) 1262 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1263} 1264 1265// Post: A regular posted comment. 1266type Post struct { 1267 // Subtype: The sub-type of this event. 1268 // 1269 // Possible values: 1270 // "SUBTYPE_UNSPECIFIED" - Subtype not available. 1271 // "ADDED" - A post was added. 1272 // "DELETED" - A post was deleted. 1273 // "REPLY_ADDED" - A reply was added. 1274 // "REPLY_DELETED" - A reply was deleted. 1275 // "RESOLVED" - A posted comment was resolved. 1276 // "REOPENED" - A posted comment was reopened. 1277 Subtype string `json:"subtype,omitempty"` 1278 1279 // ForceSendFields is a list of field names (e.g. "Subtype") to 1280 // unconditionally include in API requests. By default, fields with 1281 // empty or default values are omitted from API requests. However, any 1282 // non-pointer, non-interface field appearing in ForceSendFields will be 1283 // sent to the server regardless of whether the field is empty or not. 1284 // This may be used to include empty fields in Patch requests. 1285 ForceSendFields []string `json:"-"` 1286 1287 // NullFields is a list of field names (e.g. "Subtype") to include in 1288 // API requests with the JSON null value. By default, fields with empty 1289 // values are omitted from API requests. However, any field with an 1290 // empty value appearing in NullFields will be sent to the server as 1291 // null. It is an error if a field in this list has a non-empty value. 1292 // This may be used to include null fields in Patch requests. 1293 NullFields []string `json:"-"` 1294} 1295 1296func (s *Post) MarshalJSON() ([]byte, error) { 1297 type NoMethod Post 1298 raw := NoMethod(*s) 1299 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1300} 1301 1302// QueryDriveActivityRequest: The request message for querying Drive 1303// activity. 1304type QueryDriveActivityRequest struct { 1305 // AncestorName: Return activities for this Drive folder and all 1306 // children and descendants. The format is `items/ITEM_ID`. 1307 AncestorName string `json:"ancestorName,omitempty"` 1308 1309 // ConsolidationStrategy: Details on how to consolidate related actions 1310 // that make up the activity. If not set, then related actions are not 1311 // consolidated. 1312 ConsolidationStrategy *ConsolidationStrategy `json:"consolidationStrategy,omitempty"` 1313 1314 // Filter: The filtering for items returned from this query request. The 1315 // format of the filter string is a sequence of expressions, joined by 1316 // an optional "AND", where each expression is of the form "field 1317 // operator value". Supported fields: - `time`: Uses numerical operators 1318 // on date values either in terms of milliseconds since Jan 1, 1970 or 1319 // in RFC 3339 format. Examples: - `time > 1452409200000 AND time <= 1320 // 1492812924310` - `time >= "2016-01-10T01:02:03-05:00" - 1321 // `detail.action_detail_case`: Uses the "has" operator (:) and either a 1322 // singular value or a list of allowed action types enclosed in 1323 // parentheses. Examples: - `detail.action_detail_case: RENAME` - 1324 // `detail.action_detail_case:(CREATE EDIT)` - 1325 // `-detail.action_detail_case:MOVE` 1326 Filter string `json:"filter,omitempty"` 1327 1328 // ItemName: Return activities for this Drive item. The format is 1329 // `items/ITEM_ID`. 1330 ItemName string `json:"itemName,omitempty"` 1331 1332 // PageSize: The miminum number of activities desired in the response; 1333 // the server will attempt to return at least this quanitity. The server 1334 // may also return fewer activities if it has a partial response ready 1335 // before the request times out. If not set, a default value is used. 1336 PageSize int64 `json:"pageSize,omitempty"` 1337 1338 // PageToken: The token identifying which page of results to return. Set 1339 // this to the next_page_token value returned from a previous query to 1340 // obtain the following page of results. If not set, the first page of 1341 // results will be returned. 1342 PageToken string `json:"pageToken,omitempty"` 1343 1344 // ForceSendFields is a list of field names (e.g. "AncestorName") to 1345 // unconditionally include in API requests. By default, fields with 1346 // empty or default values are omitted from API requests. However, any 1347 // non-pointer, non-interface field appearing in ForceSendFields will be 1348 // sent to the server regardless of whether the field is empty or not. 1349 // This may be used to include empty fields in Patch requests. 1350 ForceSendFields []string `json:"-"` 1351 1352 // NullFields is a list of field names (e.g. "AncestorName") to include 1353 // in API requests with the JSON null value. By default, fields with 1354 // empty values are omitted from API requests. However, any field with 1355 // an empty value appearing in NullFields will be sent to the server as 1356 // null. It is an error if a field in this list has a non-empty value. 1357 // This may be used to include null fields in Patch requests. 1358 NullFields []string `json:"-"` 1359} 1360 1361func (s *QueryDriveActivityRequest) MarshalJSON() ([]byte, error) { 1362 type NoMethod QueryDriveActivityRequest 1363 raw := NoMethod(*s) 1364 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1365} 1366 1367// QueryDriveActivityResponse: Response message for querying Drive 1368// activity. 1369type QueryDriveActivityResponse struct { 1370 // Activities: List of activity requested. 1371 Activities []*DriveActivity `json:"activities,omitempty"` 1372 1373 // NextPageToken: Token to retrieve the next page of results, or empty 1374 // if there are no more results in the list. 1375 NextPageToken string `json:"nextPageToken,omitempty"` 1376 1377 // ServerResponse contains the HTTP response code and headers from the 1378 // server. 1379 googleapi.ServerResponse `json:"-"` 1380 1381 // ForceSendFields is a list of field names (e.g. "Activities") to 1382 // unconditionally include in API requests. By default, fields with 1383 // empty or default values are omitted from API requests. However, any 1384 // non-pointer, non-interface field appearing in ForceSendFields will be 1385 // sent to the server regardless of whether the field is empty or not. 1386 // This may be used to include empty fields in Patch requests. 1387 ForceSendFields []string `json:"-"` 1388 1389 // NullFields is a list of field names (e.g. "Activities") to include in 1390 // API requests with the JSON null value. By default, fields with empty 1391 // values are omitted from API requests. However, any field with an 1392 // empty value appearing in NullFields will be sent to the server as 1393 // null. It is an error if a field in this list has a non-empty value. 1394 // This may be used to include null fields in Patch requests. 1395 NullFields []string `json:"-"` 1396} 1397 1398func (s *QueryDriveActivityResponse) MarshalJSON() ([]byte, error) { 1399 type NoMethod QueryDriveActivityResponse 1400 raw := NoMethod(*s) 1401 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1402} 1403 1404// Rename: An object was renamed. 1405type Rename struct { 1406 // NewTitle: The new title of the drive object. 1407 NewTitle string `json:"newTitle,omitempty"` 1408 1409 // OldTitle: The previous title of the drive object. 1410 OldTitle string `json:"oldTitle,omitempty"` 1411 1412 // ForceSendFields is a list of field names (e.g. "NewTitle") to 1413 // unconditionally include in API requests. By default, fields with 1414 // empty or default values are omitted from API requests. However, any 1415 // non-pointer, non-interface field appearing in ForceSendFields will be 1416 // sent to the server regardless of whether the field is empty or not. 1417 // This may be used to include empty fields in Patch requests. 1418 ForceSendFields []string `json:"-"` 1419 1420 // NullFields is a list of field names (e.g. "NewTitle") to include in 1421 // API requests with the JSON null value. By default, fields with empty 1422 // values are omitted from API requests. However, any field with an 1423 // empty value appearing in NullFields will be sent to the server as 1424 // null. It is an error if a field in this list has a non-empty value. 1425 // This may be used to include null fields in Patch requests. 1426 NullFields []string `json:"-"` 1427} 1428 1429func (s *Rename) MarshalJSON() ([]byte, error) { 1430 type NoMethod Rename 1431 raw := NoMethod(*s) 1432 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1433} 1434 1435// Restore: A deleted object was restored. 1436type Restore struct { 1437 // Type: The type of restore action taken. 1438 // 1439 // Possible values: 1440 // "TYPE_UNSPECIFIED" - The type is not available. 1441 // "UNTRASH" - An object was restored from the trash. 1442 Type string `json:"type,omitempty"` 1443 1444 // ForceSendFields is a list of field names (e.g. "Type") to 1445 // unconditionally include in API requests. By default, fields with 1446 // empty or default values are omitted from API requests. However, any 1447 // non-pointer, non-interface field appearing in ForceSendFields will be 1448 // sent to the server regardless of whether the field is empty or not. 1449 // This may be used to include empty fields in Patch requests. 1450 ForceSendFields []string `json:"-"` 1451 1452 // NullFields is a list of field names (e.g. "Type") to include in API 1453 // requests with the JSON null value. By default, fields with empty 1454 // values are omitted from API requests. However, any field with an 1455 // empty value appearing in NullFields will be sent to the server as 1456 // null. It is an error if a field in this list has a non-empty value. 1457 // This may be used to include null fields in Patch requests. 1458 NullFields []string `json:"-"` 1459} 1460 1461func (s *Restore) MarshalJSON() ([]byte, error) { 1462 type NoMethod Restore 1463 raw := NoMethod(*s) 1464 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1465} 1466 1467// RestrictionChange: Information about restriction policy changes to a 1468// feature. 1469type RestrictionChange struct { 1470 // Feature: The feature which had a change in restriction policy. 1471 // 1472 // Possible values: 1473 // "FEATURE_UNSPECIFIED" - The feature which changed restriction 1474 // settings was not available. 1475 // "SHARING_OUTSIDE_DOMAIN" - When restricted, this prevents items 1476 // from being shared outside the domain. 1477 // "DIRECT_SHARING" - When restricted, this prevents direct sharing of 1478 // individual items. 1479 // "ITEM_DUPLICATION" - When restricted, this prevents actions like 1480 // copy, download, and print that might result in uncontrolled 1481 // duplicates of items. 1482 // "DRIVE_FILE_STREAM" - When restricted, this prevents use of Drive 1483 // File Stream. 1484 Feature string `json:"feature,omitempty"` 1485 1486 // NewRestriction: The restriction in place after the change. 1487 // 1488 // Possible values: 1489 // "RESTRICTION_UNSPECIFIED" - The type of restriction is not 1490 // available. 1491 // "UNRESTRICTED" - The feature is available without restriction. 1492 // "FULLY_RESTRICTED" - The use of this feature is fully restricted. 1493 NewRestriction string `json:"newRestriction,omitempty"` 1494 1495 // ForceSendFields is a list of field names (e.g. "Feature") to 1496 // unconditionally include in API requests. By default, fields with 1497 // empty or default values are omitted from API requests. However, any 1498 // non-pointer, non-interface field appearing in ForceSendFields will be 1499 // sent to the server regardless of whether the field is empty or not. 1500 // This may be used to include empty fields in Patch requests. 1501 ForceSendFields []string `json:"-"` 1502 1503 // NullFields is a list of field names (e.g. "Feature") to include in 1504 // API requests with the JSON null value. By default, fields with empty 1505 // values are omitted from API requests. However, any field with an 1506 // empty value appearing in NullFields will be sent to the server as 1507 // null. It is an error if a field in this list has a non-empty value. 1508 // This may be used to include null fields in Patch requests. 1509 NullFields []string `json:"-"` 1510} 1511 1512func (s *RestrictionChange) MarshalJSON() ([]byte, error) { 1513 type NoMethod RestrictionChange 1514 raw := NoMethod(*s) 1515 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1516} 1517 1518// SettingsChange: Information about settings changes. 1519type SettingsChange struct { 1520 // RestrictionChanges: The set of changes made to restrictions. 1521 RestrictionChanges []*RestrictionChange `json:"restrictionChanges,omitempty"` 1522 1523 // ForceSendFields is a list of field names (e.g. "RestrictionChanges") 1524 // to unconditionally include in API requests. By default, fields with 1525 // empty or default values are omitted from API requests. However, any 1526 // non-pointer, non-interface field appearing in ForceSendFields will be 1527 // sent to the server regardless of whether the field is empty or not. 1528 // This may be used to include empty fields in Patch requests. 1529 ForceSendFields []string `json:"-"` 1530 1531 // NullFields is a list of field names (e.g. "RestrictionChanges") to 1532 // include in API requests with the JSON null value. By default, fields 1533 // with empty values are omitted from API requests. However, any field 1534 // with an empty value appearing in NullFields will be sent to the 1535 // server as null. It is an error if a field in this list has a 1536 // non-empty value. This may be used to include null fields in Patch 1537 // requests. 1538 NullFields []string `json:"-"` 1539} 1540 1541func (s *SettingsChange) MarshalJSON() ([]byte, error) { 1542 type NoMethod SettingsChange 1543 raw := NoMethod(*s) 1544 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1545} 1546 1547// Suggestion: A suggestion. 1548type Suggestion struct { 1549 // Subtype: The sub-type of this event. 1550 // 1551 // Possible values: 1552 // "SUBTYPE_UNSPECIFIED" - Subtype not available. 1553 // "ADDED" - A suggestion was added. 1554 // "DELETED" - A suggestion was deleted. 1555 // "REPLY_ADDED" - A suggestion reply was added. 1556 // "REPLY_DELETED" - A suggestion reply was deleted. 1557 // "ACCEPTED" - A suggestion was accepted. 1558 // "REJECTED" - A suggestion was rejected. 1559 // "ACCEPT_DELETED" - An accepted suggestion was deleted. 1560 // "REJECT_DELETED" - A rejected suggestion was deleted. 1561 Subtype string `json:"subtype,omitempty"` 1562 1563 // ForceSendFields is a list of field names (e.g. "Subtype") to 1564 // unconditionally include in API requests. By default, fields with 1565 // empty or default values are omitted from API requests. However, any 1566 // non-pointer, non-interface field appearing in ForceSendFields will be 1567 // sent to the server regardless of whether the field is empty or not. 1568 // This may be used to include empty fields in Patch requests. 1569 ForceSendFields []string `json:"-"` 1570 1571 // NullFields is a list of field names (e.g. "Subtype") to include in 1572 // API requests with the JSON null value. By default, fields with empty 1573 // values are omitted from API requests. However, any field with an 1574 // empty value appearing in NullFields will be sent to the server as 1575 // null. It is an error if a field in this list has a non-empty value. 1576 // This may be used to include null fields in Patch requests. 1577 NullFields []string `json:"-"` 1578} 1579 1580func (s *Suggestion) MarshalJSON() ([]byte, error) { 1581 type NoMethod Suggestion 1582 raw := NoMethod(*s) 1583 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1584} 1585 1586// SystemEvent: Event triggered by system operations instead of end 1587// users. 1588type SystemEvent struct { 1589 // Type: The type of the system event that may triggered activity. 1590 // 1591 // Possible values: 1592 // "TYPE_UNSPECIFIED" - The event type is unspecified. 1593 // "USER_DELETION" - The event is a consequence of a user account 1594 // being deleted. 1595 // "TRASH_AUTO_PURGE" - The event is due to the system automatically 1596 // purging trash. 1597 Type string `json:"type,omitempty"` 1598 1599 // ForceSendFields is a list of field names (e.g. "Type") to 1600 // unconditionally include in API requests. By default, fields with 1601 // empty or default values are omitted from API requests. However, any 1602 // non-pointer, non-interface field appearing in ForceSendFields will be 1603 // sent to the server regardless of whether the field is empty or not. 1604 // This may be used to include empty fields in Patch requests. 1605 ForceSendFields []string `json:"-"` 1606 1607 // NullFields is a list of field names (e.g. "Type") to include in API 1608 // requests with the JSON null value. By default, fields with empty 1609 // values are omitted from API requests. However, any field with an 1610 // empty value appearing in NullFields will be sent to the server as 1611 // null. It is an error if a field in this list has a non-empty value. 1612 // This may be used to include null fields in Patch requests. 1613 NullFields []string `json:"-"` 1614} 1615 1616func (s *SystemEvent) MarshalJSON() ([]byte, error) { 1617 type NoMethod SystemEvent 1618 raw := NoMethod(*s) 1619 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1620} 1621 1622// Target: Information about the target of activity. 1623type Target struct { 1624 // Drive: The target is a shared drive. 1625 Drive *Drive `json:"drive,omitempty"` 1626 1627 // DriveItem: The target is a Drive item. 1628 DriveItem *DriveItem `json:"driveItem,omitempty"` 1629 1630 // FileComment: The target is a comment on a Drive file. 1631 FileComment *FileComment `json:"fileComment,omitempty"` 1632 1633 // TeamDrive: This field is deprecated; please use the `drive` field 1634 // instead. 1635 TeamDrive *TeamDrive `json:"teamDrive,omitempty"` 1636 1637 // ForceSendFields is a list of field names (e.g. "Drive") to 1638 // unconditionally include in API requests. By default, fields with 1639 // empty or default values are omitted from API requests. However, any 1640 // non-pointer, non-interface field appearing in ForceSendFields will be 1641 // sent to the server regardless of whether the field is empty or not. 1642 // This may be used to include empty fields in Patch requests. 1643 ForceSendFields []string `json:"-"` 1644 1645 // NullFields is a list of field names (e.g. "Drive") to include in API 1646 // requests with the JSON null value. By default, fields with empty 1647 // values are omitted from API requests. However, any field with an 1648 // empty value appearing in NullFields will be sent to the server as 1649 // null. It is an error if a field in this list has a non-empty value. 1650 // This may be used to include null fields in Patch requests. 1651 NullFields []string `json:"-"` 1652} 1653 1654func (s *Target) MarshalJSON() ([]byte, error) { 1655 type NoMethod Target 1656 raw := NoMethod(*s) 1657 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1658} 1659 1660// TargetReference: A lightweight reference to the target of activity. 1661type TargetReference struct { 1662 // Drive: The target is a shared drive. 1663 Drive *DriveReference `json:"drive,omitempty"` 1664 1665 // DriveItem: The target is a Drive item. 1666 DriveItem *DriveItemReference `json:"driveItem,omitempty"` 1667 1668 // TeamDrive: This field is deprecated; please use the `drive` field 1669 // instead. 1670 TeamDrive *TeamDriveReference `json:"teamDrive,omitempty"` 1671 1672 // ForceSendFields is a list of field names (e.g. "Drive") to 1673 // unconditionally include in API requests. By default, fields with 1674 // empty or default values are omitted from API requests. However, any 1675 // non-pointer, non-interface field appearing in ForceSendFields will be 1676 // sent to the server regardless of whether the field is empty or not. 1677 // This may be used to include empty fields in Patch requests. 1678 ForceSendFields []string `json:"-"` 1679 1680 // NullFields is a list of field names (e.g. "Drive") to include in API 1681 // requests with the JSON null value. By default, fields with empty 1682 // values are omitted from API requests. However, any field with an 1683 // empty value appearing in NullFields will be sent to the server as 1684 // null. It is an error if a field in this list has a non-empty value. 1685 // This may be used to include null fields in Patch requests. 1686 NullFields []string `json:"-"` 1687} 1688 1689func (s *TargetReference) MarshalJSON() ([]byte, error) { 1690 type NoMethod TargetReference 1691 raw := NoMethod(*s) 1692 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1693} 1694 1695// TeamDrive: This item is deprecated; please see `Drive` instead. 1696type TeamDrive struct { 1697 // Name: This field is deprecated; please see `Drive.name` instead. 1698 Name string `json:"name,omitempty"` 1699 1700 // Root: This field is deprecated; please see `Drive.root` instead. 1701 Root *DriveItem `json:"root,omitempty"` 1702 1703 // Title: This field is deprecated; please see `Drive.title` instead. 1704 Title string `json:"title,omitempty"` 1705 1706 // ForceSendFields is a list of field names (e.g. "Name") to 1707 // unconditionally include in API requests. By default, fields with 1708 // empty or default values are omitted from API requests. However, any 1709 // non-pointer, non-interface field appearing in ForceSendFields will be 1710 // sent to the server regardless of whether the field is empty or not. 1711 // This may be used to include empty fields in Patch requests. 1712 ForceSendFields []string `json:"-"` 1713 1714 // NullFields is a list of field names (e.g. "Name") to include in API 1715 // requests with the JSON null value. By default, fields with empty 1716 // values are omitted from API requests. However, any field with an 1717 // empty value appearing in NullFields will be sent to the server as 1718 // null. It is an error if a field in this list has a non-empty value. 1719 // This may be used to include null fields in Patch requests. 1720 NullFields []string `json:"-"` 1721} 1722 1723func (s *TeamDrive) MarshalJSON() ([]byte, error) { 1724 type NoMethod TeamDrive 1725 raw := NoMethod(*s) 1726 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1727} 1728 1729// TeamDriveReference: This item is deprecated; please see 1730// `DriveReference` instead. 1731type TeamDriveReference struct { 1732 // Name: This field is deprecated; please see `DriveReference.name` 1733 // instead. 1734 Name string `json:"name,omitempty"` 1735 1736 // Title: This field is deprecated; please see `DriveReference.title` 1737 // instead. 1738 Title string `json:"title,omitempty"` 1739 1740 // ForceSendFields is a list of field names (e.g. "Name") to 1741 // unconditionally include in API requests. By default, fields with 1742 // empty or default values are omitted from API requests. However, any 1743 // non-pointer, non-interface field appearing in ForceSendFields will be 1744 // sent to the server regardless of whether the field is empty or not. 1745 // This may be used to include empty fields in Patch requests. 1746 ForceSendFields []string `json:"-"` 1747 1748 // NullFields is a list of field names (e.g. "Name") to include in API 1749 // requests with the JSON null value. By default, fields with empty 1750 // values are omitted from API requests. However, any field with an 1751 // empty value appearing in NullFields will be sent to the server as 1752 // null. It is an error if a field in this list has a non-empty value. 1753 // This may be used to include null fields in Patch requests. 1754 NullFields []string `json:"-"` 1755} 1756 1757func (s *TeamDriveReference) MarshalJSON() ([]byte, error) { 1758 type NoMethod TeamDriveReference 1759 raw := NoMethod(*s) 1760 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1761} 1762 1763// TimeRange: Information about time ranges. 1764type TimeRange struct { 1765 // EndTime: The end of the time range. 1766 EndTime string `json:"endTime,omitempty"` 1767 1768 // StartTime: The start of the time range. 1769 StartTime string `json:"startTime,omitempty"` 1770 1771 // ForceSendFields is a list of field names (e.g. "EndTime") to 1772 // unconditionally include in API requests. By default, fields with 1773 // empty or default values are omitted from API requests. However, any 1774 // non-pointer, non-interface field appearing in ForceSendFields will be 1775 // sent to the server regardless of whether the field is empty or not. 1776 // This may be used to include empty fields in Patch requests. 1777 ForceSendFields []string `json:"-"` 1778 1779 // NullFields is a list of field names (e.g. "EndTime") to include in 1780 // API requests with the JSON null value. By default, fields with empty 1781 // values are omitted from API requests. However, any field with an 1782 // empty value appearing in NullFields will be sent to the server as 1783 // null. It is an error if a field in this list has a non-empty value. 1784 // This may be used to include null fields in Patch requests. 1785 NullFields []string `json:"-"` 1786} 1787 1788func (s *TimeRange) MarshalJSON() ([]byte, error) { 1789 type NoMethod TimeRange 1790 raw := NoMethod(*s) 1791 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1792} 1793 1794// UnknownUser: A user about whom nothing is currently known. 1795type UnknownUser struct { 1796} 1797 1798// Upload: An object was uploaded into Drive. 1799type Upload struct { 1800} 1801 1802// User: Information about an end user. 1803type User struct { 1804 // DeletedUser: A user whose account has since been deleted. 1805 DeletedUser *DeletedUser `json:"deletedUser,omitempty"` 1806 1807 // KnownUser: A known user. 1808 KnownUser *KnownUser `json:"knownUser,omitempty"` 1809 1810 // UnknownUser: A user about whom nothing is currently known. 1811 UnknownUser *UnknownUser `json:"unknownUser,omitempty"` 1812 1813 // ForceSendFields is a list of field names (e.g. "DeletedUser") to 1814 // unconditionally include in API requests. By default, fields with 1815 // empty or default values are omitted from API requests. However, any 1816 // non-pointer, non-interface field appearing in ForceSendFields will be 1817 // sent to the server regardless of whether the field is empty or not. 1818 // This may be used to include empty fields in Patch requests. 1819 ForceSendFields []string `json:"-"` 1820 1821 // NullFields is a list of field names (e.g. "DeletedUser") to include 1822 // in API requests with the JSON null value. By default, fields with 1823 // empty values are omitted from API requests. However, any field with 1824 // an empty value appearing in NullFields will be sent to the server as 1825 // null. It is an error if a field in this list has a non-empty value. 1826 // This may be used to include null fields in Patch requests. 1827 NullFields []string `json:"-"` 1828} 1829 1830func (s *User) MarshalJSON() ([]byte, error) { 1831 type NoMethod User 1832 raw := NoMethod(*s) 1833 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1834} 1835 1836// method id "driveactivity.activity.query": 1837 1838type ActivityQueryCall struct { 1839 s *Service 1840 querydriveactivityrequest *QueryDriveActivityRequest 1841 urlParams_ gensupport.URLParams 1842 ctx_ context.Context 1843 header_ http.Header 1844} 1845 1846// Query: Query past activity in Google Drive. 1847func (r *ActivityService) Query(querydriveactivityrequest *QueryDriveActivityRequest) *ActivityQueryCall { 1848 c := &ActivityQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1849 c.querydriveactivityrequest = querydriveactivityrequest 1850 return c 1851} 1852 1853// Fields allows partial responses to be retrieved. See 1854// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1855// for more information. 1856func (c *ActivityQueryCall) Fields(s ...googleapi.Field) *ActivityQueryCall { 1857 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1858 return c 1859} 1860 1861// Context sets the context to be used in this call's Do method. Any 1862// pending HTTP request will be aborted if the provided context is 1863// canceled. 1864func (c *ActivityQueryCall) Context(ctx context.Context) *ActivityQueryCall { 1865 c.ctx_ = ctx 1866 return c 1867} 1868 1869// Header returns an http.Header that can be modified by the caller to 1870// add HTTP headers to the request. 1871func (c *ActivityQueryCall) Header() http.Header { 1872 if c.header_ == nil { 1873 c.header_ = make(http.Header) 1874 } 1875 return c.header_ 1876} 1877 1878func (c *ActivityQueryCall) doRequest(alt string) (*http.Response, error) { 1879 reqHeaders := make(http.Header) 1880 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1881 for k, v := range c.header_ { 1882 reqHeaders[k] = v 1883 } 1884 reqHeaders.Set("User-Agent", c.s.userAgent()) 1885 var body io.Reader = nil 1886 body, err := googleapi.WithoutDataWrapper.JSONReader(c.querydriveactivityrequest) 1887 if err != nil { 1888 return nil, err 1889 } 1890 reqHeaders.Set("Content-Type", "application/json") 1891 c.urlParams_.Set("alt", alt) 1892 c.urlParams_.Set("prettyPrint", "false") 1893 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/activity:query") 1894 urls += "?" + c.urlParams_.Encode() 1895 req, err := http.NewRequest("POST", urls, body) 1896 if err != nil { 1897 return nil, err 1898 } 1899 req.Header = reqHeaders 1900 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1901} 1902 1903// Do executes the "driveactivity.activity.query" call. 1904// Exactly one of *QueryDriveActivityResponse or error will be non-nil. 1905// Any non-2xx status code is an error. Response headers are in either 1906// *QueryDriveActivityResponse.ServerResponse.Header or (if a response 1907// was returned at all) in error.(*googleapi.Error).Header. Use 1908// googleapi.IsNotModified to check whether the returned error was 1909// because http.StatusNotModified was returned. 1910func (c *ActivityQueryCall) Do(opts ...googleapi.CallOption) (*QueryDriveActivityResponse, error) { 1911 gensupport.SetOptions(c.urlParams_, opts...) 1912 res, err := c.doRequest("json") 1913 if res != nil && res.StatusCode == http.StatusNotModified { 1914 if res.Body != nil { 1915 res.Body.Close() 1916 } 1917 return nil, &googleapi.Error{ 1918 Code: res.StatusCode, 1919 Header: res.Header, 1920 } 1921 } 1922 if err != nil { 1923 return nil, err 1924 } 1925 defer googleapi.CloseBody(res) 1926 if err := googleapi.CheckResponse(res); err != nil { 1927 return nil, err 1928 } 1929 ret := &QueryDriveActivityResponse{ 1930 ServerResponse: googleapi.ServerResponse{ 1931 Header: res.Header, 1932 HTTPStatusCode: res.StatusCode, 1933 }, 1934 } 1935 target := &ret 1936 if err := gensupport.DecodeResponse(target, res); err != nil { 1937 return nil, err 1938 } 1939 return ret, nil 1940 // { 1941 // "description": "Query past activity in Google Drive.", 1942 // "flatPath": "v2/activity:query", 1943 // "httpMethod": "POST", 1944 // "id": "driveactivity.activity.query", 1945 // "parameterOrder": [], 1946 // "parameters": {}, 1947 // "path": "v2/activity:query", 1948 // "request": { 1949 // "$ref": "QueryDriveActivityRequest" 1950 // }, 1951 // "response": { 1952 // "$ref": "QueryDriveActivityResponse" 1953 // }, 1954 // "scopes": [ 1955 // "https://www.googleapis.com/auth/drive.activity", 1956 // "https://www.googleapis.com/auth/drive.activity.readonly" 1957 // ] 1958 // } 1959 1960} 1961 1962// Pages invokes f for each page of results. 1963// A non-nil error returned from f will halt the iteration. 1964// The provided context supersedes any context provided to the Context method. 1965func (c *ActivityQueryCall) Pages(ctx context.Context, f func(*QueryDriveActivityResponse) error) error { 1966 c.ctx_ = ctx 1967 defer func(pt string) { c.querydriveactivityrequest.PageToken = pt }(c.querydriveactivityrequest.PageToken) // reset paging to original point 1968 for { 1969 x, err := c.Do() 1970 if err != nil { 1971 return err 1972 } 1973 if err := f(x); err != nil { 1974 return err 1975 } 1976 if x.NextPageToken == "" { 1977 return nil 1978 } 1979 c.querydriveactivityrequest.PageToken = x.NextPageToken 1980 } 1981} 1982