| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 | 2 |
| 3 library googleapis.appsactivity.v1; | 3 library googleapis.appsactivity.v1; |
| 4 | 4 |
| 5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
| 8 | 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| 11 | 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| 13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
| 14 | 14 |
| 15 const core.String USER_AGENT = 'dart-api-client appsactivity/v1'; | 15 const core.String USER_AGENT = 'dart-api-client appsactivity/v1'; |
| 16 | 16 |
| 17 /** Provides a historical view of activity. */ | 17 /// Provides a historical view of activity. |
| 18 class AppsactivityApi { | 18 class AppsactivityApi { |
| 19 /** View the activity history of your Google apps */ | 19 /// View the activity history of your Google apps |
| 20 static const ActivityScope = "https://www.googleapis.com/auth/activity"; | 20 static const ActivityScope = "https://www.googleapis.com/auth/activity"; |
| 21 | 21 |
| 22 /** View and manage the files in your Google Drive */ | 22 /// View and manage the files in your Google Drive |
| 23 static const DriveScope = "https://www.googleapis.com/auth/drive"; | 23 static const DriveScope = "https://www.googleapis.com/auth/drive"; |
| 24 | 24 |
| 25 /** View and manage metadata of files in your Google Drive */ | 25 /// View and manage metadata of files in your Google Drive |
| 26 static const DriveMetadataScope = "https://www.googleapis.com/auth/drive.metad
ata"; | 26 static const DriveMetadataScope = |
| 27 "https://www.googleapis.com/auth/drive.metadata"; |
| 27 | 28 |
| 28 /** View metadata for files in your Google Drive */ | 29 /// View metadata for files in your Google Drive |
| 29 static const DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/dri
ve.metadata.readonly"; | 30 static const DriveMetadataReadonlyScope = |
| 31 "https://www.googleapis.com/auth/drive.metadata.readonly"; |
| 30 | 32 |
| 31 /** View the files in your Google Drive */ | 33 /// View the files in your Google Drive |
| 32 static const DriveReadonlyScope = "https://www.googleapis.com/auth/drive.reado
nly"; | 34 static const DriveReadonlyScope = |
| 33 | 35 "https://www.googleapis.com/auth/drive.readonly"; |
| 34 | 36 |
| 35 final commons.ApiRequester _requester; | 37 final commons.ApiRequester _requester; |
| 36 | 38 |
| 37 ActivitiesResourceApi get activities => new ActivitiesResourceApi(_requester); | 39 ActivitiesResourceApi get activities => new ActivitiesResourceApi(_requester); |
| 38 | 40 |
| 39 AppsactivityApi(http.Client client, {core.String rootUrl: "https://www.googlea
pis.com/", core.String servicePath: "appsactivity/v1/"}) : | 41 AppsactivityApi(http.Client client, |
| 40 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 42 {core.String rootUrl: "https://www.googleapis.com/", |
| 43 core.String servicePath: "appsactivity/v1/"}) |
| 44 : _requester = |
| 45 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
| 41 } | 46 } |
| 42 | 47 |
| 43 | |
| 44 class ActivitiesResourceApi { | 48 class ActivitiesResourceApi { |
| 45 final commons.ApiRequester _requester; | 49 final commons.ApiRequester _requester; |
| 46 | 50 |
| 47 ActivitiesResourceApi(commons.ApiRequester client) : | 51 ActivitiesResourceApi(commons.ApiRequester client) : _requester = client; |
| 48 _requester = client; | |
| 49 | 52 |
| 50 /** | 53 /// Returns a list of activities visible to the current logged in user. |
| 51 * Returns a list of activities visible to the current logged in user. Visible | 54 /// Visible activities are determined by the visiblity settings of the object |
| 52 * activities are determined by the visiblity settings of the object that was | 55 /// that was acted on, e.g. Drive files a user can see. An activity is a |
| 53 * acted on, e.g. Drive files a user can see. An activity is a record of past | 56 /// record of past events. Multiple events may be merged if they are similar. |
| 54 * events. Multiple events may be merged if they are similar. A request is | 57 /// A request is scoped to activities from a given Google service using the |
| 55 * scoped to activities from a given Google service using the source | 58 /// source parameter. |
| 56 * parameter. | 59 /// |
| 57 * | 60 /// Request parameters: |
| 58 * Request parameters: | 61 /// |
| 59 * | 62 /// [drive_ancestorId] - Identifies the Drive folder containing the items for |
| 60 * [drive_ancestorId] - Identifies the Drive folder containing the items for | 63 /// which to return activities. |
| 61 * which to return activities. | 64 /// |
| 62 * | 65 /// [drive_fileId] - Identifies the Drive item to return activities for. |
| 63 * [drive_fileId] - Identifies the Drive item to return activities for. | 66 /// |
| 64 * | 67 /// [groupingStrategy] - Indicates the strategy to use when grouping |
| 65 * [groupingStrategy] - Indicates the strategy to use when grouping | 68 /// singleEvents items in the associated combinedEvent object. |
| 66 * singleEvents items in the associated combinedEvent object. | 69 /// Possible string values are: |
| 67 * Possible string values are: | 70 /// - "driveUi" |
| 68 * - "driveUi" | 71 /// - "none" |
| 69 * - "none" | 72 /// |
| 70 * | 73 /// [pageSize] - The maximum number of events to return on a page. The |
| 71 * [pageSize] - The maximum number of events to return on a page. The response | 74 /// response includes a continuation token if there are more events. |
| 72 * includes a continuation token if there are more events. | 75 /// |
| 73 * | 76 /// [pageToken] - A token to retrieve a specific page of results. |
| 74 * [pageToken] - A token to retrieve a specific page of results. | 77 /// |
| 75 * | 78 /// [source] - The Google service from which to return activities. Possible |
| 76 * [source] - The Google service from which to return activities. Possible | 79 /// values of source are: |
| 77 * values of source are: | 80 /// - drive.google.com |
| 78 * - drive.google.com | 81 /// |
| 79 * | 82 /// [userId] - Indicates the user to return activity for. Use the special |
| 80 * [userId] - Indicates the user to return activity for. Use the special value | 83 /// value me to indicate the currently authenticated user. |
| 81 * me to indicate the currently authenticated user. | 84 /// |
| 82 * | 85 /// Completes with a [ListActivitiesResponse]. |
| 83 * Completes with a [ListActivitiesResponse]. | 86 /// |
| 84 * | 87 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 85 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 88 /// an error. |
| 86 * error. | 89 /// |
| 87 * | 90 /// If the used [http.Client] completes with an error when making a REST |
| 88 * If the used [http.Client] completes with an error when making a REST call, | 91 /// call, this method will complete with the same error. |
| 89 * this method will complete with the same error. | 92 async.Future<ListActivitiesResponse> list( |
| 90 */ | 93 {core.String drive_ancestorId, |
| 91 async.Future<ListActivitiesResponse> list({core.String drive_ancestorId, core.
String drive_fileId, core.String groupingStrategy, core.int pageSize, core.Strin
g pageToken, core.String source, core.String userId}) { | 94 core.String drive_fileId, |
| 95 core.String groupingStrategy, |
| 96 core.int pageSize, |
| 97 core.String pageToken, |
| 98 core.String source, |
| 99 core.String userId}) { |
| 92 var _url = null; | 100 var _url = null; |
| 93 var _queryParams = new core.Map(); | 101 var _queryParams = new core.Map(); |
| 94 var _uploadMedia = null; | 102 var _uploadMedia = null; |
| 95 var _uploadOptions = null; | 103 var _uploadOptions = null; |
| 96 var _downloadOptions = commons.DownloadOptions.Metadata; | 104 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 97 var _body = null; | 105 var _body = null; |
| 98 | 106 |
| 99 if (drive_ancestorId != null) { | 107 if (drive_ancestorId != null) { |
| 100 _queryParams["drive.ancestorId"] = [drive_ancestorId]; | 108 _queryParams["drive.ancestorId"] = [drive_ancestorId]; |
| 101 } | 109 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 113 } | 121 } |
| 114 if (source != null) { | 122 if (source != null) { |
| 115 _queryParams["source"] = [source]; | 123 _queryParams["source"] = [source]; |
| 116 } | 124 } |
| 117 if (userId != null) { | 125 if (userId != null) { |
| 118 _queryParams["userId"] = [userId]; | 126 _queryParams["userId"] = [userId]; |
| 119 } | 127 } |
| 120 | 128 |
| 121 _url = 'activities'; | 129 _url = 'activities'; |
| 122 | 130 |
| 123 var _response = _requester.request(_url, | 131 var _response = _requester.request(_url, "GET", |
| 124 "GET", | 132 body: _body, |
| 125 body: _body, | 133 queryParams: _queryParams, |
| 126 queryParams: _queryParams, | 134 uploadOptions: _uploadOptions, |
| 127 uploadOptions: _uploadOptions, | 135 uploadMedia: _uploadMedia, |
| 128 uploadMedia: _uploadMedia, | 136 downloadOptions: _downloadOptions); |
| 129 downloadOptions: _downloadOptions); | |
| 130 return _response.then((data) => new ListActivitiesResponse.fromJson(data)); | 137 return _response.then((data) => new ListActivitiesResponse.fromJson(data)); |
| 131 } | 138 } |
| 132 | |
| 133 } | 139 } |
| 134 | 140 |
| 141 /// An Activity resource is a combined view of multiple events. An activity has |
| 142 /// a list of individual events and a combined view of the common fields among |
| 143 /// all events. |
| 144 class Activity { |
| 145 /// The fields common to all of the singleEvents that make up the Activity. |
| 146 Event combinedEvent; |
| 135 | 147 |
| 136 | 148 /// A list of all the Events that make up the Activity. |
| 137 /** | |
| 138 * An Activity resource is a combined view of multiple events. An activity has a | |
| 139 * list of individual events and a combined view of the common fields among all | |
| 140 * events. | |
| 141 */ | |
| 142 class Activity { | |
| 143 /** | |
| 144 * The fields common to all of the singleEvents that make up the Activity. | |
| 145 */ | |
| 146 Event combinedEvent; | |
| 147 /** A list of all the Events that make up the Activity. */ | |
| 148 core.List<Event> singleEvents; | 149 core.List<Event> singleEvents; |
| 149 | 150 |
| 150 Activity(); | 151 Activity(); |
| 151 | 152 |
| 152 Activity.fromJson(core.Map _json) { | 153 Activity.fromJson(core.Map _json) { |
| 153 if (_json.containsKey("combinedEvent")) { | 154 if (_json.containsKey("combinedEvent")) { |
| 154 combinedEvent = new Event.fromJson(_json["combinedEvent"]); | 155 combinedEvent = new Event.fromJson(_json["combinedEvent"]); |
| 155 } | 156 } |
| 156 if (_json.containsKey("singleEvents")) { | 157 if (_json.containsKey("singleEvents")) { |
| 157 singleEvents = _json["singleEvents"].map((value) => new Event.fromJson(val
ue)).toList(); | 158 singleEvents = _json["singleEvents"] |
| 159 .map((value) => new Event.fromJson(value)) |
| 160 .toList(); |
| 158 } | 161 } |
| 159 } | 162 } |
| 160 | 163 |
| 161 core.Map<core.String, core.Object> toJson() { | 164 core.Map<core.String, core.Object> toJson() { |
| 162 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 165 final core.Map<core.String, core.Object> _json = |
| 166 new core.Map<core.String, core.Object>(); |
| 163 if (combinedEvent != null) { | 167 if (combinedEvent != null) { |
| 164 _json["combinedEvent"] = (combinedEvent).toJson(); | 168 _json["combinedEvent"] = (combinedEvent).toJson(); |
| 165 } | 169 } |
| 166 if (singleEvents != null) { | 170 if (singleEvents != null) { |
| 167 _json["singleEvents"] = singleEvents.map((value) => (value).toJson()).toLi
st(); | 171 _json["singleEvents"] = |
| 172 singleEvents.map((value) => (value).toJson()).toList(); |
| 168 } | 173 } |
| 169 return _json; | 174 return _json; |
| 170 } | 175 } |
| 171 } | 176 } |
| 172 | 177 |
| 173 /** Represents the changes associated with an action taken by a user. */ | 178 /// Represents the changes associated with an action taken by a user. |
| 174 class Event { | 179 class Event { |
| 175 /** | 180 /// Additional event types. Some events may have multiple types when multiple |
| 176 * Additional event types. Some events may have multiple types when multiple | 181 /// actions are part of a single event. For example, creating a document, |
| 177 * actions are part of a single event. For example, creating a document, | 182 /// renaming it, and sharing it may be part of a single file-creation event. |
| 178 * renaming it, and sharing it may be part of a single file-creation event. | |
| 179 */ | |
| 180 core.List<core.String> additionalEventTypes; | 183 core.List<core.String> additionalEventTypes; |
| 181 /** | 184 |
| 182 * The time at which the event occurred formatted as Unix time in | 185 /// The time at which the event occurred formatted as Unix time in |
| 183 * milliseconds. | 186 /// milliseconds. |
| 184 */ | |
| 185 core.String eventTimeMillis; | 187 core.String eventTimeMillis; |
| 186 /** Whether this event is caused by a user being deleted. */ | 188 |
| 189 /// Whether this event is caused by a user being deleted. |
| 187 core.bool fromUserDeletion; | 190 core.bool fromUserDeletion; |
| 188 /** | 191 |
| 189 * Extra information for move type events, such as changes in an object's | 192 /// Extra information for move type events, such as changes in an object's |
| 190 * parents. | 193 /// parents. |
| 191 */ | |
| 192 Move move; | 194 Move move; |
| 193 /** | 195 |
| 194 * Extra information for permissionChange type events, such as the user or | 196 /// Extra information for permissionChange type events, such as the user or |
| 195 * group the new permission applies to. | 197 /// group the new permission applies to. |
| 196 */ | |
| 197 core.List<PermissionChange> permissionChanges; | 198 core.List<PermissionChange> permissionChanges; |
| 198 /** | 199 |
| 199 * The main type of event that occurred. | 200 /// The main type of event that occurred. |
| 200 * Possible string values are: | 201 /// Possible string values are: |
| 201 * - "comment" | 202 /// - "comment" |
| 202 * - "create" | 203 /// - "create" |
| 203 * - "edit" | 204 /// - "edit" |
| 204 * - "emptyTrash" | 205 /// - "emptyTrash" |
| 205 * - "move" | 206 /// - "move" |
| 206 * - "permissionChange" | 207 /// - "permissionChange" |
| 207 * - "rename" | 208 /// - "rename" |
| 208 * - "trash" | 209 /// - "trash" |
| 209 * - "unknown" | 210 /// - "unknown" |
| 210 * - "untrash" | 211 /// - "untrash" |
| 211 * - "upload" | 212 /// - "upload" |
| 212 */ | |
| 213 core.String primaryEventType; | 213 core.String primaryEventType; |
| 214 /** | 214 |
| 215 * Extra information for rename type events, such as the old and new names. | 215 /// Extra information for rename type events, such as the old and new names. |
| 216 */ | |
| 217 Rename rename; | 216 Rename rename; |
| 218 /** Information specific to the Target object modified by the event. */ | 217 |
| 218 /// Information specific to the Target object modified by the event. |
| 219 Target target; | 219 Target target; |
| 220 /** Represents the user responsible for the event. */ | 220 |
| 221 /// Represents the user responsible for the event. |
| 221 User user; | 222 User user; |
| 222 | 223 |
| 223 Event(); | 224 Event(); |
| 224 | 225 |
| 225 Event.fromJson(core.Map _json) { | 226 Event.fromJson(core.Map _json) { |
| 226 if (_json.containsKey("additionalEventTypes")) { | 227 if (_json.containsKey("additionalEventTypes")) { |
| 227 additionalEventTypes = _json["additionalEventTypes"]; | 228 additionalEventTypes = _json["additionalEventTypes"]; |
| 228 } | 229 } |
| 229 if (_json.containsKey("eventTimeMillis")) { | 230 if (_json.containsKey("eventTimeMillis")) { |
| 230 eventTimeMillis = _json["eventTimeMillis"]; | 231 eventTimeMillis = _json["eventTimeMillis"]; |
| 231 } | 232 } |
| 232 if (_json.containsKey("fromUserDeletion")) { | 233 if (_json.containsKey("fromUserDeletion")) { |
| 233 fromUserDeletion = _json["fromUserDeletion"]; | 234 fromUserDeletion = _json["fromUserDeletion"]; |
| 234 } | 235 } |
| 235 if (_json.containsKey("move")) { | 236 if (_json.containsKey("move")) { |
| 236 move = new Move.fromJson(_json["move"]); | 237 move = new Move.fromJson(_json["move"]); |
| 237 } | 238 } |
| 238 if (_json.containsKey("permissionChanges")) { | 239 if (_json.containsKey("permissionChanges")) { |
| 239 permissionChanges = _json["permissionChanges"].map((value) => new Permissi
onChange.fromJson(value)).toList(); | 240 permissionChanges = _json["permissionChanges"] |
| 241 .map((value) => new PermissionChange.fromJson(value)) |
| 242 .toList(); |
| 240 } | 243 } |
| 241 if (_json.containsKey("primaryEventType")) { | 244 if (_json.containsKey("primaryEventType")) { |
| 242 primaryEventType = _json["primaryEventType"]; | 245 primaryEventType = _json["primaryEventType"]; |
| 243 } | 246 } |
| 244 if (_json.containsKey("rename")) { | 247 if (_json.containsKey("rename")) { |
| 245 rename = new Rename.fromJson(_json["rename"]); | 248 rename = new Rename.fromJson(_json["rename"]); |
| 246 } | 249 } |
| 247 if (_json.containsKey("target")) { | 250 if (_json.containsKey("target")) { |
| 248 target = new Target.fromJson(_json["target"]); | 251 target = new Target.fromJson(_json["target"]); |
| 249 } | 252 } |
| 250 if (_json.containsKey("user")) { | 253 if (_json.containsKey("user")) { |
| 251 user = new User.fromJson(_json["user"]); | 254 user = new User.fromJson(_json["user"]); |
| 252 } | 255 } |
| 253 } | 256 } |
| 254 | 257 |
| 255 core.Map<core.String, core.Object> toJson() { | 258 core.Map<core.String, core.Object> toJson() { |
| 256 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 259 final core.Map<core.String, core.Object> _json = |
| 260 new core.Map<core.String, core.Object>(); |
| 257 if (additionalEventTypes != null) { | 261 if (additionalEventTypes != null) { |
| 258 _json["additionalEventTypes"] = additionalEventTypes; | 262 _json["additionalEventTypes"] = additionalEventTypes; |
| 259 } | 263 } |
| 260 if (eventTimeMillis != null) { | 264 if (eventTimeMillis != null) { |
| 261 _json["eventTimeMillis"] = eventTimeMillis; | 265 _json["eventTimeMillis"] = eventTimeMillis; |
| 262 } | 266 } |
| 263 if (fromUserDeletion != null) { | 267 if (fromUserDeletion != null) { |
| 264 _json["fromUserDeletion"] = fromUserDeletion; | 268 _json["fromUserDeletion"] = fromUserDeletion; |
| 265 } | 269 } |
| 266 if (move != null) { | 270 if (move != null) { |
| 267 _json["move"] = (move).toJson(); | 271 _json["move"] = (move).toJson(); |
| 268 } | 272 } |
| 269 if (permissionChanges != null) { | 273 if (permissionChanges != null) { |
| 270 _json["permissionChanges"] = permissionChanges.map((value) => (value).toJs
on()).toList(); | 274 _json["permissionChanges"] = |
| 275 permissionChanges.map((value) => (value).toJson()).toList(); |
| 271 } | 276 } |
| 272 if (primaryEventType != null) { | 277 if (primaryEventType != null) { |
| 273 _json["primaryEventType"] = primaryEventType; | 278 _json["primaryEventType"] = primaryEventType; |
| 274 } | 279 } |
| 275 if (rename != null) { | 280 if (rename != null) { |
| 276 _json["rename"] = (rename).toJson(); | 281 _json["rename"] = (rename).toJson(); |
| 277 } | 282 } |
| 278 if (target != null) { | 283 if (target != null) { |
| 279 _json["target"] = (target).toJson(); | 284 _json["target"] = (target).toJson(); |
| 280 } | 285 } |
| 281 if (user != null) { | 286 if (user != null) { |
| 282 _json["user"] = (user).toJson(); | 287 _json["user"] = (user).toJson(); |
| 283 } | 288 } |
| 284 return _json; | 289 return _json; |
| 285 } | 290 } |
| 286 } | 291 } |
| 287 | 292 |
| 288 /** | 293 /// The response from the list request. Contains a list of activities and a |
| 289 * The response from the list request. Contains a list of activities and a token | 294 /// token to retrieve the next page of results. |
| 290 * to retrieve the next page of results. | |
| 291 */ | |
| 292 class ListActivitiesResponse { | 295 class ListActivitiesResponse { |
| 293 /** List of activities. */ | 296 /// List of activities. |
| 294 core.List<Activity> activities; | 297 core.List<Activity> activities; |
| 295 /** Token for the next page of results. */ | 298 |
| 299 /// Token for the next page of results. |
| 296 core.String nextPageToken; | 300 core.String nextPageToken; |
| 297 | 301 |
| 298 ListActivitiesResponse(); | 302 ListActivitiesResponse(); |
| 299 | 303 |
| 300 ListActivitiesResponse.fromJson(core.Map _json) { | 304 ListActivitiesResponse.fromJson(core.Map _json) { |
| 301 if (_json.containsKey("activities")) { | 305 if (_json.containsKey("activities")) { |
| 302 activities = _json["activities"].map((value) => new Activity.fromJson(valu
e)).toList(); | 306 activities = _json["activities"] |
| 307 .map((value) => new Activity.fromJson(value)) |
| 308 .toList(); |
| 303 } | 309 } |
| 304 if (_json.containsKey("nextPageToken")) { | 310 if (_json.containsKey("nextPageToken")) { |
| 305 nextPageToken = _json["nextPageToken"]; | 311 nextPageToken = _json["nextPageToken"]; |
| 306 } | 312 } |
| 307 } | 313 } |
| 308 | 314 |
| 309 core.Map<core.String, core.Object> toJson() { | 315 core.Map<core.String, core.Object> toJson() { |
| 310 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 316 final core.Map<core.String, core.Object> _json = |
| 317 new core.Map<core.String, core.Object>(); |
| 311 if (activities != null) { | 318 if (activities != null) { |
| 312 _json["activities"] = activities.map((value) => (value).toJson()).toList()
; | 319 _json["activities"] = |
| 320 activities.map((value) => (value).toJson()).toList(); |
| 313 } | 321 } |
| 314 if (nextPageToken != null) { | 322 if (nextPageToken != null) { |
| 315 _json["nextPageToken"] = nextPageToken; | 323 _json["nextPageToken"] = nextPageToken; |
| 316 } | 324 } |
| 317 return _json; | 325 return _json; |
| 318 } | 326 } |
| 319 } | 327 } |
| 320 | 328 |
| 321 /** | 329 /// Contains information about changes in an object's parents as a result of a |
| 322 * Contains information about changes in an object's parents as a result of a | 330 /// move type event. |
| 323 * move type event. | |
| 324 */ | |
| 325 class Move { | 331 class Move { |
| 326 /** The added parent(s). */ | 332 /// The added parent(s). |
| 327 core.List<Parent> addedParents; | 333 core.List<Parent> addedParents; |
| 328 /** The removed parent(s). */ | 334 |
| 335 /// The removed parent(s). |
| 329 core.List<Parent> removedParents; | 336 core.List<Parent> removedParents; |
| 330 | 337 |
| 331 Move(); | 338 Move(); |
| 332 | 339 |
| 333 Move.fromJson(core.Map _json) { | 340 Move.fromJson(core.Map _json) { |
| 334 if (_json.containsKey("addedParents")) { | 341 if (_json.containsKey("addedParents")) { |
| 335 addedParents = _json["addedParents"].map((value) => new Parent.fromJson(va
lue)).toList(); | 342 addedParents = _json["addedParents"] |
| 343 .map((value) => new Parent.fromJson(value)) |
| 344 .toList(); |
| 336 } | 345 } |
| 337 if (_json.containsKey("removedParents")) { | 346 if (_json.containsKey("removedParents")) { |
| 338 removedParents = _json["removedParents"].map((value) => new Parent.fromJso
n(value)).toList(); | 347 removedParents = _json["removedParents"] |
| 348 .map((value) => new Parent.fromJson(value)) |
| 349 .toList(); |
| 339 } | 350 } |
| 340 } | 351 } |
| 341 | 352 |
| 342 core.Map<core.String, core.Object> toJson() { | 353 core.Map<core.String, core.Object> toJson() { |
| 343 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 354 final core.Map<core.String, core.Object> _json = |
| 355 new core.Map<core.String, core.Object>(); |
| 344 if (addedParents != null) { | 356 if (addedParents != null) { |
| 345 _json["addedParents"] = addedParents.map((value) => (value).toJson()).toLi
st(); | 357 _json["addedParents"] = |
| 358 addedParents.map((value) => (value).toJson()).toList(); |
| 346 } | 359 } |
| 347 if (removedParents != null) { | 360 if (removedParents != null) { |
| 348 _json["removedParents"] = removedParents.map((value) => (value).toJson()).
toList(); | 361 _json["removedParents"] = |
| 362 removedParents.map((value) => (value).toJson()).toList(); |
| 349 } | 363 } |
| 350 return _json; | 364 return _json; |
| 351 } | 365 } |
| 352 } | 366 } |
| 353 | 367 |
| 354 /** | 368 /// Contains information about a parent object. For example, a folder in Drive |
| 355 * Contains information about a parent object. For example, a folder in Drive is | 369 /// is a parent for all files within it. |
| 356 * a parent for all files within it. | |
| 357 */ | |
| 358 class Parent { | 370 class Parent { |
| 359 /** The parent's ID. */ | 371 /// The parent's ID. |
| 360 core.String id; | 372 core.String id; |
| 361 /** Whether this is the root folder. */ | 373 |
| 374 /// Whether this is the root folder. |
| 362 core.bool isRoot; | 375 core.bool isRoot; |
| 363 /** The parent's title. */ | 376 |
| 377 /// The parent's title. |
| 364 core.String title; | 378 core.String title; |
| 365 | 379 |
| 366 Parent(); | 380 Parent(); |
| 367 | 381 |
| 368 Parent.fromJson(core.Map _json) { | 382 Parent.fromJson(core.Map _json) { |
| 369 if (_json.containsKey("id")) { | 383 if (_json.containsKey("id")) { |
| 370 id = _json["id"]; | 384 id = _json["id"]; |
| 371 } | 385 } |
| 372 if (_json.containsKey("isRoot")) { | 386 if (_json.containsKey("isRoot")) { |
| 373 isRoot = _json["isRoot"]; | 387 isRoot = _json["isRoot"]; |
| 374 } | 388 } |
| 375 if (_json.containsKey("title")) { | 389 if (_json.containsKey("title")) { |
| 376 title = _json["title"]; | 390 title = _json["title"]; |
| 377 } | 391 } |
| 378 } | 392 } |
| 379 | 393 |
| 380 core.Map<core.String, core.Object> toJson() { | 394 core.Map<core.String, core.Object> toJson() { |
| 381 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 395 final core.Map<core.String, core.Object> _json = |
| 396 new core.Map<core.String, core.Object>(); |
| 382 if (id != null) { | 397 if (id != null) { |
| 383 _json["id"] = id; | 398 _json["id"] = id; |
| 384 } | 399 } |
| 385 if (isRoot != null) { | 400 if (isRoot != null) { |
| 386 _json["isRoot"] = isRoot; | 401 _json["isRoot"] = isRoot; |
| 387 } | 402 } |
| 388 if (title != null) { | 403 if (title != null) { |
| 389 _json["title"] = title; | 404 _json["title"] = title; |
| 390 } | 405 } |
| 391 return _json; | 406 return _json; |
| 392 } | 407 } |
| 393 } | 408 } |
| 394 | 409 |
| 395 /** | 410 /// Contains information about the permissions and type of access allowed with |
| 396 * Contains information about the permissions and type of access allowed with | 411 /// regards to a Google Drive object. This is a subset of the fields contained |
| 397 * regards to a Google Drive object. This is a subset of the fields contained in | 412 /// in a corresponding Drive Permissions object. |
| 398 * a corresponding Drive Permissions object. | |
| 399 */ | |
| 400 class Permission { | 413 class Permission { |
| 401 /** The name of the user or group the permission applies to. */ | 414 /// The name of the user or group the permission applies to. |
| 402 core.String name; | 415 core.String name; |
| 403 /** | 416 |
| 404 * The ID for this permission. Corresponds to the Drive API's permission ID | 417 /// The ID for this permission. Corresponds to the Drive API's permission ID |
| 405 * returned as part of the Drive Permissions resource. | 418 /// returned as part of the Drive Permissions resource. |
| 406 */ | |
| 407 core.String permissionId; | 419 core.String permissionId; |
| 408 /** | 420 |
| 409 * Indicates the Google Drive permissions role. The role determines a user's | 421 /// Indicates the Google Drive permissions role. The role determines a user's |
| 410 * ability to read, write, or comment on the file. | 422 /// ability to read, write, or comment on the file. |
| 411 * Possible string values are: | 423 /// Possible string values are: |
| 412 * - "commenter" | 424 /// - "commenter" |
| 413 * - "owner" | 425 /// - "owner" |
| 414 * - "reader" | 426 /// - "reader" |
| 415 * - "writer" | 427 /// - "writer" |
| 416 */ | |
| 417 core.String role; | 428 core.String role; |
| 418 /** | 429 |
| 419 * Indicates how widely permissions are granted. | 430 /// Indicates how widely permissions are granted. |
| 420 * Possible string values are: | 431 /// Possible string values are: |
| 421 * - "anyone" | 432 /// - "anyone" |
| 422 * - "domain" | 433 /// - "domain" |
| 423 * - "group" | 434 /// - "group" |
| 424 * - "user" | 435 /// - "user" |
| 425 */ | |
| 426 core.String type; | 436 core.String type; |
| 427 /** The user's information if the type is USER. */ | 437 |
| 438 /// The user's information if the type is USER. |
| 428 User user; | 439 User user; |
| 429 /** Whether the permission requires a link to the file. */ | 440 |
| 441 /// Whether the permission requires a link to the file. |
| 430 core.bool withLink; | 442 core.bool withLink; |
| 431 | 443 |
| 432 Permission(); | 444 Permission(); |
| 433 | 445 |
| 434 Permission.fromJson(core.Map _json) { | 446 Permission.fromJson(core.Map _json) { |
| 435 if (_json.containsKey("name")) { | 447 if (_json.containsKey("name")) { |
| 436 name = _json["name"]; | 448 name = _json["name"]; |
| 437 } | 449 } |
| 438 if (_json.containsKey("permissionId")) { | 450 if (_json.containsKey("permissionId")) { |
| 439 permissionId = _json["permissionId"]; | 451 permissionId = _json["permissionId"]; |
| 440 } | 452 } |
| 441 if (_json.containsKey("role")) { | 453 if (_json.containsKey("role")) { |
| 442 role = _json["role"]; | 454 role = _json["role"]; |
| 443 } | 455 } |
| 444 if (_json.containsKey("type")) { | 456 if (_json.containsKey("type")) { |
| 445 type = _json["type"]; | 457 type = _json["type"]; |
| 446 } | 458 } |
| 447 if (_json.containsKey("user")) { | 459 if (_json.containsKey("user")) { |
| 448 user = new User.fromJson(_json["user"]); | 460 user = new User.fromJson(_json["user"]); |
| 449 } | 461 } |
| 450 if (_json.containsKey("withLink")) { | 462 if (_json.containsKey("withLink")) { |
| 451 withLink = _json["withLink"]; | 463 withLink = _json["withLink"]; |
| 452 } | 464 } |
| 453 } | 465 } |
| 454 | 466 |
| 455 core.Map<core.String, core.Object> toJson() { | 467 core.Map<core.String, core.Object> toJson() { |
| 456 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 468 final core.Map<core.String, core.Object> _json = |
| 469 new core.Map<core.String, core.Object>(); |
| 457 if (name != null) { | 470 if (name != null) { |
| 458 _json["name"] = name; | 471 _json["name"] = name; |
| 459 } | 472 } |
| 460 if (permissionId != null) { | 473 if (permissionId != null) { |
| 461 _json["permissionId"] = permissionId; | 474 _json["permissionId"] = permissionId; |
| 462 } | 475 } |
| 463 if (role != null) { | 476 if (role != null) { |
| 464 _json["role"] = role; | 477 _json["role"] = role; |
| 465 } | 478 } |
| 466 if (type != null) { | 479 if (type != null) { |
| 467 _json["type"] = type; | 480 _json["type"] = type; |
| 468 } | 481 } |
| 469 if (user != null) { | 482 if (user != null) { |
| 470 _json["user"] = (user).toJson(); | 483 _json["user"] = (user).toJson(); |
| 471 } | 484 } |
| 472 if (withLink != null) { | 485 if (withLink != null) { |
| 473 _json["withLink"] = withLink; | 486 _json["withLink"] = withLink; |
| 474 } | 487 } |
| 475 return _json; | 488 return _json; |
| 476 } | 489 } |
| 477 } | 490 } |
| 478 | 491 |
| 479 /** | 492 /// Contains information about a Drive object's permissions that changed as a |
| 480 * Contains information about a Drive object's permissions that changed as a | 493 /// result of a permissionChange type event. |
| 481 * result of a permissionChange type event. | |
| 482 */ | |
| 483 class PermissionChange { | 494 class PermissionChange { |
| 484 /** Lists all Permission objects added. */ | 495 /// Lists all Permission objects added. |
| 485 core.List<Permission> addedPermissions; | 496 core.List<Permission> addedPermissions; |
| 486 /** Lists all Permission objects removed. */ | 497 |
| 498 /// Lists all Permission objects removed. |
| 487 core.List<Permission> removedPermissions; | 499 core.List<Permission> removedPermissions; |
| 488 | 500 |
| 489 PermissionChange(); | 501 PermissionChange(); |
| 490 | 502 |
| 491 PermissionChange.fromJson(core.Map _json) { | 503 PermissionChange.fromJson(core.Map _json) { |
| 492 if (_json.containsKey("addedPermissions")) { | 504 if (_json.containsKey("addedPermissions")) { |
| 493 addedPermissions = _json["addedPermissions"].map((value) => new Permission
.fromJson(value)).toList(); | 505 addedPermissions = _json["addedPermissions"] |
| 506 .map((value) => new Permission.fromJson(value)) |
| 507 .toList(); |
| 494 } | 508 } |
| 495 if (_json.containsKey("removedPermissions")) { | 509 if (_json.containsKey("removedPermissions")) { |
| 496 removedPermissions = _json["removedPermissions"].map((value) => new Permis
sion.fromJson(value)).toList(); | 510 removedPermissions = _json["removedPermissions"] |
| 511 .map((value) => new Permission.fromJson(value)) |
| 512 .toList(); |
| 497 } | 513 } |
| 498 } | 514 } |
| 499 | 515 |
| 500 core.Map<core.String, core.Object> toJson() { | 516 core.Map<core.String, core.Object> toJson() { |
| 501 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 517 final core.Map<core.String, core.Object> _json = |
| 518 new core.Map<core.String, core.Object>(); |
| 502 if (addedPermissions != null) { | 519 if (addedPermissions != null) { |
| 503 _json["addedPermissions"] = addedPermissions.map((value) => (value).toJson
()).toList(); | 520 _json["addedPermissions"] = |
| 521 addedPermissions.map((value) => (value).toJson()).toList(); |
| 504 } | 522 } |
| 505 if (removedPermissions != null) { | 523 if (removedPermissions != null) { |
| 506 _json["removedPermissions"] = removedPermissions.map((value) => (value).to
Json()).toList(); | 524 _json["removedPermissions"] = |
| 525 removedPermissions.map((value) => (value).toJson()).toList(); |
| 507 } | 526 } |
| 508 return _json; | 527 return _json; |
| 509 } | 528 } |
| 510 } | 529 } |
| 511 | 530 |
| 512 /** Photo information for a user. */ | 531 /// Photo information for a user. |
| 513 class Photo { | 532 class Photo { |
| 514 /** The URL of the photo. */ | 533 /// The URL of the photo. |
| 515 core.String url; | 534 core.String url; |
| 516 | 535 |
| 517 Photo(); | 536 Photo(); |
| 518 | 537 |
| 519 Photo.fromJson(core.Map _json) { | 538 Photo.fromJson(core.Map _json) { |
| 520 if (_json.containsKey("url")) { | 539 if (_json.containsKey("url")) { |
| 521 url = _json["url"]; | 540 url = _json["url"]; |
| 522 } | 541 } |
| 523 } | 542 } |
| 524 | 543 |
| 525 core.Map<core.String, core.Object> toJson() { | 544 core.Map<core.String, core.Object> toJson() { |
| 526 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 545 final core.Map<core.String, core.Object> _json = |
| 546 new core.Map<core.String, core.Object>(); |
| 527 if (url != null) { | 547 if (url != null) { |
| 528 _json["url"] = url; | 548 _json["url"] = url; |
| 529 } | 549 } |
| 530 return _json; | 550 return _json; |
| 531 } | 551 } |
| 532 } | 552 } |
| 533 | 553 |
| 534 /** Contains information about a renametype event. */ | 554 /// Contains information about a renametype event. |
| 535 class Rename { | 555 class Rename { |
| 536 /** The new title. */ | 556 /// The new title. |
| 537 core.String newTitle; | 557 core.String newTitle; |
| 538 /** The old title. */ | 558 |
| 559 /// The old title. |
| 539 core.String oldTitle; | 560 core.String oldTitle; |
| 540 | 561 |
| 541 Rename(); | 562 Rename(); |
| 542 | 563 |
| 543 Rename.fromJson(core.Map _json) { | 564 Rename.fromJson(core.Map _json) { |
| 544 if (_json.containsKey("newTitle")) { | 565 if (_json.containsKey("newTitle")) { |
| 545 newTitle = _json["newTitle"]; | 566 newTitle = _json["newTitle"]; |
| 546 } | 567 } |
| 547 if (_json.containsKey("oldTitle")) { | 568 if (_json.containsKey("oldTitle")) { |
| 548 oldTitle = _json["oldTitle"]; | 569 oldTitle = _json["oldTitle"]; |
| 549 } | 570 } |
| 550 } | 571 } |
| 551 | 572 |
| 552 core.Map<core.String, core.Object> toJson() { | 573 core.Map<core.String, core.Object> toJson() { |
| 553 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 574 final core.Map<core.String, core.Object> _json = |
| 575 new core.Map<core.String, core.Object>(); |
| 554 if (newTitle != null) { | 576 if (newTitle != null) { |
| 555 _json["newTitle"] = newTitle; | 577 _json["newTitle"] = newTitle; |
| 556 } | 578 } |
| 557 if (oldTitle != null) { | 579 if (oldTitle != null) { |
| 558 _json["oldTitle"] = oldTitle; | 580 _json["oldTitle"] = oldTitle; |
| 559 } | 581 } |
| 560 return _json; | 582 return _json; |
| 561 } | 583 } |
| 562 } | 584 } |
| 563 | 585 |
| 564 /** Information about the object modified by the event. */ | 586 /// Information about the object modified by the event. |
| 565 class Target { | 587 class Target { |
| 566 /** | 588 /// The ID of the target. For example, in Google Drive, this is the file or |
| 567 * The ID of the target. For example, in Google Drive, this is the file or | 589 /// folder ID. |
| 568 * folder ID. | |
| 569 */ | |
| 570 core.String id; | 590 core.String id; |
| 571 /** The MIME type of the target. */ | 591 |
| 592 /// The MIME type of the target. |
| 572 core.String mimeType; | 593 core.String mimeType; |
| 573 /** | 594 |
| 574 * The name of the target. For example, in Google Drive, this is the title of | 595 /// The name of the target. For example, in Google Drive, this is the title |
| 575 * the file. | 596 /// of the file. |
| 576 */ | |
| 577 core.String name; | 597 core.String name; |
| 578 | 598 |
| 579 Target(); | 599 Target(); |
| 580 | 600 |
| 581 Target.fromJson(core.Map _json) { | 601 Target.fromJson(core.Map _json) { |
| 582 if (_json.containsKey("id")) { | 602 if (_json.containsKey("id")) { |
| 583 id = _json["id"]; | 603 id = _json["id"]; |
| 584 } | 604 } |
| 585 if (_json.containsKey("mimeType")) { | 605 if (_json.containsKey("mimeType")) { |
| 586 mimeType = _json["mimeType"]; | 606 mimeType = _json["mimeType"]; |
| 587 } | 607 } |
| 588 if (_json.containsKey("name")) { | 608 if (_json.containsKey("name")) { |
| 589 name = _json["name"]; | 609 name = _json["name"]; |
| 590 } | 610 } |
| 591 } | 611 } |
| 592 | 612 |
| 593 core.Map<core.String, core.Object> toJson() { | 613 core.Map<core.String, core.Object> toJson() { |
| 594 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 614 final core.Map<core.String, core.Object> _json = |
| 615 new core.Map<core.String, core.Object>(); |
| 595 if (id != null) { | 616 if (id != null) { |
| 596 _json["id"] = id; | 617 _json["id"] = id; |
| 597 } | 618 } |
| 598 if (mimeType != null) { | 619 if (mimeType != null) { |
| 599 _json["mimeType"] = mimeType; | 620 _json["mimeType"] = mimeType; |
| 600 } | 621 } |
| 601 if (name != null) { | 622 if (name != null) { |
| 602 _json["name"] = name; | 623 _json["name"] = name; |
| 603 } | 624 } |
| 604 return _json; | 625 return _json; |
| 605 } | 626 } |
| 606 } | 627 } |
| 607 | 628 |
| 608 /** A representation of a user. */ | 629 /// A representation of a user. |
| 609 class User { | 630 class User { |
| 610 /** | 631 /// A boolean which indicates whether the specified User was deleted. If |
| 611 * A boolean which indicates whether the specified User was deleted. If true, | 632 /// true, name, photo and permission_id will be omitted. |
| 612 * name, photo and permission_id will be omitted. | |
| 613 */ | |
| 614 core.bool isDeleted; | 633 core.bool isDeleted; |
| 615 /** Whether the user is the authenticated user. */ | 634 |
| 635 /// Whether the user is the authenticated user. |
| 616 core.bool isMe; | 636 core.bool isMe; |
| 617 /** The displayable name of the user. */ | 637 |
| 638 /// The displayable name of the user. |
| 618 core.String name; | 639 core.String name; |
| 619 /** | 640 |
| 620 * The permission ID associated with this user. Equivalent to the Drive API's | 641 /// The permission ID associated with this user. Equivalent to the Drive |
| 621 * permission ID for this user, returned as part of the Drive Permissions | 642 /// API's permission ID for this user, returned as part of the Drive |
| 622 * resource. | 643 /// Permissions resource. |
| 623 */ | |
| 624 core.String permissionId; | 644 core.String permissionId; |
| 625 /** | 645 |
| 626 * The profile photo of the user. Not present if the user has no profile | 646 /// The profile photo of the user. Not present if the user has no profile |
| 627 * photo. | 647 /// photo. |
| 628 */ | |
| 629 Photo photo; | 648 Photo photo; |
| 630 | 649 |
| 631 User(); | 650 User(); |
| 632 | 651 |
| 633 User.fromJson(core.Map _json) { | 652 User.fromJson(core.Map _json) { |
| 634 if (_json.containsKey("isDeleted")) { | 653 if (_json.containsKey("isDeleted")) { |
| 635 isDeleted = _json["isDeleted"]; | 654 isDeleted = _json["isDeleted"]; |
| 636 } | 655 } |
| 637 if (_json.containsKey("isMe")) { | 656 if (_json.containsKey("isMe")) { |
| 638 isMe = _json["isMe"]; | 657 isMe = _json["isMe"]; |
| 639 } | 658 } |
| 640 if (_json.containsKey("name")) { | 659 if (_json.containsKey("name")) { |
| 641 name = _json["name"]; | 660 name = _json["name"]; |
| 642 } | 661 } |
| 643 if (_json.containsKey("permissionId")) { | 662 if (_json.containsKey("permissionId")) { |
| 644 permissionId = _json["permissionId"]; | 663 permissionId = _json["permissionId"]; |
| 645 } | 664 } |
| 646 if (_json.containsKey("photo")) { | 665 if (_json.containsKey("photo")) { |
| 647 photo = new Photo.fromJson(_json["photo"]); | 666 photo = new Photo.fromJson(_json["photo"]); |
| 648 } | 667 } |
| 649 } | 668 } |
| 650 | 669 |
| 651 core.Map<core.String, core.Object> toJson() { | 670 core.Map<core.String, core.Object> toJson() { |
| 652 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 671 final core.Map<core.String, core.Object> _json = |
| 672 new core.Map<core.String, core.Object>(); |
| 653 if (isDeleted != null) { | 673 if (isDeleted != null) { |
| 654 _json["isDeleted"] = isDeleted; | 674 _json["isDeleted"] = isDeleted; |
| 655 } | 675 } |
| 656 if (isMe != null) { | 676 if (isMe != null) { |
| 657 _json["isMe"] = isMe; | 677 _json["isMe"] = isMe; |
| 658 } | 678 } |
| 659 if (name != null) { | 679 if (name != null) { |
| 660 _json["name"] = name; | 680 _json["name"] = name; |
| 661 } | 681 } |
| 662 if (permissionId != null) { | 682 if (permissionId != null) { |
| 663 _json["permissionId"] = permissionId; | 683 _json["permissionId"] = permissionId; |
| 664 } | 684 } |
| 665 if (photo != null) { | 685 if (photo != null) { |
| 666 _json["photo"] = (photo).toJson(); | 686 _json["photo"] = (photo).toJson(); |
| 667 } | 687 } |
| 668 return _json; | 688 return _json; |
| 669 } | 689 } |
| 670 } | 690 } |
| OLD | NEW |