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

1882 lines
73 KiB

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