| // Copyright 2014 Google LLC |
| // |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file or at |
| // https://developers.google.com/open-source/licenses/bsd |
| |
| // This is a generated file (see the discoveryapis_generator project). |
| |
| // ignore_for_file: camel_case_types |
| // ignore_for_file: comment_references |
| // ignore_for_file: deprecated_member_use_from_same_package |
| // ignore_for_file: doc_directive_unknown |
| // ignore_for_file: lines_longer_than_80_chars |
| // ignore_for_file: non_constant_identifier_names |
| // ignore_for_file: prefer_interpolation_to_compose_strings |
| // ignore_for_file: unintended_html_in_doc_comment |
| // ignore_for_file: unnecessary_brace_in_string_interps |
| // ignore_for_file: unnecessary_lambdas |
| // ignore_for_file: unnecessary_string_interpolations |
| |
| /// Google Drive API - v2 |
| /// |
| /// The Google Drive API allows clients to access resources from Google Drive. |
| /// |
| /// For more information, see <https://developers.google.com/workspace/drive/> |
| /// |
| /// Create an instance of [DriveApi] to access these resources: |
| /// |
| /// - [AboutResource] |
| /// - [AppsResource] |
| /// - [ChangesResource] |
| /// - [ChannelsResource] |
| /// - [ChildrenResource] |
| /// - [CommentsResource] |
| /// - [DrivesResource] |
| /// - [FilesResource] |
| /// - [ParentsResource] |
| /// - [PermissionsResource] |
| /// - [PropertiesResource] |
| /// - [RepliesResource] |
| /// - [RevisionsResource] |
| /// - [TeamdrivesResource] |
| library; |
| |
| import 'dart:async' as async; |
| import 'dart:convert' as convert_1; |
| import 'dart:core' as core; |
| |
| import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| import 'package:http/http.dart' as http; |
| |
| import '../shared.dart'; |
| import '../src/user_agent.dart'; |
| |
| export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| show |
| ApiRequestError, |
| ByteRange, |
| DetailedApiRequestError, |
| DownloadOptions, |
| Media, |
| PartialDownloadOptions, |
| ResumableUploadOptions, |
| UploadOptions; |
| |
| /// The Google Drive API allows clients to access resources from Google Drive. |
| class DriveApi { |
| /// See, edit, create, and delete all of your Google Drive files |
| static const driveScope = 'https://www.googleapis.com/auth/drive'; |
| |
| /// See, create, and delete its own configuration data in your Google Drive |
| static const driveAppdataScope = |
| 'https://www.googleapis.com/auth/drive.appdata'; |
| |
| /// View your Google Drive apps |
| static const driveAppsReadonlyScope = |
| 'https://www.googleapis.com/auth/drive.apps.readonly'; |
| |
| /// See, edit, create, and delete only the specific Google Drive files you use |
| /// with this app |
| static const driveFileScope = 'https://www.googleapis.com/auth/drive.file'; |
| |
| /// See and download your Google Drive files that were created or edited by |
| /// Google Meet. |
| static const driveMeetReadonlyScope = |
| 'https://www.googleapis.com/auth/drive.meet.readonly'; |
| |
| /// View and manage metadata of files in your Google Drive |
| static const driveMetadataScope = |
| 'https://www.googleapis.com/auth/drive.metadata'; |
| |
| /// See information about your Google Drive files |
| static const driveMetadataReadonlyScope = |
| 'https://www.googleapis.com/auth/drive.metadata.readonly'; |
| |
| /// View the photos, videos and albums in your Google Photos |
| static const drivePhotosReadonlyScope = |
| 'https://www.googleapis.com/auth/drive.photos.readonly'; |
| |
| /// See and download all your Google Drive files |
| static const driveReadonlyScope = |
| 'https://www.googleapis.com/auth/drive.readonly'; |
| |
| /// Modify your Google Apps Script scripts' behavior |
| static const driveScriptsScope = |
| 'https://www.googleapis.com/auth/drive.scripts'; |
| |
| final commons.ApiRequester _requester; |
| |
| AboutResource get about => AboutResource(_requester); |
| AppsResource get apps => AppsResource(_requester); |
| ChangesResource get changes => ChangesResource(_requester); |
| ChannelsResource get channels => ChannelsResource(_requester); |
| ChildrenResource get children => ChildrenResource(_requester); |
| CommentsResource get comments => CommentsResource(_requester); |
| DrivesResource get drives => DrivesResource(_requester); |
| FilesResource get files => FilesResource(_requester); |
| ParentsResource get parents => ParentsResource(_requester); |
| PermissionsResource get permissions => PermissionsResource(_requester); |
| PropertiesResource get properties => PropertiesResource(_requester); |
| RepliesResource get replies => RepliesResource(_requester); |
| RevisionsResource get revisions => RevisionsResource(_requester); |
| TeamdrivesResource get teamdrives => TeamdrivesResource(_requester); |
| |
| DriveApi( |
| http.Client client, { |
| core.String rootUrl = 'https://www.googleapis.com/', |
| core.String servicePath = 'drive/v2/', |
| }) : _requester = commons.ApiRequester( |
| client, |
| rootUrl, |
| servicePath, |
| requestHeaders, |
| ); |
| } |
| |
| class AboutResource { |
| final commons.ApiRequester _requester; |
| |
| AboutResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Gets the information about the current user along with Drive API settings |
| /// |
| /// Request parameters: |
| /// |
| /// [includeSubscribed] - Whether to count changes outside the My Drive |
| /// hierarchy. When set to false, changes to files such as those in the |
| /// Application Data folder or shared files which have not been added to My |
| /// Drive will be omitted from the `maxChangeIdCount`. |
| /// |
| /// [maxChangeIdCount] - Maximum number of remaining change IDs to count |
| /// |
| /// [startChangeId] - Change ID to start counting from when calculating number |
| /// of remaining change IDs |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [About]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<About> get({ |
| core.bool? includeSubscribed, |
| core.String? maxChangeIdCount, |
| core.String? startChangeId, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeSubscribed': ?includeSubscribed == null |
| ? null |
| : ['${includeSubscribed}'], |
| 'maxChangeIdCount': ?maxChangeIdCount == null ? null : [maxChangeIdCount], |
| 'startChangeId': ?startChangeId == null ? null : [startChangeId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'about'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return About.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class AppsResource { |
| final commons.ApiRequester _requester; |
| |
| AppsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Gets a specific app. |
| /// |
| /// Request parameters: |
| /// |
| /// [appId] - The ID of the app. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [App]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<App> get(core.String appId, {core.String? $fields}) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'apps/' + commons.escapeVariable('$appId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return App.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists a user's installed apps. |
| /// |
| /// Request parameters: |
| /// |
| /// [appFilterExtensions] - A comma-separated list of file extensions for open |
| /// with filtering. All apps within the given app query scope which can open |
| /// any of the given file extensions will be included in the response. If |
| /// `appFilterMimeTypes` are provided as well, the result is a union of the |
| /// two resulting app lists. |
| /// |
| /// [appFilterMimeTypes] - A comma-separated list of MIME types for open with |
| /// filtering. All apps within the given app query scope which can open any of |
| /// the given MIME types will be included in the response. If |
| /// `appFilterExtensions` are provided as well, the result is a union of the |
| /// two resulting app lists. |
| /// |
| /// [languageCode] - A language or locale code, as defined by BCP 47, with |
| /// some extensions from Unicode's LDML format |
| /// (http://www.unicode.org/reports/tr35/). |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [AppList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<AppList> list({ |
| core.String? appFilterExtensions, |
| core.String? appFilterMimeTypes, |
| core.String? languageCode, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'appFilterExtensions': ?appFilterExtensions == null |
| ? null |
| : [appFilterExtensions], |
| 'appFilterMimeTypes': ?appFilterMimeTypes == null |
| ? null |
| : [appFilterMimeTypes], |
| 'languageCode': ?languageCode == null ? null : [languageCode], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'apps'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return AppList.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ChangesResource { |
| final commons.ApiRequester _requester; |
| |
| ChangesResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deprecated: Use `changes.getStartPageToken` and `changes.list` to retrieve |
| /// recent changes. |
| /// |
| /// Request parameters: |
| /// |
| /// [changeId] - The ID of the change. |
| /// |
| /// [driveId] - The shared drive from which the change will be returned. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [teamDriveId] - Deprecated: Use `driveId` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Change]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Change> get( |
| core.String changeId, { |
| core.String? driveId, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? teamDriveId, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'driveId': ?driveId == null ? null : [driveId], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'teamDriveId': ?teamDriveId == null ? null : [teamDriveId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'changes/' + commons.escapeVariable('$changeId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return Change.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Gets the starting pageToken for listing future changes. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The ID of the shared drive for which the starting pageToken |
| /// for listing future changes from that shared drive will be returned. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [teamDriveId] - Deprecated: Use `driveId` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [StartPageToken]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<StartPageToken> getStartPageToken({ |
| core.String? driveId, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? teamDriveId, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'driveId': ?driveId == null ? null : [driveId], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'teamDriveId': ?teamDriveId == null ? null : [teamDriveId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'changes/startPageToken'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return StartPageToken.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Lists the changes for a user or shared drive. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The shared drive from which changes will be returned. If |
| /// specified the change IDs will be reflective of the shared drive; use the |
| /// combined drive ID and change ID as an identifier. |
| /// |
| /// [includeCorpusRemovals] - Whether changes should include the file resource |
| /// if the file is still accessible by the user at the time of the request, |
| /// even when a file was removed from the list of changes and there will be no |
| /// further change entries for this file. |
| /// |
| /// [includeDeleted] - Whether to include changes indicating that items have |
| /// been removed from the list of changes, for example by deletion or loss of |
| /// access. |
| /// |
| /// [includeItemsFromAllDrives] - Whether both My Drive and shared drive items |
| /// should be included in results. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [includeSubscribed] - Whether to include changes outside the My Drive |
| /// hierarchy in the result. When set to false, changes to files such as those |
| /// in the Application Data folder or shared files which have not been added |
| /// to My Drive will be omitted from the result. |
| /// |
| /// [includeTeamDriveItems] - Deprecated: Use `includeItemsFromAllDrives` |
| /// instead. |
| /// |
| /// [maxResults] - Maximum number of changes to return. |
| /// |
| /// [pageToken] - The token for continuing a previous list request on the next |
| /// page. This should be set to the value of `nextPageToken` from the previous |
| /// response or to the response from the getStartPageToken method. |
| /// |
| /// [spaces] - A comma-separated list of spaces to query. Supported values are |
| /// `drive`, `appDataFolder` and `photos`. |
| /// |
| /// [startChangeId] - Deprecated: Use `pageToken` instead. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [teamDriveId] - Deprecated: Use `driveId` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ChangeList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ChangeList> list({ |
| core.String? driveId, |
| core.bool? includeCorpusRemovals, |
| core.bool? includeDeleted, |
| core.bool? includeItemsFromAllDrives, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? includeSubscribed, |
| core.bool? includeTeamDriveItems, |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? spaces, |
| core.String? startChangeId, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? teamDriveId, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'driveId': ?driveId == null ? null : [driveId], |
| 'includeCorpusRemovals': ?includeCorpusRemovals == null |
| ? null |
| : ['${includeCorpusRemovals}'], |
| 'includeDeleted': ?includeDeleted == null ? null : ['${includeDeleted}'], |
| 'includeItemsFromAllDrives': ?includeItemsFromAllDrives == null |
| ? null |
| : ['${includeItemsFromAllDrives}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'includeSubscribed': ?includeSubscribed == null |
| ? null |
| : ['${includeSubscribed}'], |
| 'includeTeamDriveItems': ?includeTeamDriveItems == null |
| ? null |
| : ['${includeTeamDriveItems}'], |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'spaces': ?spaces == null ? null : [spaces], |
| 'startChangeId': ?startChangeId == null ? null : [startChangeId], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'teamDriveId': ?teamDriveId == null ? null : [teamDriveId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'changes'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return ChangeList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Subscribe to changes for a user. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The shared drive from which changes will be returned. If |
| /// specified the change IDs will be reflective of the shared drive; use the |
| /// combined drive ID and change ID as an identifier. |
| /// |
| /// [includeCorpusRemovals] - Whether changes should include the file resource |
| /// if the file is still accessible by the user at the time of the request, |
| /// even when a file was removed from the list of changes and there will be no |
| /// further change entries for this file. |
| /// |
| /// [includeDeleted] - Whether to include changes indicating that items have |
| /// been removed from the list of changes, for example by deletion or loss of |
| /// access. |
| /// |
| /// [includeItemsFromAllDrives] - Whether both My Drive and shared drive items |
| /// should be included in results. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [includeSubscribed] - Whether to include changes outside the My Drive |
| /// hierarchy in the result. When set to false, changes to files such as those |
| /// in the Application Data folder or shared files which have not been added |
| /// to My Drive will be omitted from the result. |
| /// |
| /// [includeTeamDriveItems] - Deprecated: Use `includeItemsFromAllDrives` |
| /// instead. |
| /// |
| /// [maxResults] - Maximum number of changes to return. |
| /// |
| /// [pageToken] - The token for continuing a previous list request on the next |
| /// page. This should be set to the value of `nextPageToken` from the previous |
| /// response or to the response from the getStartPageToken method. |
| /// |
| /// [spaces] - A comma-separated list of spaces to query. Supported values are |
| /// `drive`, `appDataFolder` and `photos`. |
| /// |
| /// [startChangeId] - Deprecated: Use `pageToken` instead. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [teamDriveId] - Deprecated: Use `driveId` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Channel]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Channel> watch( |
| Channel request, { |
| core.String? driveId, |
| core.bool? includeCorpusRemovals, |
| core.bool? includeDeleted, |
| core.bool? includeItemsFromAllDrives, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? includeSubscribed, |
| core.bool? includeTeamDriveItems, |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? spaces, |
| core.String? startChangeId, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? teamDriveId, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'driveId': ?driveId == null ? null : [driveId], |
| 'includeCorpusRemovals': ?includeCorpusRemovals == null |
| ? null |
| : ['${includeCorpusRemovals}'], |
| 'includeDeleted': ?includeDeleted == null ? null : ['${includeDeleted}'], |
| 'includeItemsFromAllDrives': ?includeItemsFromAllDrives == null |
| ? null |
| : ['${includeItemsFromAllDrives}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'includeSubscribed': ?includeSubscribed == null |
| ? null |
| : ['${includeSubscribed}'], |
| 'includeTeamDriveItems': ?includeTeamDriveItems == null |
| ? null |
| : ['${includeTeamDriveItems}'], |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'spaces': ?spaces == null ? null : [spaces], |
| 'startChangeId': ?startChangeId == null ? null : [startChangeId], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'teamDriveId': ?teamDriveId == null ? null : [teamDriveId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'changes/watch'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Channel.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ChannelsResource { |
| final commons.ApiRequester _requester; |
| |
| ChannelsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Stops watching resources through this channel. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> stop(Channel request, {core.String? $fields}) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'channels/stop'; |
| |
| await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| } |
| |
| class ChildrenResource { |
| final commons.ApiRequester _requester; |
| |
| ChildrenResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Removes a child from a folder. |
| /// |
| /// Request parameters: |
| /// |
| /// [folderId] - The ID of the folder. |
| /// |
| /// [childId] - The ID of the child. |
| /// |
| /// [enforceSingleParent] - Deprecated: If an item is not in a shared drive |
| /// and its last parent is removed, the item is placed under its owner's root. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String folderId, |
| core.String childId, { |
| core.bool? enforceSingleParent, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$folderId') + |
| '/children/' + |
| commons.escapeVariable('$childId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a specific child reference. |
| /// |
| /// Request parameters: |
| /// |
| /// [folderId] - The ID of the folder. |
| /// |
| /// [childId] - The ID of the child. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ChildReference]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ChildReference> get( |
| core.String folderId, |
| core.String childId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$folderId') + |
| '/children/' + |
| commons.escapeVariable('$childId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return ChildReference.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Inserts a file into a folder. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [folderId] - The ID of the folder. |
| /// |
| /// [enforceSingleParent] - Deprecated: Adding files to multiple folders is no |
| /// longer supported. Use `shortcuts` instead. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ChildReference]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ChildReference> insert( |
| ChildReference request, |
| core.String folderId, { |
| core.bool? enforceSingleParent, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$folderId') + '/children'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return ChildReference.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Lists a folder's children. |
| /// |
| /// Request parameters: |
| /// |
| /// [folderId] - The ID of the folder. |
| /// |
| /// [maxResults] - Maximum number of children to return. |
| /// |
| /// [orderBy] - A comma-separated list of sort keys. Valid keys are |
| /// `createdDate`, `folder`, `lastViewedByMeDate`, `modifiedByMeDate`, |
| /// `modifiedDate`, `quotaBytesUsed`, `recency`, `sharedWithMeDate`, |
| /// `starred`, and `title`. Each key sorts ascending by default, but may be |
| /// reversed with the `desc` modifier. Example usage: |
| /// ?orderBy=folder,modifiedDate desc,title. Please note that there is a |
| /// current limitation for users with approximately one million files in which |
| /// the requested sort order is ignored. |
| /// |
| /// [pageToken] - Page token for children. |
| /// |
| /// [q] - Query string for searching children. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ChildList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ChildList> list( |
| core.String folderId, { |
| core.int? maxResults, |
| core.String? orderBy, |
| core.String? pageToken, |
| core.String? q, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'orderBy': ?orderBy == null ? null : [orderBy], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'q': ?q == null ? null : [q], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$folderId') + '/children'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return ChildList.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class CommentsResource { |
| final commons.ApiRequester _requester; |
| |
| CommentsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deletes a comment. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String fileId, |
| core.String commentId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a comment by ID. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [includeDeleted] - If set, this will succeed when retrieving a deleted |
| /// comment, and will include any deleted replies. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Comment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Comment> get( |
| core.String fileId, |
| core.String commentId, { |
| core.bool? includeDeleted, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeDeleted': ?includeDeleted == null ? null : ['${includeDeleted}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return Comment.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates a new comment on the given file. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Comment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Comment> insert( |
| Comment request, |
| core.String fileId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/comments'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Comment.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists a file's comments. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [includeDeleted] - If set, all comments and replies, including deleted |
| /// comments and replies (with content stripped) will be returned. |
| /// |
| /// [maxResults] - The maximum number of discussions to include in the |
| /// response, used for paging. |
| /// Value must be between "0" and "100". |
| /// |
| /// [pageToken] - The continuation token, used to page through large result |
| /// sets. To get the next page of results, set this parameter to the value of |
| /// "nextPageToken" from the previous response. |
| /// |
| /// [updatedMin] - Only discussions that were updated after this timestamp |
| /// will be returned. Formatted as an RFC 3339 timestamp. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [CommentList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<CommentList> list( |
| core.String fileId, { |
| core.bool? includeDeleted, |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? updatedMin, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeDeleted': ?includeDeleted == null ? null : ['${includeDeleted}'], |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'updatedMin': ?updatedMin == null ? null : [updatedMin], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/comments'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return CommentList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates an existing comment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Comment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Comment> patch( |
| Comment request, |
| core.String fileId, |
| core.String commentId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PATCH', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Comment.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates an existing comment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Comment]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Comment> update( |
| Comment request, |
| core.String fileId, |
| core.String commentId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Comment.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class DrivesResource { |
| final commons.ApiRequester _requester; |
| |
| DrivesResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Permanently deletes a shared drive for which the user is an `organizer`. |
| /// |
| /// The shared drive cannot contain any untrashed items. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The ID of the shared drive. |
| /// |
| /// [allowItemDeletion] - Whether any items inside the shared drive should |
| /// also be deleted. This option is only supported when `useDomainAdminAccess` |
| /// is also set to `true`. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if they are an |
| /// administrator of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String driveId, { |
| core.bool? allowItemDeletion, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'allowItemDeletion': ?allowItemDeletion == null |
| ? null |
| : ['${allowItemDeletion}'], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'drives/' + commons.escapeVariable('$driveId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a shared drive's metadata by ID. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The ID of the shared drive. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if they are an |
| /// administrator of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Drive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Drive> get( |
| core.String driveId, { |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'drives/' + commons.escapeVariable('$driveId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return Drive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Hides a shared drive from the default view. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The ID of the shared drive. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Drive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Drive> hide(core.String driveId, {core.String? $fields}) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'drives/' + commons.escapeVariable('$driveId') + '/hide'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| queryParams: queryParams_, |
| ); |
| return Drive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Creates a new shared drive. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [requestId] - Required. An ID, such as a random UUID, which uniquely |
| /// identifies this user's request for idempotent creation of a shared drive. |
| /// A repeated request by the same user and with the same request ID will |
| /// avoid creating duplicates by attempting to create the same shared drive. |
| /// If the shared drive already exists a 409 error will be returned. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Drive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Drive> insert( |
| Drive request, |
| core.String requestId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'requestId': [requestId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'drives'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Drive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists the user's shared drives. |
| /// |
| /// This method accepts the `q` parameter, which is a search query combining |
| /// one or more search terms. For more information, see the |
| /// [Search for shared drives](https://developers.google.com/workspace/drive/api/guides/search-shareddrives) |
| /// guide. |
| /// |
| /// Request parameters: |
| /// |
| /// [maxResults] - Maximum number of shared drives to return per page. |
| /// Value must be between "1" and "100". |
| /// |
| /// [pageToken] - Page token for shared drives. |
| /// |
| /// [q] - Query string for searching shared drives. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then all shared drives of the domain in which the requester |
| /// is an administrator are returned. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [DriveList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<DriveList> list({ |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? q, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'q': ?q == null ? null : [q], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'drives'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return DriveList.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Restores a shared drive to the default view. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The ID of the shared drive. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Drive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Drive> unhide( |
| core.String driveId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'drives/' + commons.escapeVariable('$driveId') + '/unhide'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| queryParams: queryParams_, |
| ); |
| return Drive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates the metadata for a shared drive. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - The ID of the shared drive. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if they are an |
| /// administrator of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Drive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Drive> update( |
| Drive request, |
| core.String driveId, { |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'drives/' + commons.escapeVariable('$driveId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Drive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class FilesResource { |
| final commons.ApiRequester _requester; |
| |
| FilesResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Creates a copy of the specified file. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to copy. |
| /// |
| /// [convert] - Whether to convert this file to the corresponding Docs Editors |
| /// format. |
| /// |
| /// [enforceSingleParent] - Deprecated: Copying files into multiple folders is |
| /// no longer supported. Use shortcuts instead. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. |
| /// |
| /// [ocrLanguage] - If `ocr` is true, hints at the language to use. Valid |
| /// values are BCP 47 codes. |
| /// |
| /// [pinned] - Whether to pin the head revision of the new copy. A file can |
| /// have a maximum of 200 pinned revisions. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [timedTextLanguage] - The language of the timed text. |
| /// |
| /// [timedTextTrackName] - The timed text track name. |
| /// |
| /// [visibility] - The visibility of the new file. Permissions are still |
| /// inherited from parent folders. This parameter is only relevant when the |
| /// source is not a Google Doc file and when `convert=false`. |
| /// Possible string values are: |
| /// - "DEFAULT" : The visibility of the new file is determined by the user's |
| /// default visibility or sharing policies. |
| /// - "PRIVATE" : The user's default visibility or sharing policies are |
| /// ignored, and the new file is only visible to the owner and any users with |
| /// permissions inherited from the parent folder. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [File]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<File> copy( |
| File request, |
| core.String fileId, { |
| core.bool? convert, |
| core.bool? enforceSingleParent, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? ocr, |
| core.String? ocrLanguage, |
| core.bool? pinned, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? timedTextLanguage, |
| core.String? timedTextTrackName, |
| core.String? visibility, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'convert': ?convert == null ? null : ['${convert}'], |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'ocr': ?ocr == null ? null : ['${ocr}'], |
| 'ocrLanguage': ?ocrLanguage == null ? null : [ocrLanguage], |
| 'pinned': ?pinned == null ? null : ['${pinned}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'timedTextLanguage': ?timedTextLanguage == null |
| ? null |
| : [timedTextLanguage], |
| 'timedTextTrackName': ?timedTextTrackName == null |
| ? null |
| : [timedTextTrackName], |
| 'visibility': ?visibility == null ? null : [visibility], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/copy'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Permanently deletes a file owned by the user without moving it to the |
| /// trash. |
| /// |
| /// If the file belongs to a shared drive, the user must be an `organizer` on |
| /// the parent folder. If the target is a folder, all descendants owned by the |
| /// user are also deleted. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to delete. |
| /// |
| /// [enforceSingleParent] - Deprecated: If an item is not in a shared drive |
| /// and its last parent is deleted but the item itself is not, the item is |
| /// placed under its owner's root. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String fileId, { |
| core.bool? enforceSingleParent, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Permanently deletes all of the user's trashed files. |
| /// |
| /// Request parameters: |
| /// |
| /// [driveId] - If set, empties the trash of the provided shared drive. |
| /// |
| /// [enforceSingleParent] - Deprecated: If an item is not in a shared drive |
| /// and its last parent is deleted but the item itself is not, the item is |
| /// placed under its owner's root. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> emptyTrash({ |
| core.String? driveId, |
| core.bool? enforceSingleParent, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'driveId': ?driveId == null ? null : [driveId], |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'files/trash'; |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Exports a Google Workspace document to the requested MIME type and returns |
| /// exported byte content. |
| /// |
| /// Note that the exported content is limited to 10MB. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [mimeType] - Required. The MIME type of the format requested for this |
| /// export. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// [downloadOptions] - Options for downloading. A download can be either a |
| /// Metadata (default) or Media download. Partial Media downloads are possible |
| /// as well. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<commons.Media?> export( |
| core.String fileId, |
| core.String mimeType, { |
| core.String? $fields, |
| commons.DownloadOptions downloadOptions = commons.DownloadOptions.metadata, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'mimeType': [mimeType], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/export'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| downloadOptions: downloadOptions, |
| ); |
| if (downloadOptions.isMetadataDownload) { |
| return null; |
| } else { |
| return response_ as commons.Media; |
| } |
| } |
| |
| /// Generates a CSE token which can be used to create or update CSE files. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file for which the JWT should be generated. If |
| /// not provided, an id will be generated. |
| /// |
| /// [parent] - The ID of the expected parent of the file. Used when generating |
| /// a JWT for a new CSE file. If specified, the parent will be fetched, and if |
| /// the parent is a shared drive item, the shared drive's policy will be used |
| /// to determine the KACLS that should be used. It is invalid to specify both |
| /// file_id and parent in a single request. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GenerateCseTokenResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GenerateCseTokenResponse> generateCseToken({ |
| core.String? fileId, |
| core.String? parent, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fileId': ?fileId == null ? null : [fileId], |
| 'parent': ?parent == null ? null : [parent], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'files/generateCseToken'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return GenerateCseTokenResponse.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Generates a set of file IDs which can be provided in insert or copy |
| /// requests. |
| /// |
| /// Request parameters: |
| /// |
| /// [maxResults] - Maximum number of IDs to return. |
| /// Value must be between "1" and "1000". |
| /// |
| /// [space] - The space in which the IDs can be used to create new files. |
| /// Supported values are `drive` and `appDataFolder`. (Default: `drive`) |
| /// |
| /// [type] - The type of items which the IDs can be used for. Supported values |
| /// are `files` and `shortcuts`. Note that `shortcuts` are only supported in |
| /// the `drive` `space`. (Default: `files`) |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [GeneratedIds]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<GeneratedIds> generateIds({ |
| core.int? maxResults, |
| core.String? space, |
| core.String? type, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'space': ?space == null ? null : [space], |
| 'type': ?type == null ? null : [type], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'files/generateIds'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return GeneratedIds.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Gets a file's metadata or content by ID. |
| /// |
| /// If you provide the URL parameter `alt=media`, then the response includes |
| /// the file contents in the response body. Downloading content with |
| /// `alt=media` only works if the file is stored in Drive. To download Google |
| /// Docs, Sheets, and Slides use |
| /// \[`files.export`\](https://developers.google.com/workspace/drive/api/reference/rest/v2/files/export) |
| /// instead. For more information, see \[Download & export |
| /// files\](https://developers.google.com/workspace/drive/api/guides/manage-downloads). |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file in question. |
| /// |
| /// [acknowledgeAbuse] - Whether the user is acknowledging the risk of |
| /// downloading known malware or other abusive files. This is only applicable |
| /// when the `alt` parameter is set to `media` and the user is the owner of |
| /// the file or an organizer of the shared drive in which the file resides. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [projection] - Deprecated: This parameter has no function. |
| /// Possible string values are: |
| /// - "BASIC" : Deprecated. |
| /// - "FULL" : Deprecated. |
| /// |
| /// [revisionId] - Specifies the Revision ID that should be downloaded. |
| /// Ignored unless alt=media is specified. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [updateViewedDate] - Deprecated: Use `files.update` with |
| /// `modifiedDateBehavior=noChange, updateViewedDate=true` and an empty |
| /// request body. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// [downloadOptions] - Options for downloading. A download can be either a |
| /// Metadata (default) or Media download. Partial Media downloads are possible |
| /// as well. |
| /// |
| /// Completes with a |
| /// |
| /// - [File] for Metadata downloads (see [downloadOptions]). |
| /// |
| /// - [commons.Media] for Media downloads (see [downloadOptions]). |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<core.Object> get( |
| core.String fileId, { |
| core.bool? acknowledgeAbuse, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.String? projection, |
| core.String? revisionId, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? updateViewedDate, |
| core.String? $fields, |
| commons.DownloadOptions downloadOptions = commons.DownloadOptions.metadata, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'acknowledgeAbuse': ?acknowledgeAbuse == null |
| ? null |
| : ['${acknowledgeAbuse}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'projection': ?projection == null ? null : [projection], |
| 'revisionId': ?revisionId == null ? null : [revisionId], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'updateViewedDate': ?updateViewedDate == null |
| ? null |
| : ['${updateViewedDate}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| downloadOptions: downloadOptions, |
| ); |
| if (downloadOptions.isMetadataDownload) { |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } else { |
| return response_ as commons.Media; |
| } |
| } |
| |
| /// Inserts a new file. |
| /// |
| /// This method supports an * / upload* URI and accepts uploaded media with |
| /// the following characteristics: - *Maximum file size:* 5,120 GB - *Accepted |
| /// Media MIME types:*`* / * ` Note: Specify a valid MIME type, rather than |
| /// the literal `* / * ` value. The literal `* / * ` is only used to indicate |
| /// that any valid MIME type can be uploaded. For more information on |
| /// uploading files, see |
| /// [Upload file data](https://developers.google.com/workspace/drive/api/guides/manage-uploads). |
| /// Apps creating shortcuts with `files.insert` must specify the MIME type |
| /// `application/vnd.google-apps.shortcut`. Apps should specify a file |
| /// extension in the `title` property when inserting files with the API. For |
| /// example, an operation to insert a JPEG file should specify something like |
| /// `"title": "cat.jpg"` in the metadata. Subsequent `GET` requests include |
| /// the read-only `fileExtension` property populated with the extension |
| /// originally specified in the `title` property. When a Google Drive user |
| /// requests to download a file, or when the file is downloaded through the |
| /// sync client, Drive builds a full filename (with extension) based on the |
| /// title. In cases where the extension is missing, Drive attempts to |
| /// determine the extension based on the file's MIME type. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [convert] - Whether to convert this file to the corresponding Docs Editors |
| /// format. |
| /// |
| /// [enforceSingleParent] - Deprecated: Creating files in multiple folders is |
| /// no longer supported. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. |
| /// |
| /// [ocrLanguage] - If ocr is true, hints at the language to use. Valid values |
| /// are BCP 47 codes. |
| /// |
| /// [pinned] - Whether to pin the head revision of the uploaded file. A file |
| /// can have a maximum of 200 pinned revisions. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [timedTextLanguage] - The language of the timed text. |
| /// |
| /// [timedTextTrackName] - The timed text track name. |
| /// |
| /// [useContentAsIndexableText] - Whether to use the content as indexable |
| /// text. |
| /// |
| /// [visibility] - The visibility of the new file. Permissions are still |
| /// inherited from parent folders. This parameter is only relevant when |
| /// `convert=false`. |
| /// Possible string values are: |
| /// - "DEFAULT" : The visibility of the new file is determined by the user's |
| /// default visibility or sharing policies. |
| /// - "PRIVATE" : The user's default visibility or sharing policies are |
| /// ignored, and the new file is only visible to the owner and any users with |
| /// permissions inherited from the parent folder. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// [uploadMedia] - The media to upload. |
| /// |
| /// [uploadOptions] - Options for the media upload. Streaming Media without |
| /// the length being known ahead of time is only supported via resumable |
| /// uploads. |
| /// |
| /// Completes with a [File]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<File> insert( |
| File request, { |
| core.bool? convert, |
| core.bool? enforceSingleParent, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? ocr, |
| core.String? ocrLanguage, |
| core.bool? pinned, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? timedTextLanguage, |
| core.String? timedTextTrackName, |
| core.bool? useContentAsIndexableText, |
| core.String? visibility, |
| core.String? $fields, |
| commons.UploadOptions uploadOptions = commons.UploadOptions.defaultOptions, |
| commons.Media? uploadMedia, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'convert': ?convert == null ? null : ['${convert}'], |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'ocr': ?ocr == null ? null : ['${ocr}'], |
| 'ocrLanguage': ?ocrLanguage == null ? null : [ocrLanguage], |
| 'pinned': ?pinned == null ? null : ['${pinned}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'timedTextLanguage': ?timedTextLanguage == null |
| ? null |
| : [timedTextLanguage], |
| 'timedTextTrackName': ?timedTextTrackName == null |
| ? null |
| : [timedTextTrackName], |
| 'useContentAsIndexableText': ?useContentAsIndexableText == null |
| ? null |
| : ['${useContentAsIndexableText}'], |
| 'visibility': ?visibility == null ? null : [visibility], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| core.String url_; |
| if (uploadMedia == null) { |
| url_ = 'files'; |
| } else if (uploadOptions is commons.ResumableUploadOptions) { |
| url_ = '/resumable/upload/drive/v2/files'; |
| } else { |
| url_ = '/upload/drive/v2/files'; |
| } |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| uploadMedia: uploadMedia, |
| uploadOptions: uploadOptions, |
| ); |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists the user's files. |
| /// |
| /// For more information, see |
| /// [Search for files and folders](https://developers.google.com/workspace/drive/api/guides/search-files). |
| /// This method accepts the `q` parameter, which is a search query combining |
| /// one or more search terms. This method returns *all* files by default, |
| /// including trashed files. If you don't want trashed files to appear in the |
| /// list, use the `trashed=false` query parameter to remove trashed files from |
| /// the results. |
| /// |
| /// Request parameters: |
| /// |
| /// [corpora] - Bodies of items (files/documents) to which the query applies. |
| /// Supported bodies are `default`, `domain`, `drive` and `allDrives`. Prefer |
| /// `default` or `drive` to `allDrives` for efficiency. |
| /// |
| /// [corpus] - Deprecated: The body of items (files/documents) to which the |
| /// query applies. Use `corpora` instead. |
| /// Possible string values are: |
| /// - "DEFAULT" : The items that the user has accessed. |
| /// - "DOMAIN" : Items shared to the user's domain. |
| /// |
| /// [driveId] - ID of the shared drive to search. |
| /// |
| /// [includeItemsFromAllDrives] - Whether both My Drive and shared drive items |
| /// should be included in results. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [includeTeamDriveItems] - Deprecated: Use `includeItemsFromAllDrives` |
| /// instead. |
| /// |
| /// [maxResults] - The maximum number of files to return per page. Partial or |
| /// empty result pages are possible even before the end of the files list has |
| /// been reached. |
| /// |
| /// [orderBy] - A comma-separated list of sort keys. Valid keys are: * |
| /// `createdDate`: When the file was created. * `folder`: The folder ID. This |
| /// field is sorted using alphabetical ordering. * `lastViewedByMeDate`: The |
| /// last time the file was viewed by the user. * `modifiedByMeDate`: The last |
| /// time the file was modified by the user. * `modifiedDate`: The last time |
| /// the file was modified by anyone. * `quotaBytesUsed`: The number of storage |
| /// quota bytes used by the file. * `recency`: The most recent timestamp from |
| /// the file's date-time fields. * `sharedWithMeDate`: When the file was |
| /// shared with the user, if applicable. * `starred`: Whether the user has |
| /// starred the file. * `title`: The title of the file. This field is sorted |
| /// using alphabetical ordering, so 1, 12, 2, 22. * `title_natural`: The title |
| /// of the file. This field is sorted using natural sort ordering, so 1, 2, |
| /// 12, 22. Each key sorts ascending by default, but can be reversed with the |
| /// 'desc' modifier. Example usage: `?orderBy=folder,modifiedDate desc,title`. |
| /// Note that there's a current limitation for users with approximately one |
| /// million files in which the requested sort order is ignored. |
| /// |
| /// [pageToken] - Page token for files. |
| /// |
| /// [projection] - Deprecated: This parameter has no function. |
| /// Possible string values are: |
| /// - "BASIC" : Deprecated. |
| /// - "FULL" : Deprecated. |
| /// |
| /// [q] - Query string for searching files. |
| /// |
| /// [spaces] - A comma-separated list of spaces to query. Supported values are |
| /// `drive`, and `appDataFolder`. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [teamDriveId] - Deprecated: Use `driveId` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [FileList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<FileList> list({ |
| core.String? corpora, |
| core.String? corpus, |
| core.String? driveId, |
| core.bool? includeItemsFromAllDrives, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? includeTeamDriveItems, |
| core.int? maxResults, |
| core.String? orderBy, |
| core.String? pageToken, |
| core.String? projection, |
| core.String? q, |
| core.String? spaces, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? teamDriveId, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'corpora': ?corpora == null ? null : [corpora], |
| 'corpus': ?corpus == null ? null : [corpus], |
| 'driveId': ?driveId == null ? null : [driveId], |
| 'includeItemsFromAllDrives': ?includeItemsFromAllDrives == null |
| ? null |
| : ['${includeItemsFromAllDrives}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'includeTeamDriveItems': ?includeTeamDriveItems == null |
| ? null |
| : ['${includeTeamDriveItems}'], |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'orderBy': ?orderBy == null ? null : [orderBy], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'projection': ?projection == null ? null : [projection], |
| 'q': ?q == null ? null : [q], |
| 'spaces': ?spaces == null ? null : [spaces], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'teamDriveId': ?teamDriveId == null ? null : [teamDriveId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'files'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return FileList.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists the labels on a file. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file. |
| /// |
| /// [maxResults] - The maximum number of labels to return per page. When not |
| /// set, defaults to 100. |
| /// Value must be between "1" and "100". |
| /// |
| /// [pageToken] - The token for continuing a previous list request on the next |
| /// page. This should be set to the value of `nextPageToken` from the previous |
| /// response. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [LabelList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<LabelList> listLabels( |
| core.String fileId, { |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/listLabels'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return LabelList.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Modifies the set of labels applied to a file. |
| /// |
| /// Returns a list of the labels that were added or modified. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to which the labels belong. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ModifyLabelsResponse]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ModifyLabelsResponse> modifyLabels( |
| ModifyLabelsRequest request, |
| core.String fileId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/modifyLabels'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return ModifyLabelsResponse.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates a file's metadata and/or content. |
| /// |
| /// When calling this method, only populate fields in the request that you |
| /// want to modify. When updating fields, some fields might change |
| /// automatically, such as modifiedDate. This method supports patch semantics. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to update. |
| /// |
| /// [addParents] - Comma-separated list of parent IDs to add. |
| /// |
| /// [convert] - Deprecated: This parameter has no function. |
| /// |
| /// [enforceSingleParent] - Deprecated: Adding files to multiple folders is no |
| /// longer supported. Use `shortcuts` instead. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [modifiedDateBehavior] - Determines the behavior in which `modifiedDate` |
| /// is updated. This overrides `setModifiedDate`. |
| /// Possible string values are: |
| /// - "fromBody" : Set `modifiedDate` to the value provided in the body of the |
| /// request. No change if no value was provided. |
| /// - "fromBodyIfNeeded" : Set `modifiedDate` to the value provided in the |
| /// body of the request depending on other contents of the update. |
| /// - "fromBodyOrNow" : Set modifiedDate to the value provided in the body of |
| /// the request, or to the current time if no value was provided. |
| /// - "noChange" : Maintain the previous value of `modifiedDate`. |
| /// - "now" : Set `modifiedDate` to the current time. |
| /// - "nowIfNeeded" : Set `modifiedDate` to the current time depending on |
| /// contents of the update. |
| /// |
| /// [newRevision] - Whether a blob upload should create a new revision. If |
| /// false, the blob data in the current head revision is replaced. If true or |
| /// not set, a new blob is created as head revision, and previous unpinned |
| /// revisions are preserved for a short period of time. Pinned revisions are |
| /// stored indefinitely, using additional storage quota, up to a maximum of |
| /// 200 revisions. For details on how revisions are retained, see the |
| /// [Drive Help Center](https://support.google.com/drive/answer/2409045). Note |
| /// that this field is ignored if there is no payload in the request. |
| /// |
| /// [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. |
| /// |
| /// [ocrLanguage] - If ocr is true, hints at the language to use. Valid values |
| /// are BCP 47 codes. |
| /// |
| /// [pinned] - Whether to pin the new revision. A file can have a maximum of |
| /// 200 pinned revisions. Note that this field is ignored if there is no |
| /// payload in the request. |
| /// |
| /// [removeParents] - Comma-separated list of parent IDs to remove. |
| /// |
| /// [setModifiedDate] - Whether to set the modified date using the value |
| /// supplied in the request body. Setting this field to `true` is equivalent |
| /// to `modifiedDateBehavior=fromBodyOrNow`, and `false` is equivalent to |
| /// `modifiedDateBehavior=now`. To prevent any changes to the modified date |
| /// set `modifiedDateBehavior=noChange`. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [timedTextLanguage] - The language of the timed text. |
| /// |
| /// [timedTextTrackName] - The timed text track name. |
| /// |
| /// [updateViewedDate] - Whether to update the view date after successfully |
| /// updating the file. |
| /// |
| /// [useContentAsIndexableText] - Whether to use the content as indexable |
| /// text. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [File]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<File> patch( |
| File request, |
| core.String fileId, { |
| core.String? addParents, |
| core.bool? convert, |
| core.bool? enforceSingleParent, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.String? modifiedDateBehavior, |
| core.bool? newRevision, |
| core.bool? ocr, |
| core.String? ocrLanguage, |
| core.bool? pinned, |
| core.String? removeParents, |
| core.bool? setModifiedDate, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? timedTextLanguage, |
| core.String? timedTextTrackName, |
| core.bool? updateViewedDate, |
| core.bool? useContentAsIndexableText, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'addParents': ?addParents == null ? null : [addParents], |
| 'convert': ?convert == null ? null : ['${convert}'], |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'modifiedDateBehavior': ?modifiedDateBehavior == null |
| ? null |
| : [modifiedDateBehavior], |
| 'newRevision': ?newRevision == null ? null : ['${newRevision}'], |
| 'ocr': ?ocr == null ? null : ['${ocr}'], |
| 'ocrLanguage': ?ocrLanguage == null ? null : [ocrLanguage], |
| 'pinned': ?pinned == null ? null : ['${pinned}'], |
| 'removeParents': ?removeParents == null ? null : [removeParents], |
| 'setModifiedDate': ?setModifiedDate == null |
| ? null |
| : ['${setModifiedDate}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'timedTextLanguage': ?timedTextLanguage == null |
| ? null |
| : [timedTextLanguage], |
| 'timedTextTrackName': ?timedTextTrackName == null |
| ? null |
| : [timedTextTrackName], |
| 'updateViewedDate': ?updateViewedDate == null |
| ? null |
| : ['${updateViewedDate}'], |
| 'useContentAsIndexableText': ?useContentAsIndexableText == null |
| ? null |
| : ['${useContentAsIndexableText}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PATCH', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Set the file's updated time to the current server time. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to update. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [File]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<File> touch( |
| core.String fileId, { |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/touch'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| queryParams: queryParams_, |
| ); |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Moves a file to the trash. |
| /// |
| /// The currently authenticated user must own the file or be at least a |
| /// `fileOrganizer` on the parent for shared drive files. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to trash. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [File]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<File> trash( |
| core.String fileId, { |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/trash'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| queryParams: queryParams_, |
| ); |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Restores a file from the trash. |
| /// |
| /// The currently authenticated user must own the file or be at least a |
| /// `fileOrganizer` on the parent for shared drive files. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to untrash. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [File]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<File> untrash( |
| core.String fileId, { |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/untrash'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| queryParams: queryParams_, |
| ); |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates a file's metadata, content, or both. |
| /// |
| /// When calling this method, only populate fields in the request that you |
| /// want to modify. When updating fields, some fields might be changed |
| /// automatically, such as `modifiedDate`. This method supports patch |
| /// semantics. This method supports an * / upload* URI and accepts uploaded |
| /// media with the following characteristics: - *Maximum file size:* 5,120 GB |
| /// - *Accepted Media MIME types:* `* / * ` (Specify a valid MIME type, rather |
| /// than the literal `* / * ` value. The literal `* / * ` is only used to |
| /// indicate that any valid MIME type can be uploaded. For more information, |
| /// see |
| /// [Google Workspace and Google Drive supported MIME types](https://developers.google.com/workspace/drive/api/guides/mime-types).) |
| /// For more information on uploading files, see |
| /// [Upload file data](https://developers.google.com/workspace/drive/api/guides/manage-uploads). |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file to update. |
| /// |
| /// [addParents] - Comma-separated list of parent IDs to add. |
| /// |
| /// [convert] - Deprecated: This parameter has no function. |
| /// |
| /// [enforceSingleParent] - Deprecated: Adding files to multiple folders is no |
| /// longer supported. Use `shortcuts` instead. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [modifiedDateBehavior] - Determines the behavior in which `modifiedDate` |
| /// is updated. This overrides `setModifiedDate`. |
| /// Possible string values are: |
| /// - "fromBody" : Set `modifiedDate` to the value provided in the body of the |
| /// request. No change if no value was provided. |
| /// - "fromBodyIfNeeded" : Set `modifiedDate` to the value provided in the |
| /// body of the request depending on other contents of the update. |
| /// - "fromBodyOrNow" : Set modifiedDate to the value provided in the body of |
| /// the request, or to the current time if no value was provided. |
| /// - "noChange" : Maintain the previous value of `modifiedDate`. |
| /// - "now" : Set `modifiedDate` to the current time. |
| /// - "nowIfNeeded" : Set `modifiedDate` to the current time depending on |
| /// contents of the update. |
| /// |
| /// [newRevision] - Whether a blob upload should create a new revision. If |
| /// false, the blob data in the current head revision is replaced. If true or |
| /// not set, a new blob is created as head revision, and previous unpinned |
| /// revisions are preserved for a short period of time. Pinned revisions are |
| /// stored indefinitely, using additional storage quota, up to a maximum of |
| /// 200 revisions. For details on how revisions are retained, see the |
| /// [Drive Help Center](https://support.google.com/drive/answer/2409045). |
| /// |
| /// [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. |
| /// |
| /// [ocrLanguage] - If ocr is true, hints at the language to use. Valid values |
| /// are BCP 47 codes. |
| /// |
| /// [pinned] - Whether to pin the new revision. A file can have a maximum of |
| /// 200 pinned revisions. |
| /// |
| /// [removeParents] - Comma-separated list of parent IDs to remove. |
| /// |
| /// [setModifiedDate] - Whether to set the modified date using the value |
| /// supplied in the request body. Setting this field to `true` is equivalent |
| /// to `modifiedDateBehavior=fromBodyOrNow`, and `false` is equivalent to |
| /// `modifiedDateBehavior=now`. To prevent any changes to the modified date |
| /// set `modifiedDateBehavior=noChange`. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [timedTextLanguage] - The language of the timed text. |
| /// |
| /// [timedTextTrackName] - The timed text track name. |
| /// |
| /// [updateViewedDate] - Whether to update the view date after successfully |
| /// updating the file. |
| /// |
| /// [useContentAsIndexableText] - Whether to use the content as indexable |
| /// text. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// [uploadMedia] - The media to upload. |
| /// |
| /// [uploadOptions] - Options for the media upload. Streaming Media without |
| /// the length being known ahead of time is only supported via resumable |
| /// uploads. |
| /// |
| /// Completes with a [File]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<File> update( |
| File request, |
| core.String fileId, { |
| core.String? addParents, |
| core.bool? convert, |
| core.bool? enforceSingleParent, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.String? modifiedDateBehavior, |
| core.bool? newRevision, |
| core.bool? ocr, |
| core.String? ocrLanguage, |
| core.bool? pinned, |
| core.String? removeParents, |
| core.bool? setModifiedDate, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? timedTextLanguage, |
| core.String? timedTextTrackName, |
| core.bool? updateViewedDate, |
| core.bool? useContentAsIndexableText, |
| core.String? $fields, |
| commons.UploadOptions uploadOptions = commons.UploadOptions.defaultOptions, |
| commons.Media? uploadMedia, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'addParents': ?addParents == null ? null : [addParents], |
| 'convert': ?convert == null ? null : ['${convert}'], |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'modifiedDateBehavior': ?modifiedDateBehavior == null |
| ? null |
| : [modifiedDateBehavior], |
| 'newRevision': ?newRevision == null ? null : ['${newRevision}'], |
| 'ocr': ?ocr == null ? null : ['${ocr}'], |
| 'ocrLanguage': ?ocrLanguage == null ? null : [ocrLanguage], |
| 'pinned': ?pinned == null ? null : ['${pinned}'], |
| 'removeParents': ?removeParents == null ? null : [removeParents], |
| 'setModifiedDate': ?setModifiedDate == null |
| ? null |
| : ['${setModifiedDate}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'timedTextLanguage': ?timedTextLanguage == null |
| ? null |
| : [timedTextLanguage], |
| 'timedTextTrackName': ?timedTextTrackName == null |
| ? null |
| : [timedTextTrackName], |
| 'updateViewedDate': ?updateViewedDate == null |
| ? null |
| : ['${updateViewedDate}'], |
| 'useContentAsIndexableText': ?useContentAsIndexableText == null |
| ? null |
| : ['${useContentAsIndexableText}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| core.String url_; |
| if (uploadMedia == null) { |
| url_ = 'files/' + commons.escapeVariable('$fileId'); |
| } else if (uploadOptions is commons.ResumableUploadOptions) { |
| url_ = |
| '/resumable/upload/drive/v2/files/' + |
| commons.escapeVariable('$fileId'); |
| } else { |
| url_ = '/upload/drive/v2/files/' + commons.escapeVariable('$fileId'); |
| } |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| uploadMedia: uploadMedia, |
| uploadOptions: uploadOptions, |
| ); |
| return File.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Subscribes to changes to a file. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file in question. |
| /// |
| /// [acknowledgeAbuse] - Whether the user is acknowledging the risk of |
| /// downloading known malware or other abusive files. This is only applicable |
| /// when the `alt` parameter is set to `media` and the user is the owner of |
| /// the file or an organizer of the shared drive in which the file resides. |
| /// |
| /// [includeLabels] - A comma-separated list of IDs of labels to include in |
| /// the `labelInfo` part of the response. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [projection] - Deprecated: This parameter has no function. |
| /// Possible string values are: |
| /// - "BASIC" : Deprecated. |
| /// - "FULL" : Deprecated. |
| /// |
| /// [revisionId] - Specifies the Revision ID that should be downloaded. |
| /// Ignored unless alt=media is specified. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [updateViewedDate] - Deprecated: Use files.update with |
| /// modifiedDateBehavior=noChange, updateViewedDate=true and an empty request |
| /// body. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Channel]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Channel> watch( |
| Channel request, |
| core.String fileId, { |
| core.bool? acknowledgeAbuse, |
| core.String? includeLabels, |
| core.String? includePermissionsForView, |
| core.String? projection, |
| core.String? revisionId, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? updateViewedDate, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'acknowledgeAbuse': ?acknowledgeAbuse == null |
| ? null |
| : ['${acknowledgeAbuse}'], |
| 'includeLabels': ?includeLabels == null ? null : [includeLabels], |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'projection': ?projection == null ? null : [projection], |
| 'revisionId': ?revisionId == null ? null : [revisionId], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'updateViewedDate': ?updateViewedDate == null |
| ? null |
| : ['${updateViewedDate}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/watch'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Channel.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class ParentsResource { |
| final commons.ApiRequester _requester; |
| |
| ParentsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Removes a parent from a file. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [parentId] - The ID of the parent. |
| /// |
| /// [enforceSingleParent] - Deprecated: If an item is not in a shared drive |
| /// and its last parent is removed, the item is placed under its owner's root. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String fileId, |
| core.String parentId, { |
| core.bool? enforceSingleParent, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/parents/' + |
| commons.escapeVariable('$parentId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a specific parent reference. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [parentId] - The ID of the parent. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ParentReference]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ParentReference> get( |
| core.String fileId, |
| core.String parentId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/parents/' + |
| commons.escapeVariable('$parentId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return ParentReference.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Adds a parent folder for a file. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [enforceSingleParent] - Deprecated: Adding files to multiple folders is no |
| /// longer supported. Use `shortcuts` instead. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ParentReference]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ParentReference> insert( |
| ParentReference request, |
| core.String fileId, { |
| core.bool? enforceSingleParent, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/parents'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return ParentReference.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Lists a file's parents. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [ParentList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<ParentList> list( |
| core.String fileId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/parents'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return ParentList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| } |
| |
| class PermissionsResource { |
| final commons.ApiRequester _requester; |
| |
| PermissionsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deletes a permission from a file or shared drive. |
| /// |
| /// **Warning:** Concurrent permissions operations on the same file are not |
| /// supported; only the last update is applied. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file or shared drive. |
| /// |
| /// [permissionId] - The ID for the permission. |
| /// |
| /// [enforceExpansiveAccess] - Deprecated: All requests use the expansive |
| /// access rules. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if the file ID |
| /// parameter refers to a shared drive and the requester is an administrator |
| /// of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String fileId, |
| core.String permissionId, { |
| core.bool? enforceExpansiveAccess, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceExpansiveAccess': ?enforceExpansiveAccess == null |
| ? null |
| : ['${enforceExpansiveAccess}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/permissions/' + |
| commons.escapeVariable('$permissionId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a permission by ID. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file or shared drive. |
| /// |
| /// [permissionId] - The ID for the permission. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if the file ID |
| /// parameter refers to a shared drive and the requester is an administrator |
| /// of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Permission]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Permission> get( |
| core.String fileId, |
| core.String permissionId, { |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/permissions/' + |
| commons.escapeVariable('$permissionId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return Permission.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Returns the permission ID for an email address. |
| /// |
| /// Request parameters: |
| /// |
| /// [email] - The email address for which to return a permission ID |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [PermissionId]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<PermissionId> getIdForEmail( |
| core.String email, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'permissionIds/' + commons.escapeVariable('$email'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return PermissionId.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Inserts a permission for a file or shared drive. |
| /// |
| /// **Warning:** Concurrent permissions operations on the same file are not |
| /// supported; only the last update is applied. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file or shared drive. |
| /// |
| /// [emailMessage] - A plain text custom message to include in notification |
| /// emails. |
| /// |
| /// [enforceExpansiveAccess] - Deprecated: All requests use the expansive |
| /// access rules. |
| /// |
| /// [enforceSingleParent] - Deprecated: See `moveToNewOwnersRoot` for details. |
| /// |
| /// [moveToNewOwnersRoot] - This parameter will only take effect if the item |
| /// is not in a shared drive and the request is attempting to transfer the |
| /// ownership of the item. If set to `true`, the item will be moved to the new |
| /// owner's My Drive root folder and all prior parents removed. If set to |
| /// `false`, parents are not changed. |
| /// |
| /// [sendNotificationEmails] - Whether to send notification emails when |
| /// sharing to users or groups. This parameter is ignored and an email is sent |
| /// if the `role` is `owner`. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if the file ID |
| /// parameter refers to a shared drive and the requester is an administrator |
| /// of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Permission]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Permission> insert( |
| Permission request, |
| core.String fileId, { |
| core.String? emailMessage, |
| core.bool? enforceExpansiveAccess, |
| core.bool? enforceSingleParent, |
| core.bool? moveToNewOwnersRoot, |
| core.bool? sendNotificationEmails, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'emailMessage': ?emailMessage == null ? null : [emailMessage], |
| 'enforceExpansiveAccess': ?enforceExpansiveAccess == null |
| ? null |
| : ['${enforceExpansiveAccess}'], |
| 'enforceSingleParent': ?enforceSingleParent == null |
| ? null |
| : ['${enforceSingleParent}'], |
| 'moveToNewOwnersRoot': ?moveToNewOwnersRoot == null |
| ? null |
| : ['${moveToNewOwnersRoot}'], |
| 'sendNotificationEmails': ?sendNotificationEmails == null |
| ? null |
| : ['${sendNotificationEmails}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/permissions'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Permission.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Lists a file's or shared drive's permissions. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file or shared drive. |
| /// |
| /// [includePermissionsForView] - Specifies which additional view's |
| /// permissions to include in the response. Only `published` is supported. |
| /// |
| /// [maxResults] - The maximum number of permissions to return per page. When |
| /// not set for files in a shared drive, at most 100 results will be returned. |
| /// When not set for files that are not in a shared drive, the entire list |
| /// will be returned. |
| /// Value must be between "1" and "100". |
| /// |
| /// [pageToken] - The token for continuing a previous list request on the next |
| /// page. This should be set to the value of `nextPageToken` from the previous |
| /// response. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if the file ID |
| /// parameter refers to a shared drive and the requester is an administrator |
| /// of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [PermissionList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<PermissionList> list( |
| core.String fileId, { |
| core.String? includePermissionsForView, |
| core.int? maxResults, |
| core.String? pageToken, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includePermissionsForView': ?includePermissionsForView == null |
| ? null |
| : [includePermissionsForView], |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/permissions'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return PermissionList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates a permission using patch semantics. |
| /// |
| /// **Warning:** Concurrent permissions operations on the same file are not |
| /// supported; only the last update is applied. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file or shared drive. |
| /// |
| /// [permissionId] - The ID for the permission. |
| /// |
| /// [enforceExpansiveAccess] - Deprecated: All requests use the expansive |
| /// access rules. |
| /// |
| /// [removeExpiration] - Whether to remove the expiration date. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [transferOwnership] - Whether changing a role to `owner` downgrades the |
| /// current owners to writers. Does nothing if the specified role is not |
| /// `owner`. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if the file ID |
| /// parameter refers to a shared drive and the requester is an administrator |
| /// of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Permission]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Permission> patch( |
| Permission request, |
| core.String fileId, |
| core.String permissionId, { |
| core.bool? enforceExpansiveAccess, |
| core.bool? removeExpiration, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? transferOwnership, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceExpansiveAccess': ?enforceExpansiveAccess == null |
| ? null |
| : ['${enforceExpansiveAccess}'], |
| 'removeExpiration': ?removeExpiration == null |
| ? null |
| : ['${removeExpiration}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'transferOwnership': ?transferOwnership == null |
| ? null |
| : ['${transferOwnership}'], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/permissions/' + |
| commons.escapeVariable('$permissionId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PATCH', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Permission.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates a permission. |
| /// |
| /// **Warning:** Concurrent permissions operations on the same file are not |
| /// supported; only the last update is applied. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file or shared drive. |
| /// |
| /// [permissionId] - The ID for the permission. |
| /// |
| /// [enforceExpansiveAccess] - Deprecated: All requests use the expansive |
| /// access rules. |
| /// |
| /// [removeExpiration] - Whether to remove the expiration date. |
| /// |
| /// [supportsAllDrives] - Whether the requesting application supports both My |
| /// Drives and shared drives. |
| /// |
| /// [supportsTeamDrives] - Deprecated: Use `supportsAllDrives` instead. |
| /// |
| /// [transferOwnership] - Whether changing a role to `owner` downgrades the |
| /// current owners to writers. Does nothing if the specified role is not |
| /// `owner`. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if the file ID |
| /// parameter refers to a shared drive and the requester is an administrator |
| /// of the domain to which the shared drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Permission]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Permission> update( |
| Permission request, |
| core.String fileId, |
| core.String permissionId, { |
| core.bool? enforceExpansiveAccess, |
| core.bool? removeExpiration, |
| core.bool? supportsAllDrives, |
| core.bool? supportsTeamDrives, |
| core.bool? transferOwnership, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'enforceExpansiveAccess': ?enforceExpansiveAccess == null |
| ? null |
| : ['${enforceExpansiveAccess}'], |
| 'removeExpiration': ?removeExpiration == null |
| ? null |
| : ['${removeExpiration}'], |
| 'supportsAllDrives': ?supportsAllDrives == null |
| ? null |
| : ['${supportsAllDrives}'], |
| 'supportsTeamDrives': ?supportsTeamDrives == null |
| ? null |
| : ['${supportsTeamDrives}'], |
| 'transferOwnership': ?transferOwnership == null |
| ? null |
| : ['${transferOwnership}'], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/permissions/' + |
| commons.escapeVariable('$permissionId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Permission.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| } |
| |
| class PropertiesResource { |
| final commons.ApiRequester _requester; |
| |
| PropertiesResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deletes a property. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [propertyKey] - The key of the property. |
| /// |
| /// [visibility] - The visibility of the property. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String fileId, |
| core.String propertyKey, { |
| core.String? visibility, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'visibility': ?visibility == null ? null : [visibility], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/properties/' + |
| commons.escapeVariable('$propertyKey'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a property by its key. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [propertyKey] - The key of the property. |
| /// |
| /// [visibility] - The visibility of the property. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Property]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Property> get( |
| core.String fileId, |
| core.String propertyKey, { |
| core.String? visibility, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'visibility': ?visibility == null ? null : [visibility], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/properties/' + |
| commons.escapeVariable('$propertyKey'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return Property.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Adds a property to a file, or updates it if it already exists. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Property]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Property> insert( |
| Property request, |
| core.String fileId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/properties'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Property.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists a file's properties. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [PropertyList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<PropertyList> list( |
| core.String fileId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/properties'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return PropertyList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates a property. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [propertyKey] - The key of the property. |
| /// |
| /// [visibility] - The visibility of the property. Allowed values are PRIVATE |
| /// and PUBLIC. (Default: PRIVATE) |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Property]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Property> patch( |
| Property request, |
| core.String fileId, |
| core.String propertyKey, { |
| core.String? visibility, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'visibility': ?visibility == null ? null : [visibility], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/properties/' + |
| commons.escapeVariable('$propertyKey'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PATCH', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Property.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates a property. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [propertyKey] - The key of the property. |
| /// |
| /// [visibility] - The visibility of the property. Allowed values are PRIVATE |
| /// and PUBLIC. (Default: PRIVATE) |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Property]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Property> update( |
| Property request, |
| core.String fileId, |
| core.String propertyKey, { |
| core.String? visibility, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'visibility': ?visibility == null ? null : [visibility], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/properties/' + |
| commons.escapeVariable('$propertyKey'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Property.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class RepliesResource { |
| final commons.ApiRequester _requester; |
| |
| RepliesResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deletes a reply. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [replyId] - The ID of the reply. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String fileId, |
| core.String commentId, |
| core.String replyId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId') + |
| '/replies/' + |
| commons.escapeVariable('$replyId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a reply. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [replyId] - The ID of the reply. |
| /// |
| /// [includeDeleted] - If set, this will succeed when retrieving a deleted |
| /// reply. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [CommentReply]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<CommentReply> get( |
| core.String fileId, |
| core.String commentId, |
| core.String replyId, { |
| core.bool? includeDeleted, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeDeleted': ?includeDeleted == null ? null : ['${includeDeleted}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId') + |
| '/replies/' + |
| commons.escapeVariable('$replyId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return CommentReply.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Creates a new reply to the given comment. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [CommentReply]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<CommentReply> insert( |
| CommentReply request, |
| core.String fileId, |
| core.String commentId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId') + |
| '/replies'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return CommentReply.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Lists all of the replies to a comment. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [includeDeleted] - If set, all replies, including deleted replies (with |
| /// content stripped) will be returned. |
| /// |
| /// [maxResults] - The maximum number of replies to include in the response, |
| /// used for paging. |
| /// Value must be between "0" and "100". |
| /// |
| /// [pageToken] - The continuation token, used to page through large result |
| /// sets. To get the next page of results, set this parameter to the value of |
| /// "nextPageToken" from the previous response. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [CommentReplyList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<CommentReplyList> list( |
| core.String fileId, |
| core.String commentId, { |
| core.bool? includeDeleted, |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'includeDeleted': ?includeDeleted == null ? null : ['${includeDeleted}'], |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId') + |
| '/replies'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return CommentReplyList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates an existing reply. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [replyId] - The ID of the reply. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [CommentReply]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<CommentReply> patch( |
| CommentReply request, |
| core.String fileId, |
| core.String commentId, |
| core.String replyId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId') + |
| '/replies/' + |
| commons.escapeVariable('$replyId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PATCH', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return CommentReply.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates an existing reply. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [commentId] - The ID of the comment. |
| /// |
| /// [replyId] - The ID of the reply. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [CommentReply]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<CommentReply> update( |
| CommentReply request, |
| core.String fileId, |
| core.String commentId, |
| core.String replyId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/comments/' + |
| commons.escapeVariable('$commentId') + |
| '/replies/' + |
| commons.escapeVariable('$replyId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return CommentReply.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| } |
| |
| class RevisionsResource { |
| final commons.ApiRequester _requester; |
| |
| RevisionsResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Permanently deletes a file version. |
| /// |
| /// You can only delete revisions for files with binary content, like images |
| /// or videos. Revisions for other files, like Google Docs or Sheets, and the |
| /// last remaining file version can't be deleted. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [revisionId] - The ID of the revision. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String fileId, |
| core.String revisionId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/revisions/' + |
| commons.escapeVariable('$revisionId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Gets a specific revision. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [revisionId] - The ID of the revision. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Revision]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Revision> get( |
| core.String fileId, |
| core.String revisionId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/revisions/' + |
| commons.escapeVariable('$revisionId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return Revision.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Lists a file's revisions. |
| /// |
| /// **Important:** The list of revisions returned by this method might be |
| /// incomplete for files with a large revision history, including frequently |
| /// edited Google Docs, Sheets, and Slides. Older revisions might be omitted |
| /// from the response, meaning the first revision returned may not be the |
| /// oldest existing revision. The revision history visible in the Workspace |
| /// editor user interface might be more complete than the list returned by the |
| /// API. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID of the file. |
| /// |
| /// [maxResults] - Maximum number of revisions to return. |
| /// Value must be between "1" and "1000". |
| /// |
| /// [pageToken] - Page token for revisions. To get the next page of results, |
| /// set this parameter to the value of "nextPageToken" from the previous |
| /// response. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [RevisionList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<RevisionList> list( |
| core.String fileId, { |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'files/' + commons.escapeVariable('$fileId') + '/revisions'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return RevisionList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Updates a revision. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file. |
| /// |
| /// [revisionId] - The ID for the revision. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Revision]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Revision> patch( |
| Revision request, |
| core.String fileId, |
| core.String revisionId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/revisions/' + |
| commons.escapeVariable('$revisionId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PATCH', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Revision.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Updates a revision. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [fileId] - The ID for the file. |
| /// |
| /// [revisionId] - The ID for the revision. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [Revision]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<Revision> update( |
| Revision request, |
| core.String fileId, |
| core.String revisionId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = |
| 'files/' + |
| commons.escapeVariable('$fileId') + |
| '/revisions/' + |
| commons.escapeVariable('$revisionId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return Revision.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class TeamdrivesResource { |
| final commons.ApiRequester _requester; |
| |
| TeamdrivesResource(commons.ApiRequester client) : _requester = client; |
| |
| /// Deprecated: Use `drives.delete` instead. |
| /// |
| /// Request parameters: |
| /// |
| /// [teamDriveId] - The ID of the Team Drive |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<void> delete( |
| core.String teamDriveId, { |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'teamdrives/' + commons.escapeVariable('$teamDriveId'); |
| |
| await _requester.request( |
| url_, |
| 'DELETE', |
| queryParams: queryParams_, |
| downloadOptions: null, |
| ); |
| } |
| |
| /// Deprecated: Use `drives.get` instead. |
| /// |
| /// Request parameters: |
| /// |
| /// [teamDriveId] - The ID of the Team Drive |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if they are an |
| /// administrator of the domain to which the Team Drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [TeamDrive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<TeamDrive> get( |
| core.String teamDriveId, { |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'teamdrives/' + commons.escapeVariable('$teamDriveId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return TeamDrive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deprecated: Use `drives.insert` instead. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [requestId] - Required. An ID, such as a random UUID, which uniquely |
| /// identifies this user's request for idempotent creation of a Team Drive. A |
| /// repeated request by the same user and with the same request ID will avoid |
| /// creating duplicates by attempting to create the same Team Drive. If the |
| /// Team Drive already exists a 409 error will be returned. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [TeamDrive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<TeamDrive> insert( |
| TeamDrive request, |
| core.String requestId, { |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'requestId': [requestId], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'teamdrives'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'POST', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return TeamDrive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| |
| /// Deprecated: Use `drives.list` instead. |
| /// |
| /// Request parameters: |
| /// |
| /// [maxResults] - Maximum number of Team Drives to return. |
| /// Value must be between "1" and "100". |
| /// |
| /// [pageToken] - Page token for Team Drives. |
| /// |
| /// [q] - Query string for searching Team Drives. |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then all Team Drives of the domain in which the requester is |
| /// an administrator are returned. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [TeamDriveList]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<TeamDriveList> list({ |
| core.int? maxResults, |
| core.String? pageToken, |
| core.String? q, |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'maxResults': ?maxResults == null ? null : ['${maxResults}'], |
| 'pageToken': ?pageToken == null ? null : [pageToken], |
| 'q': ?q == null ? null : [q], |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| const url_ = 'teamdrives'; |
| |
| final response_ = await _requester.request( |
| url_, |
| 'GET', |
| queryParams: queryParams_, |
| ); |
| return TeamDriveList.fromJson( |
| response_ as core.Map<core.String, core.dynamic>, |
| ); |
| } |
| |
| /// Deprecated: Use `drives.update` instead. |
| /// |
| /// [request] - The metadata request object. |
| /// |
| /// Request parameters: |
| /// |
| /// [teamDriveId] - The ID of the Team Drive |
| /// |
| /// [useDomainAdminAccess] - Issue the request as a domain administrator; if |
| /// set to true, then the requester will be granted access if they are an |
| /// administrator of the domain to which the Team Drive belongs. |
| /// |
| /// [$fields] - Selector specifying which fields to include in a partial |
| /// response. |
| /// |
| /// Completes with a [TeamDrive]. |
| /// |
| /// Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| /// error. |
| /// |
| /// If the used [http.Client] completes with an error when making a REST call, |
| /// this method will complete with the same error. |
| async.Future<TeamDrive> update( |
| TeamDrive request, |
| core.String teamDriveId, { |
| core.bool? useDomainAdminAccess, |
| core.String? $fields, |
| }) async { |
| final body_ = convert_1.json.encode(request); |
| final queryParams_ = <core.String, core.List<core.String>>{ |
| 'useDomainAdminAccess': ?useDomainAdminAccess == null |
| ? null |
| : ['${useDomainAdminAccess}'], |
| 'fields': ?$fields == null ? null : [$fields], |
| }; |
| |
| final url_ = 'teamdrives/' + commons.escapeVariable('$teamDriveId'); |
| |
| final response_ = await _requester.request( |
| url_, |
| 'PUT', |
| body: body_, |
| queryParams: queryParams_, |
| ); |
| return TeamDrive.fromJson(response_ as core.Map<core.String, core.dynamic>); |
| } |
| } |
| |
| class AboutAdditionalRoleInfoRoleSets { |
| /// The supported additional roles with the primary role. |
| core.List<core.String>? additionalRoles; |
| |
| /// A primary permission role. |
| core.String? primaryRole; |
| |
| AboutAdditionalRoleInfoRoleSets({this.additionalRoles, this.primaryRole}); |
| |
| AboutAdditionalRoleInfoRoleSets.fromJson(core.Map json_) |
| : this( |
| additionalRoles: (json_['additionalRoles'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| primaryRole: json_['primaryRole'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final additionalRoles = this.additionalRoles; |
| final primaryRole = this.primaryRole; |
| return {'additionalRoles': ?additionalRoles, 'primaryRole': ?primaryRole}; |
| } |
| } |
| |
| class AboutAdditionalRoleInfo { |
| /// The supported additional roles per primary role. |
| core.List<AboutAdditionalRoleInfoRoleSets>? roleSets; |
| |
| /// The content type that this additional role info applies to. |
| core.String? type; |
| |
| AboutAdditionalRoleInfo({this.roleSets, this.type}); |
| |
| AboutAdditionalRoleInfo.fromJson(core.Map json_) |
| : this( |
| roleSets: (json_['roleSets'] as core.List?) |
| ?.map( |
| (value) => AboutAdditionalRoleInfoRoleSets.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| type: json_['type'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final roleSets = this.roleSets; |
| final type = this.type; |
| return {'roleSets': ?roleSets, 'type': ?type}; |
| } |
| } |
| |
| class AboutDriveThemes { |
| /// A link to this theme's background image. |
| core.String? backgroundImageLink; |
| |
| /// The color of this theme as an RGB hex string. |
| core.String? colorRgb; |
| |
| /// The ID of the theme. |
| core.String? id; |
| |
| AboutDriveThemes({this.backgroundImageLink, this.colorRgb, this.id}); |
| |
| AboutDriveThemes.fromJson(core.Map json_) |
| : this( |
| backgroundImageLink: json_['backgroundImageLink'] as core.String?, |
| colorRgb: json_['colorRgb'] as core.String?, |
| id: json_['id'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final backgroundImageLink = this.backgroundImageLink; |
| final colorRgb = this.colorRgb; |
| final id = this.id; |
| return { |
| 'backgroundImageLink': ?backgroundImageLink, |
| 'colorRgb': ?colorRgb, |
| 'id': ?id, |
| }; |
| } |
| } |
| |
| class AboutExportFormats { |
| /// The content type to convert from. |
| core.String? source; |
| |
| /// The possible content types to convert to. |
| core.List<core.String>? targets; |
| |
| AboutExportFormats({this.source, this.targets}); |
| |
| AboutExportFormats.fromJson(core.Map json_) |
| : this( |
| source: json_['source'] as core.String?, |
| targets: (json_['targets'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final source = this.source; |
| final targets = this.targets; |
| return {'source': ?source, 'targets': ?targets}; |
| } |
| } |
| |
| class AboutFeatures { |
| /// The name of the feature. |
| core.String? featureName; |
| |
| /// The request limit rate for this feature, in queries per second. |
| core.double? featureRate; |
| |
| AboutFeatures({this.featureName, this.featureRate}); |
| |
| AboutFeatures.fromJson(core.Map json_) |
| : this( |
| featureName: json_['featureName'] as core.String?, |
| featureRate: (json_['featureRate'] as core.num?)?.toDouble(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final featureName = this.featureName; |
| final featureRate = this.featureRate; |
| return {'featureName': ?featureName, 'featureRate': ?featureRate}; |
| } |
| } |
| |
| class AboutImportFormats { |
| /// The imported file's content type to convert from. |
| core.String? source; |
| |
| /// The possible content types to convert to. |
| core.List<core.String>? targets; |
| |
| AboutImportFormats({this.source, this.targets}); |
| |
| AboutImportFormats.fromJson(core.Map json_) |
| : this( |
| source: json_['source'] as core.String?, |
| targets: (json_['targets'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final source = this.source; |
| final targets = this.targets; |
| return {'source': ?source, 'targets': ?targets}; |
| } |
| } |
| |
| class AboutMaxUploadSizes { |
| /// The max upload size for this type. |
| core.String? size; |
| |
| /// The file type. |
| core.String? type; |
| |
| AboutMaxUploadSizes({this.size, this.type}); |
| |
| AboutMaxUploadSizes.fromJson(core.Map json_) |
| : this( |
| size: json_['size'] as core.String?, |
| type: json_['type'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final size = this.size; |
| final type = this.type; |
| return {'size': ?size, 'type': ?type}; |
| } |
| } |
| |
| class AboutQuotaBytesByService { |
| /// The storage quota bytes used by the service. |
| core.String? bytesUsed; |
| |
| /// The service's name, e.g. DRIVE, GMAIL, or PHOTOS. |
| core.String? serviceName; |
| |
| AboutQuotaBytesByService({this.bytesUsed, this.serviceName}); |
| |
| AboutQuotaBytesByService.fromJson(core.Map json_) |
| : this( |
| bytesUsed: json_['bytesUsed'] as core.String?, |
| serviceName: json_['serviceName'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final bytesUsed = this.bytesUsed; |
| final serviceName = this.serviceName; |
| return {'bytesUsed': ?bytesUsed, 'serviceName': ?serviceName}; |
| } |
| } |
| |
| class AboutTeamDriveThemes { |
| /// Deprecated: Use `driveThemes/backgroundImageLink` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? backgroundImageLink; |
| |
| /// Deprecated: Use `driveThemes/colorRgb` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? colorRgb; |
| |
| /// Deprecated: Use `driveThemes/id` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? id; |
| |
| AboutTeamDriveThemes({this.backgroundImageLink, this.colorRgb, this.id}); |
| |
| AboutTeamDriveThemes.fromJson(core.Map json_) |
| : this( |
| backgroundImageLink: json_['backgroundImageLink'] as core.String?, |
| colorRgb: json_['colorRgb'] as core.String?, |
| id: json_['id'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final backgroundImageLink = this.backgroundImageLink; |
| final colorRgb = this.colorRgb; |
| final id = this.id; |
| return { |
| 'backgroundImageLink': ?backgroundImageLink, |
| 'colorRgb': ?colorRgb, |
| 'id': ?id, |
| }; |
| } |
| } |
| |
| /// An item with user information and settings. |
| class About { |
| /// Information about supported additional roles per file type. |
| /// |
| /// The most specific type takes precedence. |
| core.List<AboutAdditionalRoleInfo>? additionalRoleInfo; |
| |
| /// Whether the user can create shared drives. |
| core.bool? canCreateDrives; |
| |
| /// Deprecated: Use `canCreateDrives` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canCreateTeamDrives; |
| |
| /// Deprecated: Does not granularly represent allowlisted domains or Trust |
| /// Rules. |
| /// |
| /// The domain sharing policy for the current user. Possible values are: * |
| /// `allowed` * `allowedWithWarning` * `incomingOnly` * `disallowed` Note that |
| /// if the user is enrolled in Trust Rules, `disallowed` will always be |
| /// returned. If sharing is restricted to allowlisted domains, either |
| /// `incomingOnly` or `allowedWithWarning` will be returned, depending on |
| /// whether receiving files from outside the allowlisted domains is permitted. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? domainSharingPolicy; |
| |
| /// A list of themes that are supported for shared drives. |
| core.List<AboutDriveThemes>? driveThemes; |
| |
| /// The ETag of the item. |
| core.String? etag; |
| |
| /// The allowable export formats. |
| core.List<AboutExportFormats>? exportFormats; |
| |
| /// List of additional features enabled on this account. |
| core.List<AboutFeatures>? features; |
| |
| /// The palette of allowable folder colors as RGB hex strings. |
| core.List<core.String>? folderColorPalette; |
| |
| /// The allowable import formats. |
| core.List<AboutImportFormats>? importFormats; |
| |
| /// A boolean indicating whether the authenticated app is installed by the |
| /// authenticated user. |
| core.bool? isCurrentAppInstalled; |
| |
| /// This is always `drive#about`. |
| core.String? kind; |
| |
| /// The user's language or locale code, as defined by BCP 47, with some |
| /// extensions from Unicode's LDML format |
| /// (http://www.unicode.org/reports/tr35/). |
| core.String? languageCode; |
| |
| /// The largest change id. |
| core.String? largestChangeId; |
| |
| /// List of max upload sizes for each file type. |
| /// |
| /// The most specific type takes precedence. |
| core.List<AboutMaxUploadSizes>? maxUploadSizes; |
| |
| /// The name of the current user. |
| core.String? name; |
| |
| /// The current user's ID as visible in the permissions collection. |
| core.String? permissionId; |
| |
| /// The amount of storage quota used by different Google services. |
| core.List<AboutQuotaBytesByService>? quotaBytesByService; |
| |
| /// The total number of quota bytes. |
| /// |
| /// This is only relevant when quotaType is LIMITED. |
| core.String? quotaBytesTotal; |
| |
| /// The number of quota bytes used by Google Drive. |
| core.String? quotaBytesUsed; |
| |
| /// The number of quota bytes used by all Google apps (Drive, Picasa, etc.). |
| core.String? quotaBytesUsedAggregate; |
| |
| /// The number of quota bytes used by trashed items. |
| core.String? quotaBytesUsedInTrash; |
| |
| /// The type of the user's storage quota. |
| /// |
| /// Possible values are: * `LIMITED` * `UNLIMITED` |
| core.String? quotaType; |
| |
| /// The number of remaining change ids, limited to no more than 2500. |
| core.String? remainingChangeIds; |
| |
| /// The id of the root folder. |
| core.String? rootFolderId; |
| |
| /// A link back to this item. |
| core.String? selfLink; |
| |
| /// Deprecated: Use `driveThemes` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.List<AboutTeamDriveThemes>? teamDriveThemes; |
| |
| /// The authenticated user. |
| User? user; |
| |
| About({ |
| this.additionalRoleInfo, |
| this.canCreateDrives, |
| this.canCreateTeamDrives, |
| this.domainSharingPolicy, |
| this.driveThemes, |
| this.etag, |
| this.exportFormats, |
| this.features, |
| this.folderColorPalette, |
| this.importFormats, |
| this.isCurrentAppInstalled, |
| this.kind, |
| this.languageCode, |
| this.largestChangeId, |
| this.maxUploadSizes, |
| this.name, |
| this.permissionId, |
| this.quotaBytesByService, |
| this.quotaBytesTotal, |
| this.quotaBytesUsed, |
| this.quotaBytesUsedAggregate, |
| this.quotaBytesUsedInTrash, |
| this.quotaType, |
| this.remainingChangeIds, |
| this.rootFolderId, |
| this.selfLink, |
| this.teamDriveThemes, |
| this.user, |
| }); |
| |
| About.fromJson(core.Map json_) |
| : this( |
| additionalRoleInfo: (json_['additionalRoleInfo'] as core.List?) |
| ?.map( |
| (value) => AboutAdditionalRoleInfo.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| canCreateDrives: json_['canCreateDrives'] as core.bool?, |
| canCreateTeamDrives: json_['canCreateTeamDrives'] as core.bool?, |
| domainSharingPolicy: json_['domainSharingPolicy'] as core.String?, |
| driveThemes: (json_['driveThemes'] as core.List?) |
| ?.map( |
| (value) => AboutDriveThemes.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| etag: json_['etag'] as core.String?, |
| exportFormats: (json_['exportFormats'] as core.List?) |
| ?.map( |
| (value) => AboutExportFormats.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| features: (json_['features'] as core.List?) |
| ?.map( |
| (value) => AboutFeatures.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| folderColorPalette: (json_['folderColorPalette'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| importFormats: (json_['importFormats'] as core.List?) |
| ?.map( |
| (value) => AboutImportFormats.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| isCurrentAppInstalled: json_['isCurrentAppInstalled'] as core.bool?, |
| kind: json_['kind'] as core.String?, |
| languageCode: json_['languageCode'] as core.String?, |
| largestChangeId: json_['largestChangeId'] as core.String?, |
| maxUploadSizes: (json_['maxUploadSizes'] as core.List?) |
| ?.map( |
| (value) => AboutMaxUploadSizes.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| name: json_['name'] as core.String?, |
| permissionId: json_['permissionId'] as core.String?, |
| quotaBytesByService: (json_['quotaBytesByService'] as core.List?) |
| ?.map( |
| (value) => AboutQuotaBytesByService.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| quotaBytesTotal: json_['quotaBytesTotal'] as core.String?, |
| quotaBytesUsed: json_['quotaBytesUsed'] as core.String?, |
| quotaBytesUsedAggregate: |
| json_['quotaBytesUsedAggregate'] as core.String?, |
| quotaBytesUsedInTrash: json_['quotaBytesUsedInTrash'] as core.String?, |
| quotaType: json_['quotaType'] as core.String?, |
| remainingChangeIds: json_['remainingChangeIds'] as core.String?, |
| rootFolderId: json_['rootFolderId'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| teamDriveThemes: (json_['teamDriveThemes'] as core.List?) |
| ?.map( |
| (value) => AboutTeamDriveThemes.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| user: json_.containsKey('user') |
| ? User.fromJson( |
| json_['user'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final additionalRoleInfo = this.additionalRoleInfo; |
| final canCreateDrives = this.canCreateDrives; |
| final canCreateTeamDrives = this.canCreateTeamDrives; |
| final domainSharingPolicy = this.domainSharingPolicy; |
| final driveThemes = this.driveThemes; |
| final etag = this.etag; |
| final exportFormats = this.exportFormats; |
| final features = this.features; |
| final folderColorPalette = this.folderColorPalette; |
| final importFormats = this.importFormats; |
| final isCurrentAppInstalled = this.isCurrentAppInstalled; |
| final kind = this.kind; |
| final languageCode = this.languageCode; |
| final largestChangeId = this.largestChangeId; |
| final maxUploadSizes = this.maxUploadSizes; |
| final name = this.name; |
| final permissionId = this.permissionId; |
| final quotaBytesByService = this.quotaBytesByService; |
| final quotaBytesTotal = this.quotaBytesTotal; |
| final quotaBytesUsed = this.quotaBytesUsed; |
| final quotaBytesUsedAggregate = this.quotaBytesUsedAggregate; |
| final quotaBytesUsedInTrash = this.quotaBytesUsedInTrash; |
| final quotaType = this.quotaType; |
| final remainingChangeIds = this.remainingChangeIds; |
| final rootFolderId = this.rootFolderId; |
| final selfLink = this.selfLink; |
| final teamDriveThemes = this.teamDriveThemes; |
| final user = this.user; |
| return { |
| 'additionalRoleInfo': ?additionalRoleInfo, |
| 'canCreateDrives': ?canCreateDrives, |
| 'canCreateTeamDrives': ?canCreateTeamDrives, |
| 'domainSharingPolicy': ?domainSharingPolicy, |
| 'driveThemes': ?driveThemes, |
| 'etag': ?etag, |
| 'exportFormats': ?exportFormats, |
| 'features': ?features, |
| 'folderColorPalette': ?folderColorPalette, |
| 'importFormats': ?importFormats, |
| 'isCurrentAppInstalled': ?isCurrentAppInstalled, |
| 'kind': ?kind, |
| 'languageCode': ?languageCode, |
| 'largestChangeId': ?largestChangeId, |
| 'maxUploadSizes': ?maxUploadSizes, |
| 'name': ?name, |
| 'permissionId': ?permissionId, |
| 'quotaBytesByService': ?quotaBytesByService, |
| 'quotaBytesTotal': ?quotaBytesTotal, |
| 'quotaBytesUsed': ?quotaBytesUsed, |
| 'quotaBytesUsedAggregate': ?quotaBytesUsedAggregate, |
| 'quotaBytesUsedInTrash': ?quotaBytesUsedInTrash, |
| 'quotaType': ?quotaType, |
| 'remainingChangeIds': ?remainingChangeIds, |
| 'rootFolderId': ?rootFolderId, |
| 'selfLink': ?selfLink, |
| 'teamDriveThemes': ?teamDriveThemes, |
| 'user': ?user, |
| }; |
| } |
| } |
| |
| class AppIcons { |
| /// Category of the icon. |
| /// |
| /// Allowed values are: * `application` - icon for the application * |
| /// `document` - icon for a file associated with the app * `documentShared` - |
| /// icon for a shared file associated with the app |
| core.String? category; |
| |
| /// URL for the icon. |
| core.String? iconUrl; |
| |
| /// Size of the icon. |
| /// |
| /// Represented as the maximum of the width and height. |
| core.int? size; |
| |
| AppIcons({this.category, this.iconUrl, this.size}); |
| |
| AppIcons.fromJson(core.Map json_) |
| : this( |
| category: json_['category'] as core.String?, |
| iconUrl: json_['iconUrl'] as core.String?, |
| size: json_['size'] as core.int?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final category = this.category; |
| final iconUrl = this.iconUrl; |
| final size = this.size; |
| return {'category': ?category, 'iconUrl': ?iconUrl, 'size': ?size}; |
| } |
| } |
| |
| /// The apps resource provides a list of the apps that a user has installed, |
| /// with information about each app's supported MIME types, file extensions, and |
| /// other details. |
| /// |
| /// Some resource methods (such as `apps.get`) require an `appId`. Use the |
| /// `apps.list` method to retrieve the ID for an installed application. |
| class App { |
| /// Whether the app is authorized to access data on the user's Drive. |
| core.bool? authorized; |
| |
| /// The template url to create a new file with this app in a given folder. |
| /// |
| /// The template will contain {folderId} to be replaced by the folder to |
| /// create the new file in. |
| core.String? createInFolderTemplate; |
| |
| /// The url to create a new file with this app. |
| core.String? createUrl; |
| |
| /// Whether the app has drive-wide scope. |
| /// |
| /// An app with drive-wide scope can access all files in the user's drive. |
| core.bool? hasDriveWideScope; |
| |
| /// The various icons for the app. |
| core.List<AppIcons>? icons; |
| |
| /// The ID of the app. |
| core.String? id; |
| |
| /// Whether the app is installed. |
| core.bool? installed; |
| |
| /// This is always `drive#app`. |
| core.String? kind; |
| |
| /// A long description of the app. |
| core.String? longDescription; |
| |
| /// The name of the app. |
| core.String? name; |
| |
| /// The type of object this app creates (e.g. Chart). |
| /// |
| /// If empty, the app name should be used instead. |
| core.String? objectType; |
| |
| /// The template url for opening files with this app. |
| /// |
| /// The template will contain `{ids}` and/or `{exportIds}` to be replaced by |
| /// the actual file ids. See Open Files for the full documentation. |
| core.String? openUrlTemplate; |
| |
| /// The list of primary file extensions. |
| core.List<core.String>? primaryFileExtensions; |
| |
| /// The list of primary mime types. |
| core.List<core.String>? primaryMimeTypes; |
| |
| /// The ID of the product listing for this app. |
| core.String? productId; |
| |
| /// A link to the product listing for this app. |
| core.String? productUrl; |
| |
| /// The list of secondary file extensions. |
| core.List<core.String>? secondaryFileExtensions; |
| |
| /// The list of secondary mime types. |
| core.List<core.String>? secondaryMimeTypes; |
| |
| /// A short description of the app. |
| core.String? shortDescription; |
| |
| /// Whether this app supports creating new objects. |
| core.bool? supportsCreate; |
| |
| /// Whether this app supports importing from Docs Editors. |
| core.bool? supportsImport; |
| |
| /// Whether this app supports opening more than one file. |
| core.bool? supportsMultiOpen; |
| |
| /// Whether this app supports creating new files when offline. |
| core.bool? supportsOfflineCreate; |
| |
| /// Whether the app is selected as the default handler for the types it |
| /// supports. |
| core.bool? useByDefault; |
| |
| App({ |
| this.authorized, |
| this.createInFolderTemplate, |
| this.createUrl, |
| this.hasDriveWideScope, |
| this.icons, |
| this.id, |
| this.installed, |
| this.kind, |
| this.longDescription, |
| this.name, |
| this.objectType, |
| this.openUrlTemplate, |
| this.primaryFileExtensions, |
| this.primaryMimeTypes, |
| this.productId, |
| this.productUrl, |
| this.secondaryFileExtensions, |
| this.secondaryMimeTypes, |
| this.shortDescription, |
| this.supportsCreate, |
| this.supportsImport, |
| this.supportsMultiOpen, |
| this.supportsOfflineCreate, |
| this.useByDefault, |
| }); |
| |
| App.fromJson(core.Map json_) |
| : this( |
| authorized: json_['authorized'] as core.bool?, |
| createInFolderTemplate: json_['createInFolderTemplate'] as core.String?, |
| createUrl: json_['createUrl'] as core.String?, |
| hasDriveWideScope: json_['hasDriveWideScope'] as core.bool?, |
| icons: (json_['icons'] as core.List?) |
| ?.map( |
| (value) => AppIcons.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| id: json_['id'] as core.String?, |
| installed: json_['installed'] as core.bool?, |
| kind: json_['kind'] as core.String?, |
| longDescription: json_['longDescription'] as core.String?, |
| name: json_['name'] as core.String?, |
| objectType: json_['objectType'] as core.String?, |
| openUrlTemplate: json_['openUrlTemplate'] as core.String?, |
| primaryFileExtensions: (json_['primaryFileExtensions'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| primaryMimeTypes: (json_['primaryMimeTypes'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| productId: json_['productId'] as core.String?, |
| productUrl: json_['productUrl'] as core.String?, |
| secondaryFileExtensions: |
| (json_['secondaryFileExtensions'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| secondaryMimeTypes: (json_['secondaryMimeTypes'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| shortDescription: json_['shortDescription'] as core.String?, |
| supportsCreate: json_['supportsCreate'] as core.bool?, |
| supportsImport: json_['supportsImport'] as core.bool?, |
| supportsMultiOpen: json_['supportsMultiOpen'] as core.bool?, |
| supportsOfflineCreate: json_['supportsOfflineCreate'] as core.bool?, |
| useByDefault: json_['useByDefault'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final authorized = this.authorized; |
| final createInFolderTemplate = this.createInFolderTemplate; |
| final createUrl = this.createUrl; |
| final hasDriveWideScope = this.hasDriveWideScope; |
| final icons = this.icons; |
| final id = this.id; |
| final installed = this.installed; |
| final kind = this.kind; |
| final longDescription = this.longDescription; |
| final name = this.name; |
| final objectType = this.objectType; |
| final openUrlTemplate = this.openUrlTemplate; |
| final primaryFileExtensions = this.primaryFileExtensions; |
| final primaryMimeTypes = this.primaryMimeTypes; |
| final productId = this.productId; |
| final productUrl = this.productUrl; |
| final secondaryFileExtensions = this.secondaryFileExtensions; |
| final secondaryMimeTypes = this.secondaryMimeTypes; |
| final shortDescription = this.shortDescription; |
| final supportsCreate = this.supportsCreate; |
| final supportsImport = this.supportsImport; |
| final supportsMultiOpen = this.supportsMultiOpen; |
| final supportsOfflineCreate = this.supportsOfflineCreate; |
| final useByDefault = this.useByDefault; |
| return { |
| 'authorized': ?authorized, |
| 'createInFolderTemplate': ?createInFolderTemplate, |
| 'createUrl': ?createUrl, |
| 'hasDriveWideScope': ?hasDriveWideScope, |
| 'icons': ?icons, |
| 'id': ?id, |
| 'installed': ?installed, |
| 'kind': ?kind, |
| 'longDescription': ?longDescription, |
| 'name': ?name, |
| 'objectType': ?objectType, |
| 'openUrlTemplate': ?openUrlTemplate, |
| 'primaryFileExtensions': ?primaryFileExtensions, |
| 'primaryMimeTypes': ?primaryMimeTypes, |
| 'productId': ?productId, |
| 'productUrl': ?productUrl, |
| 'secondaryFileExtensions': ?secondaryFileExtensions, |
| 'secondaryMimeTypes': ?secondaryMimeTypes, |
| 'shortDescription': ?shortDescription, |
| 'supportsCreate': ?supportsCreate, |
| 'supportsImport': ?supportsImport, |
| 'supportsMultiOpen': ?supportsMultiOpen, |
| 'supportsOfflineCreate': ?supportsOfflineCreate, |
| 'useByDefault': ?useByDefault, |
| }; |
| } |
| } |
| |
| /// A list of third-party applications which the user has installed or given |
| /// access to Google Drive. |
| class AppList { |
| /// List of app IDs that the user has specified to use by default. |
| /// |
| /// The list is in reverse-priority order (lowest to highest). |
| core.List<core.String>? defaultAppIds; |
| |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// The list of apps. |
| core.List<App>? items; |
| |
| /// This is always `drive#appList`. |
| core.String? kind; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| AppList({ |
| this.defaultAppIds, |
| this.etag, |
| this.items, |
| this.kind, |
| this.selfLink, |
| }); |
| |
| AppList.fromJson(core.Map json_) |
| : this( |
| defaultAppIds: (json_['defaultAppIds'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| etag: json_['etag'] as core.String?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => |
| App.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final defaultAppIds = this.defaultAppIds; |
| final etag = this.etag; |
| final items = this.items; |
| final kind = this.kind; |
| final selfLink = this.selfLink; |
| return { |
| 'defaultAppIds': ?defaultAppIds, |
| 'etag': ?etag, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// Representation of a change to a file or shared drive. |
| class Change { |
| /// The type of the change. |
| /// |
| /// Possible values are `file` and `drive`. |
| core.String? changeType; |
| |
| /// Whether the file or shared drive has been removed from this list of |
| /// changes, for example by deletion or loss of access. |
| core.bool? deleted; |
| |
| /// The updated state of the shared drive. |
| /// |
| /// Present if the changeType is drive, the user is still a member of the |
| /// shared drive, and the shared drive has not been deleted. |
| Drive? drive; |
| |
| /// The ID of the shared drive associated with this change. |
| core.String? driveId; |
| |
| /// The updated state of the file. |
| /// |
| /// Present if the type is file and the file has not been removed from this |
| /// list of changes. |
| File? file; |
| |
| /// The ID of the file associated with this change. |
| core.String? fileId; |
| |
| /// The ID of the change. |
| core.String? id; |
| |
| /// This is always `drive#change`. |
| core.String? kind; |
| |
| /// The time of this modification. |
| core.DateTime? modificationDate; |
| |
| /// A link back to this change. |
| core.String? selfLink; |
| |
| /// Deprecated: Use `drive` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| TeamDrive? teamDrive; |
| |
| /// Deprecated: Use `driveId` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? teamDriveId; |
| |
| /// Deprecated: Use `changeType` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? type; |
| |
| Change({ |
| this.changeType, |
| this.deleted, |
| this.drive, |
| this.driveId, |
| this.file, |
| this.fileId, |
| this.id, |
| this.kind, |
| this.modificationDate, |
| this.selfLink, |
| this.teamDrive, |
| this.teamDriveId, |
| this.type, |
| }); |
| |
| Change.fromJson(core.Map json_) |
| : this( |
| changeType: json_['changeType'] as core.String?, |
| deleted: json_['deleted'] as core.bool?, |
| drive: json_.containsKey('drive') |
| ? Drive.fromJson( |
| json_['drive'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| driveId: json_['driveId'] as core.String?, |
| file: json_.containsKey('file') |
| ? File.fromJson( |
| json_['file'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| fileId: json_['fileId'] as core.String?, |
| id: json_['id'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| modificationDate: json_.containsKey('modificationDate') |
| ? core.DateTime.parse(json_['modificationDate'] as core.String) |
| : null, |
| selfLink: json_['selfLink'] as core.String?, |
| teamDrive: json_.containsKey('teamDrive') |
| ? TeamDrive.fromJson( |
| json_['teamDrive'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| teamDriveId: json_['teamDriveId'] as core.String?, |
| type: json_['type'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final changeType = this.changeType; |
| final deleted = this.deleted; |
| final drive = this.drive; |
| final driveId = this.driveId; |
| final file = this.file; |
| final fileId = this.fileId; |
| final id = this.id; |
| final kind = this.kind; |
| final modificationDate = this.modificationDate; |
| final selfLink = this.selfLink; |
| final teamDrive = this.teamDrive; |
| final teamDriveId = this.teamDriveId; |
| final type = this.type; |
| return { |
| 'changeType': ?changeType, |
| 'deleted': ?deleted, |
| 'drive': ?drive, |
| 'driveId': ?driveId, |
| 'file': ?file, |
| 'fileId': ?fileId, |
| 'id': ?id, |
| 'kind': ?kind, |
| 'modificationDate': ?modificationDate?.toUtc().toIso8601String(), |
| 'selfLink': ?selfLink, |
| 'teamDrive': ?teamDrive, |
| 'teamDriveId': ?teamDriveId, |
| 'type': ?type, |
| }; |
| } |
| } |
| |
| /// A list of changes for a user. |
| class ChangeList { |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// The list of changes. |
| /// |
| /// If nextPageToken is populated, then this list may be incomplete and an |
| /// additional page of results should be fetched. |
| core.List<Change>? items; |
| |
| /// This is always `drive#changeList`. |
| core.String? kind; |
| |
| /// The current largest change ID. |
| core.String? largestChangeId; |
| |
| /// The starting page token for future changes. |
| /// |
| /// This will be present only if the end of the current changes list has been |
| /// reached. |
| core.String? newStartPageToken; |
| |
| /// A link to the next page of changes. |
| core.String? nextLink; |
| |
| /// The page token for the next page of changes. |
| /// |
| /// This will be absent if the end of the changes list has been reached. If |
| /// the token is rejected for any reason, it should be discarded, and |
| /// pagination should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| ChangeList({ |
| this.etag, |
| this.items, |
| this.kind, |
| this.largestChangeId, |
| this.newStartPageToken, |
| this.nextLink, |
| this.nextPageToken, |
| this.selfLink, |
| }); |
| |
| ChangeList.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => |
| Change.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| largestChangeId: json_['largestChangeId'] as core.String?, |
| newStartPageToken: json_['newStartPageToken'] as core.String?, |
| nextLink: json_['nextLink'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final items = this.items; |
| final kind = this.kind; |
| final largestChangeId = this.largestChangeId; |
| final newStartPageToken = this.newStartPageToken; |
| final nextLink = this.nextLink; |
| final nextPageToken = this.nextPageToken; |
| final selfLink = this.selfLink; |
| return { |
| 'etag': ?etag, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'largestChangeId': ?largestChangeId, |
| 'newStartPageToken': ?newStartPageToken, |
| 'nextLink': ?nextLink, |
| 'nextPageToken': ?nextPageToken, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A notification channel used to watch for resource changes. |
| typedef Channel = $Channel01; |
| |
| /// A list of children of a file. |
| class ChildList { |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// The list of children. |
| /// |
| /// If nextPageToken is populated, then this list may be incomplete and an |
| /// additional page of results should be fetched. |
| core.List<ChildReference>? items; |
| |
| /// This is always `drive#childList`. |
| core.String? kind; |
| |
| /// A link to the next page of children. |
| core.String? nextLink; |
| |
| /// The page token for the next page of children. |
| /// |
| /// This will be absent if the end of the children list has been reached. If |
| /// the token is rejected for any reason, it should be discarded, and |
| /// pagination should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| ChildList({ |
| this.etag, |
| this.items, |
| this.kind, |
| this.nextLink, |
| this.nextPageToken, |
| this.selfLink, |
| }); |
| |
| ChildList.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => ChildReference.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextLink: json_['nextLink'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final items = this.items; |
| final kind = this.kind; |
| final nextLink = this.nextLink; |
| final nextPageToken = this.nextPageToken; |
| final selfLink = this.selfLink; |
| return { |
| 'etag': ?etag, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'nextLink': ?nextLink, |
| 'nextPageToken': ?nextPageToken, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A reference to a folder's child. |
| /// |
| /// Some resource methods (such as `children.get`) require a `childId`. Use the |
| /// `children.list` method to retrieve the ID of the child. |
| class ChildReference { |
| /// A link to the child. |
| /// |
| /// Output only. |
| core.String? childLink; |
| |
| /// The ID of the child. |
| core.String? id; |
| |
| /// This is always `drive#childReference`. |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// A link back to this reference. |
| /// |
| /// Output only. |
| core.String? selfLink; |
| |
| ChildReference({this.childLink, this.id, this.kind, this.selfLink}); |
| |
| ChildReference.fromJson(core.Map json_) |
| : this( |
| childLink: json_['childLink'] as core.String?, |
| id: json_['id'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final childLink = this.childLink; |
| final id = this.id; |
| final kind = this.kind; |
| final selfLink = this.selfLink; |
| return { |
| 'childLink': ?childLink, |
| 'id': ?id, |
| 'kind': ?kind, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// Details about the client-side encryption applied to the file. |
| class ClientEncryptionDetails { |
| /// The metadata used for client-side operations. |
| DecryptionMetadata? decryptionMetadata; |
| |
| /// The encryption state of the file. |
| /// |
| /// The values expected here are: - encrypted - unencrypted |
| core.String? encryptionState; |
| |
| ClientEncryptionDetails({this.decryptionMetadata, this.encryptionState}); |
| |
| ClientEncryptionDetails.fromJson(core.Map json_) |
| : this( |
| decryptionMetadata: json_.containsKey('decryptionMetadata') |
| ? DecryptionMetadata.fromJson( |
| json_['decryptionMetadata'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| encryptionState: json_['encryptionState'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final decryptionMetadata = this.decryptionMetadata; |
| final encryptionState = this.encryptionState; |
| return { |
| 'decryptionMetadata': ?decryptionMetadata, |
| 'encryptionState': ?encryptionState, |
| }; |
| } |
| } |
| |
| /// Context of a file which is being commented on. |
| class CommentContext { |
| /// The MIME type of the context snippet. |
| core.String? type; |
| |
| /// Data representation of the segment of the file being commented on. |
| /// |
| /// In the case of a text file for example, this would be the actual text that |
| /// the comment is about. |
| core.String? value; |
| |
| CommentContext({this.type, this.value}); |
| |
| CommentContext.fromJson(core.Map json_) |
| : this( |
| type: json_['type'] as core.String?, |
| value: json_['value'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final type = this.type; |
| final value = this.value; |
| return {'type': ?type, 'value': ?value}; |
| } |
| } |
| |
| /// A comment on a file in Google Drive. |
| class Comment { |
| /// A region of the document represented as a JSON string. |
| /// |
| /// For details on defining anchor properties, refer to |
| /// [Manage comments and replies](https://developers.google.com/workspace/drive/api/v3/manage-comments). |
| core.String? anchor; |
| |
| /// The user who wrote this comment. |
| User? author; |
| |
| /// The ID of the comment. |
| core.String? commentId; |
| |
| /// The plain text content used to create this comment. |
| /// |
| /// This is not HTML safe and should only be used as a starting point to make |
| /// edits to a comment's content. |
| core.String? content; |
| |
| /// Context of a file which is being commented on. |
| CommentContext? context; |
| |
| /// The date when this comment was first created. |
| core.DateTime? createdDate; |
| |
| /// Whether this comment has been deleted. |
| /// |
| /// If a comment has been deleted the content will be cleared and this will |
| /// only represent a comment that once existed. |
| core.bool? deleted; |
| |
| /// The file which this comment is addressing. |
| core.String? fileId; |
| |
| /// The title of the file which this comment is addressing. |
| core.String? fileTitle; |
| |
| /// HTML formatted content for this comment. |
| core.String? htmlContent; |
| |
| /// This is always drive#comment. |
| core.String? kind; |
| |
| /// The date when this comment or any of its replies were last modified. |
| core.DateTime? modifiedDate; |
| |
| /// Replies to this post. |
| core.List<CommentReply>? replies; |
| |
| /// A link back to this comment. |
| core.String? selfLink; |
| |
| /// The status of this comment. |
| /// |
| /// Status can be changed by posting a reply to a comment with the desired |
| /// status. Possible values are: * `open` - The comment is still open. * |
| /// `resolved` - The comment has been resolved by one of its replies. |
| core.String? status; |
| |
| Comment({ |
| this.anchor, |
| this.author, |
| this.commentId, |
| this.content, |
| this.context, |
| this.createdDate, |
| this.deleted, |
| this.fileId, |
| this.fileTitle, |
| this.htmlContent, |
| this.kind, |
| this.modifiedDate, |
| this.replies, |
| this.selfLink, |
| this.status, |
| }); |
| |
| Comment.fromJson(core.Map json_) |
| : this( |
| anchor: json_['anchor'] as core.String?, |
| author: json_.containsKey('author') |
| ? User.fromJson( |
| json_['author'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| commentId: json_['commentId'] as core.String?, |
| content: json_['content'] as core.String?, |
| context: json_.containsKey('context') |
| ? CommentContext.fromJson( |
| json_['context'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| createdDate: json_.containsKey('createdDate') |
| ? core.DateTime.parse(json_['createdDate'] as core.String) |
| : null, |
| deleted: json_['deleted'] as core.bool?, |
| fileId: json_['fileId'] as core.String?, |
| fileTitle: json_['fileTitle'] as core.String?, |
| htmlContent: json_['htmlContent'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| modifiedDate: json_.containsKey('modifiedDate') |
| ? core.DateTime.parse(json_['modifiedDate'] as core.String) |
| : null, |
| replies: (json_['replies'] as core.List?) |
| ?.map( |
| (value) => CommentReply.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| selfLink: json_['selfLink'] as core.String?, |
| status: json_['status'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final anchor = this.anchor; |
| final author = this.author; |
| final commentId = this.commentId; |
| final content = this.content; |
| final context = this.context; |
| final createdDate = this.createdDate; |
| final deleted = this.deleted; |
| final fileId = this.fileId; |
| final fileTitle = this.fileTitle; |
| final htmlContent = this.htmlContent; |
| final kind = this.kind; |
| final modifiedDate = this.modifiedDate; |
| final replies = this.replies; |
| final selfLink = this.selfLink; |
| final status = this.status; |
| return { |
| 'anchor': ?anchor, |
| 'author': ?author, |
| 'commentId': ?commentId, |
| 'content': ?content, |
| 'context': ?context, |
| 'createdDate': ?createdDate?.toUtc().toIso8601String(), |
| 'deleted': ?deleted, |
| 'fileId': ?fileId, |
| 'fileTitle': ?fileTitle, |
| 'htmlContent': ?htmlContent, |
| 'kind': ?kind, |
| 'modifiedDate': ?modifiedDate?.toUtc().toIso8601String(), |
| 'replies': ?replies, |
| 'selfLink': ?selfLink, |
| 'status': ?status, |
| }; |
| } |
| } |
| |
| /// A list of comments on a file in Google Drive. |
| class CommentList { |
| /// The list of comments. |
| /// |
| /// If nextPageToken is populated, then this list may be incomplete and an |
| /// additional page of results should be fetched. |
| core.List<Comment>? items; |
| |
| /// This is always drive#commentList. |
| core.String? kind; |
| |
| /// A link to the next page of comments. |
| core.String? nextLink; |
| |
| /// The page token for the next page of comments. |
| /// |
| /// This will be absent if the end of the comments list has been reached. If |
| /// the token is rejected for any reason, it should be discarded, and |
| /// pagination should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| CommentList({ |
| this.items, |
| this.kind, |
| this.nextLink, |
| this.nextPageToken, |
| this.selfLink, |
| }); |
| |
| CommentList.fromJson(core.Map json_) |
| : this( |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => Comment.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextLink: json_['nextLink'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final items = this.items; |
| final kind = this.kind; |
| final nextLink = this.nextLink; |
| final nextPageToken = this.nextPageToken; |
| final selfLink = this.selfLink; |
| return { |
| 'items': ?items, |
| 'kind': ?kind, |
| 'nextLink': ?nextLink, |
| 'nextPageToken': ?nextPageToken, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A reply to a comment on a file in Google Drive. |
| class CommentReply { |
| /// The user who wrote this reply. |
| User? author; |
| |
| /// The plain text content used to create this reply. |
| /// |
| /// This is not HTML safe and should only be used as a starting point to make |
| /// edits to a reply's content. This field is required on inserts if no verb |
| /// is specified (resolve/reopen). |
| core.String? content; |
| |
| /// The date when this reply was first created. |
| core.DateTime? createdDate; |
| |
| /// Whether this reply has been deleted. |
| /// |
| /// If a reply has been deleted the content will be cleared and this will only |
| /// represent a reply that once existed. |
| core.bool? deleted; |
| |
| /// HTML formatted content for this reply. |
| core.String? htmlContent; |
| |
| /// This is always drive#commentReply. |
| core.String? kind; |
| |
| /// The date when this reply was last modified. |
| core.DateTime? modifiedDate; |
| |
| /// The ID of the reply. |
| core.String? replyId; |
| |
| /// The action this reply performed to the parent comment. |
| /// |
| /// When creating a new reply this is the action to be perform tSo the parent |
| /// comment. Possible values are: * `resolve` - To resolve a comment. * |
| /// `reopen` - To reopen (un-resolve) a comment. |
| core.String? verb; |
| |
| CommentReply({ |
| this.author, |
| this.content, |
| this.createdDate, |
| this.deleted, |
| this.htmlContent, |
| this.kind, |
| this.modifiedDate, |
| this.replyId, |
| this.verb, |
| }); |
| |
| CommentReply.fromJson(core.Map json_) |
| : this( |
| author: json_.containsKey('author') |
| ? User.fromJson( |
| json_['author'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| content: json_['content'] as core.String?, |
| createdDate: json_.containsKey('createdDate') |
| ? core.DateTime.parse(json_['createdDate'] as core.String) |
| : null, |
| deleted: json_['deleted'] as core.bool?, |
| htmlContent: json_['htmlContent'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| modifiedDate: json_.containsKey('modifiedDate') |
| ? core.DateTime.parse(json_['modifiedDate'] as core.String) |
| : null, |
| replyId: json_['replyId'] as core.String?, |
| verb: json_['verb'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final author = this.author; |
| final content = this.content; |
| final createdDate = this.createdDate; |
| final deleted = this.deleted; |
| final htmlContent = this.htmlContent; |
| final kind = this.kind; |
| final modifiedDate = this.modifiedDate; |
| final replyId = this.replyId; |
| final verb = this.verb; |
| return { |
| 'author': ?author, |
| 'content': ?content, |
| 'createdDate': ?createdDate?.toUtc().toIso8601String(), |
| 'deleted': ?deleted, |
| 'htmlContent': ?htmlContent, |
| 'kind': ?kind, |
| 'modifiedDate': ?modifiedDate?.toUtc().toIso8601String(), |
| 'replyId': ?replyId, |
| 'verb': ?verb, |
| }; |
| } |
| } |
| |
| /// A list of replies to a comment on a file in Google Drive. |
| class CommentReplyList { |
| /// The list of replies. |
| /// |
| /// If nextPageToken is populated, then this list may be incomplete and an |
| /// additional page of results should be fetched. |
| core.List<CommentReply>? items; |
| |
| /// This is always `drive#commentReplyList`. |
| core.String? kind; |
| |
| /// A link to the next page of replies. |
| core.String? nextLink; |
| |
| /// The page token for the next page of replies. |
| /// |
| /// This will be absent if the end of the replies list has been reached. If |
| /// the token is rejected for any reason, it should be discarded, and |
| /// pagination should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| CommentReplyList({ |
| this.items, |
| this.kind, |
| this.nextLink, |
| this.nextPageToken, |
| this.selfLink, |
| }); |
| |
| CommentReplyList.fromJson(core.Map json_) |
| : this( |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => CommentReply.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextLink: json_['nextLink'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final items = this.items; |
| final kind = this.kind; |
| final nextLink = this.nextLink; |
| final nextPageToken = this.nextPageToken; |
| final selfLink = this.selfLink; |
| return { |
| 'items': ?items, |
| 'kind': ?kind, |
| 'nextLink': ?nextLink, |
| 'nextPageToken': ?nextPageToken, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A restriction for accessing the content of the file. |
| class ContentRestriction { |
| /// Whether the content restriction can only be modified or removed by a user |
| /// who owns the file. |
| /// |
| /// For files in shared drives, any user with `organizer` capabilities can |
| /// modify or remove this content restriction. |
| core.bool? ownerRestricted; |
| |
| /// Whether the content of the file is read-only. |
| /// |
| /// If a file is read-only, a new revision of the file may not be added, |
| /// comments may not be added or modified, and the title of the file may not |
| /// be modified. |
| core.bool? readOnly; |
| |
| /// Reason for why the content of the file is restricted. |
| /// |
| /// This is only mutable on requests that also set `readOnly=true`. |
| core.String? reason; |
| |
| /// The user who set the content restriction. |
| /// |
| /// Only populated if `readOnly` is true. |
| /// |
| /// Output only. |
| User? restrictingUser; |
| |
| /// The time at which the content restriction was set (formatted RFC 3339 |
| /// timestamp). |
| /// |
| /// Only populated if readOnly is true. |
| core.DateTime? restrictionDate; |
| |
| /// Whether the content restriction was applied by the system, for example due |
| /// to an esignature. |
| /// |
| /// Users cannot modify or remove system restricted content restrictions. |
| /// |
| /// Output only. |
| core.bool? systemRestricted; |
| |
| /// The type of the content restriction. |
| /// |
| /// Currently the only possible value is `globalContentRestriction`. |
| /// |
| /// Output only. |
| core.String? type; |
| |
| ContentRestriction({ |
| this.ownerRestricted, |
| this.readOnly, |
| this.reason, |
| this.restrictingUser, |
| this.restrictionDate, |
| this.systemRestricted, |
| this.type, |
| }); |
| |
| ContentRestriction.fromJson(core.Map json_) |
| : this( |
| ownerRestricted: json_['ownerRestricted'] as core.bool?, |
| readOnly: json_['readOnly'] as core.bool?, |
| reason: json_['reason'] as core.String?, |
| restrictingUser: json_.containsKey('restrictingUser') |
| ? User.fromJson( |
| json_['restrictingUser'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| restrictionDate: json_.containsKey('restrictionDate') |
| ? core.DateTime.parse(json_['restrictionDate'] as core.String) |
| : null, |
| systemRestricted: json_['systemRestricted'] as core.bool?, |
| type: json_['type'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final ownerRestricted = this.ownerRestricted; |
| final readOnly = this.readOnly; |
| final reason = this.reason; |
| final restrictingUser = this.restrictingUser; |
| final restrictionDate = this.restrictionDate; |
| final systemRestricted = this.systemRestricted; |
| final type = this.type; |
| return { |
| 'ownerRestricted': ?ownerRestricted, |
| 'readOnly': ?readOnly, |
| 'reason': ?reason, |
| 'restrictingUser': ?restrictingUser, |
| 'restrictionDate': ?restrictionDate?.toUtc().toIso8601String(), |
| 'systemRestricted': ?systemRestricted, |
| 'type': ?type, |
| }; |
| } |
| } |
| |
| /// Representation of the CSE DecryptionMetadata. |
| typedef DecryptionMetadata = $DecryptionMetadata; |
| |
| /// An image file and cropping parameters from which a background image for this |
| /// shared drive is set. |
| /// |
| /// This is a write only field; it can only be set on `drive.drives.update` |
| /// requests that don't set `themeId`. When specified, all fields of the |
| /// `backgroundImageFile` must be set. |
| class DriveBackgroundImageFile { |
| /// The ID of an image file in Google Drive to use for the background image. |
| core.String? id; |
| |
| /// The width of the cropped image in the closed range of 0 to 1. |
| /// |
| /// This value represents the width of the cropped image divided by the width |
| /// of the entire image. The height is computed by applying a width to height |
| /// aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels |
| /// wide and 144 pixels high. |
| core.double? width; |
| |
| /// The X coordinate of the upper left corner of the cropping area in the |
| /// background image. |
| /// |
| /// This is a value in the closed range of 0 to 1. This value represents the |
| /// horizontal distance from the left side of the entire image to the left |
| /// side of the cropping area divided by the width of the entire image. |
| core.double? xCoordinate; |
| |
| /// The Y coordinate of the upper left corner of the cropping area in the |
| /// background image. |
| /// |
| /// This is a value in the closed range of 0 to 1. This value represents the |
| /// vertical distance from the top side of the entire image to the top side of |
| /// the cropping area divided by the height of the entire image. |
| core.double? yCoordinate; |
| |
| DriveBackgroundImageFile({ |
| this.id, |
| this.width, |
| this.xCoordinate, |
| this.yCoordinate, |
| }); |
| |
| DriveBackgroundImageFile.fromJson(core.Map json_) |
| : this( |
| id: json_['id'] as core.String?, |
| width: (json_['width'] as core.num?)?.toDouble(), |
| xCoordinate: (json_['xCoordinate'] as core.num?)?.toDouble(), |
| yCoordinate: (json_['yCoordinate'] as core.num?)?.toDouble(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final id = this.id; |
| final width = this.width; |
| final xCoordinate = this.xCoordinate; |
| final yCoordinate = this.yCoordinate; |
| return { |
| 'id': ?id, |
| 'width': ?width, |
| 'xCoordinate': ?xCoordinate, |
| 'yCoordinate': ?yCoordinate, |
| }; |
| } |
| } |
| |
| /// Capabilities the current user has on this shared drive. |
| /// |
| /// Output only. |
| class DriveCapabilities { |
| /// Whether the current user can add children to folders in this shared drive. |
| /// |
| /// Output only. |
| core.bool? canAddChildren; |
| |
| /// Whether the current user can change the `copyRequiresWriterPermission` |
| /// restriction of this shared drive. |
| /// |
| /// Output only. |
| core.bool? canChangeCopyRequiresWriterPermissionRestriction; |
| |
| /// Whether the current user can change the `domainUsersOnly` restriction of |
| /// this shared drive. |
| /// |
| /// Output only. |
| core.bool? canChangeDomainUsersOnlyRestriction; |
| |
| /// Whether the current user can change the background of this shared drive. |
| /// |
| /// Output only. |
| core.bool? canChangeDriveBackground; |
| |
| /// Whether the current user can change the `driveMembersOnly` restriction of |
| /// this shared drive. |
| /// |
| /// Output only. |
| core.bool? canChangeDriveMembersOnlyRestriction; |
| |
| /// Whether the current user can change the |
| /// `sharingFoldersRequiresOrganizerPermission` restriction of this shared |
| /// drive. |
| /// |
| /// Output only. |
| core.bool? canChangeSharingFoldersRequiresOrganizerPermissionRestriction; |
| |
| /// Whether the current user can comment on files in this shared drive. |
| /// |
| /// Output only. |
| core.bool? canComment; |
| |
| /// Whether the current user can copy files in this shared drive. |
| /// |
| /// Output only. |
| core.bool? canCopy; |
| |
| /// Whether the current user can delete children from folders in this shared |
| /// drive. |
| /// |
| /// Output only. |
| core.bool? canDeleteChildren; |
| |
| /// Whether the current user can delete this shared drive. |
| /// |
| /// Attempting to delete the shared drive may still fail if there are |
| /// untrashed items inside the shared drive. |
| /// |
| /// Output only. |
| core.bool? canDeleteDrive; |
| |
| /// Whether the current user can download files in this shared drive. |
| /// |
| /// Output only. |
| core.bool? canDownload; |
| |
| /// Whether the current user can edit files in this shared drive |
| /// |
| /// Output only. |
| core.bool? canEdit; |
| |
| /// Whether the current user can list the children of folders in this shared |
| /// drive. |
| /// |
| /// Output only. |
| core.bool? canListChildren; |
| |
| /// Whether the current user can add members to this shared drive or remove |
| /// them or change their role. |
| /// |
| /// Output only. |
| core.bool? canManageMembers; |
| |
| /// Whether the current user can read the revisions resource of files in this |
| /// shared drive. |
| /// |
| /// Output only. |
| core.bool? canReadRevisions; |
| |
| /// Whether the current user can rename files or folders in this shared drive. |
| /// |
| /// Output only. |
| core.bool? canRename; |
| |
| /// Whether the current user can rename this shared drive. |
| /// |
| /// Output only. |
| core.bool? canRenameDrive; |
| |
| /// Whether the current user can reset the shared drive restrictions to |
| /// defaults. |
| /// |
| /// Output only. |
| core.bool? canResetDriveRestrictions; |
| |
| /// Whether the current user can share files or folders in this shared drive. |
| /// |
| /// Output only. |
| core.bool? canShare; |
| |
| /// Whether the current user can trash children from folders in this shared |
| /// drive. |
| /// |
| /// Output only. |
| core.bool? canTrashChildren; |
| |
| DriveCapabilities({ |
| this.canAddChildren, |
| this.canChangeCopyRequiresWriterPermissionRestriction, |
| this.canChangeDomainUsersOnlyRestriction, |
| this.canChangeDriveBackground, |
| this.canChangeDriveMembersOnlyRestriction, |
| this.canChangeSharingFoldersRequiresOrganizerPermissionRestriction, |
| this.canComment, |
| this.canCopy, |
| this.canDeleteChildren, |
| this.canDeleteDrive, |
| this.canDownload, |
| this.canEdit, |
| this.canListChildren, |
| this.canManageMembers, |
| this.canReadRevisions, |
| this.canRename, |
| this.canRenameDrive, |
| this.canResetDriveRestrictions, |
| this.canShare, |
| this.canTrashChildren, |
| }); |
| |
| DriveCapabilities.fromJson(core.Map json_) |
| : this( |
| canAddChildren: json_['canAddChildren'] as core.bool?, |
| canChangeCopyRequiresWriterPermissionRestriction: |
| json_['canChangeCopyRequiresWriterPermissionRestriction'] |
| as core.bool?, |
| canChangeDomainUsersOnlyRestriction: |
| json_['canChangeDomainUsersOnlyRestriction'] as core.bool?, |
| canChangeDriveBackground: |
| json_['canChangeDriveBackground'] as core.bool?, |
| canChangeDriveMembersOnlyRestriction: |
| json_['canChangeDriveMembersOnlyRestriction'] as core.bool?, |
| canChangeSharingFoldersRequiresOrganizerPermissionRestriction: |
| json_['canChangeSharingFoldersRequiresOrganizerPermissionRestriction'] |
| as core.bool?, |
| canComment: json_['canComment'] as core.bool?, |
| canCopy: json_['canCopy'] as core.bool?, |
| canDeleteChildren: json_['canDeleteChildren'] as core.bool?, |
| canDeleteDrive: json_['canDeleteDrive'] as core.bool?, |
| canDownload: json_['canDownload'] as core.bool?, |
| canEdit: json_['canEdit'] as core.bool?, |
| canListChildren: json_['canListChildren'] as core.bool?, |
| canManageMembers: json_['canManageMembers'] as core.bool?, |
| canReadRevisions: json_['canReadRevisions'] as core.bool?, |
| canRename: json_['canRename'] as core.bool?, |
| canRenameDrive: json_['canRenameDrive'] as core.bool?, |
| canResetDriveRestrictions: |
| json_['canResetDriveRestrictions'] as core.bool?, |
| canShare: json_['canShare'] as core.bool?, |
| canTrashChildren: json_['canTrashChildren'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final canAddChildren = this.canAddChildren; |
| final canChangeCopyRequiresWriterPermissionRestriction = |
| this.canChangeCopyRequiresWriterPermissionRestriction; |
| final canChangeDomainUsersOnlyRestriction = |
| this.canChangeDomainUsersOnlyRestriction; |
| final canChangeDriveBackground = this.canChangeDriveBackground; |
| final canChangeDriveMembersOnlyRestriction = |
| this.canChangeDriveMembersOnlyRestriction; |
| final canChangeSharingFoldersRequiresOrganizerPermissionRestriction = |
| this.canChangeSharingFoldersRequiresOrganizerPermissionRestriction; |
| final canComment = this.canComment; |
| final canCopy = this.canCopy; |
| final canDeleteChildren = this.canDeleteChildren; |
| final canDeleteDrive = this.canDeleteDrive; |
| final canDownload = this.canDownload; |
| final canEdit = this.canEdit; |
| final canListChildren = this.canListChildren; |
| final canManageMembers = this.canManageMembers; |
| final canReadRevisions = this.canReadRevisions; |
| final canRename = this.canRename; |
| final canRenameDrive = this.canRenameDrive; |
| final canResetDriveRestrictions = this.canResetDriveRestrictions; |
| final canShare = this.canShare; |
| final canTrashChildren = this.canTrashChildren; |
| return { |
| 'canAddChildren': ?canAddChildren, |
| 'canChangeCopyRequiresWriterPermissionRestriction': |
| ?canChangeCopyRequiresWriterPermissionRestriction, |
| 'canChangeDomainUsersOnlyRestriction': |
| ?canChangeDomainUsersOnlyRestriction, |
| 'canChangeDriveBackground': ?canChangeDriveBackground, |
| 'canChangeDriveMembersOnlyRestriction': |
| ?canChangeDriveMembersOnlyRestriction, |
| 'canChangeSharingFoldersRequiresOrganizerPermissionRestriction': |
| ?canChangeSharingFoldersRequiresOrganizerPermissionRestriction, |
| 'canComment': ?canComment, |
| 'canCopy': ?canCopy, |
| 'canDeleteChildren': ?canDeleteChildren, |
| 'canDeleteDrive': ?canDeleteDrive, |
| 'canDownload': ?canDownload, |
| 'canEdit': ?canEdit, |
| 'canListChildren': ?canListChildren, |
| 'canManageMembers': ?canManageMembers, |
| 'canReadRevisions': ?canReadRevisions, |
| 'canRename': ?canRename, |
| 'canRenameDrive': ?canRenameDrive, |
| 'canResetDriveRestrictions': ?canResetDriveRestrictions, |
| 'canShare': ?canShare, |
| 'canTrashChildren': ?canTrashChildren, |
| }; |
| } |
| } |
| |
| /// A set of restrictions that apply to this shared drive or items inside this |
| /// shared drive. |
| class DriveRestrictions { |
| /// Whether administrative privileges on this shared drive are required to |
| /// modify restrictions. |
| core.bool? adminManagedRestrictions; |
| |
| /// Whether the options to copy, print, or download files inside this shared |
| /// drive, should be disabled for readers and commenters. |
| /// |
| /// When this restriction is set to `true`, it will override the similarly |
| /// named field to `true` for any file inside this shared drive. |
| core.bool? copyRequiresWriterPermission; |
| |
| /// Whether access to this shared drive and items inside this shared drive is |
| /// restricted to users of the domain to which this shared drive belongs. |
| /// |
| /// This restriction may be overridden by other sharing policies controlled |
| /// outside of this shared drive. |
| core.bool? domainUsersOnly; |
| |
| /// Whether access to items inside this shared drive is restricted to its |
| /// members. |
| core.bool? driveMembersOnly; |
| |
| /// If true, only users with the organizer role can share folders. |
| /// |
| /// If false, users with either the organizer role or the file organizer role |
| /// can share folders. |
| core.bool? sharingFoldersRequiresOrganizerPermission; |
| |
| DriveRestrictions({ |
| this.adminManagedRestrictions, |
| this.copyRequiresWriterPermission, |
| this.domainUsersOnly, |
| this.driveMembersOnly, |
| this.sharingFoldersRequiresOrganizerPermission, |
| }); |
| |
| DriveRestrictions.fromJson(core.Map json_) |
| : this( |
| adminManagedRestrictions: |
| json_['adminManagedRestrictions'] as core.bool?, |
| copyRequiresWriterPermission: |
| json_['copyRequiresWriterPermission'] as core.bool?, |
| domainUsersOnly: json_['domainUsersOnly'] as core.bool?, |
| driveMembersOnly: json_['driveMembersOnly'] as core.bool?, |
| sharingFoldersRequiresOrganizerPermission: |
| json_['sharingFoldersRequiresOrganizerPermission'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final adminManagedRestrictions = this.adminManagedRestrictions; |
| final copyRequiresWriterPermission = this.copyRequiresWriterPermission; |
| final domainUsersOnly = this.domainUsersOnly; |
| final driveMembersOnly = this.driveMembersOnly; |
| final sharingFoldersRequiresOrganizerPermission = |
| this.sharingFoldersRequiresOrganizerPermission; |
| return { |
| 'adminManagedRestrictions': ?adminManagedRestrictions, |
| 'copyRequiresWriterPermission': ?copyRequiresWriterPermission, |
| 'domainUsersOnly': ?domainUsersOnly, |
| 'driveMembersOnly': ?driveMembersOnly, |
| 'sharingFoldersRequiresOrganizerPermission': |
| ?sharingFoldersRequiresOrganizerPermission, |
| }; |
| } |
| } |
| |
| /// Representation of a shared drive. |
| /// |
| /// Some resource methods (such as `drives.update`) require a `driveId`. Use the |
| /// `drives.list` method to retrieve the ID for a shared drive. |
| class Drive { |
| /// An image file and cropping parameters from which a background image for |
| /// this shared drive is set. |
| /// |
| /// This is a write only field; it can only be set on `drive.drives.update` |
| /// requests that don't set `themeId`. When specified, all fields of the |
| /// `backgroundImageFile` must be set. |
| DriveBackgroundImageFile? backgroundImageFile; |
| |
| /// A short-lived link to this shared drive's background image. |
| /// |
| /// Output only. |
| core.String? backgroundImageLink; |
| |
| /// Capabilities the current user has on this shared drive. |
| /// |
| /// Output only. |
| DriveCapabilities? capabilities; |
| |
| /// The color of this shared drive as an RGB hex string. |
| /// |
| /// It can only be set on a `drive.drives.update` request that does not set |
| /// `themeId`. |
| core.String? colorRgb; |
| |
| /// The time at which the shared drive was created (RFC 3339 date-time). |
| core.DateTime? createdDate; |
| |
| /// Whether the shared drive is hidden from default view. |
| core.bool? hidden; |
| |
| /// The ID of this shared drive which is also the ID of the top level folder |
| /// of this shared drive. |
| /// |
| /// Output only. |
| core.String? id; |
| |
| /// This is always `drive#drive` |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// The name of this shared drive. |
| core.String? name; |
| |
| /// The organizational unit of this shared drive. |
| /// |
| /// This field is only populated on `drives.list` responses when the |
| /// `useDomainAdminAccess` parameter is set to `true`. |
| /// |
| /// Output only. |
| core.String? orgUnitId; |
| |
| /// A set of restrictions that apply to this shared drive or items inside this |
| /// shared drive. |
| DriveRestrictions? restrictions; |
| |
| /// The ID of the theme from which the background image and color will be set. |
| /// |
| /// The set of possible `driveThemes` can be retrieved from a |
| /// `drive.about.get` response. When not specified on a `drive.drives.insert` |
| /// request, a random theme is chosen from which the background image and |
| /// color are set. This is a write-only field; it can only be set on requests |
| /// that don't set `colorRgb` or `backgroundImageFile`. |
| core.String? themeId; |
| |
| Drive({ |
| this.backgroundImageFile, |
| this.backgroundImageLink, |
| this.capabilities, |
| this.colorRgb, |
| this.createdDate, |
| this.hidden, |
| this.id, |
| this.kind, |
| this.name, |
| this.orgUnitId, |
| this.restrictions, |
| this.themeId, |
| }); |
| |
| Drive.fromJson(core.Map json_) |
| : this( |
| backgroundImageFile: json_.containsKey('backgroundImageFile') |
| ? DriveBackgroundImageFile.fromJson( |
| json_['backgroundImageFile'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| backgroundImageLink: json_['backgroundImageLink'] as core.String?, |
| capabilities: json_.containsKey('capabilities') |
| ? DriveCapabilities.fromJson( |
| json_['capabilities'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| colorRgb: json_['colorRgb'] as core.String?, |
| createdDate: json_.containsKey('createdDate') |
| ? core.DateTime.parse(json_['createdDate'] as core.String) |
| : null, |
| hidden: json_['hidden'] as core.bool?, |
| id: json_['id'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| name: json_['name'] as core.String?, |
| orgUnitId: json_['orgUnitId'] as core.String?, |
| restrictions: json_.containsKey('restrictions') |
| ? DriveRestrictions.fromJson( |
| json_['restrictions'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| themeId: json_['themeId'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final backgroundImageFile = this.backgroundImageFile; |
| final backgroundImageLink = this.backgroundImageLink; |
| final capabilities = this.capabilities; |
| final colorRgb = this.colorRgb; |
| final createdDate = this.createdDate; |
| final hidden = this.hidden; |
| final id = this.id; |
| final kind = this.kind; |
| final name = this.name; |
| final orgUnitId = this.orgUnitId; |
| final restrictions = this.restrictions; |
| final themeId = this.themeId; |
| return { |
| 'backgroundImageFile': ?backgroundImageFile, |
| 'backgroundImageLink': ?backgroundImageLink, |
| 'capabilities': ?capabilities, |
| 'colorRgb': ?colorRgb, |
| 'createdDate': ?createdDate?.toUtc().toIso8601String(), |
| 'hidden': ?hidden, |
| 'id': ?id, |
| 'kind': ?kind, |
| 'name': ?name, |
| 'orgUnitId': ?orgUnitId, |
| 'restrictions': ?restrictions, |
| 'themeId': ?themeId, |
| }; |
| } |
| } |
| |
| /// A list of shared drives. |
| class DriveList { |
| /// The list of shared drives. |
| /// |
| /// If nextPageToken is populated, then this list may be incomplete and an |
| /// additional page of results should be fetched. |
| core.List<Drive>? items; |
| |
| /// This is always `drive#driveList` |
| core.String? kind; |
| |
| /// The page token for the next page of shared drives. |
| /// |
| /// This will be absent if the end of the list has been reached. If the token |
| /// is rejected for any reason, it should be discarded, and pagination should |
| /// be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| DriveList({this.items, this.kind, this.nextPageToken}); |
| |
| DriveList.fromJson(core.Map json_) |
| : this( |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => |
| Drive.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final items = this.items; |
| final kind = this.kind; |
| final nextPageToken = this.nextPageToken; |
| return {'items': ?items, 'kind': ?kind, 'nextPageToken': ?nextPageToken}; |
| } |
| } |
| |
| /// Capabilities the current user has on this file. |
| /// |
| /// Each capability corresponds to a fine-grained action that a user may take. |
| /// |
| /// Output only. |
| class FileCapabilities { |
| /// Whether the current user is the pending owner of the file. |
| /// |
| /// Not populated for shared drive files. |
| /// |
| /// Output only. |
| core.bool? canAcceptOwnership; |
| |
| /// Whether the current user can add children to this folder. |
| /// |
| /// This is always false when the item is not a folder. |
| /// |
| /// Output only. |
| core.bool? canAddChildren; |
| |
| /// Whether the current user can add a folder from another drive (different |
| /// shared drive or My Drive) to this folder. |
| /// |
| /// This is false when the item is not a folder. Only populated for items in |
| /// shared drives. |
| /// |
| /// Output only. |
| core.bool? canAddFolderFromAnotherDrive; |
| |
| /// Whether the current user can add a parent for the item without removing an |
| /// existing parent in the same request. |
| /// |
| /// Not populated for shared drive files. |
| /// |
| /// Output only. |
| core.bool? canAddMyDriveParent; |
| |
| /// Whether the current user can change the `copyRequiresWriterPermission` |
| /// restriction of this file. |
| /// |
| /// Output only. |
| core.bool? canChangeCopyRequiresWriterPermission; |
| |
| /// Deprecated. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canChangeRestrictedDownload; |
| |
| /// Whether the current user can change the securityUpdateEnabled field on |
| /// link share metadata. |
| /// |
| /// Output only. |
| core.bool? canChangeSecurityUpdateEnabled; |
| |
| /// Whether the current user can comment on this file. |
| /// |
| /// Output only. |
| core.bool? canComment; |
| |
| /// Whether the current user can copy this file. |
| /// |
| /// For an item in a shared drive, whether the current user can copy |
| /// non-folder descendants of this item, or this item itself if it is not a |
| /// folder. |
| /// |
| /// Output only. |
| core.bool? canCopy; |
| |
| /// Whether the current user can delete this file. |
| /// |
| /// Output only. |
| core.bool? canDelete; |
| |
| /// Whether the current user can delete children of this folder. |
| /// |
| /// This is false when the item is not a folder. Only populated for items in |
| /// shared drives. |
| /// |
| /// Output only. |
| core.bool? canDeleteChildren; |
| |
| /// Whether a user can disable inherited permissions. |
| /// |
| /// Output only. |
| core.bool? canDisableInheritedPermissions; |
| |
| /// Whether the current user can download this file. |
| /// |
| /// Output only. |
| core.bool? canDownload; |
| |
| /// Whether the current user can edit this file. |
| /// |
| /// Other factors may limit the type of changes a user can make to a file. For |
| /// example, see `canChangeCopyRequiresWriterPermission` or |
| /// `canModifyContent`. |
| /// |
| /// Output only. |
| core.bool? canEdit; |
| |
| /// Whether a user can re-enable inherited permissions. |
| /// |
| /// Output only. |
| core.bool? canEnableInheritedPermissions; |
| |
| /// Whether the current user can list the children of this folder. |
| /// |
| /// This is always false when the item is not a folder. |
| /// |
| /// Output only. |
| core.bool? canListChildren; |
| |
| /// Whether the current user can modify the content of this file. |
| /// |
| /// Output only. |
| core.bool? canModifyContent; |
| |
| /// Deprecated: Output only. |
| /// |
| /// Use one of `canModifyEditorContentRestriction`, |
| /// `canModifyOwnerContentRestriction` or `canRemoveContentRestriction`. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canModifyContentRestriction; |
| |
| /// Whether the current user can add or modify content restrictions on the |
| /// file which are editor restricted. |
| /// |
| /// Output only. |
| core.bool? canModifyEditorContentRestriction; |
| |
| /// Whether the current user can modify the labels on the file. |
| /// |
| /// Output only. |
| core.bool? canModifyLabels; |
| |
| /// Whether the current user can add or modify content restrictions which are |
| /// owner restricted. |
| /// |
| /// Output only. |
| core.bool? canModifyOwnerContentRestriction; |
| |
| /// Whether the current user can move children of this folder outside of the |
| /// shared drive. |
| /// |
| /// This is false when the item is not a folder. Only populated for items in |
| /// shared drives. |
| /// |
| /// Output only. |
| core.bool? canMoveChildrenOutOfDrive; |
| |
| /// Deprecated: Use `canMoveChildrenOutOfDrive` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canMoveChildrenOutOfTeamDrive; |
| |
| /// Whether the current user can move children of this folder within this |
| /// drive. |
| /// |
| /// This is false when the item is not a folder. Note that a request to move |
| /// the child may still fail depending on the current user's access to the |
| /// child and to the destination folder. |
| /// |
| /// Output only. |
| core.bool? canMoveChildrenWithinDrive; |
| |
| /// Deprecated: Use `canMoveChildrenWithinDrive` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canMoveChildrenWithinTeamDrive; |
| |
| /// Deprecated: Use `canMoveItemOutOfDrive` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canMoveItemIntoTeamDrive; |
| |
| /// Whether the current user can move this item outside of this drive by |
| /// changing its parent. |
| /// |
| /// Note that a request to change the parent of the item may still fail |
| /// depending on the new parent that is being added. |
| /// |
| /// Output only. |
| core.bool? canMoveItemOutOfDrive; |
| |
| /// Deprecated: Use `canMoveItemOutOfDrive` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canMoveItemOutOfTeamDrive; |
| |
| /// Whether the current user can move this item within this drive. |
| /// |
| /// Note that a request to change the parent of the item may still fail |
| /// depending on the new parent that is being added and the parent that is |
| /// being removed. |
| /// |
| /// Output only. |
| core.bool? canMoveItemWithinDrive; |
| |
| /// Deprecated: Use `canMoveItemWithinDrive` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canMoveItemWithinTeamDrive; |
| |
| /// Deprecated: Use `canMoveItemWithinDrive` or `canMoveItemOutOfDrive` |
| /// instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canMoveTeamDriveItem; |
| |
| /// Whether the current user can read the shared drive to which this file |
| /// belongs. |
| /// |
| /// Only populated for items in shared drives. |
| /// |
| /// Output only. |
| core.bool? canReadDrive; |
| |
| /// Whether the current user can read the labels on the file. |
| /// |
| /// Output only. |
| core.bool? canReadLabels; |
| |
| /// Whether the current user can read the revisions resource of this file. |
| /// |
| /// For a shared drive item, whether revisions of non-folder descendants of |
| /// this item, or this item itself if it is not a folder, can be read. |
| /// |
| /// Output only. |
| core.bool? canReadRevisions; |
| |
| /// Deprecated: Use `canReadDrive` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canReadTeamDrive; |
| |
| /// Whether the current user can remove children from this folder. |
| /// |
| /// This is always false when the item is not a folder. For a folder in a |
| /// shared drive, use `canDeleteChildren` or `canTrashChildren` instead. |
| /// |
| /// Output only. |
| core.bool? canRemoveChildren; |
| |
| /// Whether there is a content restriction on the file that can be removed by |
| /// the current user. |
| /// |
| /// Output only. |
| core.bool? canRemoveContentRestriction; |
| |
| /// Whether the current user can remove a parent from the item without adding |
| /// another parent in the same request. |
| /// |
| /// Not populated for shared drive files. |
| /// |
| /// Output only. |
| core.bool? canRemoveMyDriveParent; |
| |
| /// Whether the current user can rename this file. |
| /// |
| /// Output only. |
| core.bool? canRename; |
| |
| /// Whether the current user can modify the sharing settings for this file. |
| /// |
| /// Output only. |
| core.bool? canShare; |
| |
| /// Whether the current user can move this file to trash. |
| /// |
| /// Output only. |
| core.bool? canTrash; |
| |
| /// Whether the current user can trash children of this folder. |
| /// |
| /// This is false when the item is not a folder. Only populated for items in |
| /// shared drives. |
| /// |
| /// Output only. |
| core.bool? canTrashChildren; |
| |
| /// Whether the current user can restore this file from trash. |
| /// |
| /// Output only. |
| core.bool? canUntrash; |
| |
| FileCapabilities({ |
| this.canAcceptOwnership, |
| this.canAddChildren, |
| this.canAddFolderFromAnotherDrive, |
| this.canAddMyDriveParent, |
| this.canChangeCopyRequiresWriterPermission, |
| this.canChangeRestrictedDownload, |
| this.canChangeSecurityUpdateEnabled, |
| this.canComment, |
| this.canCopy, |
| this.canDelete, |
| this.canDeleteChildren, |
| this.canDisableInheritedPermissions, |
| this.canDownload, |
| this.canEdit, |
| this.canEnableInheritedPermissions, |
| this.canListChildren, |
| this.canModifyContent, |
| this.canModifyContentRestriction, |
| this.canModifyEditorContentRestriction, |
| this.canModifyLabels, |
| this.canModifyOwnerContentRestriction, |
| this.canMoveChildrenOutOfDrive, |
| this.canMoveChildrenOutOfTeamDrive, |
| this.canMoveChildrenWithinDrive, |
| this.canMoveChildrenWithinTeamDrive, |
| this.canMoveItemIntoTeamDrive, |
| this.canMoveItemOutOfDrive, |
| this.canMoveItemOutOfTeamDrive, |
| this.canMoveItemWithinDrive, |
| this.canMoveItemWithinTeamDrive, |
| this.canMoveTeamDriveItem, |
| this.canReadDrive, |
| this.canReadLabels, |
| this.canReadRevisions, |
| this.canReadTeamDrive, |
| this.canRemoveChildren, |
| this.canRemoveContentRestriction, |
| this.canRemoveMyDriveParent, |
| this.canRename, |
| this.canShare, |
| this.canTrash, |
| this.canTrashChildren, |
| this.canUntrash, |
| }); |
| |
| FileCapabilities.fromJson(core.Map json_) |
| : this( |
| canAcceptOwnership: json_['canAcceptOwnership'] as core.bool?, |
| canAddChildren: json_['canAddChildren'] as core.bool?, |
| canAddFolderFromAnotherDrive: |
| json_['canAddFolderFromAnotherDrive'] as core.bool?, |
| canAddMyDriveParent: json_['canAddMyDriveParent'] as core.bool?, |
| canChangeCopyRequiresWriterPermission: |
| json_['canChangeCopyRequiresWriterPermission'] as core.bool?, |
| canChangeRestrictedDownload: |
| json_['canChangeRestrictedDownload'] as core.bool?, |
| canChangeSecurityUpdateEnabled: |
| json_['canChangeSecurityUpdateEnabled'] as core.bool?, |
| canComment: json_['canComment'] as core.bool?, |
| canCopy: json_['canCopy'] as core.bool?, |
| canDelete: json_['canDelete'] as core.bool?, |
| canDeleteChildren: json_['canDeleteChildren'] as core.bool?, |
| canDisableInheritedPermissions: |
| json_['canDisableInheritedPermissions'] as core.bool?, |
| canDownload: json_['canDownload'] as core.bool?, |
| canEdit: json_['canEdit'] as core.bool?, |
| canEnableInheritedPermissions: |
| json_['canEnableInheritedPermissions'] as core.bool?, |
| canListChildren: json_['canListChildren'] as core.bool?, |
| canModifyContent: json_['canModifyContent'] as core.bool?, |
| canModifyContentRestriction: |
| json_['canModifyContentRestriction'] as core.bool?, |
| canModifyEditorContentRestriction: |
| json_['canModifyEditorContentRestriction'] as core.bool?, |
| canModifyLabels: json_['canModifyLabels'] as core.bool?, |
| canModifyOwnerContentRestriction: |
| json_['canModifyOwnerContentRestriction'] as core.bool?, |
| canMoveChildrenOutOfDrive: |
| json_['canMoveChildrenOutOfDrive'] as core.bool?, |
| canMoveChildrenOutOfTeamDrive: |
| json_['canMoveChildrenOutOfTeamDrive'] as core.bool?, |
| canMoveChildrenWithinDrive: |
| json_['canMoveChildrenWithinDrive'] as core.bool?, |
| canMoveChildrenWithinTeamDrive: |
| json_['canMoveChildrenWithinTeamDrive'] as core.bool?, |
| canMoveItemIntoTeamDrive: |
| json_['canMoveItemIntoTeamDrive'] as core.bool?, |
| canMoveItemOutOfDrive: json_['canMoveItemOutOfDrive'] as core.bool?, |
| canMoveItemOutOfTeamDrive: |
| json_['canMoveItemOutOfTeamDrive'] as core.bool?, |
| canMoveItemWithinDrive: json_['canMoveItemWithinDrive'] as core.bool?, |
| canMoveItemWithinTeamDrive: |
| json_['canMoveItemWithinTeamDrive'] as core.bool?, |
| canMoveTeamDriveItem: json_['canMoveTeamDriveItem'] as core.bool?, |
| canReadDrive: json_['canReadDrive'] as core.bool?, |
| canReadLabels: json_['canReadLabels'] as core.bool?, |
| canReadRevisions: json_['canReadRevisions'] as core.bool?, |
| canReadTeamDrive: json_['canReadTeamDrive'] as core.bool?, |
| canRemoveChildren: json_['canRemoveChildren'] as core.bool?, |
| canRemoveContentRestriction: |
| json_['canRemoveContentRestriction'] as core.bool?, |
| canRemoveMyDriveParent: json_['canRemoveMyDriveParent'] as core.bool?, |
| canRename: json_['canRename'] as core.bool?, |
| canShare: json_['canShare'] as core.bool?, |
| canTrash: json_['canTrash'] as core.bool?, |
| canTrashChildren: json_['canTrashChildren'] as core.bool?, |
| canUntrash: json_['canUntrash'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final canAcceptOwnership = this.canAcceptOwnership; |
| final canAddChildren = this.canAddChildren; |
| final canAddFolderFromAnotherDrive = this.canAddFolderFromAnotherDrive; |
| final canAddMyDriveParent = this.canAddMyDriveParent; |
| final canChangeCopyRequiresWriterPermission = |
| this.canChangeCopyRequiresWriterPermission; |
| final canChangeRestrictedDownload = this.canChangeRestrictedDownload; |
| final canChangeSecurityUpdateEnabled = this.canChangeSecurityUpdateEnabled; |
| final canComment = this.canComment; |
| final canCopy = this.canCopy; |
| final canDelete = this.canDelete; |
| final canDeleteChildren = this.canDeleteChildren; |
| final canDisableInheritedPermissions = this.canDisableInheritedPermissions; |
| final canDownload = this.canDownload; |
| final canEdit = this.canEdit; |
| final canEnableInheritedPermissions = this.canEnableInheritedPermissions; |
| final canListChildren = this.canListChildren; |
| final canModifyContent = this.canModifyContent; |
| final canModifyContentRestriction = this.canModifyContentRestriction; |
| final canModifyEditorContentRestriction = |
| this.canModifyEditorContentRestriction; |
| final canModifyLabels = this.canModifyLabels; |
| final canModifyOwnerContentRestriction = |
| this.canModifyOwnerContentRestriction; |
| final canMoveChildrenOutOfDrive = this.canMoveChildrenOutOfDrive; |
| final canMoveChildrenOutOfTeamDrive = this.canMoveChildrenOutOfTeamDrive; |
| final canMoveChildrenWithinDrive = this.canMoveChildrenWithinDrive; |
| final canMoveChildrenWithinTeamDrive = this.canMoveChildrenWithinTeamDrive; |
| final canMoveItemIntoTeamDrive = this.canMoveItemIntoTeamDrive; |
| final canMoveItemOutOfDrive = this.canMoveItemOutOfDrive; |
| final canMoveItemOutOfTeamDrive = this.canMoveItemOutOfTeamDrive; |
| final canMoveItemWithinDrive = this.canMoveItemWithinDrive; |
| final canMoveItemWithinTeamDrive = this.canMoveItemWithinTeamDrive; |
| final canMoveTeamDriveItem = this.canMoveTeamDriveItem; |
| final canReadDrive = this.canReadDrive; |
| final canReadLabels = this.canReadLabels; |
| final canReadRevisions = this.canReadRevisions; |
| final canReadTeamDrive = this.canReadTeamDrive; |
| final canRemoveChildren = this.canRemoveChildren; |
| final canRemoveContentRestriction = this.canRemoveContentRestriction; |
| final canRemoveMyDriveParent = this.canRemoveMyDriveParent; |
| final canRename = this.canRename; |
| final canShare = this.canShare; |
| final canTrash = this.canTrash; |
| final canTrashChildren = this.canTrashChildren; |
| final canUntrash = this.canUntrash; |
| return { |
| 'canAcceptOwnership': ?canAcceptOwnership, |
| 'canAddChildren': ?canAddChildren, |
| 'canAddFolderFromAnotherDrive': ?canAddFolderFromAnotherDrive, |
| 'canAddMyDriveParent': ?canAddMyDriveParent, |
| 'canChangeCopyRequiresWriterPermission': |
| ?canChangeCopyRequiresWriterPermission, |
| 'canChangeRestrictedDownload': ?canChangeRestrictedDownload, |
| 'canChangeSecurityUpdateEnabled': ?canChangeSecurityUpdateEnabled, |
| 'canComment': ?canComment, |
| 'canCopy': ?canCopy, |
| 'canDelete': ?canDelete, |
| 'canDeleteChildren': ?canDeleteChildren, |
| 'canDisableInheritedPermissions': ?canDisableInheritedPermissions, |
| 'canDownload': ?canDownload, |
| 'canEdit': ?canEdit, |
| 'canEnableInheritedPermissions': ?canEnableInheritedPermissions, |
| 'canListChildren': ?canListChildren, |
| 'canModifyContent': ?canModifyContent, |
| 'canModifyContentRestriction': ?canModifyContentRestriction, |
| 'canModifyEditorContentRestriction': ?canModifyEditorContentRestriction, |
| 'canModifyLabels': ?canModifyLabels, |
| 'canModifyOwnerContentRestriction': ?canModifyOwnerContentRestriction, |
| 'canMoveChildrenOutOfDrive': ?canMoveChildrenOutOfDrive, |
| 'canMoveChildrenOutOfTeamDrive': ?canMoveChildrenOutOfTeamDrive, |
| 'canMoveChildrenWithinDrive': ?canMoveChildrenWithinDrive, |
| 'canMoveChildrenWithinTeamDrive': ?canMoveChildrenWithinTeamDrive, |
| 'canMoveItemIntoTeamDrive': ?canMoveItemIntoTeamDrive, |
| 'canMoveItemOutOfDrive': ?canMoveItemOutOfDrive, |
| 'canMoveItemOutOfTeamDrive': ?canMoveItemOutOfTeamDrive, |
| 'canMoveItemWithinDrive': ?canMoveItemWithinDrive, |
| 'canMoveItemWithinTeamDrive': ?canMoveItemWithinTeamDrive, |
| 'canMoveTeamDriveItem': ?canMoveTeamDriveItem, |
| 'canReadDrive': ?canReadDrive, |
| 'canReadLabels': ?canReadLabels, |
| 'canReadRevisions': ?canReadRevisions, |
| 'canReadTeamDrive': ?canReadTeamDrive, |
| 'canRemoveChildren': ?canRemoveChildren, |
| 'canRemoveContentRestriction': ?canRemoveContentRestriction, |
| 'canRemoveMyDriveParent': ?canRemoveMyDriveParent, |
| 'canRename': ?canRename, |
| 'canShare': ?canShare, |
| 'canTrash': ?canTrash, |
| 'canTrashChildren': ?canTrashChildren, |
| 'canUntrash': ?canUntrash, |
| }; |
| } |
| } |
| |
| /// Geographic location information stored in the image. |
| /// |
| /// Output only. |
| class FileImageMediaMetadataLocation { |
| /// The altitude stored in the image. |
| /// |
| /// Output only. |
| core.double? altitude; |
| |
| /// The latitude stored in the image. |
| /// |
| /// Output only. |
| core.double? latitude; |
| |
| /// The longitude stored in the image. |
| /// |
| /// Output only. |
| core.double? longitude; |
| |
| FileImageMediaMetadataLocation({ |
| this.altitude, |
| this.latitude, |
| this.longitude, |
| }); |
| |
| FileImageMediaMetadataLocation.fromJson(core.Map json_) |
| : this( |
| altitude: (json_['altitude'] as core.num?)?.toDouble(), |
| latitude: (json_['latitude'] as core.num?)?.toDouble(), |
| longitude: (json_['longitude'] as core.num?)?.toDouble(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final altitude = this.altitude; |
| final latitude = this.latitude; |
| final longitude = this.longitude; |
| return { |
| 'altitude': ?altitude, |
| 'latitude': ?latitude, |
| 'longitude': ?longitude, |
| }; |
| } |
| } |
| |
| /// Metadata about image media. |
| /// |
| /// This will only be present for image types, and its contents will depend on |
| /// what can be parsed from the image content. |
| /// |
| /// Output only. |
| class FileImageMediaMetadata { |
| /// The aperture used to create the photo (f-number). |
| /// |
| /// Output only. |
| core.double? aperture; |
| |
| /// The make of the camera used to create the photo. |
| /// |
| /// Output only. |
| core.String? cameraMake; |
| |
| /// The model of the camera used to create the photo. |
| /// |
| /// Output only. |
| core.String? cameraModel; |
| |
| /// The color space of the photo. |
| /// |
| /// Output only. |
| core.String? colorSpace; |
| |
| /// The date and time the photo was taken (EXIF format timestamp). |
| /// |
| /// Output only. |
| core.String? date; |
| |
| /// The exposure bias of the photo (APEX value). |
| /// |
| /// Output only. |
| core.double? exposureBias; |
| |
| /// The exposure mode used to create the photo. |
| /// |
| /// Output only. |
| core.String? exposureMode; |
| |
| /// The length of the exposure, in seconds. |
| /// |
| /// Output only. |
| core.double? exposureTime; |
| |
| /// Whether a flash was used to create the photo. |
| /// |
| /// Output only. |
| core.bool? flashUsed; |
| |
| /// The focal length used to create the photo, in millimeters. |
| /// |
| /// Output only. |
| core.double? focalLength; |
| |
| /// The height of the image in pixels. |
| /// |
| /// Output only. |
| core.int? height; |
| |
| /// The ISO speed used to create the photo. |
| /// |
| /// Output only. |
| core.int? isoSpeed; |
| |
| /// The lens used to create the photo. |
| /// |
| /// Output only. |
| core.String? lens; |
| |
| /// Geographic location information stored in the image. |
| /// |
| /// Output only. |
| FileImageMediaMetadataLocation? location; |
| |
| /// The smallest f-number of the lens at the focal length used to create the |
| /// photo (APEX value). |
| /// |
| /// Output only. |
| core.double? maxApertureValue; |
| |
| /// The metering mode used to create the photo. |
| /// |
| /// Output only. |
| core.String? meteringMode; |
| |
| /// The number of clockwise 90 degree rotations applied from the image's |
| /// original orientation. |
| /// |
| /// Output only. |
| core.int? rotation; |
| |
| /// The type of sensor used to create the photo. |
| /// |
| /// Output only. |
| core.String? sensor; |
| |
| /// The distance to the subject of the photo, in meters. |
| /// |
| /// Output only. |
| core.int? subjectDistance; |
| |
| /// The white balance mode used to create the photo. |
| /// |
| /// Output only. |
| core.String? whiteBalance; |
| |
| /// The width of the image in pixels. |
| /// |
| /// Output only. |
| core.int? width; |
| |
| FileImageMediaMetadata({ |
| this.aperture, |
| this.cameraMake, |
| this.cameraModel, |
| this.colorSpace, |
| this.date, |
| this.exposureBias, |
| this.exposureMode, |
| this.exposureTime, |
| this.flashUsed, |
| this.focalLength, |
| this.height, |
| this.isoSpeed, |
| this.lens, |
| this.location, |
| this.maxApertureValue, |
| this.meteringMode, |
| this.rotation, |
| this.sensor, |
| this.subjectDistance, |
| this.whiteBalance, |
| this.width, |
| }); |
| |
| FileImageMediaMetadata.fromJson(core.Map json_) |
| : this( |
| aperture: (json_['aperture'] as core.num?)?.toDouble(), |
| cameraMake: json_['cameraMake'] as core.String?, |
| cameraModel: json_['cameraModel'] as core.String?, |
| colorSpace: json_['colorSpace'] as core.String?, |
| date: json_['date'] as core.String?, |
| exposureBias: (json_['exposureBias'] as core.num?)?.toDouble(), |
| exposureMode: json_['exposureMode'] as core.String?, |
| exposureTime: (json_['exposureTime'] as core.num?)?.toDouble(), |
| flashUsed: json_['flashUsed'] as core.bool?, |
| focalLength: (json_['focalLength'] as core.num?)?.toDouble(), |
| height: json_['height'] as core.int?, |
| isoSpeed: json_['isoSpeed'] as core.int?, |
| lens: json_['lens'] as core.String?, |
| location: json_.containsKey('location') |
| ? FileImageMediaMetadataLocation.fromJson( |
| json_['location'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| maxApertureValue: (json_['maxApertureValue'] as core.num?)?.toDouble(), |
| meteringMode: json_['meteringMode'] as core.String?, |
| rotation: json_['rotation'] as core.int?, |
| sensor: json_['sensor'] as core.String?, |
| subjectDistance: json_['subjectDistance'] as core.int?, |
| whiteBalance: json_['whiteBalance'] as core.String?, |
| width: json_['width'] as core.int?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final aperture = this.aperture; |
| final cameraMake = this.cameraMake; |
| final cameraModel = this.cameraModel; |
| final colorSpace = this.colorSpace; |
| final date = this.date; |
| final exposureBias = this.exposureBias; |
| final exposureMode = this.exposureMode; |
| final exposureTime = this.exposureTime; |
| final flashUsed = this.flashUsed; |
| final focalLength = this.focalLength; |
| final height = this.height; |
| final isoSpeed = this.isoSpeed; |
| final lens = this.lens; |
| final location = this.location; |
| final maxApertureValue = this.maxApertureValue; |
| final meteringMode = this.meteringMode; |
| final rotation = this.rotation; |
| final sensor = this.sensor; |
| final subjectDistance = this.subjectDistance; |
| final whiteBalance = this.whiteBalance; |
| final width = this.width; |
| return { |
| 'aperture': ?aperture, |
| 'cameraMake': ?cameraMake, |
| 'cameraModel': ?cameraModel, |
| 'colorSpace': ?colorSpace, |
| 'date': ?date, |
| 'exposureBias': ?exposureBias, |
| 'exposureMode': ?exposureMode, |
| 'exposureTime': ?exposureTime, |
| 'flashUsed': ?flashUsed, |
| 'focalLength': ?focalLength, |
| 'height': ?height, |
| 'isoSpeed': ?isoSpeed, |
| 'lens': ?lens, |
| 'location': ?location, |
| 'maxApertureValue': ?maxApertureValue, |
| 'meteringMode': ?meteringMode, |
| 'rotation': ?rotation, |
| 'sensor': ?sensor, |
| 'subjectDistance': ?subjectDistance, |
| 'whiteBalance': ?whiteBalance, |
| 'width': ?width, |
| }; |
| } |
| } |
| |
| /// Indexable text attributes for the file (can only be written) |
| class FileIndexableText { |
| /// The text to be indexed for this file. |
| core.String? text; |
| |
| FileIndexableText({this.text}); |
| |
| FileIndexableText.fromJson(core.Map json_) |
| : this(text: json_['text'] as core.String?); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final text = this.text; |
| return {'text': ?text}; |
| } |
| } |
| |
| /// An overview of the labels on the file. |
| /// |
| /// Output only. |
| class FileLabelInfo { |
| /// The set of labels on the file as requested by the label IDs in the |
| /// `includeLabels` parameter. |
| /// |
| /// By default, no labels are returned. |
| /// |
| /// Output only. |
| core.List<Label>? labels; |
| |
| FileLabelInfo({this.labels}); |
| |
| FileLabelInfo.fromJson(core.Map json_) |
| : this( |
| labels: (json_['labels'] as core.List?) |
| ?.map( |
| (value) => |
| Label.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final labels = this.labels; |
| return {'labels': ?labels}; |
| } |
| } |
| |
| /// A group of labels for the file. |
| class FileLabels { |
| /// Deprecated. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? hidden; |
| |
| /// Whether the file has been modified by this user. |
| /// |
| /// Output only. |
| core.bool? modified; |
| |
| /// Deprecated: Use `copyRequiresWriterPermission` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? restricted; |
| |
| /// Whether this file is starred by the user. |
| core.bool? starred; |
| |
| /// Whether this file has been trashed. |
| /// |
| /// This label applies to all users accessing the file; however, only owners |
| /// are allowed to see and untrash files. |
| core.bool? trashed; |
| |
| /// Whether this file has been viewed by this user. |
| core.bool? viewed; |
| |
| FileLabels({ |
| this.hidden, |
| this.modified, |
| this.restricted, |
| this.starred, |
| this.trashed, |
| this.viewed, |
| }); |
| |
| FileLabels.fromJson(core.Map json_) |
| : this( |
| hidden: json_['hidden'] as core.bool?, |
| modified: json_['modified'] as core.bool?, |
| restricted: json_['restricted'] as core.bool?, |
| starred: json_['starred'] as core.bool?, |
| trashed: json_['trashed'] as core.bool?, |
| viewed: json_['viewed'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final hidden = this.hidden; |
| final modified = this.modified; |
| final restricted = this.restricted; |
| final starred = this.starred; |
| final trashed = this.trashed; |
| final viewed = this.viewed; |
| return { |
| 'hidden': ?hidden, |
| 'modified': ?modified, |
| 'restricted': ?restricted, |
| 'starred': ?starred, |
| 'trashed': ?trashed, |
| 'viewed': ?viewed, |
| }; |
| } |
| } |
| |
| /// Contains details about the link URLs that clients are using to refer to this |
| /// item. |
| class FileLinkShareMetadata { |
| /// Whether the file is eligible for security update. |
| /// |
| /// Output only. |
| core.bool? securityUpdateEligible; |
| |
| /// Whether the security update is enabled for this file. |
| /// |
| /// Output only. |
| core.bool? securityUpdateEnabled; |
| |
| FileLinkShareMetadata({ |
| this.securityUpdateEligible, |
| this.securityUpdateEnabled, |
| }); |
| |
| FileLinkShareMetadata.fromJson(core.Map json_) |
| : this( |
| securityUpdateEligible: json_['securityUpdateEligible'] as core.bool?, |
| securityUpdateEnabled: json_['securityUpdateEnabled'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final securityUpdateEligible = this.securityUpdateEligible; |
| final securityUpdateEnabled = this.securityUpdateEnabled; |
| return { |
| 'securityUpdateEligible': ?securityUpdateEligible, |
| 'securityUpdateEnabled': ?securityUpdateEnabled, |
| }; |
| } |
| } |
| |
| /// Shortcut file details. |
| /// |
| /// Only populated for shortcut files, which have the mimeType field set to |
| /// `application/vnd.google-apps.shortcut`. Can only be set on `files.insert` |
| /// requests. |
| class FileShortcutDetails { |
| /// The ID of the file that this shortcut points to. |
| /// |
| /// Can only be set on `files.insert` requests. |
| core.String? targetId; |
| |
| /// The MIME type of the file that this shortcut points to. |
| /// |
| /// The value of this field is a snapshot of the target's MIME type, captured |
| /// when the shortcut is created. |
| /// |
| /// Output only. |
| core.String? targetMimeType; |
| |
| /// The ResourceKey for the target file. |
| /// |
| /// Output only. |
| core.String? targetResourceKey; |
| |
| FileShortcutDetails({ |
| this.targetId, |
| this.targetMimeType, |
| this.targetResourceKey, |
| }); |
| |
| FileShortcutDetails.fromJson(core.Map json_) |
| : this( |
| targetId: json_['targetId'] as core.String?, |
| targetMimeType: json_['targetMimeType'] as core.String?, |
| targetResourceKey: json_['targetResourceKey'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final targetId = this.targetId; |
| final targetMimeType = this.targetMimeType; |
| final targetResourceKey = this.targetResourceKey; |
| return { |
| 'targetId': ?targetId, |
| 'targetMimeType': ?targetMimeType, |
| 'targetResourceKey': ?targetResourceKey, |
| }; |
| } |
| } |
| |
| /// A thumbnail for the file. |
| /// |
| /// This will only be used if a standard thumbnail cannot be generated. |
| class FileThumbnail { |
| /// The URL-safe Base64 encoded bytes of the thumbnail image. |
| /// |
| /// It should conform to RFC 4648 section 5. |
| core.String? image; |
| core.List<core.int> get imageAsBytes => convert_1.base64.decode(image!); |
| |
| set imageAsBytes(core.List<core.int> bytes_) { |
| image = convert_1.base64 |
| .encode(bytes_) |
| .replaceAll('/', '_') |
| .replaceAll('+', '-'); |
| } |
| |
| /// The MIME type of the thumbnail. |
| core.String? mimeType; |
| |
| FileThumbnail({this.image, this.mimeType}); |
| |
| FileThumbnail.fromJson(core.Map json_) |
| : this( |
| image: json_['image'] as core.String?, |
| mimeType: json_['mimeType'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final image = this.image; |
| final mimeType = this.mimeType; |
| return {'image': ?image, 'mimeType': ?mimeType}; |
| } |
| } |
| |
| /// Metadata about video media. |
| /// |
| /// This will only be present for video types. |
| /// |
| /// Output only. |
| class FileVideoMediaMetadata { |
| /// The duration of the video in milliseconds. |
| /// |
| /// Output only. |
| core.String? durationMillis; |
| |
| /// The height of the video in pixels. |
| /// |
| /// Output only. |
| core.int? height; |
| |
| /// The width of the video in pixels. |
| /// |
| /// Output only. |
| core.int? width; |
| |
| FileVideoMediaMetadata({this.durationMillis, this.height, this.width}); |
| |
| FileVideoMediaMetadata.fromJson(core.Map json_) |
| : this( |
| durationMillis: json_['durationMillis'] as core.String?, |
| height: json_['height'] as core.int?, |
| width: json_['width'] as core.int?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final durationMillis = this.durationMillis; |
| final height = this.height; |
| final width = this.width; |
| return { |
| 'durationMillis': ?durationMillis, |
| 'height': ?height, |
| 'width': ?width, |
| }; |
| } |
| } |
| |
| /// The metadata for a file. |
| /// |
| /// Some resource methods (such as `files.update`) require a `fileId`. Use the |
| /// `files.list` method to retrieve the ID for a file. |
| class File { |
| /// A link for opening the file in a relevant Google editor or viewer. |
| /// |
| /// Output only. |
| core.String? alternateLink; |
| |
| /// Whether this file is in the Application Data folder. |
| /// |
| /// Output only. |
| core.bool? appDataContents; |
| |
| /// Deprecated: Use `capabilities/canComment` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canComment; |
| |
| /// Deprecated: Use `capabilities/canReadRevisions` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canReadRevisions; |
| |
| /// Capabilities the current user has on this file. |
| /// |
| /// Each capability corresponds to a fine-grained action that a user may take. |
| /// |
| /// Output only. |
| FileCapabilities? capabilities; |
| |
| /// Client Side Encryption related details. |
| /// |
| /// Contains details about the encryption state of the file and details |
| /// regarding the encryption mechanism that clients need to use when |
| /// decrypting the contents of this item. This will only be present on files |
| /// and not on folders or shortcuts. |
| ClientEncryptionDetails? clientEncryptionDetails; |
| |
| /// Restrictions for accessing the content of the file. |
| /// |
| /// Only populated if such a restriction exists. |
| core.List<ContentRestriction>? contentRestrictions; |
| |
| /// Whether the options to copy, print, or download this file, should be |
| /// disabled for readers and commenters. |
| core.bool? copyRequiresWriterPermission; |
| |
| /// Deprecated: Use `capabilities/canCopy` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? copyable; |
| |
| /// Create time for this file (formatted RFC 3339 timestamp). |
| core.DateTime? createdDate; |
| |
| /// A link to open this file with the user's default app for this file. |
| /// |
| /// Only populated when the drive.apps.readonly scope is used. |
| /// |
| /// Output only. |
| core.String? defaultOpenWithLink; |
| |
| /// A short description of the file. |
| core.String? description; |
| |
| /// Short lived download URL for the file. |
| /// |
| /// This field is only populated for files with content stored in Google |
| /// Drive; it is not populated for Google Docs or shortcut files. |
| /// |
| /// Output only. |
| core.String? downloadUrl; |
| |
| /// ID of the shared drive the file resides in. |
| /// |
| /// Only populated for items in shared drives. |
| /// |
| /// Output only. |
| core.String? driveId; |
| |
| /// Deprecated: Use `capabilities/canEdit` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? editable; |
| |
| /// A link for embedding the file. |
| /// |
| /// Output only. |
| core.String? embedLink; |
| |
| /// ETag of the file. |
| /// |
| /// Output only. |
| core.String? etag; |
| |
| /// Whether this file has been explicitly trashed, as opposed to recursively |
| /// trashed. |
| /// |
| /// Output only. |
| core.bool? explicitlyTrashed; |
| |
| /// Links for exporting Docs Editors files to specific formats. |
| /// |
| /// Output only. |
| core.Map<core.String, core.String>? exportLinks; |
| |
| /// The final component of `fullFileExtension` with trailing text that does |
| /// not appear to be part of the extension removed. |
| /// |
| /// This field is only populated for files with content stored in Google |
| /// Drive; it is not populated for Docs Editors or shortcut files. |
| /// |
| /// Output only. |
| core.String? fileExtension; |
| |
| /// Size in bytes of blobs and first party editor files. |
| /// |
| /// Won't be populated for files that have no size, like shortcuts and |
| /// folders. |
| /// |
| /// Output only. |
| core.String? fileSize; |
| |
| /// Folder color as an RGB hex string if the file is a folder or a shortcut to |
| /// a folder. |
| /// |
| /// The list of supported colors is available in the folderColorPalette field |
| /// of the About resource. If an unsupported color is specified, it will be |
| /// changed to the closest color in the palette. |
| core.String? folderColorRgb; |
| |
| /// The full file extension; extracted from the title. |
| /// |
| /// May contain multiple concatenated extensions, such as "tar.gz". Removing |
| /// an extension from the title does not clear this field; however, changing |
| /// the extension on the title does update this field. This field is only |
| /// populated for files with content stored in Google Drive; it is not |
| /// populated for Docs Editors or shortcut files. |
| /// |
| /// Output only. |
| core.String? fullFileExtension; |
| |
| /// Whether there are permissions directly on this file. |
| /// |
| /// This field is only populated for items in shared drives. |
| /// |
| /// Output only. |
| core.bool? hasAugmentedPermissions; |
| |
| /// Whether this file has a thumbnail. |
| /// |
| /// This does not indicate whether the requesting app has access to the |
| /// thumbnail. To check access, look for the presence of the thumbnailLink |
| /// field. |
| /// |
| /// Output only. |
| core.bool? hasThumbnail; |
| |
| /// The ID of the file's head revision. |
| /// |
| /// This field is only populated for files with content stored in Google |
| /// Drive; it is not populated for Docs Editors or shortcut files. |
| /// |
| /// Output only. |
| core.String? headRevisionId; |
| |
| /// A link to the file's icon. |
| /// |
| /// Output only. |
| core.String? iconLink; |
| |
| /// The ID of the file. |
| core.String? id; |
| |
| /// Metadata about image media. |
| /// |
| /// This will only be present for image types, and its contents will depend on |
| /// what can be parsed from the image content. |
| /// |
| /// Output only. |
| FileImageMediaMetadata? imageMediaMetadata; |
| |
| /// Indexable text attributes for the file (can only be written) |
| FileIndexableText? indexableText; |
| |
| /// Whether this file has inherited permissions disabled. |
| /// |
| /// Inherited permissions are enabled by default. |
| core.bool? inheritedPermissionsDisabled; |
| |
| /// Whether the file was created or opened by the requesting app. |
| /// |
| /// Output only. |
| core.bool? isAppAuthorized; |
| |
| /// The type of file. |
| /// |
| /// This is always `drive#file`. |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// An overview of the labels on the file. |
| /// |
| /// Output only. |
| FileLabelInfo? labelInfo; |
| |
| /// A group of labels for the file. |
| FileLabels? labels; |
| |
| /// The last user to modify this file. |
| /// |
| /// This field is only populated when the last modification was performed by a |
| /// signed-in user. |
| /// |
| /// Output only. |
| User? lastModifyingUser; |
| |
| /// Name of the last user to modify this file. |
| /// |
| /// Output only. |
| core.String? lastModifyingUserName; |
| |
| /// Last time this file was viewed by the user (formatted RFC 3339 timestamp). |
| core.DateTime? lastViewedByMeDate; |
| |
| /// Contains details about the link URLs that clients are using to refer to |
| /// this item. |
| FileLinkShareMetadata? linkShareMetadata; |
| |
| /// Deprecated. |
| core.DateTime? markedViewedByMeDate; |
| |
| /// An MD5 checksum for the content of this file. |
| /// |
| /// This field is only populated for files with content stored in Google |
| /// Drive; it is not populated for Docs Editors or shortcut files. |
| /// |
| /// Output only. |
| core.String? md5Checksum; |
| |
| /// The MIME type of the file. |
| /// |
| /// This is only mutable on update when uploading new content. This field can |
| /// be left blank, and the mimetype will be determined from the uploaded |
| /// content's MIME type. |
| core.String? mimeType; |
| |
| /// Last time this file was modified by the user (formatted RFC 3339 |
| /// timestamp). |
| /// |
| /// Note that setting modifiedDate will also update the modifiedByMe date for |
| /// the user which set the date. |
| core.DateTime? modifiedByMeDate; |
| |
| /// Last time this file was modified by anyone (formatted RFC 3339 timestamp). |
| /// |
| /// This is only mutable on update when the setModifiedDate parameter is set. |
| core.DateTime? modifiedDate; |
| |
| /// A map of the id of each of the user's apps to a link to open this file |
| /// with that app. |
| /// |
| /// Only populated when the drive.apps.readonly scope is used. |
| /// |
| /// Output only. |
| core.Map<core.String, core.String>? openWithLinks; |
| |
| /// The original filename of the uploaded content if available, or else the |
| /// original value of the `title` field. |
| /// |
| /// This is only available for files with binary content in Google Drive. |
| core.String? originalFilename; |
| |
| /// Whether the file is owned by the current user. |
| /// |
| /// Not populated for items in shared drives. |
| /// |
| /// Output only. |
| core.bool? ownedByMe; |
| |
| /// Name(s) of the owner(s) of this file. |
| /// |
| /// Not populated for items in shared drives. |
| /// |
| /// Output only. |
| core.List<core.String>? ownerNames; |
| |
| /// The owner of this file. |
| /// |
| /// Only certain legacy files may have more than one owner. This field isn't |
| /// populated for items in shared drives. |
| /// |
| /// Output only. |
| core.List<User>? owners; |
| |
| /// The ID of the parent folder containing the file. |
| /// |
| /// A file can only have one parent folder; specifying multiple parents isn't |
| /// supported. If not specified as part of an insert request, the file is |
| /// placed directly in the user's My Drive folder. If not specified as part of |
| /// a copy request, the file inherits any discoverable parent of the source |
| /// file. Update requests must use the `addParents` and `removeParents` |
| /// parameters to modify the parents list. |
| core.List<ParentReference>? parents; |
| |
| /// List of permission IDs for users with access to this file. |
| /// |
| /// Output only. |
| core.List<core.String>? permissionIds; |
| |
| /// The list of permissions for users with access to this file. |
| /// |
| /// Not populated for items in shared drives. |
| /// |
| /// Output only. |
| core.List<Permission>? permissions; |
| |
| /// The list of properties. |
| core.List<Property>? properties; |
| |
| /// The number of quota bytes used by this file. |
| /// |
| /// Output only. |
| core.String? quotaBytesUsed; |
| |
| /// A key needed to access the item via a shared link. |
| /// |
| /// Output only. |
| core.String? resourceKey; |
| |
| /// A link back to this file. |
| /// |
| /// Output only. |
| core.String? selfLink; |
| |
| /// The SHA1 checksum associated with this file, if available. |
| /// |
| /// This field is only populated for files with content stored in Google |
| /// Drive; it is not populated for Docs Editors or shortcut files. |
| /// |
| /// Output only. |
| core.String? sha1Checksum; |
| |
| /// The SHA256 checksum associated with this file, if available. |
| /// |
| /// This field is only populated for files with content stored in Google |
| /// Drive; it is not populated for Docs Editors or shortcut files. |
| /// |
| /// Output only. |
| core.String? sha256Checksum; |
| |
| /// Deprecated: Use `capabilities/canShare` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? shareable; |
| |
| /// Whether the file has been shared. |
| /// |
| /// Not populated for items in shared drives. |
| /// |
| /// Output only. |
| core.bool? shared; |
| |
| /// Time at which this file was shared with the user (formatted RFC 3339 |
| /// timestamp). |
| core.DateTime? sharedWithMeDate; |
| |
| /// User that shared the item with the current user, if available. |
| /// |
| /// Output only. |
| User? sharingUser; |
| |
| /// Shortcut file details. |
| /// |
| /// Only populated for shortcut files, which have the mimeType field set to |
| /// `application/vnd.google-apps.shortcut`. Can only be set on `files.insert` |
| /// requests. |
| FileShortcutDetails? shortcutDetails; |
| |
| /// The list of spaces which contain the file. |
| /// |
| /// Supported values are `drive`, `appDataFolder` and `photos`. |
| /// |
| /// Output only. |
| core.List<core.String>? spaces; |
| |
| /// Deprecated: Use `driveId` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? teamDriveId; |
| |
| /// A thumbnail for the file. |
| /// |
| /// This will only be used if a standard thumbnail cannot be generated. |
| FileThumbnail? thumbnail; |
| |
| /// A short-lived link to the file's thumbnail, if available. |
| /// |
| /// Typically lasts on the order of hours. Not intended for direct usage on |
| /// web applications due to \[Cross-Origin Resource Sharing |
| /// (CORS)\](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), consider |
| /// using a proxy server. Only populated when the requesting app can access |
| /// the file's content. If the file isn't shared publicly, the URL returned in |
| /// `Files.thumbnailLink` must be fetched using a credentialed request. |
| /// |
| /// Output only. |
| core.String? thumbnailLink; |
| |
| /// The thumbnail version for use in thumbnail cache invalidation. |
| /// |
| /// Output only. |
| core.String? thumbnailVersion; |
| |
| /// The title of this file. |
| /// |
| /// Note that for immutable items such as the top level folders of shared |
| /// drives, My Drive root folder, and Application Data folder the title is |
| /// constant. |
| core.String? title; |
| |
| /// The time that the item was trashed (formatted RFC 3339 timestamp). |
| /// |
| /// Only populated for items in shared drives. |
| core.DateTime? trashedDate; |
| |
| /// If the file has been explicitly trashed, the user who trashed it. |
| /// |
| /// Only populated for items in shared drives. |
| /// |
| /// Output only. |
| User? trashingUser; |
| |
| /// The permissions for the authenticated user on this file. |
| /// |
| /// Output only. |
| Permission? userPermission; |
| |
| /// A monotonically increasing version number for the file. |
| /// |
| /// This reflects every change made to the file on the server, even those not |
| /// visible to the requesting user. |
| /// |
| /// Output only. |
| core.String? version; |
| |
| /// Metadata about video media. |
| /// |
| /// This will only be present for video types. |
| /// |
| /// Output only. |
| FileVideoMediaMetadata? videoMediaMetadata; |
| |
| /// A link for downloading the content of the file in a browser using cookie |
| /// based authentication. |
| /// |
| /// In cases where the content is shared publicly, the content can be |
| /// downloaded without any credentials. |
| /// |
| /// Output only. |
| core.String? webContentLink; |
| |
| /// A link only available on public folders for viewing their static web |
| /// assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting. |
| /// |
| /// Output only. |
| core.String? webViewLink; |
| |
| /// Whether writers can share the document with other users. |
| /// |
| /// Not populated for items in shared drives. |
| core.bool? writersCanShare; |
| |
| File({ |
| this.alternateLink, |
| this.appDataContents, |
| this.canComment, |
| this.canReadRevisions, |
| this.capabilities, |
| this.clientEncryptionDetails, |
| this.contentRestrictions, |
| this.copyRequiresWriterPermission, |
| this.copyable, |
| this.createdDate, |
| this.defaultOpenWithLink, |
| this.description, |
| this.downloadUrl, |
| this.driveId, |
| this.editable, |
| this.embedLink, |
| this.etag, |
| this.explicitlyTrashed, |
| this.exportLinks, |
| this.fileExtension, |
| this.fileSize, |
| this.folderColorRgb, |
| this.fullFileExtension, |
| this.hasAugmentedPermissions, |
| this.hasThumbnail, |
| this.headRevisionId, |
| this.iconLink, |
| this.id, |
| this.imageMediaMetadata, |
| this.indexableText, |
| this.inheritedPermissionsDisabled, |
| this.isAppAuthorized, |
| this.kind, |
| this.labelInfo, |
| this.labels, |
| this.lastModifyingUser, |
| this.lastModifyingUserName, |
| this.lastViewedByMeDate, |
| this.linkShareMetadata, |
| this.markedViewedByMeDate, |
| this.md5Checksum, |
| this.mimeType, |
| this.modifiedByMeDate, |
| this.modifiedDate, |
| this.openWithLinks, |
| this.originalFilename, |
| this.ownedByMe, |
| this.ownerNames, |
| this.owners, |
| this.parents, |
| this.permissionIds, |
| this.permissions, |
| this.properties, |
| this.quotaBytesUsed, |
| this.resourceKey, |
| this.selfLink, |
| this.sha1Checksum, |
| this.sha256Checksum, |
| this.shareable, |
| this.shared, |
| this.sharedWithMeDate, |
| this.sharingUser, |
| this.shortcutDetails, |
| this.spaces, |
| this.teamDriveId, |
| this.thumbnail, |
| this.thumbnailLink, |
| this.thumbnailVersion, |
| this.title, |
| this.trashedDate, |
| this.trashingUser, |
| this.userPermission, |
| this.version, |
| this.videoMediaMetadata, |
| this.webContentLink, |
| this.webViewLink, |
| this.writersCanShare, |
| }); |
| |
| File.fromJson(core.Map json_) |
| : this( |
| alternateLink: json_['alternateLink'] as core.String?, |
| appDataContents: json_['appDataContents'] as core.bool?, |
| canComment: json_['canComment'] as core.bool?, |
| canReadRevisions: json_['canReadRevisions'] as core.bool?, |
| capabilities: json_.containsKey('capabilities') |
| ? FileCapabilities.fromJson( |
| json_['capabilities'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| clientEncryptionDetails: json_.containsKey('clientEncryptionDetails') |
| ? ClientEncryptionDetails.fromJson( |
| json_['clientEncryptionDetails'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| contentRestrictions: (json_['contentRestrictions'] as core.List?) |
| ?.map( |
| (value) => ContentRestriction.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| copyRequiresWriterPermission: |
| json_['copyRequiresWriterPermission'] as core.bool?, |
| copyable: json_['copyable'] as core.bool?, |
| createdDate: json_.containsKey('createdDate') |
| ? core.DateTime.parse(json_['createdDate'] as core.String) |
| : null, |
| defaultOpenWithLink: json_['defaultOpenWithLink'] as core.String?, |
| description: json_['description'] as core.String?, |
| downloadUrl: json_['downloadUrl'] as core.String?, |
| driveId: json_['driveId'] as core.String?, |
| editable: json_['editable'] as core.bool?, |
| embedLink: json_['embedLink'] as core.String?, |
| etag: json_['etag'] as core.String?, |
| explicitlyTrashed: json_['explicitlyTrashed'] as core.bool?, |
| exportLinks: |
| (json_['exportLinks'] as core.Map<core.String, core.dynamic>?)?.map( |
| (key, value) => core.MapEntry(key, value as core.String), |
| ), |
| fileExtension: json_['fileExtension'] as core.String?, |
| fileSize: json_['fileSize'] as core.String?, |
| folderColorRgb: json_['folderColorRgb'] as core.String?, |
| fullFileExtension: json_['fullFileExtension'] as core.String?, |
| hasAugmentedPermissions: json_['hasAugmentedPermissions'] as core.bool?, |
| hasThumbnail: json_['hasThumbnail'] as core.bool?, |
| headRevisionId: json_['headRevisionId'] as core.String?, |
| iconLink: json_['iconLink'] as core.String?, |
| id: json_['id'] as core.String?, |
| imageMediaMetadata: json_.containsKey('imageMediaMetadata') |
| ? FileImageMediaMetadata.fromJson( |
| json_['imageMediaMetadata'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| indexableText: json_.containsKey('indexableText') |
| ? FileIndexableText.fromJson( |
| json_['indexableText'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| inheritedPermissionsDisabled: |
| json_['inheritedPermissionsDisabled'] as core.bool?, |
| isAppAuthorized: json_['isAppAuthorized'] as core.bool?, |
| kind: json_['kind'] as core.String?, |
| labelInfo: json_.containsKey('labelInfo') |
| ? FileLabelInfo.fromJson( |
| json_['labelInfo'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| labels: json_.containsKey('labels') |
| ? FileLabels.fromJson( |
| json_['labels'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| lastModifyingUser: json_.containsKey('lastModifyingUser') |
| ? User.fromJson( |
| json_['lastModifyingUser'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| lastModifyingUserName: json_['lastModifyingUserName'] as core.String?, |
| lastViewedByMeDate: json_.containsKey('lastViewedByMeDate') |
| ? core.DateTime.parse(json_['lastViewedByMeDate'] as core.String) |
| : null, |
| linkShareMetadata: json_.containsKey('linkShareMetadata') |
| ? FileLinkShareMetadata.fromJson( |
| json_['linkShareMetadata'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| markedViewedByMeDate: json_.containsKey('markedViewedByMeDate') |
| ? core.DateTime.parse(json_['markedViewedByMeDate'] as core.String) |
| : null, |
| md5Checksum: json_['md5Checksum'] as core.String?, |
| mimeType: json_['mimeType'] as core.String?, |
| modifiedByMeDate: json_.containsKey('modifiedByMeDate') |
| ? core.DateTime.parse(json_['modifiedByMeDate'] as core.String) |
| : null, |
| modifiedDate: json_.containsKey('modifiedDate') |
| ? core.DateTime.parse(json_['modifiedDate'] as core.String) |
| : null, |
| openWithLinks: |
| (json_['openWithLinks'] as core.Map<core.String, core.dynamic>?) |
| ?.map((key, value) => core.MapEntry(key, value as core.String)), |
| originalFilename: json_['originalFilename'] as core.String?, |
| ownedByMe: json_['ownedByMe'] as core.bool?, |
| ownerNames: (json_['ownerNames'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| owners: (json_['owners'] as core.List?) |
| ?.map( |
| (value) => |
| User.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| parents: (json_['parents'] as core.List?) |
| ?.map( |
| (value) => ParentReference.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| permissionIds: (json_['permissionIds'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| permissions: (json_['permissions'] as core.List?) |
| ?.map( |
| (value) => Permission.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| properties: (json_['properties'] as core.List?) |
| ?.map( |
| (value) => Property.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| quotaBytesUsed: json_['quotaBytesUsed'] as core.String?, |
| resourceKey: json_['resourceKey'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| sha1Checksum: json_['sha1Checksum'] as core.String?, |
| sha256Checksum: json_['sha256Checksum'] as core.String?, |
| shareable: json_['shareable'] as core.bool?, |
| shared: json_['shared'] as core.bool?, |
| sharedWithMeDate: json_.containsKey('sharedWithMeDate') |
| ? core.DateTime.parse(json_['sharedWithMeDate'] as core.String) |
| : null, |
| sharingUser: json_.containsKey('sharingUser') |
| ? User.fromJson( |
| json_['sharingUser'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| shortcutDetails: json_.containsKey('shortcutDetails') |
| ? FileShortcutDetails.fromJson( |
| json_['shortcutDetails'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| spaces: (json_['spaces'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| teamDriveId: json_['teamDriveId'] as core.String?, |
| thumbnail: json_.containsKey('thumbnail') |
| ? FileThumbnail.fromJson( |
| json_['thumbnail'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| thumbnailLink: json_['thumbnailLink'] as core.String?, |
| thumbnailVersion: json_['thumbnailVersion'] as core.String?, |
| title: json_['title'] as core.String?, |
| trashedDate: json_.containsKey('trashedDate') |
| ? core.DateTime.parse(json_['trashedDate'] as core.String) |
| : null, |
| trashingUser: json_.containsKey('trashingUser') |
| ? User.fromJson( |
| json_['trashingUser'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| userPermission: json_.containsKey('userPermission') |
| ? Permission.fromJson( |
| json_['userPermission'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| version: json_['version'] as core.String?, |
| videoMediaMetadata: json_.containsKey('videoMediaMetadata') |
| ? FileVideoMediaMetadata.fromJson( |
| json_['videoMediaMetadata'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| webContentLink: json_['webContentLink'] as core.String?, |
| webViewLink: json_['webViewLink'] as core.String?, |
| writersCanShare: json_['writersCanShare'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final alternateLink = this.alternateLink; |
| final appDataContents = this.appDataContents; |
| final canComment = this.canComment; |
| final canReadRevisions = this.canReadRevisions; |
| final capabilities = this.capabilities; |
| final clientEncryptionDetails = this.clientEncryptionDetails; |
| final contentRestrictions = this.contentRestrictions; |
| final copyRequiresWriterPermission = this.copyRequiresWriterPermission; |
| final copyable = this.copyable; |
| final createdDate = this.createdDate; |
| final defaultOpenWithLink = this.defaultOpenWithLink; |
| final description = this.description; |
| final downloadUrl = this.downloadUrl; |
| final driveId = this.driveId; |
| final editable = this.editable; |
| final embedLink = this.embedLink; |
| final etag = this.etag; |
| final explicitlyTrashed = this.explicitlyTrashed; |
| final exportLinks = this.exportLinks; |
| final fileExtension = this.fileExtension; |
| final fileSize = this.fileSize; |
| final folderColorRgb = this.folderColorRgb; |
| final fullFileExtension = this.fullFileExtension; |
| final hasAugmentedPermissions = this.hasAugmentedPermissions; |
| final hasThumbnail = this.hasThumbnail; |
| final headRevisionId = this.headRevisionId; |
| final iconLink = this.iconLink; |
| final id = this.id; |
| final imageMediaMetadata = this.imageMediaMetadata; |
| final indexableText = this.indexableText; |
| final inheritedPermissionsDisabled = this.inheritedPermissionsDisabled; |
| final isAppAuthorized = this.isAppAuthorized; |
| final kind = this.kind; |
| final labelInfo = this.labelInfo; |
| final labels = this.labels; |
| final lastModifyingUser = this.lastModifyingUser; |
| final lastModifyingUserName = this.lastModifyingUserName; |
| final lastViewedByMeDate = this.lastViewedByMeDate; |
| final linkShareMetadata = this.linkShareMetadata; |
| final markedViewedByMeDate = this.markedViewedByMeDate; |
| final md5Checksum = this.md5Checksum; |
| final mimeType = this.mimeType; |
| final modifiedByMeDate = this.modifiedByMeDate; |
| final modifiedDate = this.modifiedDate; |
| final openWithLinks = this.openWithLinks; |
| final originalFilename = this.originalFilename; |
| final ownedByMe = this.ownedByMe; |
| final ownerNames = this.ownerNames; |
| final owners = this.owners; |
| final parents = this.parents; |
| final permissionIds = this.permissionIds; |
| final permissions = this.permissions; |
| final properties = this.properties; |
| final quotaBytesUsed = this.quotaBytesUsed; |
| final resourceKey = this.resourceKey; |
| final selfLink = this.selfLink; |
| final sha1Checksum = this.sha1Checksum; |
| final sha256Checksum = this.sha256Checksum; |
| final shareable = this.shareable; |
| final shared = this.shared; |
| final sharedWithMeDate = this.sharedWithMeDate; |
| final sharingUser = this.sharingUser; |
| final shortcutDetails = this.shortcutDetails; |
| final spaces = this.spaces; |
| final teamDriveId = this.teamDriveId; |
| final thumbnail = this.thumbnail; |
| final thumbnailLink = this.thumbnailLink; |
| final thumbnailVersion = this.thumbnailVersion; |
| final title = this.title; |
| final trashedDate = this.trashedDate; |
| final trashingUser = this.trashingUser; |
| final userPermission = this.userPermission; |
| final version = this.version; |
| final videoMediaMetadata = this.videoMediaMetadata; |
| final webContentLink = this.webContentLink; |
| final webViewLink = this.webViewLink; |
| final writersCanShare = this.writersCanShare; |
| return { |
| 'alternateLink': ?alternateLink, |
| 'appDataContents': ?appDataContents, |
| 'canComment': ?canComment, |
| 'canReadRevisions': ?canReadRevisions, |
| 'capabilities': ?capabilities, |
| 'clientEncryptionDetails': ?clientEncryptionDetails, |
| 'contentRestrictions': ?contentRestrictions, |
| 'copyRequiresWriterPermission': ?copyRequiresWriterPermission, |
| 'copyable': ?copyable, |
| 'createdDate': ?createdDate?.toUtc().toIso8601String(), |
| 'defaultOpenWithLink': ?defaultOpenWithLink, |
| 'description': ?description, |
| 'downloadUrl': ?downloadUrl, |
| 'driveId': ?driveId, |
| 'editable': ?editable, |
| 'embedLink': ?embedLink, |
| 'etag': ?etag, |
| 'explicitlyTrashed': ?explicitlyTrashed, |
| 'exportLinks': ?exportLinks, |
| 'fileExtension': ?fileExtension, |
| 'fileSize': ?fileSize, |
| 'folderColorRgb': ?folderColorRgb, |
| 'fullFileExtension': ?fullFileExtension, |
| 'hasAugmentedPermissions': ?hasAugmentedPermissions, |
| 'hasThumbnail': ?hasThumbnail, |
| 'headRevisionId': ?headRevisionId, |
| 'iconLink': ?iconLink, |
| 'id': ?id, |
| 'imageMediaMetadata': ?imageMediaMetadata, |
| 'indexableText': ?indexableText, |
| 'inheritedPermissionsDisabled': ?inheritedPermissionsDisabled, |
| 'isAppAuthorized': ?isAppAuthorized, |
| 'kind': ?kind, |
| 'labelInfo': ?labelInfo, |
| 'labels': ?labels, |
| 'lastModifyingUser': ?lastModifyingUser, |
| 'lastModifyingUserName': ?lastModifyingUserName, |
| 'lastViewedByMeDate': ?lastViewedByMeDate?.toUtc().toIso8601String(), |
| 'linkShareMetadata': ?linkShareMetadata, |
| 'markedViewedByMeDate': ?markedViewedByMeDate?.toUtc().toIso8601String(), |
| 'md5Checksum': ?md5Checksum, |
| 'mimeType': ?mimeType, |
| 'modifiedByMeDate': ?modifiedByMeDate?.toUtc().toIso8601String(), |
| 'modifiedDate': ?modifiedDate?.toUtc().toIso8601String(), |
| 'openWithLinks': ?openWithLinks, |
| 'originalFilename': ?originalFilename, |
| 'ownedByMe': ?ownedByMe, |
| 'ownerNames': ?ownerNames, |
| 'owners': ?owners, |
| 'parents': ?parents, |
| 'permissionIds': ?permissionIds, |
| 'permissions': ?permissions, |
| 'properties': ?properties, |
| 'quotaBytesUsed': ?quotaBytesUsed, |
| 'resourceKey': ?resourceKey, |
| 'selfLink': ?selfLink, |
| 'sha1Checksum': ?sha1Checksum, |
| 'sha256Checksum': ?sha256Checksum, |
| 'shareable': ?shareable, |
| 'shared': ?shared, |
| 'sharedWithMeDate': ?sharedWithMeDate?.toUtc().toIso8601String(), |
| 'sharingUser': ?sharingUser, |
| 'shortcutDetails': ?shortcutDetails, |
| 'spaces': ?spaces, |
| 'teamDriveId': ?teamDriveId, |
| 'thumbnail': ?thumbnail, |
| 'thumbnailLink': ?thumbnailLink, |
| 'thumbnailVersion': ?thumbnailVersion, |
| 'title': ?title, |
| 'trashedDate': ?trashedDate?.toUtc().toIso8601String(), |
| 'trashingUser': ?trashingUser, |
| 'userPermission': ?userPermission, |
| 'version': ?version, |
| 'videoMediaMetadata': ?videoMediaMetadata, |
| 'webContentLink': ?webContentLink, |
| 'webViewLink': ?webViewLink, |
| 'writersCanShare': ?writersCanShare, |
| }; |
| } |
| } |
| |
| /// A list of files. |
| class FileList { |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// Whether the search process was incomplete. |
| /// |
| /// If true, then some search results may be missing, since all documents were |
| /// not searched. This may occur when searching multiple drives with the |
| /// "allDrives" corpora, but all corpora could not be searched. When this |
| /// happens, it is suggested that clients narrow their query by choosing a |
| /// different corpus such as "default" or "drive". |
| core.bool? incompleteSearch; |
| |
| /// The list of files. |
| /// |
| /// If nextPageToken is populated, then this list may be incomplete and an |
| /// additional page of results should be fetched. |
| core.List<File>? items; |
| |
| /// This is always `drive#fileList`. |
| core.String? kind; |
| |
| /// A link to the next page of files. |
| core.String? nextLink; |
| |
| /// The page token for the next page of files. |
| /// |
| /// This will be absent if the end of the files list has been reached. If the |
| /// token is rejected for any reason, it should be discarded, and pagination |
| /// should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| FileList({ |
| this.etag, |
| this.incompleteSearch, |
| this.items, |
| this.kind, |
| this.nextLink, |
| this.nextPageToken, |
| this.selfLink, |
| }); |
| |
| FileList.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| incompleteSearch: json_['incompleteSearch'] as core.bool?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => |
| File.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextLink: json_['nextLink'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final incompleteSearch = this.incompleteSearch; |
| final items = this.items; |
| final kind = this.kind; |
| final nextLink = this.nextLink; |
| final nextPageToken = this.nextPageToken; |
| final selfLink = this.selfLink; |
| return { |
| 'etag': ?etag, |
| 'incompleteSearch': ?incompleteSearch, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'nextLink': ?nextLink, |
| 'nextPageToken': ?nextPageToken, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// JWT and associated metadata used to generate CSE files. |
| typedef GenerateCseTokenResponse = $GenerateCseTokenResponse; |
| |
| /// A list of generated IDs which can be provided in insert requests |
| class GeneratedIds { |
| /// The IDs generated for the requesting user in the specified space. |
| core.List<core.String>? ids; |
| |
| /// This is always `drive#generatedIds` |
| core.String? kind; |
| |
| /// The type of file that can be created with these IDs. |
| core.String? space; |
| |
| GeneratedIds({this.ids, this.kind, this.space}); |
| |
| GeneratedIds.fromJson(core.Map json_) |
| : this( |
| ids: (json_['ids'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| space: json_['space'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final ids = this.ids; |
| final kind = this.kind; |
| final space = this.space; |
| return {'ids': ?ids, 'kind': ?kind, 'space': ?space}; |
| } |
| } |
| |
| /// Representation of a label and label fields. |
| class Label { |
| /// A map of the fields on the label, keyed by the field's ID. |
| core.Map<core.String, LabelField>? fields; |
| |
| /// The ID of the label. |
| core.String? id; |
| |
| /// This is always `drive#label` |
| core.String? kind; |
| |
| /// The revision ID of the label. |
| core.String? revisionId; |
| |
| Label({this.fields, this.id, this.kind, this.revisionId}); |
| |
| Label.fromJson(core.Map json_) |
| : this( |
| fields: (json_['fields'] as core.Map<core.String, core.dynamic>?)?.map( |
| (key, value) => core.MapEntry( |
| key, |
| LabelField.fromJson(value as core.Map<core.String, core.dynamic>), |
| ), |
| ), |
| id: json_['id'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| revisionId: json_['revisionId'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final fields = this.fields; |
| final id = this.id; |
| final kind = this.kind; |
| final revisionId = this.revisionId; |
| return { |
| 'fields': ?fields, |
| 'id': ?id, |
| 'kind': ?kind, |
| 'revisionId': ?revisionId, |
| }; |
| } |
| } |
| |
| /// Representation of field, which is a typed key-value pair. |
| class LabelField { |
| /// Only present if valueType is dateString. |
| /// |
| /// RFC 3339 formatted date: YYYY-MM-DD. |
| core.List<core.DateTime>? dateString; |
| |
| /// The identifier of this label field. |
| core.String? id; |
| |
| /// Only present if `valueType` is `integer`. |
| core.List<core.String>? integer; |
| |
| /// This is always `drive#labelField`. |
| core.String? kind; |
| |
| /// Only present if `valueType` is `selection` |
| core.List<core.String>? selection; |
| |
| /// Only present if `valueType` is `text`. |
| core.List<core.String>? text; |
| |
| /// Only present if `valueType` is `user`. |
| core.List<User>? user; |
| |
| /// The field type. |
| /// |
| /// While new values may be supported in the future, the following are |
| /// currently allowed: * `dateString` * `integer` * `selection` * `text` * |
| /// `user` |
| core.String? valueType; |
| |
| LabelField({ |
| this.dateString, |
| this.id, |
| this.integer, |
| this.kind, |
| this.selection, |
| this.text, |
| this.user, |
| this.valueType, |
| }); |
| |
| LabelField.fromJson(core.Map json_) |
| : this( |
| dateString: (json_['dateString'] as core.List?) |
| ?.map((value) => core.DateTime.parse(value as core.String)) |
| .toList(), |
| id: json_['id'] as core.String?, |
| integer: (json_['integer'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| selection: (json_['selection'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| text: (json_['text'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| user: (json_['user'] as core.List?) |
| ?.map( |
| (value) => |
| User.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| valueType: json_['valueType'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final dateString = this.dateString; |
| final id = this.id; |
| final integer = this.integer; |
| final kind = this.kind; |
| final selection = this.selection; |
| final text = this.text; |
| final user = this.user; |
| final valueType = this.valueType; |
| return { |
| 'dateString': ?dateString |
| ?.map( |
| (value) => |
| "${value.year.toString().padLeft(4, '0')}-${value.month.toString().padLeft(2, '0')}-${value.day.toString().padLeft(2, '0')}", |
| ) |
| .toList(), |
| 'id': ?id, |
| 'integer': ?integer, |
| 'kind': ?kind, |
| 'selection': ?selection, |
| 'text': ?text, |
| 'user': ?user, |
| 'valueType': ?valueType, |
| }; |
| } |
| } |
| |
| /// A modification to a label's field. |
| class LabelFieldModification { |
| /// The ID of the field to be modified. |
| core.String? fieldId; |
| |
| /// This is always `drive#labelFieldModification`. |
| core.String? kind; |
| |
| /// Replaces the value of a dateString Field with these new values. |
| /// |
| /// The string must be in the RFC 3339 full-date format: YYYY-MM-DD. |
| core.List<core.DateTime>? setDateValues; |
| |
| /// Replaces the value of an `integer` field with these new values. |
| core.List<core.String>? setIntegerValues; |
| |
| /// Replaces a `selection` field with these new values. |
| core.List<core.String>? setSelectionValues; |
| |
| /// Sets the value of a `text` field. |
| core.List<core.String>? setTextValues; |
| |
| /// Replaces a `user` field with these new values. |
| /// |
| /// The values must be valid email addresses. |
| core.List<core.String>? setUserValues; |
| |
| /// Unsets the values for this field. |
| core.bool? unsetValues; |
| |
| LabelFieldModification({ |
| this.fieldId, |
| this.kind, |
| this.setDateValues, |
| this.setIntegerValues, |
| this.setSelectionValues, |
| this.setTextValues, |
| this.setUserValues, |
| this.unsetValues, |
| }); |
| |
| LabelFieldModification.fromJson(core.Map json_) |
| : this( |
| fieldId: json_['fieldId'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| setDateValues: (json_['setDateValues'] as core.List?) |
| ?.map((value) => core.DateTime.parse(value as core.String)) |
| .toList(), |
| setIntegerValues: (json_['setIntegerValues'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| setSelectionValues: (json_['setSelectionValues'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| setTextValues: (json_['setTextValues'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| setUserValues: (json_['setUserValues'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| unsetValues: json_['unsetValues'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final fieldId = this.fieldId; |
| final kind = this.kind; |
| final setDateValues = this.setDateValues; |
| final setIntegerValues = this.setIntegerValues; |
| final setSelectionValues = this.setSelectionValues; |
| final setTextValues = this.setTextValues; |
| final setUserValues = this.setUserValues; |
| final unsetValues = this.unsetValues; |
| return { |
| 'fieldId': ?fieldId, |
| 'kind': ?kind, |
| 'setDateValues': ?setDateValues |
| ?.map( |
| (value) => |
| "${value.year.toString().padLeft(4, '0')}-${value.month.toString().padLeft(2, '0')}-${value.day.toString().padLeft(2, '0')}", |
| ) |
| .toList(), |
| 'setIntegerValues': ?setIntegerValues, |
| 'setSelectionValues': ?setSelectionValues, |
| 'setTextValues': ?setTextValues, |
| 'setUserValues': ?setUserValues, |
| 'unsetValues': ?unsetValues, |
| }; |
| } |
| } |
| |
| /// A list of labels applied to a file. |
| class LabelList { |
| /// The list of labels. |
| core.List<Label>? items; |
| |
| /// This is always `drive#labelList` |
| core.String? kind; |
| |
| /// The page token for the next page of labels. |
| /// |
| /// This field will be absent if the end of the list has been reached. If the |
| /// token is rejected for any reason, it should be discarded, and pagination |
| /// should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| LabelList({this.items, this.kind, this.nextPageToken}); |
| |
| LabelList.fromJson(core.Map json_) |
| : this( |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => |
| Label.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final items = this.items; |
| final kind = this.kind; |
| final nextPageToken = this.nextPageToken; |
| return {'items': ?items, 'kind': ?kind, 'nextPageToken': ?nextPageToken}; |
| } |
| } |
| |
| /// A modification to a label on a file. |
| /// |
| /// A LabelModification can be used to apply a label to a file, update an |
| /// existing label on a file, or remove a label from a file. |
| class LabelModification { |
| /// The list of modifications to this label's fields. |
| core.List<LabelFieldModification>? fieldModifications; |
| |
| /// This is always `drive#labelModification`. |
| core.String? kind; |
| |
| /// The ID of the label to modify. |
| core.String? labelId; |
| |
| /// If true, the label will be removed from the file. |
| core.bool? removeLabel; |
| |
| LabelModification({ |
| this.fieldModifications, |
| this.kind, |
| this.labelId, |
| this.removeLabel, |
| }); |
| |
| LabelModification.fromJson(core.Map json_) |
| : this( |
| fieldModifications: (json_['fieldModifications'] as core.List?) |
| ?.map( |
| (value) => LabelFieldModification.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| labelId: json_['labelId'] as core.String?, |
| removeLabel: json_['removeLabel'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final fieldModifications = this.fieldModifications; |
| final kind = this.kind; |
| final labelId = this.labelId; |
| final removeLabel = this.removeLabel; |
| return { |
| 'fieldModifications': ?fieldModifications, |
| 'kind': ?kind, |
| 'labelId': ?labelId, |
| 'removeLabel': ?removeLabel, |
| }; |
| } |
| } |
| |
| /// A request to modify the set of labels on a file. |
| /// |
| /// This request may contain many modifications that will either all succeed or |
| /// all fail atomically. |
| class ModifyLabelsRequest { |
| /// This is always `drive#modifyLabelsRequest`. |
| core.String? kind; |
| |
| /// The list of modifications to apply to the labels on the file. |
| core.List<LabelModification>? labelModifications; |
| |
| ModifyLabelsRequest({this.kind, this.labelModifications}); |
| |
| ModifyLabelsRequest.fromJson(core.Map json_) |
| : this( |
| kind: json_['kind'] as core.String?, |
| labelModifications: (json_['labelModifications'] as core.List?) |
| ?.map( |
| (value) => LabelModification.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final kind = this.kind; |
| final labelModifications = this.labelModifications; |
| return {'kind': ?kind, 'labelModifications': ?labelModifications}; |
| } |
| } |
| |
| /// Response to a ModifyLabels request. |
| /// |
| /// This contains only those labels which were added or updated by the request. |
| class ModifyLabelsResponse { |
| /// This is always `drive#modifyLabelsResponse` |
| core.String? kind; |
| |
| /// The list of labels which were added or updated by the request. |
| core.List<Label>? modifiedLabels; |
| |
| ModifyLabelsResponse({this.kind, this.modifiedLabels}); |
| |
| ModifyLabelsResponse.fromJson(core.Map json_) |
| : this( |
| kind: json_['kind'] as core.String?, |
| modifiedLabels: (json_['modifiedLabels'] as core.List?) |
| ?.map( |
| (value) => |
| Label.fromJson(value as core.Map<core.String, core.dynamic>), |
| ) |
| .toList(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final kind = this.kind; |
| final modifiedLabels = this.modifiedLabels; |
| return {'kind': ?kind, 'modifiedLabels': ?modifiedLabels}; |
| } |
| } |
| |
| /// A list of a file's parents. |
| class ParentList { |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// The list of parents. |
| core.List<ParentReference>? items; |
| |
| /// This is always `drive#parentList`. |
| core.String? kind; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| ParentList({this.etag, this.items, this.kind, this.selfLink}); |
| |
| ParentList.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => ParentReference.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final items = this.items; |
| final kind = this.kind; |
| final selfLink = this.selfLink; |
| return { |
| 'etag': ?etag, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A reference to a file's parent. |
| /// |
| /// A file can only have one parent folder; specifying multiple parents isn't |
| /// supported. Some resource methods (such as `parents.get`) require a |
| /// `parentId`. Use the `parents.list` method to retrieve the ID for a parent. |
| class ParentReference { |
| /// The ID of the parent. |
| core.String? id; |
| |
| /// Whether or not the parent is the root folder. |
| /// |
| /// Output only. |
| core.bool? isRoot; |
| |
| /// This is always `drive#parentReference`. |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// A link to the parent. |
| /// |
| /// Output only. |
| core.String? parentLink; |
| |
| /// A link back to this reference. |
| /// |
| /// Output only. |
| core.String? selfLink; |
| |
| ParentReference({ |
| this.id, |
| this.isRoot, |
| this.kind, |
| this.parentLink, |
| this.selfLink, |
| }); |
| |
| ParentReference.fromJson(core.Map json_) |
| : this( |
| id: json_['id'] as core.String?, |
| isRoot: json_['isRoot'] as core.bool?, |
| kind: json_['kind'] as core.String?, |
| parentLink: json_['parentLink'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final id = this.id; |
| final isRoot = this.isRoot; |
| final kind = this.kind; |
| final parentLink = this.parentLink; |
| final selfLink = this.selfLink; |
| return { |
| 'id': ?id, |
| 'isRoot': ?isRoot, |
| 'kind': ?kind, |
| 'parentLink': ?parentLink, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| class PermissionPermissionDetails { |
| /// Additional roles for this user. |
| /// |
| /// Only `commenter` is currently possible, though more may be supported in |
| /// the future. |
| /// |
| /// Output only. |
| core.List<core.String>? additionalRoles; |
| |
| /// Whether this permission is inherited. |
| /// |
| /// This field is always populated. |
| /// |
| /// Output only. |
| core.bool? inherited; |
| |
| /// The ID of the item from which this permission is inherited. |
| /// |
| /// This is only populated for items in shared drives. |
| /// |
| /// Output only. |
| core.String? inheritedFrom; |
| |
| /// The permission type for this user. |
| /// |
| /// While new values may be added in future, the following are currently |
| /// possible: * `file` * `member` |
| /// |
| /// Output only. |
| core.String? permissionType; |
| |
| /// The primary role for this user. |
| /// |
| /// While new values may be added in the future, the following are currently |
| /// possible: * `organizer` * `fileOrganizer` * `writer` * `reader` |
| /// |
| /// Output only. |
| core.String? role; |
| |
| PermissionPermissionDetails({ |
| this.additionalRoles, |
| this.inherited, |
| this.inheritedFrom, |
| this.permissionType, |
| this.role, |
| }); |
| |
| PermissionPermissionDetails.fromJson(core.Map json_) |
| : this( |
| additionalRoles: (json_['additionalRoles'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| inherited: json_['inherited'] as core.bool?, |
| inheritedFrom: json_['inheritedFrom'] as core.String?, |
| permissionType: json_['permissionType'] as core.String?, |
| role: json_['role'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final additionalRoles = this.additionalRoles; |
| final inherited = this.inherited; |
| final inheritedFrom = this.inheritedFrom; |
| final permissionType = this.permissionType; |
| final role = this.role; |
| return { |
| 'additionalRoles': ?additionalRoles, |
| 'inherited': ?inherited, |
| 'inheritedFrom': ?inheritedFrom, |
| 'permissionType': ?permissionType, |
| 'role': ?role, |
| }; |
| } |
| } |
| |
| class PermissionTeamDrivePermissionDetails { |
| /// Deprecated: Use `permissionDetails/additionalRoles` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.List<core.String>? additionalRoles; |
| |
| /// Deprecated: Use `permissionDetails/inherited` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? inherited; |
| |
| /// Deprecated: Use `permissionDetails/inheritedFrom` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? inheritedFrom; |
| |
| /// Deprecated: Use `permissionDetails/role` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? role; |
| |
| /// Deprecated: Use `permissionDetails/permissionType` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? teamDrivePermissionType; |
| |
| PermissionTeamDrivePermissionDetails({ |
| this.additionalRoles, |
| this.inherited, |
| this.inheritedFrom, |
| this.role, |
| this.teamDrivePermissionType, |
| }); |
| |
| PermissionTeamDrivePermissionDetails.fromJson(core.Map json_) |
| : this( |
| additionalRoles: (json_['additionalRoles'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| inherited: json_['inherited'] as core.bool?, |
| inheritedFrom: json_['inheritedFrom'] as core.String?, |
| role: json_['role'] as core.String?, |
| teamDrivePermissionType: |
| json_['teamDrivePermissionType'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final additionalRoles = this.additionalRoles; |
| final inherited = this.inherited; |
| final inheritedFrom = this.inheritedFrom; |
| final role = this.role; |
| final teamDrivePermissionType = this.teamDrivePermissionType; |
| return { |
| 'additionalRoles': ?additionalRoles, |
| 'inherited': ?inherited, |
| 'inheritedFrom': ?inheritedFrom, |
| 'role': ?role, |
| 'teamDrivePermissionType': ?teamDrivePermissionType, |
| }; |
| } |
| } |
| |
| /// A permission for a file. |
| /// |
| /// A permission grants a user, group, domain, or the world access to a file or |
| /// a folder hierarchy. Some resource methods (such as `permissions.update`) |
| /// require a `permissionId`. Use the `permissions.list` method to retrieve the |
| /// ID for a file, folder, or shared drive. |
| class Permission { |
| /// Additional roles for this user. |
| /// |
| /// Only `commenter` is currently allowed, though more may be supported in the |
| /// future. |
| core.List<core.String>? additionalRoles; |
| |
| /// Deprecated. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.String? authKey; |
| |
| /// Whether the account associated with this permission has been deleted. |
| /// |
| /// This field only pertains to user and group permissions. |
| /// |
| /// Output only. |
| core.bool? deleted; |
| |
| /// The domain name of the entity this permission refers to. |
| /// |
| /// This is an output-only field which is present when the permission type is |
| /// `user`, `group` or `domain`. |
| /// |
| /// Output only. |
| core.String? domain; |
| |
| /// The email address of the user or group this permission refers to. |
| /// |
| /// This is an output-only field which is present when the permission type is |
| /// `user` or `group`. |
| /// |
| /// Output only. |
| core.String? emailAddress; |
| |
| /// The ETag of the permission. |
| /// |
| /// Output only. |
| core.String? etag; |
| |
| /// The time at which this permission will expire (RFC 3339 date-time). |
| /// |
| /// Expiration dates have the following restrictions: - They can only be set |
| /// on user and group permissions - The date must be in the future - The date |
| /// cannot be more than a year in the future - The date can only be set on |
| /// drive.permissions.update or drive.permissions.patch requests |
| core.DateTime? expirationDate; |
| |
| /// The ID of the user this permission refers to, and identical to the |
| /// `permissionId` in the About and Files resources. |
| /// |
| /// When making a `drive.permissions.insert` request, exactly one of the `id` |
| /// or `value` fields must be specified unless the permission type is |
| /// `anyone`, in which case both `id` and `value` are ignored. |
| core.String? id; |
| |
| /// When true, only organizers, owners, and users with permissions added |
| /// directly on the item can access it. |
| core.bool? inheritedPermissionsDisabled; |
| |
| /// This is always `drive#permission`. |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// The name for this permission. |
| /// |
| /// Output only. |
| core.String? name; |
| |
| /// Whether the account associated with this permission is a pending owner. |
| /// |
| /// Only populated for `user` type permissions for files that are not in a |
| /// shared drive. |
| core.bool? pendingOwner; |
| |
| /// Details of whether the permissions on this item are inherited or directly |
| /// on this item. |
| /// |
| /// Output only. |
| core.List<PermissionPermissionDetails>? permissionDetails; |
| |
| /// A link to the profile photo, if available. |
| /// |
| /// Output only. |
| core.String? photoLink; |
| |
| /// The primary role for this user. |
| /// |
| /// While new values may be supported in the future, the following are |
| /// currently allowed: * `owner` * `organizer` * `fileOrganizer` * `writer` * |
| /// `reader` |
| core.String? role; |
| |
| /// A link back to this permission. |
| /// |
| /// Output only. |
| core.String? selfLink; |
| |
| /// Deprecated: Use `permissionDetails` instead. |
| /// |
| /// Output only. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.List<PermissionTeamDrivePermissionDetails>? teamDrivePermissionDetails; |
| |
| /// The account type. |
| /// |
| /// Allowed values are: * `user` * `group` * `domain` * `anyone` |
| core.String? type; |
| |
| /// The email address or domain name for the entity. |
| /// |
| /// This is used during inserts and is not populated in responses. When making |
| /// a `drive.permissions.insert` request, exactly one of the `id` or `value` |
| /// fields must be specified unless the permission type is `anyone`, in which |
| /// case both `id` and `value` are ignored. |
| core.String? value; |
| |
| /// Indicates the view for this permission. |
| /// |
| /// Only populated for permissions that belong to a view. published and |
| /// metadata are the only supported values. - published: The permission's role |
| /// is published_reader. - metadata: The item is only visible to the metadata |
| /// view because the item has limited access and the scope has at least read |
| /// access to the parent. Note: The metadata view is currently only supported |
| /// on folders. |
| core.String? view; |
| |
| /// Whether the link is required for this permission. |
| core.bool? withLink; |
| |
| Permission({ |
| this.additionalRoles, |
| this.authKey, |
| this.deleted, |
| this.domain, |
| this.emailAddress, |
| this.etag, |
| this.expirationDate, |
| this.id, |
| this.inheritedPermissionsDisabled, |
| this.kind, |
| this.name, |
| this.pendingOwner, |
| this.permissionDetails, |
| this.photoLink, |
| this.role, |
| this.selfLink, |
| this.teamDrivePermissionDetails, |
| this.type, |
| this.value, |
| this.view, |
| this.withLink, |
| }); |
| |
| Permission.fromJson(core.Map json_) |
| : this( |
| additionalRoles: (json_['additionalRoles'] as core.List?) |
| ?.map((value) => value as core.String) |
| .toList(), |
| authKey: json_['authKey'] as core.String?, |
| deleted: json_['deleted'] as core.bool?, |
| domain: json_['domain'] as core.String?, |
| emailAddress: json_['emailAddress'] as core.String?, |
| etag: json_['etag'] as core.String?, |
| expirationDate: json_.containsKey('expirationDate') |
| ? core.DateTime.parse(json_['expirationDate'] as core.String) |
| : null, |
| id: json_['id'] as core.String?, |
| inheritedPermissionsDisabled: |
| json_['inheritedPermissionsDisabled'] as core.bool?, |
| kind: json_['kind'] as core.String?, |
| name: json_['name'] as core.String?, |
| pendingOwner: json_['pendingOwner'] as core.bool?, |
| permissionDetails: (json_['permissionDetails'] as core.List?) |
| ?.map( |
| (value) => PermissionPermissionDetails.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| photoLink: json_['photoLink'] as core.String?, |
| role: json_['role'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| teamDrivePermissionDetails: |
| (json_['teamDrivePermissionDetails'] as core.List?) |
| ?.map( |
| (value) => PermissionTeamDrivePermissionDetails.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| type: json_['type'] as core.String?, |
| value: json_['value'] as core.String?, |
| view: json_['view'] as core.String?, |
| withLink: json_['withLink'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final additionalRoles = this.additionalRoles; |
| final authKey = this.authKey; |
| final deleted = this.deleted; |
| final domain = this.domain; |
| final emailAddress = this.emailAddress; |
| final etag = this.etag; |
| final expirationDate = this.expirationDate; |
| final id = this.id; |
| final inheritedPermissionsDisabled = this.inheritedPermissionsDisabled; |
| final kind = this.kind; |
| final name = this.name; |
| final pendingOwner = this.pendingOwner; |
| final permissionDetails = this.permissionDetails; |
| final photoLink = this.photoLink; |
| final role = this.role; |
| final selfLink = this.selfLink; |
| final teamDrivePermissionDetails = this.teamDrivePermissionDetails; |
| final type = this.type; |
| final value = this.value; |
| final view = this.view; |
| final withLink = this.withLink; |
| return { |
| 'additionalRoles': ?additionalRoles, |
| 'authKey': ?authKey, |
| 'deleted': ?deleted, |
| 'domain': ?domain, |
| 'emailAddress': ?emailAddress, |
| 'etag': ?etag, |
| 'expirationDate': ?expirationDate?.toUtc().toIso8601String(), |
| 'id': ?id, |
| 'inheritedPermissionsDisabled': ?inheritedPermissionsDisabled, |
| 'kind': ?kind, |
| 'name': ?name, |
| 'pendingOwner': ?pendingOwner, |
| 'permissionDetails': ?permissionDetails, |
| 'photoLink': ?photoLink, |
| 'role': ?role, |
| 'selfLink': ?selfLink, |
| 'teamDrivePermissionDetails': ?teamDrivePermissionDetails, |
| 'type': ?type, |
| 'value': ?value, |
| 'view': ?view, |
| 'withLink': ?withLink, |
| }; |
| } |
| } |
| |
| /// An ID for a user or group as seen in Permission items. |
| class PermissionId { |
| /// The permission ID. |
| core.String? id; |
| |
| /// This is always `drive#permissionId`. |
| core.String? kind; |
| |
| PermissionId({this.id, this.kind}); |
| |
| PermissionId.fromJson(core.Map json_) |
| : this( |
| id: json_['id'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final id = this.id; |
| final kind = this.kind; |
| return {'id': ?id, 'kind': ?kind}; |
| } |
| } |
| |
| /// A list of permissions associated with a file. |
| class PermissionList { |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// The list of permissions. |
| core.List<Permission>? items; |
| |
| /// This is always `drive#permissionList`. |
| core.String? kind; |
| |
| /// The page token for the next page of permissions. |
| /// |
| /// This field will be absent if the end of the permissions list has been |
| /// reached. If the token is rejected for any reason, it should be discarded, |
| /// and pagination should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| PermissionList({ |
| this.etag, |
| this.items, |
| this.kind, |
| this.nextPageToken, |
| this.selfLink, |
| }); |
| |
| PermissionList.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => Permission.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final items = this.items; |
| final kind = this.kind; |
| final nextPageToken = this.nextPageToken; |
| final selfLink = this.selfLink; |
| return { |
| 'etag': ?etag, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'nextPageToken': ?nextPageToken, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A key-value pair attached to a file that is either public or private to an |
| /// application. |
| /// |
| /// The following limits apply to file properties: * Maximum of 100 properties |
| /// total per file * Maximum of 30 private properties per app * Maximum of 30 |
| /// public properties * Maximum of 124 bytes size limit on (key + value) string |
| /// in UTF-8 encoding for a single property Some resource methods (such as |
| /// `properties.update`) require a `propertyKey`. Use the `properties.list` |
| /// method to retrieve the key for a property. |
| class Property { |
| /// ETag of the property. |
| /// |
| /// Output only. |
| core.String? etag; |
| |
| /// The key of this property. |
| core.String? key; |
| |
| /// This is always `drive#property`. |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// The link back to this property. |
| /// |
| /// Output only. |
| core.String? selfLink; |
| |
| /// The value of this property. |
| core.String? value; |
| |
| /// The visibility of this property. |
| /// |
| /// Allowed values are PRIVATE (default) and PUBLIC. Private properties can |
| /// only be retrieved using an authenticated request. An authenticated request |
| /// uses an access token obtained with a OAuth 2 client ID. You cannot use an |
| /// API key to retrieve private properties. |
| core.String? visibility; |
| |
| Property({ |
| this.etag, |
| this.key, |
| this.kind, |
| this.selfLink, |
| this.value, |
| this.visibility, |
| }); |
| |
| Property.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| key: json_['key'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| value: json_['value'] as core.String?, |
| visibility: json_['visibility'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final key = this.key; |
| final kind = this.kind; |
| final selfLink = this.selfLink; |
| final value = this.value; |
| final visibility = this.visibility; |
| return { |
| 'etag': ?etag, |
| 'key': ?key, |
| 'kind': ?kind, |
| 'selfLink': ?selfLink, |
| 'value': ?value, |
| 'visibility': ?visibility, |
| }; |
| } |
| } |
| |
| /// A collection of properties, key-value pairs that are either public or |
| /// private to an application. |
| class PropertyList { |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// The list of properties. |
| core.List<Property>? items; |
| |
| /// This is always `drive#propertyList`. |
| core.String? kind; |
| |
| /// The link back to this list. |
| core.String? selfLink; |
| |
| PropertyList({this.etag, this.items, this.kind, this.selfLink}); |
| |
| PropertyList.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => Property.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final items = this.items; |
| final kind = this.kind; |
| final selfLink = this.selfLink; |
| return { |
| 'etag': ?etag, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A revision of a file. |
| /// |
| /// Some resource methods (such as `revisions.update`) require a `revisionId`. |
| /// Use the `revisions.list` method to retrieve the ID for a revision. |
| class Revision { |
| /// Short term download URL for the file. |
| /// |
| /// This will only be populated on files with content stored in Drive. |
| /// |
| /// Output only. |
| core.String? downloadUrl; |
| |
| /// The ETag of the revision. |
| /// |
| /// Output only. |
| core.String? etag; |
| |
| /// Links for exporting Docs Editors files to specific formats. |
| /// |
| /// Output only. |
| core.Map<core.String, core.String>? exportLinks; |
| |
| /// The size of the revision in bytes. |
| /// |
| /// This will only be populated on files with content stored in Drive. |
| /// |
| /// Output only. |
| core.String? fileSize; |
| |
| /// The ID of the revision. |
| /// |
| /// Output only. |
| core.String? id; |
| |
| /// This is always `drive#revision`. |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// The last user to modify this revision. |
| /// |
| /// This field is only populated when the last modification was performed by a |
| /// signed-in user. |
| /// |
| /// Output only. |
| User? lastModifyingUser; |
| |
| /// Name of the last user to modify this revision. |
| /// |
| /// Output only. |
| core.String? lastModifyingUserName; |
| |
| /// An MD5 checksum for the content of this revision. |
| /// |
| /// This will only be populated on files with content stored in Drive. |
| /// |
| /// Output only. |
| core.String? md5Checksum; |
| |
| /// The MIME type of the revision. |
| /// |
| /// Output only. |
| core.String? mimeType; |
| |
| /// Last time this revision was modified (formatted RFC 3339 timestamp). |
| core.DateTime? modifiedDate; |
| |
| /// The original filename when this revision was created. |
| /// |
| /// This will only be populated on files with content stored in Drive. |
| /// |
| /// Output only. |
| core.String? originalFilename; |
| |
| /// Whether this revision is pinned to prevent automatic purging. |
| /// |
| /// If not set, the revision is automatically purged 30 days after newer |
| /// content is uploaded. This field can only be modified on files with content |
| /// stored in Drive, excluding Docs Editors files. Revisions can also be |
| /// pinned when they are created through the drive.files.insert/update/copy by |
| /// using the pinned query parameter. Pinned revisions are stored indefinitely |
| /// using additional storage quota, up to a maximum of 200 revisions. |
| core.bool? pinned; |
| |
| /// Whether subsequent revisions will be automatically republished. |
| /// |
| /// This is only populated and can only be modified for Docs Editors files. |
| core.bool? publishAuto; |
| |
| /// Whether this revision is published. |
| /// |
| /// This is only populated and can only be modified for Docs Editors files. |
| core.bool? published; |
| |
| /// A link to the published revision. |
| /// |
| /// This is only populated for Docs Editors files. |
| /// |
| /// Output only. |
| core.String? publishedLink; |
| |
| /// Whether this revision is published outside the domain. |
| /// |
| /// This is only populated and can only be modified for Docs Editors files. |
| core.bool? publishedOutsideDomain; |
| |
| /// A link back to this revision. |
| /// |
| /// Output only. |
| core.String? selfLink; |
| |
| Revision({ |
| this.downloadUrl, |
| this.etag, |
| this.exportLinks, |
| this.fileSize, |
| this.id, |
| this.kind, |
| this.lastModifyingUser, |
| this.lastModifyingUserName, |
| this.md5Checksum, |
| this.mimeType, |
| this.modifiedDate, |
| this.originalFilename, |
| this.pinned, |
| this.publishAuto, |
| this.published, |
| this.publishedLink, |
| this.publishedOutsideDomain, |
| this.selfLink, |
| }); |
| |
| Revision.fromJson(core.Map json_) |
| : this( |
| downloadUrl: json_['downloadUrl'] as core.String?, |
| etag: json_['etag'] as core.String?, |
| exportLinks: |
| (json_['exportLinks'] as core.Map<core.String, core.dynamic>?)?.map( |
| (key, value) => core.MapEntry(key, value as core.String), |
| ), |
| fileSize: json_['fileSize'] as core.String?, |
| id: json_['id'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| lastModifyingUser: json_.containsKey('lastModifyingUser') |
| ? User.fromJson( |
| json_['lastModifyingUser'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| lastModifyingUserName: json_['lastModifyingUserName'] as core.String?, |
| md5Checksum: json_['md5Checksum'] as core.String?, |
| mimeType: json_['mimeType'] as core.String?, |
| modifiedDate: json_.containsKey('modifiedDate') |
| ? core.DateTime.parse(json_['modifiedDate'] as core.String) |
| : null, |
| originalFilename: json_['originalFilename'] as core.String?, |
| pinned: json_['pinned'] as core.bool?, |
| publishAuto: json_['publishAuto'] as core.bool?, |
| published: json_['published'] as core.bool?, |
| publishedLink: json_['publishedLink'] as core.String?, |
| publishedOutsideDomain: json_['publishedOutsideDomain'] as core.bool?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final downloadUrl = this.downloadUrl; |
| final etag = this.etag; |
| final exportLinks = this.exportLinks; |
| final fileSize = this.fileSize; |
| final id = this.id; |
| final kind = this.kind; |
| final lastModifyingUser = this.lastModifyingUser; |
| final lastModifyingUserName = this.lastModifyingUserName; |
| final md5Checksum = this.md5Checksum; |
| final mimeType = this.mimeType; |
| final modifiedDate = this.modifiedDate; |
| final originalFilename = this.originalFilename; |
| final pinned = this.pinned; |
| final publishAuto = this.publishAuto; |
| final published = this.published; |
| final publishedLink = this.publishedLink; |
| final publishedOutsideDomain = this.publishedOutsideDomain; |
| final selfLink = this.selfLink; |
| return { |
| 'downloadUrl': ?downloadUrl, |
| 'etag': ?etag, |
| 'exportLinks': ?exportLinks, |
| 'fileSize': ?fileSize, |
| 'id': ?id, |
| 'kind': ?kind, |
| 'lastModifyingUser': ?lastModifyingUser, |
| 'lastModifyingUserName': ?lastModifyingUserName, |
| 'md5Checksum': ?md5Checksum, |
| 'mimeType': ?mimeType, |
| 'modifiedDate': ?modifiedDate?.toUtc().toIso8601String(), |
| 'originalFilename': ?originalFilename, |
| 'pinned': ?pinned, |
| 'publishAuto': ?publishAuto, |
| 'published': ?published, |
| 'publishedLink': ?publishedLink, |
| 'publishedOutsideDomain': ?publishedOutsideDomain, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| /// A list of revisions of a file. |
| class RevisionList { |
| /// The ETag of the list. |
| core.String? etag; |
| |
| /// The list of revisions. |
| /// |
| /// If nextPageToken is populated, then this list may be incomplete and an |
| /// additional page of results should be fetched. |
| core.List<Revision>? items; |
| |
| /// This is always `drive#revisionList`. |
| core.String? kind; |
| |
| /// The page token for the next page of revisions. |
| /// |
| /// This field will be absent if the end of the revisions list has been |
| /// reached. If the token is rejected for any reason, it should be discarded |
| /// and pagination should be restarted from the first page of results. |
| core.String? nextPageToken; |
| |
| /// A link back to this list. |
| core.String? selfLink; |
| |
| RevisionList({ |
| this.etag, |
| this.items, |
| this.kind, |
| this.nextPageToken, |
| this.selfLink, |
| }); |
| |
| RevisionList.fromJson(core.Map json_) |
| : this( |
| etag: json_['etag'] as core.String?, |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => Revision.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| selfLink: json_['selfLink'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final etag = this.etag; |
| final items = this.items; |
| final kind = this.kind; |
| final nextPageToken = this.nextPageToken; |
| final selfLink = this.selfLink; |
| return { |
| 'etag': ?etag, |
| 'items': ?items, |
| 'kind': ?kind, |
| 'nextPageToken': ?nextPageToken, |
| 'selfLink': ?selfLink, |
| }; |
| } |
| } |
| |
| class StartPageToken { |
| /// Identifies what kind of resource this is. |
| /// |
| /// Value: the fixed string `"drive#startPageToken"`. |
| core.String? kind; |
| |
| /// The starting page token for listing changes. |
| core.String? startPageToken; |
| |
| StartPageToken({this.kind, this.startPageToken}); |
| |
| StartPageToken.fromJson(core.Map json_) |
| : this( |
| kind: json_['kind'] as core.String?, |
| startPageToken: json_['startPageToken'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final kind = this.kind; |
| final startPageToken = this.startPageToken; |
| return {'kind': ?kind, 'startPageToken': ?startPageToken}; |
| } |
| } |
| |
| /// An image file and cropping parameters from which a background image for this |
| /// Team Drive is set. |
| /// |
| /// This is a write only field; it can only be set on `drive.teamdrives.update` |
| /// requests that don't set `themeId`. When specified, all fields of the |
| /// `backgroundImageFile` must be set. |
| class TeamDriveBackgroundImageFile { |
| /// The ID of an image file in Drive to use for the background image. |
| core.String? id; |
| |
| /// The width of the cropped image in the closed range of 0 to 1. |
| /// |
| /// This value represents the width of the cropped image divided by the width |
| /// of the entire image. The height is computed by applying a width to height |
| /// aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels |
| /// wide and 144 pixels high. |
| core.double? width; |
| |
| /// The X coordinate of the upper left corner of the cropping area in the |
| /// background image. |
| /// |
| /// This is a value in the closed range of 0 to 1. This value represents the |
| /// horizontal distance from the left side of the entire image to the left |
| /// side of the cropping area divided by the width of the entire image. |
| core.double? xCoordinate; |
| |
| /// The Y coordinate of the upper left corner of the cropping area in the |
| /// background image. |
| /// |
| /// This is a value in the closed range of 0 to 1. This value represents the |
| /// vertical distance from the top side of the entire image to the top side of |
| /// the cropping area divided by the height of the entire image. |
| core.double? yCoordinate; |
| |
| TeamDriveBackgroundImageFile({ |
| this.id, |
| this.width, |
| this.xCoordinate, |
| this.yCoordinate, |
| }); |
| |
| TeamDriveBackgroundImageFile.fromJson(core.Map json_) |
| : this( |
| id: json_['id'] as core.String?, |
| width: (json_['width'] as core.num?)?.toDouble(), |
| xCoordinate: (json_['xCoordinate'] as core.num?)?.toDouble(), |
| yCoordinate: (json_['yCoordinate'] as core.num?)?.toDouble(), |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final id = this.id; |
| final width = this.width; |
| final xCoordinate = this.xCoordinate; |
| final yCoordinate = this.yCoordinate; |
| return { |
| 'id': ?id, |
| 'width': ?width, |
| 'xCoordinate': ?xCoordinate, |
| 'yCoordinate': ?yCoordinate, |
| }; |
| } |
| } |
| |
| /// Capabilities the current user has on this Team Drive. |
| class TeamDriveCapabilities { |
| /// Whether the current user can add children to folders in this Team Drive. |
| core.bool? canAddChildren; |
| |
| /// Whether the current user can change the `copyRequiresWriterPermission` |
| /// restriction of this Team Drive. |
| core.bool? canChangeCopyRequiresWriterPermissionRestriction; |
| |
| /// Whether the current user can change the `domainUsersOnly` restriction of |
| /// this Team Drive. |
| core.bool? canChangeDomainUsersOnlyRestriction; |
| |
| /// Whether the current user can change the |
| /// `sharingFoldersRequiresOrganizerPermission` restriction of this Team |
| /// Drive. |
| core.bool? canChangeSharingFoldersRequiresOrganizerPermissionRestriction; |
| |
| /// Whether the current user can change the background of this Team Drive. |
| core.bool? canChangeTeamDriveBackground; |
| |
| /// Whether the current user can change the `teamMembersOnly` restriction of |
| /// this Team Drive. |
| core.bool? canChangeTeamMembersOnlyRestriction; |
| |
| /// Whether the current user can comment on files in this Team Drive. |
| core.bool? canComment; |
| |
| /// Whether the current user can copy files in this Team Drive. |
| core.bool? canCopy; |
| |
| /// Whether the current user can delete children from folders in this Team |
| /// Drive. |
| core.bool? canDeleteChildren; |
| |
| /// Whether the current user can delete this Team Drive. |
| /// |
| /// Attempting to delete the Team Drive may still fail if there are untrashed |
| /// items inside the Team Drive. |
| core.bool? canDeleteTeamDrive; |
| |
| /// Whether the current user can download files in this Team Drive. |
| core.bool? canDownload; |
| |
| /// Whether the current user can edit files in this Team Drive |
| core.bool? canEdit; |
| |
| /// Whether the current user can list the children of folders in this Team |
| /// Drive. |
| core.bool? canListChildren; |
| |
| /// Whether the current user can add members to this Team Drive or remove them |
| /// or change their role. |
| core.bool? canManageMembers; |
| |
| /// Whether the current user can read the revisions resource of files in this |
| /// Team Drive. |
| core.bool? canReadRevisions; |
| |
| /// Deprecated: Use `canDeleteChildren` or `canTrashChildren` instead. |
| @core.Deprecated( |
| 'Not supported. Member documentation may have more information.', |
| ) |
| core.bool? canRemoveChildren; |
| |
| /// Whether the current user can rename files or folders in this Team Drive. |
| core.bool? canRename; |
| |
| /// Whether the current user can rename this Team Drive. |
| core.bool? canRenameTeamDrive; |
| |
| /// Whether the current user can reset the Team Drive restrictions to |
| /// defaults. |
| core.bool? canResetTeamDriveRestrictions; |
| |
| /// Whether the current user can share files or folders in this Team Drive. |
| core.bool? canShare; |
| |
| /// Whether the current user can trash children from folders in this Team |
| /// Drive. |
| core.bool? canTrashChildren; |
| |
| TeamDriveCapabilities({ |
| this.canAddChildren, |
| this.canChangeCopyRequiresWriterPermissionRestriction, |
| this.canChangeDomainUsersOnlyRestriction, |
| this.canChangeSharingFoldersRequiresOrganizerPermissionRestriction, |
| this.canChangeTeamDriveBackground, |
| this.canChangeTeamMembersOnlyRestriction, |
| this.canComment, |
| this.canCopy, |
| this.canDeleteChildren, |
| this.canDeleteTeamDrive, |
| this.canDownload, |
| this.canEdit, |
| this.canListChildren, |
| this.canManageMembers, |
| this.canReadRevisions, |
| this.canRemoveChildren, |
| this.canRename, |
| this.canRenameTeamDrive, |
| this.canResetTeamDriveRestrictions, |
| this.canShare, |
| this.canTrashChildren, |
| }); |
| |
| TeamDriveCapabilities.fromJson(core.Map json_) |
| : this( |
| canAddChildren: json_['canAddChildren'] as core.bool?, |
| canChangeCopyRequiresWriterPermissionRestriction: |
| json_['canChangeCopyRequiresWriterPermissionRestriction'] |
| as core.bool?, |
| canChangeDomainUsersOnlyRestriction: |
| json_['canChangeDomainUsersOnlyRestriction'] as core.bool?, |
| canChangeSharingFoldersRequiresOrganizerPermissionRestriction: |
| json_['canChangeSharingFoldersRequiresOrganizerPermissionRestriction'] |
| as core.bool?, |
| canChangeTeamDriveBackground: |
| json_['canChangeTeamDriveBackground'] as core.bool?, |
| canChangeTeamMembersOnlyRestriction: |
| json_['canChangeTeamMembersOnlyRestriction'] as core.bool?, |
| canComment: json_['canComment'] as core.bool?, |
| canCopy: json_['canCopy'] as core.bool?, |
| canDeleteChildren: json_['canDeleteChildren'] as core.bool?, |
| canDeleteTeamDrive: json_['canDeleteTeamDrive'] as core.bool?, |
| canDownload: json_['canDownload'] as core.bool?, |
| canEdit: json_['canEdit'] as core.bool?, |
| canListChildren: json_['canListChildren'] as core.bool?, |
| canManageMembers: json_['canManageMembers'] as core.bool?, |
| canReadRevisions: json_['canReadRevisions'] as core.bool?, |
| canRemoveChildren: json_['canRemoveChildren'] as core.bool?, |
| canRename: json_['canRename'] as core.bool?, |
| canRenameTeamDrive: json_['canRenameTeamDrive'] as core.bool?, |
| canResetTeamDriveRestrictions: |
| json_['canResetTeamDriveRestrictions'] as core.bool?, |
| canShare: json_['canShare'] as core.bool?, |
| canTrashChildren: json_['canTrashChildren'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final canAddChildren = this.canAddChildren; |
| final canChangeCopyRequiresWriterPermissionRestriction = |
| this.canChangeCopyRequiresWriterPermissionRestriction; |
| final canChangeDomainUsersOnlyRestriction = |
| this.canChangeDomainUsersOnlyRestriction; |
| final canChangeSharingFoldersRequiresOrganizerPermissionRestriction = |
| this.canChangeSharingFoldersRequiresOrganizerPermissionRestriction; |
| final canChangeTeamDriveBackground = this.canChangeTeamDriveBackground; |
| final canChangeTeamMembersOnlyRestriction = |
| this.canChangeTeamMembersOnlyRestriction; |
| final canComment = this.canComment; |
| final canCopy = this.canCopy; |
| final canDeleteChildren = this.canDeleteChildren; |
| final canDeleteTeamDrive = this.canDeleteTeamDrive; |
| final canDownload = this.canDownload; |
| final canEdit = this.canEdit; |
| final canListChildren = this.canListChildren; |
| final canManageMembers = this.canManageMembers; |
| final canReadRevisions = this.canReadRevisions; |
| final canRemoveChildren = this.canRemoveChildren; |
| final canRename = this.canRename; |
| final canRenameTeamDrive = this.canRenameTeamDrive; |
| final canResetTeamDriveRestrictions = this.canResetTeamDriveRestrictions; |
| final canShare = this.canShare; |
| final canTrashChildren = this.canTrashChildren; |
| return { |
| 'canAddChildren': ?canAddChildren, |
| 'canChangeCopyRequiresWriterPermissionRestriction': |
| ?canChangeCopyRequiresWriterPermissionRestriction, |
| 'canChangeDomainUsersOnlyRestriction': |
| ?canChangeDomainUsersOnlyRestriction, |
| 'canChangeSharingFoldersRequiresOrganizerPermissionRestriction': |
| ?canChangeSharingFoldersRequiresOrganizerPermissionRestriction, |
| 'canChangeTeamDriveBackground': ?canChangeTeamDriveBackground, |
| 'canChangeTeamMembersOnlyRestriction': |
| ?canChangeTeamMembersOnlyRestriction, |
| 'canComment': ?canComment, |
| 'canCopy': ?canCopy, |
| 'canDeleteChildren': ?canDeleteChildren, |
| 'canDeleteTeamDrive': ?canDeleteTeamDrive, |
| 'canDownload': ?canDownload, |
| 'canEdit': ?canEdit, |
| 'canListChildren': ?canListChildren, |
| 'canManageMembers': ?canManageMembers, |
| 'canReadRevisions': ?canReadRevisions, |
| 'canRemoveChildren': ?canRemoveChildren, |
| 'canRename': ?canRename, |
| 'canRenameTeamDrive': ?canRenameTeamDrive, |
| 'canResetTeamDriveRestrictions': ?canResetTeamDriveRestrictions, |
| 'canShare': ?canShare, |
| 'canTrashChildren': ?canTrashChildren, |
| }; |
| } |
| } |
| |
| /// A set of restrictions that apply to this Team Drive or items inside this |
| /// Team Drive. |
| class TeamDriveRestrictions { |
| /// Whether administrative privileges on this Team Drive are required to |
| /// modify restrictions. |
| core.bool? adminManagedRestrictions; |
| |
| /// Whether the options to copy, print, or download files inside this Team |
| /// Drive, should be disabled for readers and commenters. |
| /// |
| /// When this restriction is set to `true`, it will override the similarly |
| /// named field to `true` for any file inside this Team Drive. |
| core.bool? copyRequiresWriterPermission; |
| |
| /// Whether access to this Team Drive and items inside this Team Drive is |
| /// restricted to users of the domain to which this Team Drive belongs. |
| /// |
| /// This restriction may be overridden by other sharing policies controlled |
| /// outside of this Team Drive. |
| core.bool? domainUsersOnly; |
| |
| /// If true, only users with the organizer role can share folders. |
| /// |
| /// If false, users with either the organizer role or the file organizer role |
| /// can share folders. |
| core.bool? sharingFoldersRequiresOrganizerPermission; |
| |
| /// Whether access to items inside this Team Drive is restricted to members of |
| /// this Team Drive. |
| core.bool? teamMembersOnly; |
| |
| TeamDriveRestrictions({ |
| this.adminManagedRestrictions, |
| this.copyRequiresWriterPermission, |
| this.domainUsersOnly, |
| this.sharingFoldersRequiresOrganizerPermission, |
| this.teamMembersOnly, |
| }); |
| |
| TeamDriveRestrictions.fromJson(core.Map json_) |
| : this( |
| adminManagedRestrictions: |
| json_['adminManagedRestrictions'] as core.bool?, |
| copyRequiresWriterPermission: |
| json_['copyRequiresWriterPermission'] as core.bool?, |
| domainUsersOnly: json_['domainUsersOnly'] as core.bool?, |
| sharingFoldersRequiresOrganizerPermission: |
| json_['sharingFoldersRequiresOrganizerPermission'] as core.bool?, |
| teamMembersOnly: json_['teamMembersOnly'] as core.bool?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final adminManagedRestrictions = this.adminManagedRestrictions; |
| final copyRequiresWriterPermission = this.copyRequiresWriterPermission; |
| final domainUsersOnly = this.domainUsersOnly; |
| final sharingFoldersRequiresOrganizerPermission = |
| this.sharingFoldersRequiresOrganizerPermission; |
| final teamMembersOnly = this.teamMembersOnly; |
| return { |
| 'adminManagedRestrictions': ?adminManagedRestrictions, |
| 'copyRequiresWriterPermission': ?copyRequiresWriterPermission, |
| 'domainUsersOnly': ?domainUsersOnly, |
| 'sharingFoldersRequiresOrganizerPermission': |
| ?sharingFoldersRequiresOrganizerPermission, |
| 'teamMembersOnly': ?teamMembersOnly, |
| }; |
| } |
| } |
| |
| /// Deprecated: Use the `drive` collection instead. |
| class TeamDrive { |
| /// An image file and cropping parameters from which a background image for |
| /// this Team Drive is set. |
| /// |
| /// This is a write only field; it can only be set on |
| /// `drive.teamdrives.update` requests that don't set `themeId`. When |
| /// specified, all fields of the `backgroundImageFile` must be set. |
| TeamDriveBackgroundImageFile? backgroundImageFile; |
| |
| /// A short-lived link to this Team Drive's background image. |
| core.String? backgroundImageLink; |
| |
| /// Capabilities the current user has on this Team Drive. |
| TeamDriveCapabilities? capabilities; |
| |
| /// The color of this Team Drive as an RGB hex string. |
| /// |
| /// It can only be set on a `drive.teamdrives.update` request that does not |
| /// set `themeId`. |
| core.String? colorRgb; |
| |
| /// The time at which the Team Drive was created (RFC 3339 date-time). |
| core.DateTime? createdDate; |
| |
| /// The ID of this Team Drive which is also the ID of the top level folder of |
| /// this Team Drive. |
| core.String? id; |
| |
| /// This is always `drive#teamDrive` |
| core.String? kind; |
| |
| /// The name of this Team Drive. |
| core.String? name; |
| |
| /// The organizational unit of this shared drive. |
| /// |
| /// This field is only populated on `drives.list` responses when the |
| /// `useDomainAdminAccess` parameter is set to `true`. |
| core.String? orgUnitId; |
| |
| /// A set of restrictions that apply to this Team Drive or items inside this |
| /// Team Drive. |
| TeamDriveRestrictions? restrictions; |
| |
| /// The ID of the theme from which the background image and color will be set. |
| /// |
| /// The set of possible `teamDriveThemes` can be retrieved from a |
| /// `drive.about.get` response. When not specified on a |
| /// `drive.teamdrives.insert` request, a random theme is chosen from which the |
| /// background image and color are set. This is a write-only field; it can |
| /// only be set on requests that don't set `colorRgb` or |
| /// `backgroundImageFile`. |
| core.String? themeId; |
| |
| TeamDrive({ |
| this.backgroundImageFile, |
| this.backgroundImageLink, |
| this.capabilities, |
| this.colorRgb, |
| this.createdDate, |
| this.id, |
| this.kind, |
| this.name, |
| this.orgUnitId, |
| this.restrictions, |
| this.themeId, |
| }); |
| |
| TeamDrive.fromJson(core.Map json_) |
| : this( |
| backgroundImageFile: json_.containsKey('backgroundImageFile') |
| ? TeamDriveBackgroundImageFile.fromJson( |
| json_['backgroundImageFile'] |
| as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| backgroundImageLink: json_['backgroundImageLink'] as core.String?, |
| capabilities: json_.containsKey('capabilities') |
| ? TeamDriveCapabilities.fromJson( |
| json_['capabilities'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| colorRgb: json_['colorRgb'] as core.String?, |
| createdDate: json_.containsKey('createdDate') |
| ? core.DateTime.parse(json_['createdDate'] as core.String) |
| : null, |
| id: json_['id'] as core.String?, |
| kind: json_['kind'] as core.String?, |
| name: json_['name'] as core.String?, |
| orgUnitId: json_['orgUnitId'] as core.String?, |
| restrictions: json_.containsKey('restrictions') |
| ? TeamDriveRestrictions.fromJson( |
| json_['restrictions'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| themeId: json_['themeId'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final backgroundImageFile = this.backgroundImageFile; |
| final backgroundImageLink = this.backgroundImageLink; |
| final capabilities = this.capabilities; |
| final colorRgb = this.colorRgb; |
| final createdDate = this.createdDate; |
| final id = this.id; |
| final kind = this.kind; |
| final name = this.name; |
| final orgUnitId = this.orgUnitId; |
| final restrictions = this.restrictions; |
| final themeId = this.themeId; |
| return { |
| 'backgroundImageFile': ?backgroundImageFile, |
| 'backgroundImageLink': ?backgroundImageLink, |
| 'capabilities': ?capabilities, |
| 'colorRgb': ?colorRgb, |
| 'createdDate': ?createdDate?.toUtc().toIso8601String(), |
| 'id': ?id, |
| 'kind': ?kind, |
| 'name': ?name, |
| 'orgUnitId': ?orgUnitId, |
| 'restrictions': ?restrictions, |
| 'themeId': ?themeId, |
| }; |
| } |
| } |
| |
| /// A list of Team Drives. |
| class TeamDriveList { |
| /// The list of Team Drives. |
| core.List<TeamDrive>? items; |
| |
| /// This is always `drive#teamDriveList` |
| core.String? kind; |
| |
| /// The page token for the next page of Team Drives. |
| core.String? nextPageToken; |
| |
| TeamDriveList({this.items, this.kind, this.nextPageToken}); |
| |
| TeamDriveList.fromJson(core.Map json_) |
| : this( |
| items: (json_['items'] as core.List?) |
| ?.map( |
| (value) => TeamDrive.fromJson( |
| value as core.Map<core.String, core.dynamic>, |
| ), |
| ) |
| .toList(), |
| kind: json_['kind'] as core.String?, |
| nextPageToken: json_['nextPageToken'] as core.String?, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final items = this.items; |
| final kind = this.kind; |
| final nextPageToken = this.nextPageToken; |
| return {'items': ?items, 'kind': ?kind, 'nextPageToken': ?nextPageToken}; |
| } |
| } |
| |
| /// The user's profile picture. |
| /// |
| /// Output only. |
| class UserPicture { |
| /// A URL that points to a profile picture of this user. |
| /// |
| /// Output only. |
| core.String? url; |
| |
| UserPicture({this.url}); |
| |
| UserPicture.fromJson(core.Map json_) |
| : this(url: json_['url'] as core.String?); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final url = this.url; |
| return {'url': ?url}; |
| } |
| } |
| |
| /// Information about a Drive user. |
| class User { |
| /// A plain text displayable name for this user. |
| /// |
| /// Output only. |
| core.String? displayName; |
| |
| /// The email address of the user. |
| /// |
| /// This may not be present in certain contexts if the user has not made their |
| /// email address visible to the requester. |
| /// |
| /// Output only. |
| core.String? emailAddress; |
| |
| /// Whether this user is the same as the authenticated user for whom the |
| /// request was made. |
| /// |
| /// Output only. |
| core.bool? isAuthenticatedUser; |
| |
| /// Identifies what kind of resource this is. |
| /// |
| /// Value: the fixed string `drive#user`. |
| /// |
| /// Output only. |
| core.String? kind; |
| |
| /// The user's ID as visible in Permission resources. |
| /// |
| /// Output only. |
| core.String? permissionId; |
| |
| /// The user's profile picture. |
| /// |
| /// Output only. |
| UserPicture? picture; |
| |
| User({ |
| this.displayName, |
| this.emailAddress, |
| this.isAuthenticatedUser, |
| this.kind, |
| this.permissionId, |
| this.picture, |
| }); |
| |
| User.fromJson(core.Map json_) |
| : this( |
| displayName: json_['displayName'] as core.String?, |
| emailAddress: json_['emailAddress'] as core.String?, |
| isAuthenticatedUser: json_['isAuthenticatedUser'] as core.bool?, |
| kind: json_['kind'] as core.String?, |
| permissionId: json_['permissionId'] as core.String?, |
| picture: json_.containsKey('picture') |
| ? UserPicture.fromJson( |
| json_['picture'] as core.Map<core.String, core.dynamic>, |
| ) |
| : null, |
| ); |
| |
| core.Map<core.String, core.dynamic> toJson() { |
| final displayName = this.displayName; |
| final emailAddress = this.emailAddress; |
| final isAuthenticatedUser = this.isAuthenticatedUser; |
| final kind = this.kind; |
| final permissionId = this.permissionId; |
| final picture = this.picture; |
| return { |
| 'displayName': ?displayName, |
| 'emailAddress': ?emailAddress, |
| 'isAuthenticatedUser': ?isAuthenticatedUser, |
| 'kind': ?kind, |
| 'permissionId': ?permissionId, |
| 'picture': ?picture, |
| }; |
| } |
| } |