@@ -50,10 +50,10 @@ export class DriveBackedValue_<T> {
5050 }
5151
5252 private createDriveFolder ( ) : string {
53- const response = this . driveService . Files . insert (
53+ const response = this . driveService . Files . create (
5454 {
5555 mimeType : "application/vnd.google-apps.folder" ,
56- title : DriveBackedValue_ . driveFolderName ,
56+ name : DriveBackedValue_ . driveFolderName ,
5757 } ,
5858 {
5959 id : true ,
@@ -85,14 +85,14 @@ export class DriveBackedValue_<T> {
8585 { id : true } ,
8686 {
8787 maxResults : 1 ,
88- q : `title = "${ this . getFileName ( ) } " and "${ folderId } " in parents and trashed = false` ,
88+ q : `name = "${ this . getFileName ( ) } " and "${ folderId } " in parents and trashed = false` ,
8989 } ,
9090 ) ;
9191 if (
92- response . items . length === 1 &&
93- typeof response . items [ 0 ] . id === "string"
92+ response . files . length === 1 &&
93+ typeof response . files [ 0 ] . id === "string"
9494 ) {
95- return response . items [ 0 ] . id ;
95+ return response . files [ 0 ] . id ;
9696 }
9797 return null ;
9898 }
@@ -102,14 +102,14 @@ export class DriveBackedValue_<T> {
102102 { id : true } ,
103103 {
104104 maxResults : 1 ,
105- q : `title = "${ DriveBackedValue_ . driveFolderName } " and "root" in parents and mimeType = "application/vnd.google-apps.folder" and trashed = false` ,
105+ q : `name = "${ DriveBackedValue_ . driveFolderName } " and "root" in parents and mimeType = "application/vnd.google-apps.folder" and trashed = false` ,
106106 } ,
107107 ) ;
108108 if (
109- response . items . length === 1 &&
110- typeof response . items [ 0 ] . id === "string"
109+ response . files . length === 1 &&
110+ typeof response . files [ 0 ] . id === "string"
111111 ) {
112- return response . items [ 0 ] . id ;
112+ return response . files [ 0 ] . id ;
113113 }
114114 return null ;
115115 }
@@ -126,15 +126,15 @@ export class DriveBackedValue_<T> {
126126 q : `"${ folderId } " in parents and trashed = false` ,
127127 } ,
128128 ) ;
129- return response . items . length === 0 ;
129+ return response . files . length === 0 ;
130130 }
131131
132132 private saveAsNewDriveFile ( folderId : string , value : T ) : void {
133- this . driveService . Files . insert (
133+ this . driveService . Files . create (
134134 {
135135 mimeType : "application/json" ,
136- parents : [ { id : folderId } ] ,
137- title : this . getFileName ( ) ,
136+ name : this . getFileName ( ) ,
137+ parents : [ folderId ] ,
138138 } ,
139139 { } ,
140140 Utilities . newBlob ( JSON . stringify ( value ) , "application/json" ) ,
0 commit comments